You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
5.7 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. namespace NFine.Web.Areas.WMS.Controllers
  6. {
  7. public class WareHouseLotinspectionController : ControllerBase
  8. {
  9. WareHouseLotinspectionApp App = new WareHouseLotinspectionApp();
  10. private string result;
  11. public ActionResult WareHouseLotinspection()
  12. {
  13. return View();
  14. }
  15. public ActionResult WareHouseLotinspectionAdd()
  16. {
  17. return View();
  18. }
  19. public ActionResult WareHouseLotinspectionUpdate()
  20. {
  21. return View();
  22. }
  23. public ActionResult SeachInspectLot()
  24. {
  25. return View();
  26. }
  27. [HttpGet]
  28. public ActionResult GetICSInspect(Pagination pagination)
  29. {
  30. DataTable ListData = App.GetICSInspect(ref pagination);
  31. var JsonData = new
  32. {
  33. total = pagination.total,
  34. page = pagination.page,
  35. records = pagination.records,
  36. rows = ListData,
  37. };
  38. return Content(JsonData.ToJson());
  39. }
  40. [HttpGet]
  41. [HandlerAjaxOnly]
  42. public ActionResult ICSInspectDetail(string InspectCode, Pagination pagination)
  43. {
  44. DataTable ListData = App.GetICSMOApplyNegDetail(InspectCode, ref pagination);
  45. var JsonData = new
  46. {
  47. total = pagination.total,
  48. page = pagination.page,
  49. records = pagination.records,
  50. rows = ListData,
  51. };
  52. return Content(JsonData.ToJson());
  53. }
  54. [HttpPost]
  55. [HandlerAjaxOnly]
  56. [ValidateAntiForgeryToken]
  57. public ActionResult DeleteICSInspect(string keyValue)
  58. {
  59. string msg = App.DeleteICSInspect(keyValue);
  60. if (string.IsNullOrEmpty(msg))
  61. {
  62. return Success("删除成功!");
  63. }
  64. else
  65. {
  66. return Error(msg);
  67. }
  68. }
  69. public ActionResult GetICSInspectTemporary(string InspectCode, Pagination pagination)
  70. {
  71. DataTable table = App.GetICSInspectTemporary(InspectCode);
  72. var JsonData = new
  73. {
  74. total = pagination.total,
  75. page = pagination.page,
  76. records = pagination.records,
  77. rows = table
  78. };
  79. return Content(JsonData.ToJson());
  80. }
  81. [HttpGet]
  82. [HandlerAjaxOnly]
  83. public ActionResult GetInspectDocType(string ID)
  84. {
  85. DataTable dt = App.GetInspectDocType(ID);
  86. return Content(dt.ToJson());
  87. }
  88. [HttpGet]
  89. [HandlerAjaxOnly]
  90. public ActionResult GetInspectDept(string ID)
  91. {
  92. DataTable dt = App.GetInspectDept(ID);
  93. return Content(dt.ToJson());
  94. }
  95. public void ClearTemp()
  96. {
  97. App.ClearTemp();
  98. }
  99. [HttpGet]
  100. [HandlerAjaxOnly]
  101. public ActionResult SeachInspectLotcheck(string lotNo)
  102. {
  103. string dtl = App.SeachInspectLotcheck(lotNo);
  104. return Content(result);
  105. }
  106. [HttpGet]
  107. public ActionResult GetInspectLot(string invcode, string WHCode, string InspectType, Pagination pagination)
  108. {
  109. DataTable ListData = App.GetInspectLot(invcode, WHCode, InspectType, ref pagination);
  110. var JsonData = new
  111. {
  112. total = pagination.total,
  113. page = pagination.page,
  114. records = pagination.records,
  115. rows = ListData,
  116. };
  117. return Content(JsonData.ToJson());
  118. }
  119. public void AddMOApplyNegTemp(string json)
  120. {
  121. App.AddMOApplyNegTemp(json);
  122. }
  123. public void UpdateMOApplyNegTemp(string json)
  124. {
  125. App.UpdateMOApplyNegTemp(json);
  126. }
  127. [HttpPost]
  128. [HandlerAjaxOnly]
  129. public ActionResult SaveInspect(string LotNOList, string DocType, string DeptCode, string Memo)
  130. {
  131. string msg = App.SaveInspect(LotNOList, DocType, DeptCode, Memo);
  132. if (!string.IsNullOrEmpty(msg))
  133. {
  134. return Error(msg);
  135. }
  136. else
  137. {
  138. return Success("添加成功!");
  139. }
  140. }
  141. [HttpPost]
  142. [HandlerAjaxOnly]
  143. public ActionResult UpdateInspect(string InspectCode, string LotNOList, string DeptCode, string Memo)
  144. {
  145. string msg = App.UpdateInspect(InspectCode, LotNOList, DeptCode, Memo);
  146. if (!string.IsNullOrEmpty(msg))
  147. {
  148. return Error(msg);
  149. }
  150. else
  151. {
  152. return Success("添加成功!");
  153. }
  154. }
  155. public ActionResult GetICSMOApplyNegDetailTemp(string ApplyNegCode, Pagination pagination)
  156. {
  157. DataTable table = App.GetICSMOApplyNegDetailTemp(ApplyNegCode);
  158. var JsonData = new
  159. {
  160. total = pagination.total,
  161. page = pagination.page,
  162. records = pagination.records,
  163. rows = table
  164. };
  165. return Content(JsonData.ToJson());
  166. }
  167. [HttpPost]
  168. [HandlerAjaxOnly]
  169. public ActionResult UpdateICSMOApplyNeg(string ICSASN)
  170. {
  171. string msg = App.UpdateICSMOApplyNeg(ICSASN);
  172. if (!string.IsNullOrEmpty(msg))
  173. {
  174. return Error(msg);
  175. }
  176. else
  177. {
  178. return Success("修改成功!");
  179. }
  180. }
  181. }
  182. }