ReBuildMattressInterfaceExcutor.cs 2.4 KB

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