12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.Data.SqlClient;
- using System.Linq;
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com;
- using JLHHJSvr.Com.Model;
- using JLHHJSvr.Helper;
- using JLHHJSvr.LJException;
- using LJLib.DAL.SQL;
- using LJLib.Net.SPI.Server;
- namespace JLHHJSvr.Excutor
- {
- internal sealed class ReBuildMattressInterfaceExcutor : ExcutorBase<ReBuildMattressInterfaceRequest, ReBuildMattressInterfaceResponse>
- {
- protected override void ExcuteInternal(ReBuildMattressInterfaceRequest request, object state, ReBuildMattressInterfaceResponse rslt)
- {
- var tokendata = BllHelper.GetToken(request.token);
- if (tokendata == null)
- {
- rslt.ErrMsg = "会话已经中断,请重新登录";
- return;
- }
- if (request.mattressid == null || request.mattressid <= 0)
- {
- rslt.ErrMsg = "床垫id有误,请检查!";
- return;
- }
- using (var con = new SqlConnection(GlobalVar.ConnectionString))
- using (var cmd = con.CreateCommand())
- {
- con.Open();
- var copy_list = new List<u_mattress_interface>();
- var selectStr = @"SELECT mattressid
- ,printid
- ,itemname
- ,bj_pzname
- ,bj_namemx
- ,actual_size
- ,sb_craft
- ,actual_size_sb
- ,erp_pzid
- ,ss_rate
- ,ls_rate
- ,bj_inputtype
- FROM u_mattress_interface";
- DbSqlHelper.SelectJoin(cmd, selectStr, "mattressid = @mattressid", new Dictionary<string, object>() { { "@mattressid", request.mattressid } }, "printid", "mattressid,printid,itemname,bj_pzname,bj_namemx,actual_size,sb_craft,actual_size_sb,erp_pzid,ss_rate,ls_rate,bj_inputtype", 0, 0, copy_list);
- using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
- using (var erp_cmd = erp_con.CreateCommand())
- {
- erp_con.Open();
- var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, erp_cmd, new HelperBase.Context() { tokendata = tokendata });
- var interfaceList = interfaceHelper.RefreshMattressInterfaceList(request.mattressid.Value);
- rslt.mxList = interfaceList;
- }
- }
- }
- }
- }
|