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.

296 lines
8.5 KiB

4 days ago
  1. using NFine.Application.SRM;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.SRM.Controllers
  10. {
  11. public class ContainerController : ControllerBase
  12. {
  13. ContainerApp App = new ContainerApp();
  14. //
  15. // GET: /SRM/Container/
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult ICSContainerAdd()
  21. {
  22. return View();
  23. }
  24. public ActionResult ICSContainerBinding()
  25. {
  26. return View();
  27. }
  28. public ActionResult ICSContainerLot()
  29. {
  30. return View();
  31. }
  32. public ActionResult ICSContainerLotBinding()
  33. {
  34. return View();
  35. }
  36. /// <summary>
  37. /// 查询容器信息
  38. /// </summary>
  39. /// <param name="pagination"></param>
  40. /// <param name="queryJson"></param>
  41. /// <returns></returns>
  42. [HttpGet]
  43. [HandlerAjaxOnly]
  44. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  45. {
  46. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  47. var JsonData = new
  48. {
  49. total = pagination.total,
  50. page = pagination.page,
  51. records = pagination.records,
  52. rows = ListData,
  53. };
  54. return Content(JsonData.ToJson());
  55. }
  56. [HttpGet]
  57. [HandlerAjaxOnly]
  58. public ActionResult GetGridJson4(Pagination pagination, string queryJson)
  59. {
  60. DataTable ListData = App.GetGridJson4(queryJson, ref pagination);
  61. var JsonData = new
  62. {
  63. total = pagination.total,
  64. page = pagination.page,
  65. records = pagination.records,
  66. rows = ListData,
  67. };
  68. return Content(JsonData.ToJson());
  69. }
  70. /// <summary>
  71. /// 查询容器绑定
  72. /// </summary>
  73. /// <param name="pagination"></param>
  74. /// <param name="queryJson"></param>
  75. /// <returns></returns>
  76. [HttpGet]
  77. [HandlerAjaxOnly]
  78. public ActionResult GetGridJsonBinding(Pagination pagination, string queryJson)
  79. {
  80. DataTable ListData = App.GetGridJsonBinding(queryJson, ref pagination);
  81. var JsonData = new
  82. {
  83. total = pagination.total,
  84. page = pagination.page,
  85. records = pagination.records,
  86. rows = ListData,
  87. };
  88. return Content(JsonData.ToJson());
  89. }
  90. /// <summary>
  91. /// 删除包装、容器
  92. /// </summary>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [HandlerAjaxOnly]
  96. [ValidateAntiForgeryToken]
  97. public ActionResult DeleteICSContainer(string keyValue)
  98. {
  99. string msg = App.DeleteICSContainer(keyValue);
  100. if (string.IsNullOrEmpty(msg))
  101. {
  102. return Success("删除成功!");
  103. }
  104. else
  105. {
  106. return Error(msg);
  107. }
  108. }
  109. //获取父容器
  110. [HttpGet]
  111. [HandlerAjaxOnly]
  112. public ActionResult GetContainerID()
  113. {
  114. DataTable dt = App.GetContainerID();
  115. return Content(dt.ToJson());
  116. }
  117. //获取父容器
  118. [HttpGet]
  119. [HandlerAjaxOnly]
  120. public ActionResult GetContainerType()
  121. {
  122. DataTable dt = App.GetContainerType();
  123. return Content(dt.ToJson());
  124. }
  125. /// <summary>
  126. /// 修改包装、容器
  127. /// </summary>
  128. /// <param name="keyValue"></param>
  129. /// <returns></returns>
  130. [HttpPost]
  131. [HandlerAjaxOnly]
  132. public ActionResult UpdateICSContainer(string keyValue)
  133. {
  134. string msg = App.UpdateICSContainer(keyValue);
  135. if (!string.IsNullOrEmpty(msg))
  136. {
  137. return Error(msg);
  138. }
  139. else
  140. {
  141. return Success("修改成功!");
  142. }
  143. }
  144. /// <summary>
  145. /// 新增包装、容器
  146. /// </summary>
  147. /// <param name="keyValue"></param>
  148. /// <returns></returns>
  149. [HttpPost]
  150. [HandlerAjaxOnly]
  151. public ActionResult InsertICSContainerLot(string keyValue)
  152. {
  153. string msg = App.InsertICSContainerLot(keyValue);
  154. if (!string.IsNullOrEmpty(msg))
  155. {
  156. return Error(msg);
  157. }
  158. else
  159. {
  160. return Success("添加成功!");
  161. }
  162. }
  163. //包装容器
  164. public ActionResult GetSendContainer(Pagination pagination, string queryJson)
  165. {
  166. DataTable ListData = App.GetSendContainer(ref pagination, queryJson);
  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 GetBindContainerID(string SireCode)
  179. {
  180. DataTable ListData = App.GetBindContainerID(SireCode);
  181. var JsonData = new
  182. {
  183. rows = ListData,
  184. };
  185. return Content(JsonData.ToJson());
  186. }
  187. [HttpGet]
  188. [HandlerAjaxOnly]
  189. public ActionResult GetContainerInfo(string Code)
  190. {
  191. DataTable ListData = App.GetContainerInfo(Code);
  192. var JsonData = new
  193. {
  194. rows = ListData,
  195. };
  196. return Content(JsonData.ToJson());
  197. }
  198. [HttpPost]
  199. [HandlerAjaxOnly]
  200. public ActionResult BindingContainerID(string keyValue)
  201. {
  202. string msg = App.BindingContainerID(keyValue);
  203. if (!string.IsNullOrEmpty(msg))
  204. {
  205. return Error(msg);
  206. }
  207. else
  208. {
  209. return Success("绑定成功!");
  210. }
  211. }
  212. /// <summary>
  213. /// 新增包装、容器
  214. /// </summary>
  215. /// <param name="keyValue"></param>
  216. /// <returns></returns>
  217. [HttpPost]
  218. [HandlerAjaxOnly]
  219. public ActionResult InsertICSContainer(string keyValue)
  220. {
  221. string msg = App.InsertICSContainer(keyValue);
  222. if (!string.IsNullOrEmpty(msg))
  223. {
  224. return Error(msg);
  225. }
  226. else
  227. {
  228. return Success("添加成功!");
  229. }
  230. }
  231. //包装容器关联条码
  232. public ActionResult GetSendContainerLot(Pagination pagination, string queryJson)
  233. {
  234. DataTable ListData = App.GetSendContainerLot(ref pagination, queryJson);
  235. var JsonData = new
  236. {
  237. total = pagination.total,
  238. page = pagination.page,
  239. records = pagination.records,
  240. rows = ListData,
  241. };
  242. return Content(JsonData.ToJson());
  243. }
  244. [HttpGet]
  245. [HandlerAjaxOnly]
  246. public ActionResult GetContainerLotInfo(string LotNo)
  247. {
  248. DataTable ListData = App.GetContainerLotInfo(LotNo);
  249. var JsonData = new
  250. {
  251. rows = ListData,
  252. };
  253. return Content(JsonData.ToJson());
  254. }
  255. [HttpPost]
  256. [HandlerAjaxOnly]
  257. public ActionResult BindingContainerLotID(string keyValue)
  258. {
  259. string msg = App.BindingContainerLotID(keyValue);
  260. if (!string.IsNullOrEmpty(msg))
  261. {
  262. return Error(msg);
  263. }
  264. else
  265. {
  266. return Success("绑定成功!");
  267. }
  268. }
  269. /// <summary>
  270. /// 删除包装、容器关联
  271. /// </summary>
  272. /// <returns></returns>
  273. [HttpPost]
  274. [HandlerAjaxOnly]
  275. [ValidateAntiForgeryToken]
  276. public ActionResult DeleteICSContainerLot(string keyValue)
  277. {
  278. string msg = App.DeleteICSContainerLot(keyValue);
  279. if (string.IsNullOrEmpty(msg))
  280. {
  281. return Success("删除成功!");
  282. }
  283. else
  284. {
  285. return Error(msg);
  286. }
  287. }
  288. }
  289. }