纽威
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.

213 lines
5.8 KiB

3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. namespace NFine.Web.Areas.WMS.Controllers
  16. {
  17. public class ICSRCVIQCsController : ControllerBase
  18. {
  19. ICSRCVIQCsApp App = new ICSRCVIQCsApp();
  20. // GET: WMS/ICSRCVIQCs
  21. public ActionResult ICSRCVIQCs()
  22. {
  23. return View();
  24. }
  25. public ActionResult Rejection()
  26. {
  27. return View();
  28. }
  29. public ActionResult WWRejection()
  30. {
  31. return View();
  32. }
  33. public ActionResult ICSInspectionDetail()
  34. {
  35. return View();
  36. }
  37. //采购
  38. [HttpGet]
  39. public ActionResult GetICSInspection(Pagination pagination, string queryJson)
  40. {
  41. DataTable ListData = App.GetICSInspection(ref pagination, queryJson);
  42. var JsonData = new
  43. {
  44. total = pagination.total,
  45. page = pagination.page,
  46. records = pagination.records,
  47. rows = ListData,
  48. };
  49. return Content(JsonData.ToJson());
  50. }
  51. //委外
  52. [HttpGet]
  53. public ActionResult GetICSInspection2(Pagination pagination, string queryJson)
  54. {
  55. DataTable ListData = App.GetICSInspection2(ref pagination, queryJson);
  56. var JsonData = new
  57. {
  58. total = pagination.total,
  59. page = pagination.page,
  60. records = pagination.records,
  61. rows = ListData,
  62. };
  63. return Content(JsonData.ToJson());
  64. }
  65. //工单
  66. [HttpGet]
  67. public ActionResult GetICSInspection3(Pagination pagination, string queryJson)
  68. {
  69. DataTable ListData = App.GetICSInspection3(ref pagination, queryJson);
  70. var JsonData = new
  71. {
  72. total = pagination.total,
  73. page = pagination.page,
  74. records = pagination.records,
  75. rows = ListData,
  76. };
  77. return Content(JsonData.ToJson());
  78. }
  79. //不良原因
  80. [HttpGet]
  81. public ActionResult Select_ICSBadReason(string InvCode)
  82. {
  83. var data = App.Select_ICSBadReason(InvCode);
  84. return Content(data.ToJson());
  85. }
  86. //不良代码
  87. [HttpGet]
  88. public ActionResult GetSelectICSBadCode(string InvCode)
  89. {
  90. var data = App.GetSelectICSBadCode(InvCode);
  91. return Content(data.ToJson());
  92. }
  93. /// <summary>
  94. /// 创建检验表
  95. /// </summary>
  96. /// <param name="keyValue"></param>
  97. /// <returns></returns>
  98. [HttpPost]
  99. [HandlerAjaxOnly]
  100. public ActionResult CreateICSInspection(string keyValue, string ICSInspections)
  101. {
  102. string msg = App.CreateICSInspection(keyValue, ICSInspections);
  103. if (!string.IsNullOrEmpty(msg))
  104. {
  105. return Error(msg);
  106. }
  107. else
  108. {
  109. return Success("添加成功!");
  110. }
  111. }
  112. //生成拒收单
  113. [HttpPost]
  114. [HandlerAjaxOnly]
  115. [ValidateAntiForgeryToken]
  116. public ActionResult CreateRejection(string keyValue,string Type)
  117. {
  118. string msg = "";
  119. if (Type=="1")
  120. {
  121. msg = App.CreateRejection(keyValue);
  122. }
  123. else
  124. {
  125. msg = App.CreateWWRejection(keyValue);
  126. }
  127. if (string.IsNullOrEmpty(msg))
  128. {
  129. return Success("操作成功!");
  130. }
  131. else
  132. {
  133. return Error("" + msg + "");
  134. }
  135. }
  136. /// <summary>
  137. /// 删除拒收单
  138. /// </summary>
  139. /// <returns></returns>
  140. [HttpPost]
  141. [HandlerAjaxOnly]
  142. [ValidateAntiForgeryToken]
  143. public ActionResult DelectRejection(string keyValue)
  144. {
  145. string msg = App.DelectRejection(keyValue);
  146. if (string.IsNullOrEmpty(msg))
  147. {
  148. return Success("删除成功!");
  149. }
  150. else
  151. {
  152. return Error(msg);
  153. }
  154. }
  155. [HttpPost]
  156. [HandlerAjaxOnly]
  157. [ValidateAntiForgeryToken]
  158. public ActionResult DelectWWRejection(string keyValue)
  159. {
  160. string msg = App.DelectWWRejection(keyValue);
  161. if (string.IsNullOrEmpty(msg))
  162. {
  163. return Success("删除成功!");
  164. }
  165. else
  166. {
  167. return Error(msg);
  168. }
  169. }
  170. [HttpGet]
  171. public ActionResult GetInventoryInspection(Pagination pagination, string InvCode)
  172. {
  173. DataTable ListData = App.GetInventoryInspection(ref pagination, InvCode);
  174. var JsonData = new
  175. {
  176. total = pagination.total,
  177. page = pagination.page,
  178. records = pagination.records,
  179. rows = ListData,
  180. };
  181. return Content(JsonData.ToJson());
  182. }
  183. [HttpPost]
  184. [HandlerAjaxOnly]
  185. public ActionResult SaveICSInspectionDetail(string ICSMTDOC, string InvCode)
  186. {
  187. string msg = App.SaveICSInspectionDetail(ICSMTDOC, InvCode);
  188. if (!string.IsNullOrEmpty(msg))
  189. {
  190. return Error(msg);
  191. }
  192. else
  193. {
  194. return Success("保存成功!");
  195. }
  196. }
  197. }
  198. }