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.

319 lines
8.3 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. using System.Collections.Generic;
  6. namespace NFine.Web.Areas.WMS.Controllers
  7. {
  8. public class ProductionIssueController : ControllerBase
  9. {
  10. ProductionIssueApp App = new ProductionIssueApp();
  11. // GET: WMS/ProductionIssue
  12. public ActionResult ICSMOApplyNeg()
  13. {
  14. ViewBag.PageName = "ProductionIssue";
  15. return View();
  16. }
  17. public ActionResult ICSMOApplyNegAdd()
  18. {
  19. return View();
  20. }
  21. public ActionResult SeachICSMO()
  22. {
  23. return View();
  24. }
  25. public ActionResult SeachInventory()
  26. {
  27. return View();
  28. }
  29. public ActionResult ICSMOApplyNegUpdate()
  30. {
  31. return View();
  32. }
  33. [HttpGet]
  34. public ActionResult GetICSMOApplyNeg(Pagination pagination, string queryJson)
  35. {
  36. DataTable ListData = App.GetICSMOApplyNeg(queryJson, ref pagination);
  37. var JsonData = new
  38. {
  39. total = pagination.total,
  40. page = pagination.page,
  41. records = pagination.records,
  42. rows = ListData,
  43. };
  44. return Content(JsonData.ToJson());
  45. }
  46. [HttpGet]
  47. [HandlerAjaxOnly]
  48. public ActionResult GetICSMOApplyNegDetail(string ApplyNegCode, Pagination pagination)
  49. {
  50. DataTable ListData = App.GetICSMOApplyNegDetail(ApplyNegCode, ref pagination);
  51. var JsonData = new
  52. {
  53. total = pagination.total,
  54. page = pagination.page,
  55. records = pagination.records,
  56. rows = ListData,
  57. };
  58. return Content(JsonData.ToJson());
  59. }
  60. [HttpGet]
  61. public ActionResult GetINV(string invcode, string Code, string Invstd, string EATTRIBUTE2, string TimeFrom, string TimeArrive, Pagination pagination)
  62. {
  63. DataTable ListData = App.GetINV(invcode, Code, Invstd, EATTRIBUTE2, TimeFrom, TimeArrive, ref pagination);
  64. var JsonData = new
  65. {
  66. total = pagination.total,
  67. page = pagination.page,
  68. records = pagination.records,
  69. rows = ListData,
  70. };
  71. return Content(JsonData.ToJson());
  72. }
  73. [HttpGet]
  74. public ActionResult GetICSMOPickLog(string invcode, Pagination pagination)
  75. {
  76. DataTable ListData = App.GetICSMOPickLog(invcode, ref pagination);
  77. var JsonData = new
  78. {
  79. total = pagination.total,
  80. page = pagination.page,
  81. records = pagination.records,
  82. rows = ListData,
  83. };
  84. return Content(JsonData.ToJson());
  85. }
  86. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  87. {
  88. DataTable table = App.GetICSReturnTemporary(rfqno);
  89. var JsonData = new
  90. {
  91. total = pagination.total,
  92. page = pagination.page,
  93. records = pagination.records,
  94. rows = table
  95. };
  96. return Content(JsonData.ToJson());
  97. }
  98. [HttpGet]
  99. [HandlerAjaxOnly]
  100. public ActionResult GetWHCode()
  101. {
  102. DataTable dt = App.GetWHCode();
  103. return Content(dt.ToJson());
  104. }
  105. //[HttpGet]
  106. //[HandlerAjaxOnly]
  107. //public ActionResult GetInvCode()
  108. //{
  109. // DataTable dt = App.GetInvCode();
  110. // return Content(dt.ToJson());
  111. //}
  112. public void AddMOApplyNegTemp(string json)
  113. {
  114. App.AddMOApplyNegTemp(json);
  115. }
  116. public ActionResult DeleteMopick(string json)
  117. {
  118. return Content(App.DeleteMopick(json));
  119. }
  120. public void ClearTemp()
  121. {
  122. App.ClearTemp();
  123. }
  124. [HttpPost]
  125. [HandlerAjaxOnly]
  126. public ActionResult SaveICSMOApplyNeg(string ICSASN)
  127. {
  128. string msg = App.SaveICSMOApplyNeg(ICSASN);
  129. if (!string.IsNullOrEmpty(msg))
  130. {
  131. return Error(msg);
  132. }
  133. else
  134. {
  135. return Success("添加成功!");
  136. }
  137. }
  138. [HttpPost]
  139. [HandlerAjaxOnly]
  140. public ActionResult UpdateICSMOApplyNeg(string ICSASN)
  141. {
  142. string msg = App.UpdateICSMOApplyNeg(ICSASN);
  143. if (!string.IsNullOrEmpty(msg))
  144. {
  145. return Error(msg);
  146. }
  147. else
  148. {
  149. return Success("修改成功!");
  150. }
  151. }
  152. /// <summary>
  153. /// 获取文本框值
  154. /// </summary>
  155. /// <param name="POCode"></param>
  156. /// <param name="PORow"></param>
  157. /// <returns></returns>
  158. [HttpPost]
  159. [HandlerAjaxOnly]
  160. public ActionResult GetInputValue(string ID)
  161. {
  162. DataTable ListData = App.GetInputValue(ID);
  163. var JsonData = new
  164. {
  165. rows = ListData,
  166. };
  167. return Content(JsonData.ToJson());
  168. }
  169. public ActionResult GetICSMOApplyNegDetailTemp(string ApplyNegCode, Pagination pagination)
  170. {
  171. DataTable table = App.GetICSMOApplyNegDetailTemp(ApplyNegCode);
  172. var JsonData = new
  173. {
  174. total = pagination.total,
  175. page = pagination.page,
  176. records = pagination.records,
  177. rows = table
  178. };
  179. return Content(JsonData.ToJson());
  180. }
  181. public void UpdateMOApplyNegTemp(string json)
  182. {
  183. App.UpdateMOApplyNegTemp(json);
  184. }
  185. [HttpPost]
  186. [HandlerAjaxOnly]
  187. public ActionResult AuditICSMOApplyNeg(string ICSASN)
  188. {
  189. string msg = App.AuditICSMOApplyNeg(ICSASN);
  190. if (!string.IsNullOrEmpty(msg))
  191. {
  192. return Error(msg);
  193. }
  194. else
  195. {
  196. return Success("操作成功!");
  197. }
  198. }
  199. [HttpPost]
  200. [HandlerAjaxOnly]
  201. [ValidateAntiForgeryToken]
  202. public ActionResult DeleteICSMOApplyNeg(string keyValue)
  203. {
  204. string msg = App.DeleteICSMOApplyNeg(keyValue);
  205. if (string.IsNullOrEmpty(msg))
  206. {
  207. return Success("删除成功!");
  208. }
  209. else
  210. {
  211. return Error(msg);
  212. }
  213. }
  214. [HttpPost]
  215. [HandlerAjaxOnly]
  216. public ActionResult SaveTexts(string pageName, List<Dictionary<string, string>> texts)
  217. {
  218. string msg = App.SaveTexts(pageName, texts);
  219. if (!string.IsNullOrEmpty(msg))
  220. {
  221. return Error(msg);
  222. }
  223. else
  224. {
  225. return Success("操作成功!");
  226. }
  227. }
  228. // 获取页面文本
  229. [HttpGet]
  230. public ActionResult GetTexts(string pageName)
  231. {
  232. var result = new Dictionary<string, Dictionary<string, string>>();
  233. DataTable dt = App.GetTexts(pageName);
  234. // 处理查询结果
  235. foreach (DataRow row in dt.Rows)
  236. {
  237. string textKey = row["TextKey"].ToString();
  238. // 创建每种语言的字典
  239. var languageValues = new Dictionary<string, string>
  240. {
  241. { "Chinese", row["Chinese"].ToString() },
  242. { "English", row["English"].ToString() },
  243. { "Japanese", row["Japanese"].ToString() },
  244. { "Vietnamese", row["Vietnamese"].ToString() },
  245. { "Korean", row["Korean"].ToString() },
  246. { "Others", row["Others"].ToString() }
  247. };
  248. // 添加到结果字典
  249. result[textKey] = languageValues;
  250. }
  251. return Json(result, JsonRequestBehavior.AllowGet);
  252. }
  253. [HttpPost]
  254. public void StatementExportAll( string ID)
  255. {
  256. //ID = ID.Substring(0, ID.Length - 2);
  257. DataTable dt = App.StatementExportAll(ID);
  258. AsposeCell.Export(dt);
  259. }
  260. }
  261. }