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.

438 lines
11 KiB

  1. using Aspose.Cells;
  2. using NFine.Application.SRM;
  3. using NFine.Code;
  4. using System;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace NFine.Web.Areas.SRM.Controllers
  11. {
  12. public class WatchPanelController : ControllerBase
  13. {
  14. private WatchPanelApp App = new WatchPanelApp();
  15. [HttpGet]
  16. [HandlerAjaxOnly]
  17. public ActionResult GetGridJson1(Pagination pagination, string queryJson)
  18. {
  19. DataTable dt = App.GetList1(queryJson, ref pagination);
  20. var data = new
  21. {
  22. rows = dt,
  23. total = pagination.total,
  24. page = pagination.page,
  25. records = pagination.records
  26. };
  27. return Content(data.ToJson());
  28. }
  29. [HttpGet]
  30. [HandlerAjaxOnly]
  31. public ActionResult GetGridJson2(Pagination pagination, string queryJson)
  32. {
  33. DataTable dt = App.GetList2(queryJson, ref pagination);
  34. var data = new
  35. {
  36. rows = dt,
  37. total = pagination.total,
  38. page = pagination.page,
  39. records = pagination.records
  40. };
  41. return Content(data.ToJson());
  42. }
  43. [HttpGet]
  44. [HandlerAjaxOnly]
  45. public ActionResult GetGridJson3(Pagination pagination, string queryJson)
  46. {
  47. DataTable dt = App.GetList3(queryJson, ref pagination);
  48. var data = new
  49. {
  50. rows = dt,
  51. total = pagination.total,
  52. page = pagination.page,
  53. records = pagination.records
  54. };
  55. return Content(data.ToJson());
  56. }
  57. [HttpGet]
  58. [HandlerAjaxOnly]
  59. public ActionResult GetGridJson4(Pagination pagination, string queryJson)
  60. {
  61. DataTable dt = App.GetList4(queryJson, ref pagination);
  62. var data = new
  63. {
  64. rows = dt,
  65. total = pagination.total,
  66. page = pagination.page,
  67. records = pagination.records
  68. };
  69. return Content(data.ToJson());
  70. }
  71. [HttpGet]
  72. [HandlerAjaxOnly]
  73. public ActionResult GetGridJson_WIPJinDu(Pagination pagination, string queryJson,string filters)
  74. {
  75. try
  76. {
  77. DataTable dt = App.GetList_WIPJinDu(queryJson, filters, ref pagination);
  78. var data = new
  79. {
  80. rows = dt,
  81. total = pagination.total,
  82. page = pagination.page,
  83. records = pagination.records
  84. };
  85. if (Request.Cookies["SSMES"] != null)
  86. {
  87. Response.Cookies["SSMES"].Value = queryJson;
  88. Response.Cookies["SSMES"].Expires = DateTime.Now.Add(new TimeSpan(12, 0, 0));
  89. }
  90. else
  91. {
  92. HttpCookie Cookie = new HttpCookie("SSMES", queryJson);
  93. Cookie.Expires = DateTime.Now.Add(new TimeSpan(12, 0, 0));
  94. Response.Cookies.Add(Cookie);
  95. }
  96. return Content(data.ToJson());
  97. }
  98. catch (Exception ex)
  99. {
  100. return Error(ex.Message);
  101. }
  102. }
  103. //导出生产看板
  104. [HttpPost]
  105. public void ExportAll(string value )
  106. {
  107. DataTable dt = App.GetList_WIPJinDu(value);
  108. if (dt != null && dt.Rows.Count > 0)
  109. {
  110. AsposeCell.Export(dt);
  111. }
  112. }
  113. public void ExportAll(string txtProject, string txtEQPType, string txtItemStd, string txtEQPCode, string txtPlanStartDay,
  114. string txtMOCode, string txtItemCode, string txtProJieDuan, string txtStatus, string txtPlanEndDay)
  115. {
  116. Pagination pagination = new Pagination();
  117. string queryJson = "{\"txtProject\":\"" + txtProject + "\"";
  118. queryJson += ",\"txtEQPType\":\"" + txtEQPType + "\"";
  119. queryJson += ",\"txtItemStd\":\"" + txtItemStd + "\"";
  120. queryJson += ",\"txtEQPCode\":\"" + txtEQPCode + "\"";
  121. queryJson += ",\"txtPlanStartDay\":\"" + txtPlanStartDay + "\"";
  122. queryJson += ",\"txtMOCode\":\"" + txtMOCode + "\"";
  123. queryJson += ",\"txtItemCode\":\"" + txtItemCode + "\"";
  124. queryJson += ",\"txtProJieDuan\":\"" + txtProJieDuan + "\"";
  125. queryJson += ",\"txtStatus\":\"" + txtStatus + "\"";
  126. queryJson += ",\"txtPlanEndDay\":\"" + txtPlanEndDay + "\"";
  127. queryJson += " }";
  128. DataTable data = App.GetList_WIPJinDu(queryJson, "", ref pagination);
  129. if (data != null)
  130. {
  131. data.Columns.Remove("ColorStr");
  132. data.Columns.Remove("ID");
  133. data.Columns.Remove("项目进度条值");
  134. }
  135. if (data != null && data.Rows.Count > 0)
  136. {
  137. AsposeCell.Export(data);
  138. }
  139. }
  140. [HttpGet]
  141. public ActionResult GetProjectJD()
  142. {
  143. try
  144. {
  145. DataTable data = App.GetProjectJD();
  146. return Content(data.ToJson());
  147. }
  148. catch (Exception ex)
  149. {
  150. return Error(ex.ToString());
  151. }
  152. }
  153. [HttpGet]
  154. public ActionResult GetEQPType()
  155. {
  156. try
  157. {
  158. DataTable data = App.GetEQPType();
  159. return Content(data.ToJson());
  160. }
  161. catch (Exception ex)
  162. {
  163. return Error(ex.ToString());
  164. }
  165. }
  166. [HttpGet]
  167. public ActionResult GetStatus()
  168. {
  169. try
  170. {
  171. DataTable data = App.GetStatus();
  172. return Content(data.ToJson());
  173. }
  174. catch (Exception ex)
  175. {
  176. return Error(ex.ToString());
  177. }
  178. }
  179. [HttpGet]
  180. [HandlerAjaxOnly]
  181. public ActionResult GetWIPQty1(string XX)
  182. {
  183. var data = App.GetWIPQty1();
  184. return Content(data.ToJson());
  185. }
  186. [HttpGet]
  187. [HandlerAjaxOnly]
  188. public ActionResult GetWIPQty5(string XX)
  189. {
  190. var data = App.GetWIPQty5();
  191. return Content(data.ToJson());
  192. }
  193. [HttpGet]
  194. [HandlerAjaxOnly]
  195. public ActionResult GetWIPQty2(string XX)
  196. {
  197. var data = App.GetWIPQty2();
  198. return Content(data.ToJson());
  199. }
  200. [HttpGet]
  201. [HandlerAjaxOnly]
  202. public ActionResult GetWIPQty3(string XX)
  203. {
  204. var data = App.GetWIPQty3();
  205. return Content(data.ToJson());
  206. }
  207. [HttpGet]
  208. [HandlerAjaxOnly]
  209. public ActionResult GetWIPQty4(string XX)
  210. {
  211. var data = App.GetWIPQty4();
  212. return Content(data.ToJson());
  213. }
  214. [HttpGet]
  215. [HandlerAjaxOnly]
  216. public ActionResult GetPeiLiaoJingDu(string XX)
  217. {
  218. var data = App.GetPeiLiaoJingDu();
  219. return Content(data.ToJson());
  220. }
  221. [HttpGet]
  222. [HandlerAjaxOnly]
  223. public ActionResult GetRCVQty(string type)
  224. {
  225. var data = App.GetRCVQty(type);
  226. return Content(data.ToJson());
  227. }
  228. [HttpGet]
  229. [HandlerAjaxOnly]
  230. public ActionResult GetWareInQty(string type)
  231. {
  232. var data = App.GetWareInQty(type);
  233. return Content(data.ToJson());
  234. }
  235. [HttpGet]
  236. [HandlerAjaxOnly]
  237. public ActionResult GetRCVJingDu(string XX)
  238. {
  239. var data = App.GetRCVJingDu();
  240. return Content(data.ToJson());
  241. }
  242. [HttpGet]
  243. [HandlerAjaxOnly]
  244. public ActionResult GetZhiXing_MO(string ItemNumber)
  245. {
  246. var data = App.GetZhiXing_MO(ItemNumber);
  247. return Content(data.ToJson());
  248. }
  249. [HttpGet]
  250. [HandlerAjaxOnly]
  251. public ActionResult GetZhiXing_OQC(string XX)
  252. {
  253. var data = App.GetZhiXing_OQC();
  254. return Content(data.ToJson());
  255. }
  256. [HttpGet]
  257. [HandlerAjaxOnly]
  258. public ActionResult GetZhiXing_RCVUnInWare(string XX)
  259. {
  260. var data = App.GetZhiXing_RCVUnInWare();
  261. return Content(data.ToJson());
  262. }
  263. public virtual ActionResult PanelWIP()
  264. {
  265. return View();
  266. }
  267. public virtual ActionResult PanelWIPDetail()
  268. {
  269. return View();
  270. }
  271. public virtual ActionResult PanelWareHouse()
  272. {
  273. return View();
  274. }
  275. public virtual ActionResult PanelWareHouseDetail()
  276. {
  277. return View();
  278. }
  279. public virtual ActionResult PanelWareHouseNew()
  280. {
  281. return View();
  282. }
  283. public virtual ActionResult PanelWIPDetail_SX()
  284. {
  285. return View();
  286. }
  287. public virtual ActionResult PanelWIPZhiXingDa()
  288. {
  289. return View();
  290. }
  291. public virtual ActionResult PanelWIPZhiXingDa2()
  292. {
  293. return View();
  294. }
  295. [HttpGet]
  296. [HandlerAjaxOnly]
  297. public ActionResult GetSScode() {
  298. string cookiemes = "";
  299. if (Request.Cookies["SSMES"]!= null)
  300. cookiemes = Request.Cookies["SSMES"].Value;
  301. return Content(App.GetSScode(cookiemes).ToJson());
  302. }
  303. //成品发货一览数据源
  304. [HttpGet]
  305. [HandlerAjaxOnly]
  306. public ActionResult Get_Table1()
  307. {
  308. var data = App.Get_Table1();
  309. return Content(data.ToJson());
  310. }
  311. //采购未到货一览
  312. [HttpGet]
  313. [HandlerAjaxOnly]
  314. public ActionResult Get_Table2()
  315. {
  316. var data = App.Get_Table2();
  317. return Content(data.ToJson());
  318. }
  319. //成品未入库
  320. [HttpGet]
  321. [HandlerAjaxOnly]
  322. public ActionResult Get_Table3()
  323. {
  324. var data = App.Get_Table3();
  325. return Content(data.ToJson());
  326. }
  327. //委外加工状态一览
  328. [HttpGet]
  329. [HandlerAjaxOnly]
  330. public ActionResult Get_Table4()
  331. {
  332. var data = App.Get_Table4();
  333. return Content(data.ToJson());
  334. }
  335. //委外到货
  336. [HttpGet]
  337. [HandlerAjaxOnly]
  338. public ActionResult Get_Table5()
  339. {
  340. var data = App.Get_Table5();
  341. return Content(data.ToJson());
  342. }
  343. //调拨
  344. [HttpGet]
  345. [HandlerAjaxOnly]
  346. public ActionResult Get_Table6()
  347. {
  348. var data = App.Get_Table6();
  349. return Content(data.ToJson());
  350. }
  351. //库存
  352. [HttpGet]
  353. [HandlerAjaxOnly]
  354. public ActionResult Get_KCInfo()
  355. {
  356. var data = App.Get_KCInfo();
  357. return Content(data.ToJson());
  358. }
  359. //数据源条数
  360. [HttpGet]
  361. [HandlerAjaxOnly]
  362. public ActionResult Get_InfoNum()
  363. {
  364. var data = App.Get_InfoNum();
  365. return Content(data.ToJson());
  366. }
  367. }
  368. }