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.

293 lines
8.2 KiB

11 months ago
11 months 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 BlitemController : ControllerBase
  18. {
  19. BlitemApp App = new BlitemApp();
  20. // GET: WMS/Blitem
  21. public ActionResult BlitemList()
  22. {
  23. return View();
  24. }
  25. public ActionResult ICSCheckAdd()
  26. {
  27. return View();
  28. }
  29. public ActionResult GetHierarchy()
  30. {
  31. return View();
  32. }
  33. [HttpGet]
  34. [HandlerAjaxOnly]
  35. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  36. {
  37. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  38. var JsonData = new
  39. {
  40. total = pagination.total,
  41. page = pagination.page,
  42. records = pagination.records,
  43. rows = ListData,
  44. };
  45. return Content(JsonData.ToJson());
  46. }
  47. [HttpGet]
  48. [HandlerAjaxOnly]
  49. public ActionResult GetSubGridJson(string ID, string Sequence, Pagination pagination)
  50. {
  51. DataTable ListData = App.GetSubGridJson(ID, Sequence, ref pagination);
  52. var JsonData = new
  53. {
  54. total = pagination.total,
  55. page = pagination.page,
  56. records = pagination.records,
  57. rows = ListData,
  58. };
  59. return Content(JsonData.ToJson());
  60. }
  61. public ActionResult DeleteICSCheckDetail(string ID)
  62. {
  63. //keyValue = keyValue.Substring(1, keyValue.Length - 2);
  64. //WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
  65. string msg = App.DeleteICSCheckDetail(ID);
  66. if (string.IsNullOrWhiteSpace(msg))
  67. {
  68. return Success("删除成功!");
  69. }
  70. else
  71. {
  72. return Error(msg);
  73. }
  74. }
  75. //获取仓库
  76. public ActionResult GetWHCode()
  77. {
  78. DataTable dt = App.GetWHCode();
  79. return Content(dt.ToJson());
  80. }
  81. public ActionResult GetQU(string WHCodeID)
  82. {
  83. DataTable dt = App.GetQU(WHCodeID);
  84. return Content(dt.ToJson());
  85. }
  86. //[HttpGet]
  87. //public ActionResult GetQU(string WHCodeID)
  88. //{
  89. // try
  90. // {
  91. // DataTable data = App.GetQU(WHCodeID);
  92. // return Content(data.ToJson());
  93. // }
  94. // catch (Exception ex)
  95. // {
  96. // return Error(ex.ToString());
  97. // }
  98. //}
  99. public ActionResult GetPai(string WHCodeID, string Qu)
  100. {
  101. DataTable dt = App.GetPai(WHCodeID, Qu);
  102. return Content(dt.ToJson());
  103. }
  104. public ActionResult GetHuoJia(string WHCodeID, string Qu, string Pai)
  105. {
  106. DataTable dt = App.GetHuoJia(WHCodeID, Qu, Pai);
  107. return Content(dt.ToJson());
  108. }
  109. public ActionResult GetCeng(string WHCodeID, string Qu, string Pai, string HuoJia)
  110. {
  111. DataTable dt = App.GetCeng(WHCodeID, Qu, Pai, HuoJia);
  112. return Content(dt.ToJson());
  113. }
  114. public ActionResult GetGe(string WHCodeID, string Qu, string Pai, string HuoJia, string Ceng)
  115. {
  116. DataTable dt = App.GetGe(WHCodeID, Qu, Pai, HuoJia, Ceng);
  117. return Content(dt.ToJson());
  118. }
  119. [HttpPost]
  120. [HandlerAjaxOnly]
  121. public ActionResult AddICSCheck(string Parameter)
  122. {
  123. string msg = App.AddICSCheck(Parameter);
  124. if (!string.IsNullOrEmpty(msg))
  125. {
  126. return Error(msg);
  127. }
  128. else
  129. {
  130. return Success("添加成功!");
  131. }
  132. }
  133. [HttpPost]
  134. [HandlerAjaxOnly]
  135. [ValidateAntiForgeryToken]
  136. public ActionResult DeleteICSCheck(string keyValue)
  137. {
  138. string msg = App.DeleteICSCheck(keyValue);
  139. if (string.IsNullOrEmpty(msg))
  140. {
  141. return Success("删除成功!");
  142. }
  143. else
  144. {
  145. return Error(msg);
  146. }
  147. }
  148. [HttpGet]
  149. [HandlerAjaxOnly]
  150. public ActionResult GetGridJsonWarehouse(Pagination pagination, string queryJson)
  151. {
  152. DataTable ListData = App.GetGridJsonWarehouse(queryJson, ref pagination);
  153. var JsonData = new
  154. {
  155. total = pagination.total,
  156. page = pagination.page,
  157. records = pagination.records,
  158. rows = ListData,
  159. };
  160. return Content(JsonData.ToJson());
  161. }
  162. [HttpGet]
  163. [HandlerAjaxOnly]
  164. public ActionResult GetSubGridJsonRegion(string ID, Pagination pagination)
  165. {
  166. DataTable ListData = App.GetSubGridJsonRegion(ID, ref pagination);
  167. var JsonData = new
  168. {
  169. total = pagination.total,
  170. page = pagination.page,
  171. records = pagination.records,
  172. rows = ListData,
  173. };
  174. return Content(JsonData.ToJson());
  175. }
  176. [HttpGet]
  177. [HandlerAjaxOnly]
  178. public ActionResult GetSubGridJsonRow(string WHID, string Region, Pagination pagination)
  179. {
  180. DataTable ListData = App.GetSubGridJsonRow(WHID, Region, ref pagination);
  181. var JsonData = new
  182. {
  183. total = pagination.total,
  184. page = pagination.page,
  185. records = pagination.records,
  186. rows = ListData,
  187. };
  188. return Content(JsonData.ToJson());
  189. }
  190. [HttpGet]
  191. [HandlerAjaxOnly]
  192. public ActionResult GetSubGridJsonGoodsShelf(string WHID, string Region, string Row, Pagination pagination)
  193. {
  194. DataTable ListData = App.GetSubGridJsonGoodsShelf(WHID, Region, Row, ref pagination);
  195. var JsonData = new
  196. {
  197. total = pagination.total,
  198. page = pagination.page,
  199. records = pagination.records,
  200. rows = ListData,
  201. };
  202. return Content(JsonData.ToJson());
  203. }
  204. [HttpGet]
  205. [HandlerAjaxOnly]
  206. public ActionResult GetSubGridJsonTier(string WHID, string Region, string Row, string GoodsShelf, Pagination pagination)
  207. {
  208. DataTable ListData = App.GetSubGridJsonTier(WHID, Region, Row, GoodsShelf, ref pagination);
  209. var JsonData = new
  210. {
  211. total = pagination.total,
  212. page = pagination.page,
  213. records = pagination.records,
  214. rows = ListData,
  215. };
  216. return Content(JsonData.ToJson());
  217. }
  218. [HttpGet]
  219. [HandlerAjaxOnly]
  220. public ActionResult GetSubGridJsonGrid(string WHID, string Region, string Row, string GoodsShelf, string Tier, Pagination pagination)
  221. {
  222. DataTable ListData = App.GetSubGridJsonGrid(WHID, Region, Row, GoodsShelf, Tier, ref pagination);
  223. var JsonData = new
  224. {
  225. total = pagination.total,
  226. page = pagination.page,
  227. records = pagination.records,
  228. rows = ListData,
  229. };
  230. return Content(JsonData.ToJson());
  231. }
  232. [HttpPost]
  233. public void StatementExportAll(string ID)
  234. {
  235. //ID = ID.Substring(0, ID.Length - 2);
  236. DataTable dt = App.StatementExportAll(ID);
  237. AsposeCell.Export(dt);
  238. }
  239. [HttpPost]
  240. [HandlerAjaxOnly]
  241. public ActionResult AuditICSCheck(string Code)
  242. {
  243. string msg = App.AuditICSCheck(Code);
  244. if (!string.IsNullOrEmpty(msg))
  245. {
  246. return Error(msg);
  247. }
  248. else
  249. {
  250. return Success("审核成功!");
  251. }
  252. }
  253. }
  254. }