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.

379 lines
10 KiB

3 weeks ago
  1. using NFine.Code;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. using NFine.Application.KBSWMS;
  9. namespace NFine.Web.Areas.KBSWMS.Controllers
  10. {
  11. public class ICSInspectionReportsController : ControllerBase
  12. {
  13. ICSInspectionReportsApp App = new ICSInspectionReportsApp();
  14. public ActionResult PassFirstTime()
  15. {
  16. return View();
  17. }
  18. public ActionResult ICSTransferAdd()
  19. {
  20. return View();
  21. }
  22. public ActionResult ExternalImprovementReports()
  23. {
  24. return View();
  25. }
  26. public ActionResult TOP3NGBatch()
  27. {
  28. return View();
  29. }
  30. public ActionResult RejudicationNG()
  31. {
  32. return View();
  33. }
  34. public ActionResult TOP5NGBatch()
  35. {
  36. return View();
  37. }
  38. public ActionResult ExceptionTrackingReports() {
  39. return View();
  40. }
  41. public ActionResult POUnarrivedQuantity()
  42. {
  43. return View();
  44. }
  45. public ActionResult VenDeliveries()
  46. {
  47. return View();
  48. }
  49. /// <summary>
  50. /// 获取月度一次检验合格率
  51. /// </summary>
  52. /// <param name="pagination"></param>
  53. /// <param name="queryJson"></param>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [HandlerAjaxOnly]
  57. public ActionResult GetPassFirstTime( string queryJson)
  58. {
  59. string ListData = App.GetPassFirstTime(queryJson);
  60. return Content(ListData);
  61. }
  62. /// <summary>
  63. /// 获取月度一次检验合格率
  64. /// </summary>
  65. /// <param name="pagination"></param>
  66. /// <param name="queryJson"></param>
  67. /// <returns></returns>
  68. [HttpGet]
  69. [HandlerAjaxOnly]
  70. public ActionResult GetPassFirstTime2(string queryJson)
  71. {
  72. DataTable ListData = App.GetPassFirstTime2(queryJson);
  73. var JsonData = new
  74. {
  75. rows = ListData,
  76. };
  77. return Content(JsonData.ToJson());
  78. }
  79. /// <summary>
  80. /// 获取月度一次检验合格率导出
  81. /// </summary>
  82. /// <param name="DateNow"></param>
  83. [HttpPost]
  84. public void ExportAll1(string DateNow)
  85. {
  86. DataTable data = App.ExportAll1(DateNow);
  87. if (data != null && data.Rows.Count > 0)
  88. {
  89. //MemoryStream ms = OutFileToStreamItemReplace(data);
  90. AsposeCell.Export(data);
  91. }
  92. }
  93. /// <summary>
  94. /// 对外改善异常追踪表
  95. /// </summary>
  96. /// <param name="pagination"></param>
  97. /// <param name="queryJson"></param>
  98. /// <returns></returns>
  99. [HttpGet]
  100. [HandlerAjaxOnly]
  101. public ActionResult GetPassFirstTime4(string queryJson)
  102. {
  103. DataTable ListData = App.GetPassFirstTime4(queryJson);
  104. var JsonData = new
  105. {
  106. rows = ListData,
  107. };
  108. return Content(JsonData.ToJson());
  109. }
  110. [HttpPost]
  111. public void ExportAll4(string DateNow)
  112. {
  113. DataTable data = App.ExportAll4(DateNow);
  114. if (data != null && data.Rows.Count > 0)
  115. {
  116. //MemoryStream ms = OutFileToStreamItemReplace(data);
  117. AsposeCell.Export(data);
  118. }
  119. }
  120. /// <summary>
  121. /// 复判NG对外改善
  122. /// </summary>
  123. /// <param name="queryJson"></param>
  124. /// <returns></returns>
  125. public ActionResult GetPassFirstTime3(string queryJson)
  126. {
  127. string ListData = App.GetPassFirstTime3(queryJson);
  128. return Content(ListData);
  129. }
  130. /// <summary>
  131. /// 复判NG对外改善报表
  132. /// </summary>
  133. /// <param name="DateNow"></param>
  134. [HttpPost]
  135. public void ExportAll3(string DateNow)
  136. {
  137. DataTable data = App.ExportAll3(DateNow);
  138. if (data != null && data.Rows.Count > 0)
  139. {
  140. //MemoryStream ms = OutFileToStreamItemReplace(data);
  141. AsposeCell.Export(data);
  142. }
  143. }
  144. /// <summary>
  145. /// 对外改善异常追踪表
  146. /// </summary>
  147. /// <param name="pagination"></param>
  148. /// <param name="queryJson"></param>
  149. /// <returns></returns>
  150. [HttpGet]
  151. [HandlerAjaxOnly]
  152. public ActionResult GetPassFirstTime6(string queryJson)
  153. {
  154. DataTable ListData = App.GetPassFirstTime6(queryJson);
  155. var JsonData = new
  156. {
  157. rows = ListData,
  158. };
  159. return Content(JsonData.ToJson());
  160. }
  161. public void ExportAll6(string DateNow)
  162. {
  163. DataTable data = App.ExportAll6(DateNow);
  164. if (data != null && data.Rows.Count > 0)
  165. {
  166. //MemoryStream ms = OutFileToStreamItemReplace(data);
  167. AsposeCell.Export(data);
  168. }
  169. }
  170. /// <summary>
  171. /// 对外改善异常追踪表
  172. /// </summary>
  173. /// <param name="pagination"></param>
  174. /// <param name="queryJson"></param>
  175. /// <returns></returns>
  176. [HttpGet]
  177. [HandlerAjaxOnly]
  178. public ActionResult GetPassFirstTime5(string queryJson)
  179. {
  180. DataTable ListData = App.GetPassFirstTime5(queryJson);
  181. var JsonData = new
  182. {
  183. rows = ListData,
  184. };
  185. return Content(JsonData.ToJson());
  186. }
  187. [HttpPost]
  188. public void ExportAll(string DateNow)
  189. {
  190. DataTable data = App.ExportAll(DateNow);
  191. if (data != null && data.Rows.Count > 0)
  192. {
  193. //MemoryStream ms = OutFileToStreamItemReplace(data);
  194. AsposeCell.Export(data);
  195. }
  196. }
  197. /// <summary>
  198. /// 详情
  199. /// </summary>
  200. /// <param name="RCVCode"></param>
  201. /// <param name="pagination"></param>
  202. /// <returns></returns>
  203. [HttpGet]
  204. [HandlerAjaxOnly]
  205. public ActionResult GetMOIssueApplyNegDetail(string RCVCode, Pagination pagination)
  206. {
  207. DataTable ListData = App.GetMOIssueApplyNegDetail(RCVCode, ref pagination);
  208. var JsonData = new
  209. {
  210. total = pagination.total,
  211. page = pagination.page,
  212. records = pagination.records,
  213. rows = ListData,
  214. };
  215. return Content(JsonData.ToJson());
  216. }
  217. public void ClearTemp()
  218. {
  219. App.ClearTemp();
  220. }
  221. /// <summary>
  222. /// 生成调拨单
  223. /// </summary>
  224. /// <param name="keyValue"></param>
  225. /// <returns></returns>
  226. [HttpPost]
  227. [HandlerAjaxOnly]
  228. public ActionResult AddICSTransfer(string keyValue)
  229. {
  230. string msg = App.AddICSTransfer(keyValue);
  231. if (!string.IsNullOrEmpty(msg))
  232. {
  233. return Error(msg);
  234. }
  235. else
  236. {
  237. return Success("操作成功!");
  238. }
  239. }
  240. /// <summary>
  241. /// 多个产成品退库单 弃核
  242. /// </summary>
  243. /// <param name="keyValue"></param>
  244. /// <returns></returns>
  245. [HttpPost]
  246. [HandlerAjaxOnly]
  247. public ActionResult ICSMOIssueSendBackAuditRollback(string keyValue)
  248. {
  249. string msg = App.ICSMOIssueSendBackAuditRollback(keyValue);
  250. if (!string.IsNullOrEmpty(msg))
  251. {
  252. return Error(msg);
  253. }
  254. else
  255. {
  256. return Success("弃审成功!");
  257. }
  258. }
  259. [HttpPost]
  260. public void ExportAll5(string DateNow)
  261. {
  262. DataTable data = App.ExportAll5(DateNow);
  263. if (data != null && data.Rows.Count > 0)
  264. {
  265. //MemoryStream ms = OutFileToStreamItemReplace(data);
  266. AsposeCell.Export(data);
  267. }
  268. }
  269. [HttpGet]
  270. public ActionResult SelectTableColumnName(string BeginTime, string EndTime)
  271. {
  272. var data = App.SelectTableColumnName(BeginTime, EndTime);
  273. return Content(data.ToJson());
  274. }
  275. /// <summary>
  276. /// 订单所在的日期的订单未交货数量
  277. /// </summary>
  278. /// <param name="queryJson"></param>
  279. /// <returns></returns>
  280. [HttpGet]
  281. [HandlerAjaxOnly]
  282. public ActionResult GetPOUnarrivedQuantity(string queryJson)
  283. {
  284. DataTable ListData = App.GetPOUnarrivedQuantity(queryJson);
  285. var JsonData = new
  286. {
  287. rows = ListData,
  288. };
  289. return Content(JsonData.ToJson());
  290. }
  291. /// <summary>
  292. /// 订单所在的日期的订单未交货数量(报表)
  293. /// </summary>
  294. /// <param name="DateNow"></param>
  295. [HttpPost]
  296. public void ExportAll7(string BeginTime, string EndTime)
  297. {
  298. DataTable data = App.ExportAll7(BeginTime,EndTime);
  299. if (data != null && data.Rows.Count > 0)
  300. {
  301. //MemoryStream ms = OutFileToStreamItemReplace(data);
  302. AsposeCell.Export(data);
  303. }
  304. }
  305. /// <summary>
  306. /// 供应商交货的频率
  307. /// </summary>
  308. /// <param name="queryJson"></param>
  309. /// <returns></returns>
  310. [HttpGet]
  311. [HandlerAjaxOnly]
  312. public ActionResult GetVenDeliveries(string queryJson)
  313. {
  314. DataTable ListData = App.GetVenDeliveries(queryJson);
  315. var JsonData = new
  316. {
  317. rows = ListData,
  318. };
  319. return Content(JsonData.ToJson());
  320. }
  321. [HttpPost]
  322. public void ExportAll8(string BeginTime, string EndTime)
  323. {
  324. DataTable data = App.ExportAll8(BeginTime, EndTime);
  325. if (data != null && data.Rows.Count > 0)
  326. {
  327. //MemoryStream ms = OutFileToStreamItemReplace(data);
  328. AsposeCell.Export(data);
  329. }
  330. }
  331. }
  332. }