ReBuildMattressInterfaceExcutor.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.SqlClient;
  4. using System.Linq;
  5. using JLHHJSvr.BLL;
  6. using JLHHJSvr.Com;
  7. using JLHHJSvr.Com.Model;
  8. using JLHHJSvr.Helper;
  9. using JLHHJSvr.LJException;
  10. using LJLib.DAL.SQL;
  11. using LJLib.Net.SPI.Server;
  12. namespace JLHHJSvr.Excutor
  13. {
  14. internal sealed class ReBuildMattressInterfaceExcutor : ExcutorBase<ReBuildMattressInterfaceRequest, ReBuildMattressInterfaceResponse>
  15. {
  16. protected override void ExcuteInternal(ReBuildMattressInterfaceRequest request, object state, ReBuildMattressInterfaceResponse rslt)
  17. {
  18. var tokendata = BllHelper.GetToken(request.token);
  19. if (tokendata == null)
  20. {
  21. rslt.ErrMsg = "会话已经中断,请重新登录";
  22. return;
  23. }
  24. if (request.mattressid == null || request.mattressid <= 0)
  25. {
  26. rslt.ErrMsg = "床垫id有误,请检查!";
  27. return;
  28. }
  29. using (var con = new SqlConnection(GlobalVar.ConnectionString))
  30. using (var cmd = con.CreateCommand())
  31. {
  32. con.Open();
  33. var copy_list = new List<u_mattress_interface>();
  34. var selectStr = @"SELECT mattressid
  35. ,printid
  36. ,itemname
  37. ,bj_pzname
  38. ,bj_namemx
  39. ,actual_size
  40. ,sb_craft
  41. ,actual_size_sb
  42. ,erp_pzid
  43. ,ss_rate
  44. ,ls_rate
  45. ,bj_inputtype
  46. FROM u_mattress_interface";
  47. 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);
  48. var interfaceHelper = HelperBase.GetHelper<InterfaceHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
  49. var interfaceList = interfaceHelper.RefreshMattressInterfaceList(request.mattressid.Value);
  50. rslt.mxList = interfaceList;
  51. }
  52. }
  53. }
  54. }