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.

206 lines
5.5 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. using System;
  6. namespace NFine.Web.Areas.WMS.Controllers
  7. {
  8. public class WareHouseReserveController : ControllerBase
  9. {
  10. WareHouseReserveApp App = new WareHouseReserveApp();
  11. public ActionResult WareHouseReserve()
  12. {
  13. return View();
  14. }
  15. public ActionResult WareHouseReserveAdd()
  16. {
  17. return View();
  18. }
  19. public ActionResult WareHouseReserveUpdate()
  20. {
  21. return View();
  22. }
  23. public ActionResult SeachInvInfo()
  24. {
  25. return View();
  26. }
  27. [HttpGet]
  28. public ActionResult GetICSReserve(Pagination pagination)
  29. {
  30. DataTable ListData = App.GetICSReserve(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 DeleteICSReserve(string keyValue)
  58. {
  59. string msg = App.DeleteICSReserve(keyValue);
  60. if (string.IsNullOrEmpty(msg))
  61. {
  62. return Success("删除成功!");
  63. }
  64. else
  65. {
  66. return Error(msg);
  67. }
  68. }
  69. public ActionResult GetICSReserveTemporary(string ID, Pagination pagination)
  70. {
  71. DataTable table = App.GetICSReserveTemporary(ID);
  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. public void ClearTemp()
  89. {
  90. App.ClearTemp();
  91. }
  92. [HttpGet]
  93. public ActionResult GetReserveInv(string invcode, string WHCode, Pagination pagination)
  94. {
  95. DataTable ListData = App.GetReserveInv(invcode, WHCode, ref pagination);
  96. var JsonData = new
  97. {
  98. total = pagination.total,
  99. page = pagination.page,
  100. records = pagination.records,
  101. rows = ListData,
  102. };
  103. return Content(JsonData.ToJson());
  104. }
  105. public void AddMOApplyNegTemp(string json)
  106. {
  107. App.AddMOApplyNegTemp(json);
  108. }
  109. public void UpdateMOApplyNegTemp(string json)
  110. {
  111. App.UpdateMOApplyNegTemp(json);
  112. }
  113. /// <summary>
  114. /// 保存预留信息
  115. /// </summary>
  116. /// <param name="keyValue"></param>
  117. /// <returns></returns>
  118. [HttpPost]
  119. [HandlerAjaxOnly]
  120. public ActionResult SaveReserve(string ReserveInfo)
  121. {
  122. try
  123. {
  124. string msg = App.SaveReserve(ReserveInfo);
  125. if (!string.IsNullOrEmpty(msg))
  126. {
  127. return Error(msg);
  128. }
  129. else
  130. {
  131. return Success("添加成功!");
  132. }
  133. }
  134. catch (Exception ex)
  135. {
  136. return Error(ex.Message);
  137. }
  138. }
  139. /// <summary>
  140. /// 更新预留状态
  141. /// </summary>
  142. /// <param name="keyValue"></param>
  143. /// <returns></returns>
  144. [HttpPost]
  145. [HandlerAjaxOnly]
  146. public ActionResult UpdateReserveStatus(string IDList, string Status)
  147. {
  148. string msg = App.UpdateReserveStatus(IDList.TrimEnd(','), Status);
  149. if (!string.IsNullOrEmpty(msg))
  150. {
  151. return Error(msg);
  152. }
  153. else
  154. {
  155. return Success("添加成功!");
  156. }
  157. }
  158. public ActionResult GetICSMOApplyNegDetailTemp(string ApplyNegCode, Pagination pagination)
  159. {
  160. DataTable table = App.GetICSMOApplyNegDetailTemp(ApplyNegCode);
  161. var JsonData = new
  162. {
  163. total = pagination.total,
  164. page = pagination.page,
  165. records = pagination.records,
  166. rows = table
  167. };
  168. return Content(JsonData.ToJson());
  169. }
  170. [HttpPost]
  171. [HandlerAjaxOnly]
  172. public ActionResult UpdateICSMOApplyNeg(string ICSASN)
  173. {
  174. string msg = App.UpdateICSMOApplyNeg(ICSASN);
  175. if (!string.IsNullOrEmpty(msg))
  176. {
  177. return Error(msg);
  178. }
  179. else
  180. {
  181. return Success("修改成功!");
  182. }
  183. }
  184. }
  185. }