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.

348 lines
9.9 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 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. public ActionResult ICSInvCheckAdd()
  34. {
  35. return View();
  36. }
  37. public ActionResult ICSSpecialCheckAddJH()
  38. {
  39. return View();
  40. }
  41. [HttpGet]
  42. [HandlerAjaxOnly]
  43. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  44. {
  45. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  46. var JsonData = new
  47. {
  48. total = pagination.total,
  49. page = pagination.page,
  50. records = pagination.records,
  51. rows = ListData,
  52. };
  53. return Content(JsonData.ToJson());
  54. }
  55. [HttpGet]
  56. [HandlerAjaxOnly]
  57. public ActionResult GetSubGridJson(string ID, string Inventory,string InvCode,string LotNo, Pagination pagination)
  58. {
  59. DataTable ListData = App.GetSubGridJson(ID, Inventory, InvCode, LotNo,ref pagination);
  60. var JsonData = new
  61. {
  62. total = pagination.total,
  63. page = pagination.page,
  64. records = pagination.records,
  65. rows = ListData,
  66. };
  67. return Content(JsonData.ToJson());
  68. }
  69. public ActionResult DeleteICSCheckDetail(string ID)
  70. {
  71. //keyValue = keyValue.Substring(1, keyValue.Length - 2);
  72. //WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
  73. string msg = App.DeleteICSCheckDetail(ID);
  74. if (string.IsNullOrWhiteSpace(msg))
  75. {
  76. return Success("删除成功!");
  77. }
  78. else
  79. {
  80. return Error(msg);
  81. }
  82. }
  83. //获取仓库
  84. public ActionResult GetWHCode()
  85. {
  86. DataTable dt = App.GetWHCode();
  87. return Content(dt.ToJson());
  88. }
  89. public ActionResult GetQU(string WHCodeID)
  90. {
  91. DataTable dt = App.GetQU(WHCodeID);
  92. return Content(dt.ToJson());
  93. }
  94. //[HttpGet]
  95. //public ActionResult GetQU(string WHCodeID)
  96. //{
  97. // try
  98. // {
  99. // DataTable data = App.GetQU(WHCodeID);
  100. // return Content(data.ToJson());
  101. // }
  102. // catch (Exception ex)
  103. // {
  104. // return Error(ex.ToString());
  105. // }
  106. //}
  107. public ActionResult GetPai(string WHCodeID, string Qu)
  108. {
  109. DataTable dt = App.GetPai(WHCodeID, Qu);
  110. return Content(dt.ToJson());
  111. }
  112. public ActionResult GetHuoJia(string WHCodeID, string Qu, string Pai)
  113. {
  114. DataTable dt = App.GetHuoJia(WHCodeID, Qu, Pai);
  115. return Content(dt.ToJson());
  116. }
  117. public ActionResult GetCeng(string WHCodeID, string Qu, string Pai, string HuoJia)
  118. {
  119. DataTable dt = App.GetCeng(WHCodeID, Qu, Pai, HuoJia);
  120. return Content(dt.ToJson());
  121. }
  122. public ActionResult GetGe(string WHCodeID, string Qu, string Pai, string HuoJia, string Ceng)
  123. {
  124. DataTable dt = App.GetGe(WHCodeID, Qu, Pai, HuoJia, Ceng);
  125. return Content(dt.ToJson());
  126. }
  127. [HttpPost]
  128. [HandlerAjaxOnly]
  129. public ActionResult AddICSCheck(string Parameter)
  130. {
  131. string msg = App.AddICSCheck(Parameter);
  132. if (!string.IsNullOrEmpty(msg))
  133. {
  134. return Error(msg);
  135. }
  136. else
  137. {
  138. return Success("添加成功!");
  139. }
  140. }
  141. [HttpPost]
  142. [HandlerAjaxOnly]
  143. [ValidateAntiForgeryToken]
  144. public ActionResult DeleteICSCheck(string keyValue)
  145. {
  146. string msg = App.DeleteICSCheck(keyValue);
  147. if (string.IsNullOrEmpty(msg))
  148. {
  149. return Success("删除成功!");
  150. }
  151. else
  152. {
  153. return Error(msg);
  154. }
  155. }
  156. [HttpGet]
  157. [HandlerAjaxOnly]
  158. public ActionResult GetGridJsonWarehouse(Pagination pagination, string queryJson)
  159. {
  160. DataTable ListData = App.GetGridJsonWarehouse(queryJson, ref pagination);
  161. var JsonData = new
  162. {
  163. total = pagination.total,
  164. page = pagination.page,
  165. records = pagination.records,
  166. rows = ListData,
  167. };
  168. return Content(JsonData.ToJson());
  169. }
  170. [HttpGet]
  171. [HandlerAjaxOnly]
  172. public ActionResult GetSubGridJsonRegion(string ID, Pagination pagination)
  173. {
  174. DataTable ListData = App.GetSubGridJsonRegion(ID, ref pagination);
  175. var JsonData = new
  176. {
  177. total = pagination.total,
  178. page = pagination.page,
  179. records = pagination.records,
  180. rows = ListData,
  181. };
  182. return Content(JsonData.ToJson());
  183. }
  184. [HttpGet]
  185. [HandlerAjaxOnly]
  186. public ActionResult GetSubGridJsonRow(string WHID, string Region, Pagination pagination)
  187. {
  188. DataTable ListData = App.GetSubGridJsonRow(WHID, Region, ref pagination);
  189. var JsonData = new
  190. {
  191. total = pagination.total,
  192. page = pagination.page,
  193. records = pagination.records,
  194. rows = ListData,
  195. };
  196. return Content(JsonData.ToJson());
  197. }
  198. [HttpGet]
  199. [HandlerAjaxOnly]
  200. public ActionResult GetSubGridJsonGoodsShelf(string WHID, string Region, string Row, Pagination pagination)
  201. {
  202. DataTable ListData = App.GetSubGridJsonGoodsShelf(WHID, Region, Row, ref pagination);
  203. var JsonData = new
  204. {
  205. total = pagination.total,
  206. page = pagination.page,
  207. records = pagination.records,
  208. rows = ListData,
  209. };
  210. return Content(JsonData.ToJson());
  211. }
  212. [HttpGet]
  213. [HandlerAjaxOnly]
  214. public ActionResult GetSubGridJsonTier(string WHID, string Region, string Row, string GoodsShelf, Pagination pagination)
  215. {
  216. DataTable ListData = App.GetSubGridJsonTier(WHID, Region, Row, GoodsShelf, ref pagination);
  217. var JsonData = new
  218. {
  219. total = pagination.total,
  220. page = pagination.page,
  221. records = pagination.records,
  222. rows = ListData,
  223. };
  224. return Content(JsonData.ToJson());
  225. }
  226. [HttpGet]
  227. [HandlerAjaxOnly]
  228. public ActionResult GetSubGridJsonGrid(string WHID, string Region, string Row, string GoodsShelf, string Tier, Pagination pagination)
  229. {
  230. DataTable ListData = App.GetSubGridJsonGrid(WHID, Region, Row, GoodsShelf, Tier, ref pagination);
  231. var JsonData = new
  232. {
  233. total = pagination.total,
  234. page = pagination.page,
  235. records = pagination.records,
  236. rows = ListData,
  237. };
  238. return Content(JsonData.ToJson());
  239. }
  240. [HttpPost]
  241. public void StatementExportAll(string ID,string Inventory,string InvCode)
  242. {
  243. //ID = ID.Substring(0, ID.Length - 2);
  244. DataTable dt = App.StatementExportAll(ID, Inventory, InvCode);
  245. AsposeCell.Export(dt);
  246. }
  247. [HttpGet]
  248. //[HandlerAjaxOnly]
  249. public ActionResult GetGridJsonInv(Pagination pagination, string queryJson)
  250. {
  251. DataTable ListData = App.GetGridJsonInv(queryJson, ref pagination);
  252. var JsonData = new
  253. {
  254. total = pagination.total,
  255. page = pagination.page,
  256. records = pagination.records,
  257. rows = ListData,
  258. };
  259. return Content(JsonData.ToJson());
  260. }
  261. [HttpPost]
  262. [HandlerAjaxOnly]
  263. public ActionResult AuditICSCheck(string keyValue)
  264. {
  265. string msg = App.AuditICSCheck(keyValue);
  266. if (!string.IsNullOrEmpty(msg))
  267. {
  268. return Error(msg);
  269. }
  270. else
  271. {
  272. return Success("操作成功!");
  273. }
  274. }
  275. [HttpPost]
  276. [HandlerAjaxOnly]
  277. public ActionResult AuditSkipLot(string keyValue)
  278. {
  279. string msg = App.AuditSkipLot(keyValue);
  280. if (!string.IsNullOrEmpty(msg))
  281. {
  282. return Error(msg);
  283. }
  284. else
  285. {
  286. return Success("操作成功!");
  287. }
  288. }
  289. [HttpGet]
  290. //[HandlerAjaxOnly]
  291. public ActionResult GetGridJsonCustomerInvJH(Pagination pagination, string queryJson)
  292. {
  293. DataTable ListData = App.GetGridJsonCustomerInvJH(queryJson, ref pagination);
  294. var JsonData = new
  295. {
  296. total = pagination.total,
  297. page = pagination.page,
  298. records = pagination.records,
  299. rows = ListData,
  300. };
  301. return Content(JsonData.ToJson());
  302. }
  303. }
  304. }