123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using DirectService.Tools;
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com;
- using JLHHJSvr.Com.Model;
- using JLHHJSvr.Helper;
- using JLHHJSvr.LJException;
- using JLHHJSvr.Tools;
- using LJLib.DAL.SQL;
- using LJLib.Net.SPI.Server;
- namespace JLHHJSvr.Excutor
- {
- internal sealed class GetMattressSubspecsExcutor : ExcutorBase<GetMattressSubspecsRequest, GetMattressSubspecsResponse>
- {
- protected override void ExcuteInternal(GetMattressSubspecsRequest request, object state, GetMattressSubspecsResponse rslt)
- {
- var tokendata = BllHelper.GetToken(request.token);
- if (tokendata == null)
- {
- rslt.ErrMsg = "会话已经中断,请重新登录";
- return;
- }
- if (request.mattressid == 0)
- {
- rslt.ErrMsg = "床垫id不能为0";
- return;
- }
- using (var con = new SqlConnection(GlobalVar.ConnectionString))
- using (var cmd = con.CreateCommand())
- {
- con.Open();
- using (cmd.Transaction = con.BeginTransaction())
- {
- var helper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
- var subspecsList = new List<u_mattress>();
- var result = new List<u_mattress_mx_subspecs>();
- //获取副规格列表
- subspecsList = helper.GetMattressSubspecs(request.mattressid);
- if (subspecsList.Count > 0)
- {
- rslt.bednetMxs = new List<u_mattress_mx_mtrl>();
- rslt.mtrllist = new List<u_mattress_mx_mtrl>();
- foreach (var mattrss in subspecsList)
- {
- //获取弹簧排列
- List<u_mattress_mx_mtrl> bednetmxList = helper.GetMattressSubspecsBednet(mattrss.mattressid);
- rslt.bednetMxs = rslt.bednetMxs.Concat(bednetmxList).ToList();
- //判断是否有主副规格调整物料
- List<u_mattress_mx_mtrl> mtrlList = helper.GetMattressMxSubspecsMtrl(mattrss.mattressid);
- rslt.mtrllist = rslt.mtrllist.Concat(mtrlList).ToList();
- }
- }
- rslt.mattresses = subspecsList;
- }
- }
- }
- }
- }
|