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.

286 lines
7.8 KiB

3 weeks 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 ICSDisassemblyDocController : ControllerBase
  18. {
  19. // GET: WMS/ICSDisassemblyDoc
  20. ICSDisassemblyDocApp App = new ICSDisassemblyDocApp();
  21. ICSDisassemblyDocEntityApp EntityApp = new ICSDisassemblyDocEntityApp();
  22. public ActionResult ICSDisassem()
  23. {
  24. return View();
  25. }
  26. public ActionResult ICSDisassemblyDocAdd()
  27. {
  28. return View();
  29. }
  30. [HttpGet]
  31. [HandlerAjaxOnly]
  32. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  33. {
  34. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  35. var JsonData = new
  36. {
  37. total = pagination.total,
  38. page = pagination.page,
  39. records = pagination.records,
  40. rows = ListData,
  41. };
  42. return Content(JsonData.ToJson());
  43. }
  44. [HttpGet]
  45. [HandlerAjaxOnly]
  46. public ActionResult GetSubGridJson(string Code)
  47. {
  48. DataTable ListData = App.GetSubGridJson(Code);
  49. var JsonData = new
  50. {
  51. rows = ListData,
  52. };
  53. return Content(JsonData.ToJson());
  54. }
  55. //查询符合套件的在库条码
  56. public ActionResult GetLotNoByKit(string InvCode, string WHCode, string ExtensionID, Pagination pagination)
  57. {
  58. DataTable ListData = App.GetLotNoByKit(InvCode, WHCode, ExtensionID, ref pagination);
  59. var JsonData = new
  60. {
  61. total = pagination.total,
  62. page = pagination.page,
  63. records = pagination.records,
  64. rows = ListData,
  65. };
  66. return Content(JsonData.ToJson());
  67. }
  68. //绑定套件
  69. [HttpPost]
  70. [HandlerAjaxOnly]
  71. public ActionResult CreateLogByKit(string Code, string Parameter)
  72. {
  73. string msg = App.CreateLogByKit(Code,Parameter);
  74. if (!string.IsNullOrEmpty(msg))
  75. {
  76. return Error(msg);
  77. }
  78. else
  79. {
  80. return Success("添加成功!");
  81. }
  82. }
  83. //批量生成散件条码
  84. [HttpPost]
  85. [HandlerAjaxOnly]
  86. public ActionResult CreateInventoryLot(string Code)
  87. {
  88. string msg = App.CreateInventoryLot(Code);
  89. if (!string.IsNullOrEmpty(msg))
  90. {
  91. return Error(msg);
  92. }
  93. else
  94. {
  95. return Success("生成成功!");
  96. }
  97. }
  98. //删除条码
  99. [HttpPost]
  100. [HandlerAjaxOnly]
  101. public ActionResult DeleteInventoryLot(string Code)
  102. {
  103. string msg = App.DeleteInventoryLot(Code);
  104. if (string.IsNullOrWhiteSpace(msg))
  105. {
  106. return Success("删除成功!");
  107. }
  108. else
  109. {
  110. return Error(msg);
  111. }
  112. }
  113. public ActionResult ICSDisassemblyDocQuery()
  114. {
  115. return View();
  116. }
  117. public ActionResult ICSDisassemblyDocEdit()
  118. {
  119. return View();
  120. }
  121. [HttpPost]
  122. [HandlerAjaxOnly]
  123. [ValidateAntiForgeryToken]
  124. public ActionResult DeleteDisassemblyDocApplyNeg(string keyValue)
  125. {
  126. string msg = EntityApp.DeleteDisassemblyDocApplyNeg(keyValue);
  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. /// <param name="DABDOCCode"></param>
  140. /// <param name="pagination"></param>
  141. /// <returns></returns>
  142. [HttpGet]
  143. [HandlerAjaxOnly]
  144. public ActionResult GetDisassemblyDocApplyNegDetail(string DABDOCCode, Pagination pagination)
  145. {
  146. DataTable ListData = EntityApp.GetDisassemblyDocApplyNegDetail(DABDOCCode, ref pagination);
  147. var JsonData = new
  148. {
  149. total = pagination.total,
  150. page = pagination.page,
  151. records = pagination.records,
  152. rows = ListData,
  153. };
  154. return Content(JsonData.ToJson());
  155. }
  156. public void ClearTemp()
  157. {
  158. EntityApp.ClearTemp();
  159. }
  160. public ActionResult GetOOCode(string WorkPoint)
  161. {
  162. try
  163. {
  164. string Code = EntityApp.GetOOCode(WorkPoint);
  165. var JsonData = new
  166. {
  167. Code = Code,
  168. };
  169. return Content(JsonData.ToJson());
  170. }
  171. catch (Exception ex)
  172. {
  173. return Error(ex.Message);
  174. }
  175. }
  176. /// <summary>
  177. /// 汇总
  178. /// </summary>
  179. /// <param name="pagination"></param>
  180. /// <returns></returns>
  181. [HttpGet]
  182. public ActionResult GetDisassemblyDocApplyNeg(Pagination pagination)
  183. {
  184. DataTable ListData = EntityApp.GetDisassemblyDocApplyNeg(ref pagination);
  185. var JsonData = new
  186. {
  187. total = pagination.total,
  188. page = pagination.page,
  189. records = pagination.records,
  190. rows = ListData,
  191. };
  192. return Content(JsonData.ToJson());
  193. }
  194. /// <summary>
  195. /// 修改弹出框的数据来源
  196. /// </summary>
  197. /// <param name="DABDOCCode"></param>
  198. /// <param name="pagination"></param>
  199. /// <returns></returns>
  200. public ActionResult GetICSDisassemblyDocEntityReturnTemporary(string DABDOCCode, Pagination pagination)
  201. {
  202. DataTable table = EntityApp.GetDisassemblyDocReturnTemporary(DABDOCCode);
  203. var JsonData = new
  204. {
  205. total = pagination.total,
  206. page = pagination.page,
  207. records = pagination.records,
  208. rows = table
  209. };
  210. return Content(JsonData.ToJson());
  211. }
  212. /// <summary>
  213. /// 新增和修改
  214. /// </summary>
  215. /// <param name="ICSASN"></param>
  216. /// <returns></returns>
  217. [HttpPost]
  218. [HandlerAjaxOnly]
  219. public ActionResult SaveICSDisassemblyDocEntityApplyNeg(string keyValue, string deleteIDs)
  220. {
  221. string msg = EntityApp.SaveDisassemblyDocApplyNeg(keyValue, deleteIDs);
  222. if (!string.IsNullOrEmpty(msg))
  223. {
  224. return Error(msg);
  225. }
  226. else
  227. {
  228. return Success("保存成功!");
  229. }
  230. }
  231. /// <summary>
  232. /// 零件一键入库(咖博士)
  233. /// </summary>
  234. /// <param name="Codes"></param>
  235. /// <returns></returns>
  236. [HttpPost]
  237. [HandlerAjaxOnly]
  238. public ActionResult PostInWareHouse(string Codes)
  239. {
  240. try
  241. {
  242. string msg = App.PostInWareHouse(Codes);
  243. if (!string.IsNullOrEmpty(msg))
  244. {
  245. return Error(msg);
  246. }
  247. else
  248. {
  249. return Success("操作成功!");
  250. }
  251. }
  252. catch (Exception ex)
  253. {
  254. return Error(ex.Message);
  255. }
  256. }
  257. }
  258. }