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

363 lines
9.9 KiB

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 GetProductProgress(string ItemNumber)
  253. {
  254. var data = App.GetZhiXing_MO(ItemNumber);
  255. return Content(data.ToJson());
  256. }
  257. [HttpGet]
  258. [HandlerAjaxOnly]
  259. public ActionResult GetZhiXing_OQC(string XX)
  260. {
  261. var data = App.GetZhiXing_OQC();
  262. return Content(data.ToJson());
  263. }
  264. [HttpGet]
  265. [HandlerAjaxOnly]
  266. public ActionResult GetZhiXing_RCVUnInWare(string XX)
  267. {
  268. var data = App.GetZhiXing_RCVUnInWare();
  269. return Content(data.ToJson());
  270. }
  271. public virtual ActionResult PanelWIP()
  272. {
  273. return View();
  274. }
  275. public virtual ActionResult PanelWIPDetail()
  276. {
  277. return View();
  278. }
  279. public virtual ActionResult PanelWareHouse()
  280. {
  281. return View();
  282. }
  283. public virtual ActionResult PanelWareHouseDetail()
  284. {
  285. return View();
  286. }
  287. public virtual ActionResult PanelWareHouseNew()
  288. {
  289. return View();
  290. }
  291. public virtual ActionResult PanelWIPDetail_SX()
  292. {
  293. return View();
  294. }
  295. public virtual ActionResult PanelWIPZhiXingDa()
  296. {
  297. return View();
  298. }
  299. public virtual ActionResult PanelWIPZhiXingDa2()
  300. {
  301. return View();
  302. }
  303. [HttpGet]
  304. [HandlerAjaxOnly]
  305. public ActionResult GetSScode() {
  306. string cookiemes = "";
  307. if (Request.Cookies["SSMES"]!= null)
  308. cookiemes = Request.Cookies["SSMES"].Value;
  309. return Content(App.GetSScode(cookiemes).ToJson());
  310. }
  311. }
  312. }