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.

233 lines
6.3 KiB

12 months 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 ICSOOCreateLotController : ControllerBase
  12. {
  13. ICSOOCreateLotApp App = new ICSOOCreateLotApp();
  14. // GET: OMAY/ICSOOCreateLot
  15. public ActionResult ICSCreateLotByOO()
  16. {
  17. return View();
  18. }
  19. public ActionResult OOFrom()
  20. {
  21. return View();
  22. }
  23. //奥美工单生成条码主表查询
  24. [HttpGet]
  25. [HandlerAjaxOnly]
  26. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  27. {
  28. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  29. var JsonData = new
  30. {
  31. total = pagination.total,
  32. page = pagination.page,
  33. records = pagination.records,
  34. rows = ListData,
  35. };
  36. return Content(JsonData.ToJson());
  37. }
  38. //生成条码子表查询
  39. [HttpGet]
  40. [HandlerAjaxOnly]
  41. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination)
  42. {
  43. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination);
  44. var JsonData = new
  45. {
  46. total = pagination.total,
  47. page = pagination.page,
  48. records = pagination.records,
  49. rows = ListData,
  50. };
  51. return Content(JsonData.ToJson());
  52. }
  53. //工单生成条码获取物料数量信息
  54. [HttpGet]
  55. [HandlerAjaxOnly]
  56. public ActionResult GetSubGridJsonChengPingByCreate(string OOCode, string Sequence, string WorkPoint)
  57. {
  58. DataTable ListData = App.GetSubGridJsonChengPingByCreate(OOCode, Sequence, WorkPoint);
  59. var JsonData = new
  60. {
  61. rows = ListData,
  62. };
  63. return Content(JsonData.ToJson());
  64. }
  65. //查询超生比例
  66. [HttpGet]
  67. [HandlerAjaxOnly]
  68. public ActionResult GetScale()
  69. {
  70. DataTable ListData = App.GetScale();
  71. var JsonData = new
  72. {
  73. rows = ListData,
  74. };
  75. return Content(JsonData.ToJson());
  76. }
  77. //副产品调用接口来显示本次可生产数量
  78. [HttpGet]
  79. [HandlerAjaxOnly]
  80. public ActionResult GetOOPickAbsolveQty(string OOCode, string Sequence, string Qty)
  81. {
  82. var rows = App.GetOOPickAbsolveQty(OOCode, Sequence, Qty);
  83. return Content(rows.ToJson());
  84. }
  85. //工单调用接口来显示本次可生产数量
  86. [HttpGet]
  87. [HandlerAjaxOnly]
  88. public ActionResult GetAbsolveQty(string OOCode, string Sequence, string Qty)
  89. {
  90. var rows = App.GetAbsolveQty(OOCode, Sequence, Qty);
  91. return Content(rows.ToJson());
  92. }
  93. //工单生成条码
  94. [HttpPost]
  95. [HandlerAjaxOnly]
  96. [ValidateAntiForgeryToken]
  97. public ActionResult SubmitFormChengPing(string OOCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  98. {
  99. int i = App.SubmitFormChengPing(OOCode, Sequence, keyValue, WorkPoint, AMEnable);
  100. if (i > 0)
  101. {
  102. return Success("生成成功!");
  103. }
  104. else
  105. {
  106. return Error("生成失败!");
  107. }
  108. }
  109. //副产品
  110. [HttpGet]
  111. [HandlerAjaxOnly]
  112. public ActionResult GetGridJsonOOPick(Pagination pagination, string queryJson)
  113. {
  114. DataTable ListData = App.GetGridJsonOOPick(queryJson, ref pagination);
  115. var JsonData = new
  116. {
  117. total = pagination.total,
  118. page = pagination.page,
  119. records = pagination.records,
  120. rows = ListData,
  121. };
  122. return Content(JsonData.ToJson());
  123. }
  124. //副产品生成条码获取物料数量信息
  125. [HttpGet]
  126. [HandlerAjaxOnly]
  127. public ActionResult GetSubGridJsonOOPickCreate(string OOPickCode, string Sequence, string WorkPoint)
  128. {
  129. DataTable ListData = App.GetSubGridJsonOOPickCreate(OOPickCode, Sequence, WorkPoint);
  130. var JsonData = new
  131. {
  132. rows = ListData,
  133. };
  134. return Content(JsonData.ToJson());
  135. }
  136. //联产品生成条码
  137. [HttpPost]
  138. [HandlerAjaxOnly]
  139. [ValidateAntiForgeryToken]
  140. public ActionResult SubmitFormOOPick(string OOPickCode, string Sequence, string keyValue, string WorkPoint, string AMEnable)
  141. {
  142. int i = App.SubmitFormOOPick(OOPickCode, Sequence, keyValue, WorkPoint, AMEnable);
  143. if (i > 0)
  144. {
  145. return Success("生成成功!");
  146. }
  147. else
  148. {
  149. return Error("生成失败!");
  150. }
  151. }
  152. [HttpGet]
  153. [HandlerAjaxOnly]
  154. public ActionResult GetByproductGridJson(Pagination pagination, string queryJson)
  155. {
  156. DataTable ListData = App.GetByproductGridJson(queryJson, ref pagination);
  157. var JsonData = new
  158. {
  159. total = pagination.total,
  160. page = pagination.page,
  161. records = pagination.records,
  162. rows = ListData,
  163. };
  164. return Content(JsonData.ToJson());
  165. }
  166. //获取料品信息
  167. public ActionResult GetInvCode()
  168. {
  169. DataTable dt = App.GetInvCode();
  170. return Content(dt.ToJson());
  171. }
  172. //副产品生成条码
  173. [HttpPost]
  174. [HandlerAjaxOnly]
  175. [ValidateAntiForgeryToken]
  176. public ActionResult SubmitFormOOPickNoCode(string keyValue, string WorkPoint, string AMEnable)
  177. {
  178. int i = App.SubmitFormOOPickNoCode( keyValue, WorkPoint, AMEnable);
  179. if (i > 0)
  180. {
  181. return Success("生成成功!");
  182. }
  183. else
  184. {
  185. return Error("生成失败!");
  186. }
  187. }
  188. }
  189. }