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.

246 lines
6.7 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Reflection.Emit;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace NFine.Web.Areas.WMS.Controllers
  11. {
  12. public class ICSSDNALLController : ControllerBase
  13. {
  14. ICSSDNALLApp App = new ICSSDNALLApp();
  15. // GET: DHAY/ICSCustomerSuppliedReturn
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult Create()
  21. {
  22. return View();
  23. }
  24. public ActionResult GetInvCode()
  25. {
  26. return View();
  27. }
  28. public ActionResult Update()
  29. {
  30. return View();
  31. }
  32. public ActionResult GetWHCode()
  33. {
  34. return View();
  35. }
  36. public ActionResult GetBatch()
  37. {
  38. return View();
  39. }
  40. [HttpGet]
  41. [HandlerAjaxOnly]
  42. public ActionResult GetU9CodeType()
  43. {
  44. DataTable dt = App.GetU9CodeType();
  45. return Content(dt.ToJson());
  46. }
  47. [HttpPost]
  48. [HandlerAjaxOnly]
  49. [ValidateAntiForgeryToken]
  50. public ActionResult DeleteICSSDN(string keyValue)
  51. {
  52. string msg = App.DeleteICSSDN(keyValue);
  53. if (string.IsNullOrEmpty(msg))
  54. {
  55. return Success("删除成功!");
  56. }
  57. else
  58. {
  59. return Error(msg);
  60. }
  61. }
  62. [HttpPost]
  63. [HandlerAjaxOnly]
  64. public ActionResult SaveICSSDN(string ICSASN)
  65. {
  66. try
  67. {
  68. string msg = App.SaveICSSDN(ICSASN);
  69. if (!string.IsNullOrEmpty(msg))
  70. {
  71. return Error(msg);
  72. }
  73. else
  74. {
  75. return Success("添加成功!");
  76. }
  77. }
  78. catch (Exception ex)
  79. {
  80. return Error(ex.Message);
  81. }
  82. }
  83. [HttpGet]
  84. public ActionResult GetICSSDN(Pagination pagination, string queryJson)
  85. {
  86. DataTable ListData = App.GetICSSDN(ref pagination, queryJson);
  87. var JsonData = new
  88. {
  89. total = pagination.total,
  90. page = pagination.page,
  91. records = pagination.records,
  92. rows = ListData,
  93. };
  94. return Content(JsonData.ToJson());
  95. }
  96. [HttpGet]
  97. public ActionResult GetICSSDNBySDNCode(string SDNCode)
  98. {
  99. DataTable ListData = App.GetICSSDNBySDNCode(SDNCode);
  100. var JsonData = new
  101. {
  102. rows = ListData,
  103. };
  104. return Content(JsonData.ToJson());
  105. }
  106. [HttpGet]
  107. [HandlerAjaxOnly]
  108. public ActionResult GetICSSDNDetail(string SDNCode, string queryJson, Pagination pagination)
  109. {
  110. DataTable ListData = App.GetICSSDNDetail(SDNCode, queryJson, ref pagination);
  111. var JsonData = new
  112. {
  113. total = pagination.total,
  114. page = pagination.page,
  115. records = pagination.records,
  116. rows = ListData,
  117. };
  118. return Content(JsonData.ToJson());
  119. }
  120. [HttpPost]
  121. [HandlerAjaxOnly]
  122. [ValidateAntiForgeryToken]
  123. public ActionResult DeleteICSSDNByCode(string keyValue)
  124. {
  125. string msg = App.DeleteICSSDNByCode(keyValue);
  126. if (string.IsNullOrEmpty(msg))
  127. {
  128. return Success("删除成功!");
  129. }
  130. else
  131. {
  132. return Error(msg);
  133. }
  134. }
  135. public ActionResult GetBidCode(string WorkPoint)
  136. {
  137. try
  138. {
  139. string Code = App.GetBidCode(WorkPoint);
  140. var JsonData = new
  141. {
  142. Code = Code,
  143. };
  144. return Content(JsonData.ToJson());
  145. }
  146. catch (Exception ex)
  147. {
  148. return Error(ex.Message);
  149. }
  150. }
  151. [HttpPost]
  152. [HandlerAjaxOnly]
  153. public ActionResult UpdateICSSDN(string ICSASN)
  154. {
  155. string msg = App.UpdateICSSDN(ICSASN);
  156. if (!string.IsNullOrEmpty(msg))
  157. {
  158. return Error(msg);
  159. }
  160. else
  161. {
  162. return Success("修改成功!");
  163. }
  164. }
  165. [HttpGet]
  166. [HandlerAjaxOnly]
  167. public ActionResult GetItemList(Pagination pagination, string queryJson)
  168. {
  169. DataTable ListData = App.GetItemList(queryJson, ref pagination);
  170. var JsonData = new
  171. {
  172. total = pagination.total,
  173. page = pagination.page,
  174. records = pagination.records,
  175. rows = ListData,
  176. };
  177. return Content(JsonData.ToJson());
  178. }
  179. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  180. {
  181. DataTable table = App.GetICSReturnTemporary(rfqno);
  182. var JsonData = new
  183. {
  184. total = pagination.total,
  185. page = pagination.page,
  186. records = pagination.records,
  187. rows = table
  188. };
  189. return Content(JsonData.ToJson());
  190. }
  191. /// <summary>
  192. /// 获取批次信息
  193. /// </summary>
  194. /// <param name="pagination"></param>
  195. /// <param name="queryJson"></param>
  196. /// <returns></returns>
  197. [HttpGet]
  198. [HandlerAjaxOnly]
  199. public ActionResult GetBatchList(Pagination pagination, string queryJson)
  200. {
  201. DataTable ListData = App.GetBatchList(queryJson, ref pagination);
  202. var JsonData = new
  203. {
  204. total = pagination.total,
  205. page = pagination.page,
  206. records = pagination.records,
  207. rows = ListData,
  208. };
  209. return Content(JsonData.ToJson());
  210. }
  211. [HttpGet]
  212. [HandlerAjaxOnly]
  213. public ActionResult GetU9Status(string SOCode)
  214. {
  215. try
  216. {
  217. DataTable ListData = App.GetU9Status(SOCode);
  218. if (ListData.Rows.Count <= 0)
  219. {
  220. return Success("验证成功");
  221. }
  222. else
  223. {
  224. return Error("验证失败");
  225. }
  226. }
  227. catch (Exception ex)
  228. {
  229. return Error(ex.Message);
  230. }
  231. }
  232. }
  233. }