金豪看板
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.

391 lines
11 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
8 months ago
2 years ago
8 months ago
2 years ago
  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. //振翔生产进度看板区域一
  250. [HttpGet]
  251. [HandlerAjaxOnly]
  252. public ActionResult GetAreal1()
  253. {
  254. var data = App.GetAreal1();
  255. return Content(data.ToJson());
  256. }
  257. //振翔生产进度看板区域二
  258. [HttpGet]
  259. [HandlerAjaxOnly]
  260. public ActionResult GetProductProgress(string ItemNumber)
  261. {
  262. var data = App.GetProductProgress(ItemNumber);
  263. return Content(data.ToJson());
  264. }
  265. //振翔看板区域三
  266. [HttpGet]
  267. [HandlerAjaxOnly]
  268. public ActionResult GetOutput(string XX)
  269. {
  270. var data = App.GetOutput();
  271. return Content(data.ToJson());
  272. }
  273. //振翔看板月完成数量区域四
  274. [HttpGet]
  275. [HandlerAjaxOnly]
  276. public ActionResult monthOutput(string XX)
  277. {
  278. var data = App.monthOutput();
  279. return Content(data.ToJson());
  280. }
  281. [HttpGet]
  282. [HandlerAjaxOnly]
  283. public ActionResult GetZhiXing_OQC(string XX)
  284. {
  285. var data = App.GetZhiXing_OQC();
  286. return Content(data.ToJson());
  287. }
  288. [HttpGet]
  289. [HandlerAjaxOnly]
  290. public ActionResult GetZhiXing_RCVUnInWare(string XX)
  291. {
  292. var data = App.GetZhiXing_RCVUnInWare();
  293. return Content(data.ToJson());
  294. }
  295. [HttpGet]
  296. [HandlerAjaxOnly]
  297. public ActionResult GetOtherData(string XX)
  298. {
  299. var data = App.GetOtherData();
  300. return Content(data.ToJson());
  301. }
  302. [HttpGet]
  303. [HandlerAjaxOnly]
  304. public ActionResult GetCKData(string XX)
  305. {
  306. var data = App.GetCKData();
  307. return Content(data.ToJson());
  308. }
  309. [HttpGet]
  310. [HandlerAjaxOnly]
  311. public ActionResult GetCKOKRate(string XX)
  312. {
  313. var data = App.GetCKOKRate();
  314. return Content(data.ToJson());
  315. }
  316. [HttpGet]
  317. [HandlerAjaxOnly]
  318. public ActionResult GetCKOKRateALL(string XX)
  319. {
  320. var data = App.GetCKOKRateALL();
  321. return Content(data.ToJson());
  322. }
  323. public virtual ActionResult PanelWip()
  324. {
  325. return View();
  326. }
  327. public virtual ActionResult PanelCK()
  328. {
  329. return View();
  330. }
  331. [HttpGet]
  332. [HandlerAjaxOnly]
  333. public ActionResult GetSScode() {
  334. string cookiemes = "";
  335. if (Request.Cookies["SSMES"]!= null)
  336. cookiemes = Request.Cookies["SSMES"].Value;
  337. return Content(App.GetSScode(cookiemes).ToJson());
  338. }
  339. }
  340. }