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

278 lines
8.0 KiB

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