using Aspose.Cells; using NFine.Application.SRM; using NFine.Code; using System; using System.Data; using System.Drawing; using System.IO; using System.Web; using System.Web.Mvc; namespace NFine.Web.Areas.SRM.Controllers { public class WatchPanelController : ControllerBase { private WatchPanelApp App = new WatchPanelApp(); [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson1(Pagination pagination, string queryJson) { DataTable dt = App.GetList1(queryJson, ref pagination); var data = new { rows = dt, total = pagination.total, page = pagination.page, records = pagination.records }; return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson2(Pagination pagination, string queryJson) { DataTable dt = App.GetList2(queryJson, ref pagination); var data = new { rows = dt, total = pagination.total, page = pagination.page, records = pagination.records }; return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson3(Pagination pagination, string queryJson) { DataTable dt = App.GetList3(queryJson, ref pagination); var data = new { rows = dt, total = pagination.total, page = pagination.page, records = pagination.records }; return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson4(Pagination pagination, string queryJson) { DataTable dt = App.GetList4(queryJson, ref pagination); var data = new { rows = dt, total = pagination.total, page = pagination.page, records = pagination.records }; return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson_WIPJinDu(Pagination pagination, string queryJson,string filters) { try { DataTable dt = App.GetList_WIPJinDu(queryJson, filters, ref pagination); var data = new { rows = dt, total = pagination.total, page = pagination.page, records = pagination.records }; if (Request.Cookies["SSMES"] != null) { Response.Cookies["SSMES"].Value = queryJson; Response.Cookies["SSMES"].Expires = DateTime.Now.Add(new TimeSpan(12, 0, 0)); } else { HttpCookie Cookie = new HttpCookie("SSMES", queryJson); Cookie.Expires = DateTime.Now.Add(new TimeSpan(12, 0, 0)); Response.Cookies.Add(Cookie); } return Content(data.ToJson()); } catch (Exception ex) { return Error(ex.Message); } } //导出生产看板 [HttpPost] public void ExportAll(string value ) { DataTable dt = App.GetList_WIPJinDu(value); if (dt != null && dt.Rows.Count > 0) { AsposeCell.Export(dt); } } public void ExportAll(string txtProject, string txtEQPType, string txtItemStd, string txtEQPCode, string txtPlanStartDay, string txtMOCode, string txtItemCode, string txtProJieDuan, string txtStatus, string txtPlanEndDay) { Pagination pagination = new Pagination(); string queryJson = "{\"txtProject\":\"" + txtProject + "\""; queryJson += ",\"txtEQPType\":\"" + txtEQPType + "\""; queryJson += ",\"txtItemStd\":\"" + txtItemStd + "\""; queryJson += ",\"txtEQPCode\":\"" + txtEQPCode + "\""; queryJson += ",\"txtPlanStartDay\":\"" + txtPlanStartDay + "\""; queryJson += ",\"txtMOCode\":\"" + txtMOCode + "\""; queryJson += ",\"txtItemCode\":\"" + txtItemCode + "\""; queryJson += ",\"txtProJieDuan\":\"" + txtProJieDuan + "\""; queryJson += ",\"txtStatus\":\"" + txtStatus + "\""; queryJson += ",\"txtPlanEndDay\":\"" + txtPlanEndDay + "\""; queryJson += " }"; DataTable data = App.GetList_WIPJinDu(queryJson, "", ref pagination); if (data != null) { data.Columns.Remove("ColorStr"); data.Columns.Remove("ID"); data.Columns.Remove("项目进度条值"); } if (data != null && data.Rows.Count > 0) { AsposeCell.Export(data); } } [HttpGet] public ActionResult GetProjectJD() { try { DataTable data = App.GetProjectJD(); return Content(data.ToJson()); } catch (Exception ex) { return Error(ex.ToString()); } } [HttpGet] public ActionResult GetEQPType() { try { DataTable data = App.GetEQPType(); return Content(data.ToJson()); } catch (Exception ex) { return Error(ex.ToString()); } } [HttpGet] public ActionResult GetStatus() { try { DataTable data = App.GetStatus(); return Content(data.ToJson()); } catch (Exception ex) { return Error(ex.ToString()); } } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWIPQty1(string XX) { var data = App.GetWIPQty1(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWIPQty5(string XX) { var data = App.GetWIPQty5(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWIPQty2(string XX) { var data = App.GetWIPQty2(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWIPQty3(string XX) { var data = App.GetWIPQty3(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWIPQty4(string XX) { var data = App.GetWIPQty4(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetPeiLiaoJingDu(string XX) { var data = App.GetPeiLiaoJingDu(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetRCVQty(string type) { var data = App.GetRCVQty(type); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetWareInQty(string type) { var data = App.GetWareInQty(type); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetRCVJingDu(string XX) { var data = App.GetRCVJingDu(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetZhiXing_MO(string ItemNumber) { var data = App.GetZhiXing_MO(ItemNumber); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetZhiXing_OQC(string XX) { var data = App.GetZhiXing_OQC(); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetZhiXing_RCVUnInWare(string XX) { var data = App.GetZhiXing_RCVUnInWare(); return Content(data.ToJson()); } public virtual ActionResult PanelWIP() { return View(); } public virtual ActionResult PanelWIPDetail() { return View(); } public virtual ActionResult PanelWareHouse() { return View(); } public virtual ActionResult PanelWareHouseDetail() { return View(); } public virtual ActionResult PanelWareHouseNew() { return View(); } public virtual ActionResult PanelWIPDetail_SX() { return View(); } public virtual ActionResult PanelWIPZhiXingDa() { return View(); } public virtual ActionResult PanelWIPZhiXingDa2() { return View(); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetSScode() { string cookiemes = ""; if (Request.Cookies["SSMES"]!= null) cookiemes = Request.Cookies["SSMES"].Value; return Content(App.GetSScode(cookiemes).ToJson()); } //成品发货一览数据源 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table1() { var data = App.Get_Table1(); return Content(data.ToJson()); } //采购未到货一览 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table2() { var data = App.Get_Table2(); return Content(data.ToJson()); } //成品未入库 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table3() { var data = App.Get_Table3(); return Content(data.ToJson()); } //委外加工状态一览 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table4() { var data = App.Get_Table4(); return Content(data.ToJson()); } //委外到货 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table5() { var data = App.Get_Table5(); return Content(data.ToJson()); } //调拨 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_Table6() { var data = App.Get_Table6(); return Content(data.ToJson()); } //库存 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_KCInfo() { var data = App.Get_KCInfo(); return Content(data.ToJson()); } //数据源条数 [HttpGet] [HandlerAjaxOnly] public ActionResult Get_InfoNum() { var data = App.Get_InfoNum(); return Content(data.ToJson()); } } }