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

279 lines
8.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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 PickMaterialController : ControllerBase
  18. {
  19. // GET: WMS/PickMaterial
  20. PickMaterialApp App = new PickMaterialApp();
  21. public ActionResult ICSMOPickMerge()
  22. {
  23. return View();
  24. }
  25. [HttpGet]
  26. [HandlerAjaxOnly]
  27. public ActionResult GetGridJson(Pagination pagination, string queryJson, string Type)
  28. {
  29. DataTable ListData = new DataTable();
  30. if (Type == "1")//工单
  31. {
  32. ListData = App.GetGridJson(queryJson, ref pagination);
  33. }
  34. if (Type=="2")//工单发料
  35. {
  36. ListData = App.GetGridJson2(queryJson, ref pagination);
  37. }
  38. if ( Type == "12")//售后领料
  39. {
  40. ListData = App.GetGridJson12(queryJson, ref pagination);
  41. }
  42. if (Type=="3")//工单材料出库
  43. {
  44. ListData = App.GetGridJson3(queryJson, ref pagination);
  45. }
  46. if (Type == "4")//委外备料
  47. {
  48. ListData = App.GetGridJson4(queryJson, ref pagination);
  49. }
  50. if (Type == "5")//委外领料
  51. {
  52. ListData = App.GetGridJson5(queryJson, ref pagination);
  53. }
  54. if (Type == "6")//委外材料出库
  55. {
  56. ListData = App.GetGridJson6(queryJson, ref pagination);
  57. }
  58. if (Type == "7")//销售发货
  59. {
  60. ListData = App.GetGridJson7(queryJson, ref pagination);
  61. }
  62. if (Type == "8")//其它出库
  63. {
  64. ListData = App.GetGridJson8(queryJson, ref pagination);
  65. }
  66. if (Type == "9")//借用单
  67. {
  68. ListData = App.GetGridJson9(queryJson, ref pagination);
  69. }
  70. if (Type == "10")//物料调拨
  71. {
  72. ListData = App.GetGridJson10(queryJson, ref pagination);
  73. }
  74. if (Type == "11")//两步调出
  75. {
  76. ListData = App.GetGridJson11(queryJson, ref pagination);
  77. }
  78. var JsonData = new
  79. {
  80. total = pagination.total,
  81. page = pagination.page,
  82. records = pagination.records,
  83. rows = ListData,
  84. };
  85. return Content(JsonData.ToJson());
  86. }
  87. //子表查询
  88. [HttpGet]
  89. [HandlerAjaxOnly]
  90. public ActionResult GetSubGridJson(string Code, string queryJson, string Type)
  91. {
  92. DataTable ListData = new DataTable();
  93. if (Type=="1"){ListData = App.GetSubGridJson1(Code); }//工单
  94. if (Type=="2"){ListData = App.GetSubGridJson2(queryJson,Code); }//工单发料
  95. if (Type == "12") { ListData = App.GetSubGridJson12(queryJson, Code); }//工单发料
  96. if (Type == "3") { ListData = App.GetSubGridJson3(Code); }//材料出库
  97. if (Type == "4") { ListData = App.GetSubGridJson4(Code); }//委外备料
  98. if (Type == "5") { ListData = App.GetSubGridJson5(Code, queryJson); }//委外领料
  99. if (Type == "6") { ListData = App.GetSubGridJson6(Code); }//委外材料出库
  100. if (Type == "7") { ListData = App.GetSubGridJson7(Code, queryJson); }//销售发货
  101. if (Type == "8") { ListData = App.GetSubGridJson8(Code, queryJson); }//其它出库
  102. if (Type == "9") { ListData = App.GetSubGridJson9(Code); }//借用单
  103. if (Type == "10") { ListData = App.GetSubGridJson10(Code, queryJson); }//物料调拨
  104. if (Type == "11") { ListData = App.GetSubGridJson11(Code); }//两步调出
  105. var JsonData = new
  106. {
  107. rows = ListData,
  108. };
  109. return Content(JsonData.ToJson());
  110. }
  111. [HttpGet]
  112. [HandlerAjaxOnly]
  113. public ActionResult GetICSMOPickMergeTemp(Pagination pagination, string ID,string Type,string flag)
  114. {
  115. DataTable ListData = new DataTable();
  116. if (flag=="1")
  117. {
  118. ListData = App.GetICSMOPickMergeTemp(ID, Type);
  119. }
  120. else
  121. {
  122. ListData = App.GetICSMOPickMergeTemp2(ID, Type);
  123. }
  124. var JsonData = new
  125. {
  126. total = pagination.total,
  127. page = pagination.page,
  128. records = pagination.records,
  129. rows = ListData,
  130. };
  131. return Content(JsonData.ToJson());
  132. }
  133. /// <summary>
  134. /// 合并拣料的接口
  135. /// </summary>
  136. /// <param name="keyValue"></param>
  137. /// <param name="Type"></param>
  138. /// <returns></returns>
  139. [HttpPost]
  140. [HandlerAjaxOnly]
  141. public ActionResult MergeMaterial(string keyValue,string Type)
  142. {
  143. string msg = App.MergeMaterial(keyValue, Type);
  144. if (!string.IsNullOrEmpty(msg))
  145. {
  146. return Error(msg);
  147. }
  148. else
  149. {
  150. return Success("添加成功!");
  151. }
  152. }
  153. /// <summary>
  154. /// 取消合并拣料的接口
  155. /// </summary>
  156. /// <param name="keyValue"></param>
  157. /// <param name="Type"></param>
  158. /// <returns></returns>
  159. [HttpPost]
  160. [HandlerAjaxOnly]
  161. public ActionResult CancelMergeMaterial(string keyValue, string Type)
  162. {
  163. string msg = App.CancelMergeMaterial(keyValue, Type);
  164. if (!string.IsNullOrEmpty(msg))
  165. {
  166. return Error(msg);
  167. }
  168. else
  169. {
  170. return Success("取消成功!");
  171. }
  172. }
  173. [HttpPost]
  174. public ActionResult CheckQty(string objArr)
  175. {
  176. string i = App.CheckQty(objArr);
  177. var JsonData = new
  178. {
  179. count = i
  180. };
  181. return Content(JsonData.ToJson());
  182. }
  183. [HttpPost]
  184. [HandlerAjaxOnly]
  185. [ValidateAntiForgeryToken]
  186. public ActionResult DelPickLog(string objCode)
  187. {
  188. string msg = App.DelPickLog(objCode);
  189. if (string.IsNullOrEmpty(msg))
  190. {
  191. return Success("取消占料成功!");
  192. }
  193. else
  194. {
  195. return Error(msg);
  196. }
  197. }
  198. [HttpPost]
  199. public ActionResult SeachPickLog(string objCode)
  200. {
  201. string Falg = "";
  202. objCode = objCode.TrimEnd(',');
  203. string[] parameters = objCode.Split(',');
  204. int parameterCount = parameters.Length;
  205. int i = App.SeachPickLog(objCode);
  206. if (i == 0)
  207. {
  208. Falg = "0";//代表全部未占料
  209. }
  210. if (i != parameterCount && i != 0)
  211. {
  212. Falg = "1";//代表有占料跟非占料的 同时存在
  213. }
  214. else if (i == parameterCount)
  215. {
  216. Falg = "2";//代表全部已占料
  217. }
  218. var JsonData = new
  219. {
  220. count = Falg
  221. };
  222. return Content(JsonData.ToJson());
  223. }
  224. [HttpGet]
  225. [HandlerAjaxOnly]
  226. public ActionResult GetPickLogInfo(Pagination pagination, string ID)
  227. {
  228. DataTable ListData = new DataTable();
  229. ListData = App.GetPickLogInfo(ID);
  230. var JsonData = new
  231. {
  232. total = pagination.total,
  233. page = pagination.page,
  234. records = pagination.records,
  235. rows = ListData,
  236. };
  237. return Content(JsonData.ToJson());
  238. }
  239. }
  240. }