GetMattressSubspecsExcutor.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.SqlClient;
  4. using System.Linq;
  5. using System.Text;
  6. using DirectService.Tools;
  7. using JLHHJSvr.BLL;
  8. using JLHHJSvr.Com;
  9. using JLHHJSvr.Com.Model;
  10. using JLHHJSvr.Helper;
  11. using JLHHJSvr.LJException;
  12. using JLHHJSvr.Tools;
  13. using LJLib.DAL.SQL;
  14. using LJLib.Net.SPI.Server;
  15. namespace JLHHJSvr.Excutor
  16. {
  17. internal sealed class GetMattressSubspecsExcutor : ExcutorBase<GetMattressSubspecsRequest, GetMattressSubspecsResponse>
  18. {
  19. protected override void ExcuteInternal(GetMattressSubspecsRequest request, object state, GetMattressSubspecsResponse rslt)
  20. {
  21. var tokendata = BllHelper.GetToken(request.token);
  22. if (tokendata == null)
  23. {
  24. rslt.ErrMsg = "会话已经中断,请重新登录";
  25. return;
  26. }
  27. if (request.mattressid == 0)
  28. {
  29. rslt.ErrMsg = "床垫id不能为0";
  30. return;
  31. }
  32. using (var con = new SqlConnection(GlobalVar.ConnectionString))
  33. using (var cmd = con.CreateCommand())
  34. {
  35. con.Open();
  36. using (cmd.Transaction = con.BeginTransaction())
  37. {
  38. var helper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
  39. var subspecsList = new List<u_mattress>();
  40. var result = new List<u_mattress_mx_subspecs>();
  41. //获取副规格列表
  42. subspecsList = helper.GetMattressSubspecs(request.mattressid);
  43. if (subspecsList.Count > 0)
  44. {
  45. foreach(var mattrss in subspecsList)
  46. {
  47. var _res = new u_mattress_mx_subspecs()
  48. {
  49. mattressid = mattrss.mattressid,
  50. mattress_width = mattrss.mattress_width,
  51. mattress_length = mattrss.mattress_length,
  52. //mattress_height =
  53. };
  54. //获取弹簧排列
  55. List<u_mattress_mx_mtrl> springList = helper.GetMattressSubspecsBednet(mattrss.mattressid);
  56. //判断是否有主副规格调整物料
  57. }
  58. }
  59. //rslt.mattressMx = result;
  60. }
  61. }
  62. }
  63. }
  64. }