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.

280 lines
7.3 KiB

1 year ago
1 year ago
1 year ago
  1. using NFine.Application.OMAY;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.OMAY.Controllers
  10. {
  11. public class ICSMoCreateLotController : ControllerBase
  12. {
  13. ICSMoCreateLotApp App = new ICSMoCreateLotApp();
  14. // GET: OMAY/ICSMoCreateLot
  15. public ActionResult ICSCreateLotByMO()
  16. {
  17. return View();
  18. }
  19. public ActionResult From()
  20. {
  21. return View();
  22. }
  23. public ActionResult ICSMOByproduct()
  24. {
  25. return View();
  26. }
  27. public ActionResult ICSMOByproductFrom()
  28. {
  29. return View();
  30. }
  31. //奥美工单生成条码主表查询
  32. [HttpGet]
  33. [HandlerAjaxOnly]
  34. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  35. {
  36. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  37. var JsonData = new
  38. {
  39. total = pagination.total,
  40. page = pagination.page,
  41. records = pagination.records,
  42. rows = ListData,
  43. };
  44. return Content(JsonData.ToJson());
  45. }
  46. //生成条码子表查询
  47. [HttpGet]
  48. [HandlerAjaxOnly]
  49. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination)
  50. {
  51. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination);
  52. var JsonData = new
  53. {
  54. total = pagination.total,
  55. page = pagination.page,
  56. records = pagination.records,
  57. rows = ListData,
  58. };
  59. return Content(JsonData.ToJson());
  60. }
  61. //工单生成条码获取物料数量信息
  62. [HttpGet]
  63. [HandlerAjaxOnly]
  64. public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint,string MoTypeValue)
  65. {
  66. DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint, MoTypeValue);
  67. var JsonData = new
  68. {
  69. rows = ListData,
  70. };
  71. return Content(JsonData.ToJson());
  72. }
  73. //查询超生比例
  74. [HttpGet]
  75. [HandlerAjaxOnly]
  76. public ActionResult GetScale()
  77. {
  78. DataTable ListData = App.GetScale();
  79. var JsonData = new
  80. {
  81. rows = ListData,
  82. };
  83. return Content(JsonData.ToJson());
  84. }
  85. //副产品调用接口来显示本次可生产数量
  86. [HttpGet]
  87. [HandlerAjaxOnly]
  88. public ActionResult GetFCPAbsolveQty(string MOCode, string Sequence, string Qty)
  89. {
  90. var rows = App.GetFCPAbsolveQty(MOCode, Sequence, Qty);
  91. return Content(rows.ToJson());
  92. }
  93. //工单调用接口来显示本次可生产数量
  94. [HttpGet]
  95. [HandlerAjaxOnly]
  96. public ActionResult GetAbsolveQty(string MOCode, string Sequence, string Qty)
  97. {
  98. var rows = App.GetAbsolveQty(MOCode, Sequence, Qty);
  99. return Content(rows.ToJson());
  100. }
  101. //工单生成条码
  102. [HttpPost]
  103. [HandlerAjaxOnly]
  104. [ValidateAntiForgeryToken]
  105. public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  106. {
  107. int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint, AMEnable);
  108. if (i > 0)
  109. {
  110. return Success("生成成功!");
  111. }
  112. else
  113. {
  114. return Error("生成失败!");
  115. }
  116. }
  117. //副产品
  118. [HttpGet]
  119. [HandlerAjaxOnly]
  120. public ActionResult GetGridJsonFCP(Pagination pagination, string queryJson)
  121. {
  122. DataTable ListData = App.GetGridJsonFCP(queryJson, ref pagination);
  123. var JsonData = new
  124. {
  125. total = pagination.total,
  126. page = pagination.page,
  127. records = pagination.records,
  128. rows = ListData,
  129. };
  130. return Content(JsonData.ToJson());
  131. }
  132. //副产品生成条码获取物料数量信息
  133. [HttpGet]
  134. [HandlerAjaxOnly]
  135. public ActionResult GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint, string MoTypeValue)
  136. {
  137. DataTable ListData = App.GetSubGridJsonFCPCreate(FCPMOCode, Sequence, WorkPoint, MoTypeValue);
  138. var JsonData = new
  139. {
  140. rows = ListData,
  141. };
  142. return Content(JsonData.ToJson());
  143. }
  144. //联产品生成条码
  145. [HttpPost]
  146. [HandlerAjaxOnly]
  147. [ValidateAntiForgeryToken]
  148. public ActionResult SubmitFormFCP(string FCPMOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  149. {
  150. int i = App.SubmitFormFCP(FCPMOCode, Sequence, keyValue, WorkPoint, AMEnable);
  151. if (i > 0)
  152. {
  153. return Success("生成成功!");
  154. }
  155. else
  156. {
  157. return Error("生成失败!");
  158. }
  159. }
  160. [HttpGet]
  161. [HandlerAjaxOnly]
  162. public ActionResult GetByproductGridJson(Pagination pagination, string queryJson)
  163. {
  164. DataTable ListData = App.GetByproductGridJson(queryJson, ref pagination);
  165. var JsonData = new
  166. {
  167. total = pagination.total,
  168. page = pagination.page,
  169. records = pagination.records,
  170. rows = ListData,
  171. };
  172. return Content(JsonData.ToJson());
  173. }
  174. //获取料品信息
  175. public ActionResult GetInvCode()
  176. {
  177. DataTable dt = App.GetInvCode();
  178. return Content(dt.ToJson());
  179. }
  180. [HttpGet]
  181. [HandlerAjaxOnly]
  182. public ActionResult SeachAmountEnablebyInvCode(string InvCode)
  183. {
  184. DataTable ListData = App.SeachAmountEnablebyInvCode(InvCode);
  185. var JsonData = new
  186. {
  187. rows = ListData,
  188. };
  189. return Content(JsonData.ToJson());
  190. }
  191. //副产品生成条码
  192. [HttpPost]
  193. [HandlerAjaxOnly]
  194. [ValidateAntiForgeryToken]
  195. public ActionResult SubmitFormFCPNoCode(string keyValue, string WorkPoint, string AMEnable)
  196. {
  197. int i = App.SubmitFormFCPNoCode( keyValue, WorkPoint, AMEnable);
  198. if (i > 0)
  199. {
  200. return Success("生成成功!");
  201. }
  202. else
  203. {
  204. return Error("生成失败!");
  205. }
  206. }
  207. [HttpPost]
  208. [HandlerAjaxOnly]
  209. [ValidateAntiForgeryToken]
  210. public ActionResult DeleteFCPLot(string keyValue)
  211. {
  212. string msg = App.DeleteFCPLot(keyValue);
  213. if (string.IsNullOrEmpty(msg))
  214. {
  215. return Success("删除成功!");
  216. }
  217. else
  218. {
  219. return Error(msg);
  220. }
  221. }
  222. }
  223. }