public string JxdwCreateOrder_submitsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); //JObject item2 = (JObject)JsonConvert.DeserializeObject(item["plan_data"].ToString()); string flowname = item["Flow_Name"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); //signal["Job_Order"] = item2["Plan_num"].ToString(); signal["Job_Name"] = item["Job_Name"].ToString(); signal["Job_Order"] = item["Job_Order"].ToString(); ERPInfoManagement erp = new ERPInfoManagement(); GD_InfoModal res = erp.getGD_Modal_GDId("00" + item["Job_Order"].ToString()); signal["Job_OrderState"] = res.GD_State; //signal["Job_OrderState"] = item["Job_OrderState"].ToString(); //signal["job_Name"] = item2["Plan_name"].ToString(); signal["ZjGxIsOK"] = "是"; //signal["Equip_GyCode"] = "8"; //signal["Equip_Code"] = "7"; //signal["Equip_ABCMark"] = "A"; //record Dictionary <string, string> record = new Dictionary <string, string>(); record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(flowname), signal, record); } catch (Exception e) { return(""); } return("/A8dot2/Index"); }
public string click_submitsignal(string wfe_id) { try { Dictionary <string, string> signal = new Dictionary <string, string>(); //补充跳转A8dot2的变量,Cj_Name,Zy_Type,Zy_SubType Dictionary <string, object> paras1 = new Dictionary <string, object>(); paras1["Zz_Name"] = null; paras1["Equip_GyCode"] = null; paras1["Equip_Code"] = null; paras1["Plan_Name"] = null; paras1["JobOrder"] = null; UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(wfe_id), paras1); //获取设备专业类别和子类别及设备所属车间 EquipManagment tm = new EquipManagment(); ERPInfoManagement erp = new ERPInfoManagement(); GD_InfoModal res = erp.getGD_Modal_GDId(paras1["JobOrder"].ToString()); if (res != null) { //if (String.Compare(res.GD_EquipCode.Trim(), paras1["Equip_Code"].ToString().Trim()) != 0) if (!res.GD_EquipCode.Contains(paras1["Equip_Code"].ToString())) { return("工单号与设备不匹配"); } } else { return("系统中无此工单"); } Equip_Info getZy = tm.getEquip_ByGyCode(paras1["Equip_GyCode"].ToString()); signal["Zy_Type"] = getZy.Equip_Specialty; signal["Zy_SubType"] = getZy.Equip_PhaseB; signal["Equip_Type"] = getZy.Equip_Type; //EA_Name_EA_Id= tm.getEquip(paras1["Zz_Name"].ToString()).EA_Parent.EA_Id; signal["Cj_Name"] = tm.getEquip(paras1["Zz_Name"].ToString()); signal["Plan_Name"] = paras1["Plan_Name"].ToString(); signal["JxdwAttachPlanOrder_Done"] = "true"; signal["Data_Src"] = "计划管理"; //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record1); return("/A14dot3/Index"); } catch (Exception e) { return(""); } //return ("/A13dot2/Index"); }
public ActionResult JxdwCreateOrder(string wfe_id) { Dictionary <string, object> paras1 = new Dictionary <string, object>(); paras1["Job_Name"] = null; paras1["Job_Order"] = null; paras1["Data_Src"] = null; UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(wfe_id), paras1); ViewBag.GD_Id = paras1["Job_Order"].ToString(); ViewBag.Plan_Name = paras1["Job_Name"].ToString(); ViewBag.Data_Src = paras1["Data_Src"].ToString(); ERPInfoManagement erp = new ERPInfoManagement(); GD_InfoModal res = erp.getGD_Modal_GDId(paras1["Job_Order"].ToString()); if (res != null) { ViewBag.GD_State = res.GD_State; } return(View(getWFDetail_Model(wfe_id))); }
/// <summary> /// 有以前的通过Excel表读取数据模式改为现在的直接读取ERP中数据,通过周期调用此函数,周期存库 /// </summary> /// <param name="json1"></param> /// <returns></returns> public void ERPSubmit() { try { PersonManagment PM = new PersonManagment(); A6dot2Managment WM = new A6dot2Managment(); A6dot2Tab1 WDT_list = new A6dot2Tab1(); ERPInfoManagement erp = new ERPInfoManagement(); EquipManagment EM = new EquipManagment(); string EquipPhaseB; WDT_list.uploadDesc = ""; //字段保留,(以前用于上传五定表的描述) WDT_list.uuploadFileName = ""; //字段保留,(以前用于上传五定表的名字) //string[] savedFileName = WDT_list.uuploadFileName.Split(new char[] { '$' }); //string wdt_filename = Path.Combine(Request.MapPath("~/Upload"), savedFileName[1]);//没有用到的变量 //WDT_list.userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; WDT_list.userName = "******"; WDT_list.uploadtime = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); //WDT_list.pqName = PM.Get_Person_Depart((Session["User"] as EquipModel.Entities.Person_Info).Person_Id).Depart_Name; WDT_list.pqName = "待定"; int WDT_ID = WM.add_WDT_list(WDT_list); List <OilInfo> OilInfo_Overdue = erp.getOilInfo_overdue(); List <A6dot2Tab2> wdt_list = new List <A6dot2Tab2>(); foreach (var i in OilInfo_Overdue) { A6dot2Tab2 tmp = new A6dot2Tab2(); tmp.isValid = 1; tmp.equipCode = i.oil_EquipCode; tmp.equipDesc = i.oil_EquipDesc; tmp.funLoc = i.oil_Fun_Loc; tmp.funLoc_desc = i.oil_Fun_LocDesc; tmp.oilLoc = i.oil_Loc; tmp.oilLoc_desc = i.oil_Loc; tmp.oilInterval = Convert.ToInt32(i.oil_Interval); tmp.unit = i.oil_Unit; tmp.lastOilTime = i.oil_LastDate; tmp.lastOilNumber = Convert.ToDouble(i.oil_LastNum); tmp.lastOilUnit = i.oil_Unit; tmp.NextOilTime = i.oil_NextDate.ToString(); tmp.NextOilNumber = Convert.ToDouble(i.oil_NextNum); tmp.NextOilUnit = i.oil_Unit2; tmp.oilCode = i.oil_Code; tmp.oilCode_desc = i.oil_Desc; tmp.substiOilCode = ""; tmp.substiOilCode_desc = ""; if (EM.getEquip_Info(tmp.equipCode) != null) { EquipPhaseB = EM.getEquip_Info(tmp.equipCode).Equip_PhaseB; if (EquipPhaseB == null) { tmp.isOilType = 0; } else { if (EquipPhaseB.Equals("机泵") || EquipPhaseB.Equals("风机")) { tmp.isOilType = 1; } else { tmp.isOilType = 0; } } List <Equip_Archi> ZzCj = EM.getEquip_ZzBelong(EM.getEquip_Info(tmp.equipCode).Equip_Id); tmp.equip_ZzName = ZzCj.First().EA_Name; tmp.equip_CjName = ZzCj.Last().EA_Name; tmp.equip_PqName = EM.GetPqofZz(tmp.equip_ZzName).Pq_Name; } tmp.isExceed = 1; tmp.Tab1_Id = WDT_ID; wdt_list.Add(tmp); } WM.add_WDT_content(WDT_ID, wdt_list); /* foreach(var i in wdt_content) * { * return i.equip_CjName; * } * */ // return "/A6dot2/Index_Tj"; } catch { } }
private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data) { DtResponse dt = new DtResponse(); var http = DtRequest.HttpData(data); var Data = http["data"] as Dictionary <string, object>; int wfe_id = -1; foreach (var d in Data) { wfe_id = Convert.ToInt32(d.Key); } string jx_reason = ""; string E_code = ""; string job_order = ""; string notice_order = ""; foreach (var d in Data) { int id = Convert.ToInt32(d.Key); foreach (var dd in d.Value as Dictionary <string, object> ) { ERPInfoManagement erp = new ERPInfoManagement(); //sb_code、jxreason与设备绑定在一起传过来,当通知单号工单号填完后满足向A8.2跳转条件 if (dd.Key == "sb_code") { E_code = dd.Value.ToString(); } if (dd.Key == "jxreason") { jx_reason = dd.Value.ToString(); } if (dd.Key == "notice_order2") { if (dd.Value.ToString() == "") { continue; } notice_order = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_Notice(notice_order); if (res != null) { job_order = res.GD_Id; } } if (dd.Key == "job_order2") { if (dd.Value.ToString() == "") { continue; } job_order = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_GDId(job_order); if (res != null) { notice_order = res.GD_Notice_Id; } } //if (dd.Key == "JumpA8dot2DR") //{ // string Equip_Code = E_code; // string Jx_Reason = jx_reason; // string flowname = "A8dot2"; // UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname); // if (wfe != null) // { // EquipManagment em = new EquipManagment(); // Equip_Info eqinfo = em.getEquip_Info(Equip_Code); // List<Equip_Archi> Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id); // Dictionary<string, string> record = wfe.GetRecordItems(); // record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record["time"] = DateTime.Now.ToString(); // wfe.Start(record); // int flow_id = wfe.EntityID; // //paras // Dictionary<string, string> signal = new Dictionary<string, string>(); // signal["JxSubmit_done"] = "true"; // signal["Cj_Name"] = Equip_ZzBelong[1].EA_Name; //Cj_Name // signal["Zz_Name"] = Equip_ZzBelong[0].EA_Name; //Zz_Name // signal["Equip_GyCode"] = eqinfo.Equip_GyCode; // signal["Equip_Code"] = eqinfo.Equip_Code; // signal["Equip_Type"] = eqinfo.Equip_Type; // signal["Zy_Type"] = eqinfo.Equip_Specialty; // signal["Zy_SubType"] = eqinfo.Equip_PhaseB; // signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark; // signal["Jx_Reason"] = Jx_Reason;//计划检修原因 PM? // signal["Job_Name"] = "来自DRBPM"; // signal["Job_Order"] = job_order; // //record // record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record["time"] = DateTime.Now.ToString(); // //submit // CWFEngine.SubmitSignal(flow_id, signal, record); // } //} } } Dictionary <string, object> m_kv = new Dictionary <string, object>(); EquipManagment em1 = new EquipManagment(); Equip_Info eqinfo1 = em1.getEquip_Info(E_code); List <Equip_Archi> Equip_ZzBelong1 = em1.getEquip_ZzBelong(eqinfo1.Equip_Id); int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId); m_kv["index_Id"] = wfe_id; m_kv["zz_name"] = Equip_ZzBelong1[0].EA_Name; //Zz_Name m_kv["sb_gycode"] = eqinfo1.Equip_GyCode; m_kv["sb_code"] = E_code; m_kv["sb_type"] = eqinfo1.Equip_Type; m_kv["sb_ABCMark"] = eqinfo1.Equip_ABCmark; m_kv["plan_name"] = "来自DRBPM"; m_kv["jxreason"] = jx_reason; m_kv["kkconfirm2"] = "同意"; m_kv["zytdconfirm2"] = "同意"; m_kv["job_order2"] = job_order; m_kv["notice_order2"] = notice_order; m_kv["missionname"] = "完善工单与通知单后跳转"; m_kv["role"] = pv.Role_Names; dt.data.Add(m_kv); return(dt); }
public string click_submitsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); ERPInfoManagement erp = new ERPInfoManagement(); GD_InfoModal res = erp.getGD_Modal_GDId(item["Job_Order"].ToString()); if (res != null) { if (String.Compare(res.GD_EquipCode.Trim(), item["Equip_Code"].ToString().Trim()) != 0) { return("工单号与设备不匹配"); } } else { return("系统中无此工单"); } string Equip_Code = item["Equip_Code"].ToString(); string Jx_Reason = item["Jx_Reason"].ToString(); string flowname = "A8dot2"; UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname); if (wfe != null) { EquipManagment em = new EquipManagment(); Equip_Info eqinfo = em.getEquip_Info(Equip_Code); List <Equip_Archi> Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id); Dictionary <string, string> record = wfe.GetRecordItems(); record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record["time"] = DateTime.Now.ToString(); wfe.Start(record); int flow_id = wfe.EntityID; //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["JxSubmit_done"] = "true"; signal["Cj_Name"] = Equip_ZzBelong[1].EA_Name; //Cj_Name signal["Zz_Name"] = Equip_ZzBelong[0].EA_Name; //Zz_Name signal["Equip_GyCode"] = eqinfo.Equip_GyCode; signal["Equip_Code"] = eqinfo.Equip_Code; signal["Equip_Type"] = eqinfo.Equip_Type; signal["Zy_Type"] = eqinfo.Equip_Specialty; signal["Zy_SubType"] = eqinfo.Equip_PhaseB; signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark; signal["Jx_Reason"] = Jx_Reason;//计划检修原因 PM? signal["Data_Src"] = "月度计划DRBPM"; signal["Job_Name"] = "来自DRBPM"; signal["Job_Order"] = item["Job_Order"].ToString(); //record record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(flow_id, signal, record); return("/A8dot2/Index"); } else { return("/A14dot1/Index"); } } catch (Exception e) { return(""); } //return ("/A14dot1/Index"); }
private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data) { DtResponse dt = new DtResponse(); var http = DtRequest.HttpData(data); var Data = http["data"] as Dictionary <string, object>; int wfe_id = -1; foreach (var d in Data) { wfe_id = Convert.ToInt32(d.Key); } foreach (var d in Data) { int id = Convert.ToInt32(d.Key); foreach (var dd in d.Value as Dictionary <string, object> ) { ERPInfoManagement erp = new ERPInfoManagement(); Dictionary <string, string> signal = new Dictionary <string, string>(); if (dd.Key == "plan_name") { signal["Plan_Name"] = dd.Value.ToString(); //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "jxreason") { signal["JxCauseDesc"] = dd.Value.ToString(); signal["CompleteNameReason_Done"] = "true"; //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "xcconfirm") { string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["XcConfirm_Result"] = result[0]; if (result.Length > 1) { signal["XcConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "kkconfirm") { if (dd.Value.ToString() == "") { continue; } string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["KkConfirm_Result"] = result[0]; if (result.Length > 1) { signal["KkConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "zytdconfirm") { if (dd.Value.ToString() == "") { continue; } string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["ZytdConfirm_Result"] = result[0]; if (result.Length > 1) { signal["ZytdConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "notice_order") { if (dd.Value.ToString() == "") { continue; } signal["NoticeOrder"] = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_Notice("00" + dd.Value.ToString()); if (res != null) { signal["JobOrder"] = res.GD_Id; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "job_order") { if (dd.Value.ToString() == "") { continue; } signal["JobOrder"] = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_GDId("00" + dd.Value.ToString()); if (res != null) { signal["NoticeOrder"] = res.GD_Notice_Id; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } //if (dd.Key == "JumpA8dot2T") //{ // //补充跳转A8dot2的变量,Cj_Name,Zy_Type,Zy_SubType // Dictionary<string, object> paras1 = new Dictionary<string, object>(); // paras1["Zz_Name"] = null; // paras1["Equip_GyCode"] = null; // paras1["Equip_Code"] = null; // paras1["Plan_Name"] = null; // UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(id, paras1); // //获取设备专业类别和子类别及设备所属车间 // EquipManagment tm = new EquipManagment(); // Equip_Info getZy = tm.getEquip_ByGyCode(paras1["Equip_GyCode"].ToString()); // signal["Zy_Type"] = getZy.Equip_Specialty; // signal["Zy_SubType"] = getZy.Equip_PhaseB; // signal["Equip_Type"] = getZy.Equip_Type; // //EA_Name_EA_Id= tm.getEquip(paras1["Zz_Name"].ToString()).EA_Parent.EA_Id; // signal["Cj_Name"] = tm.getEquip(paras1["Zz_Name"].ToString()); // signal["Plan_Name"] = paras1["Plan_Name"].ToString(); // signal["JxdwAttachPlanOrder_Done"] = dd.Value.ToString(); // //record // Dictionary<string, string> record1 = new Dictionary<string, string>(); // record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record1["time"] = DateTime.Now.ToString(); // //submit // CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); //} } } Dictionary <string, object> paras = new Dictionary <string, object>(); paras["Zz_Name"] = null; paras["Equip_GyCode"] = null; paras["Equip_Code"] = null; paras["Equip_Type"] = null; paras["Equip_ABCMark"] = null; paras["Plan_Name"] = null; paras["JxCauseDesc"] = null; paras["XcConfirm_Result"] = null; paras["KkConfirm_Result"] = null; paras["ZytdConfirm_Result"] = null; paras["JobOrder"] = null; paras["NoticeOrder"] = null; if (wfe_id != -1) { WorkFlows wfsd = new WorkFlows(); UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(wfe_id, paras); Dictionary <string, object> m_kv = new Dictionary <string, object>(); Mission db_miss = wfsd.GetWFEntityMissions(wfe_id).Last();//获取该实体最后一个任务 int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId); m_kv["index_Id"] = wfe_id; m_kv["zz_name"] = paras["Zz_Name"].ToString(); m_kv["sb_gycode"] = paras["Equip_GyCode"].ToString(); m_kv["sb_code"] = paras["Equip_Code"].ToString(); m_kv["sb_type"] = paras["Equip_Type"].ToString(); m_kv["sb_ABCMark"] = paras["Equip_ABCMark"].ToString(); m_kv["plan_name"] = paras["Plan_Name"].ToString(); m_kv["jxreason"] = paras["JxCauseDesc"].ToString(); m_kv["xcconfirm"] = paras["XcConfirm_Result"].ToString(); m_kv["kkconfirm"] = paras["KkConfirm_Result"].ToString(); m_kv["zytdconfirm"] = paras["ZytdConfirm_Result"].ToString(); m_kv["job_order"] = paras["JobOrder"].ToString(); m_kv["notice_order"] = paras["NoticeOrder"].ToString(); m_kv["missionname"] = db_miss.Miss_Desc; m_kv["role"] = pv.Role_Names; dt.data.Add(m_kv); } return(dt); }
public ActionResult DSZzSubmit(string wfe_id) { submitmodel sm = new submitmodel(); ViewBag.curtime = DateTime.Now; ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId); if (pv.Role_Names.Contains("可靠性工程师")) sm.kkxgcs = 1; if (pv.Role_Names.Contains("检维修人员")) sm.jwxry = 1; ERPInfoManagement erp = new ERPInfoManagement(); EquipArchiManagment em = new EquipArchiManagment(); UI_MISSION mi = CWFEngine.GetActiveMission<Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext); Dictionary<string, object> mi_params = mi.Miss_Params; ViewBag.Pqname = mi.Miss_Params["Pqname"].ToString(); string ea_code = em.getEa_codebyname(mi.Miss_Params["Pqname"].ToString()); ViewBag.timesNonPlanStop=erp.getNoticesYx_1(mi.Miss_Params["Pqname"].ToString()); ViewBag.scoreDeductFaultIntensity = (erp.getNoticesYx_1(mi.Miss_Params["Pqname"].ToString()) * 50) + (erp.getNoticeYx_2(mi.Miss_Params["Pqname"].ToString()) * 30) + (erp.getNoticeYx_3(mi.Miss_Params["Pqname"].ToString()) * 20) + (erp.getNoticeYx_4(mi.Miss_Params["Pqname"].ToString()) * 5); ViewBag.rateFaultMaintenance = erp.getFaultRation(mi.Miss_Params["Pqname"].ToString()); ViewBag.MTBF = erp.getNonFaultInterVal(mi.Miss_Params["Pqname"].ToString()); ViewBag.rateEquipUse = erp.DeliverRatio(mi.Miss_Params["Pqname"].ToString()); ViewBag.rateBigUnitFault = erp.bigEquipsRatio(mi.Miss_Params["Pqname"].ToString()); ViewBag.wfe_id = wfe_id; TablesManagment tm = new TablesManagment(); EquipManagment Em = new EquipManagment(); List<EANummodel> E = Em.getequipnum_byarchi(); List<Equip_Archi> AllCj_List = Em.GetAllCj(); List<WebApp.Controllers.A5dot1Controller.NameandNum> cj = new List<WebApp.Controllers.A5dot1Controller.NameandNum>(); List<WebApp.Controllers.A5dot1Controller.NameandNum> pq = new List<WebApp.Controllers.A5dot1Controller.NameandNum>(); for (int i = 0; i < AllCj_List.Count; i++) { int count = 0; WebApp.Controllers.A5dot1Controller.NameandNum temp1 = new WebApp.Controllers.A5dot1Controller.NameandNum(); temp1.name = AllCj_List[i].EA_Name; for (int j = 0; j < E.Count; j++) { if (AllCj_List[i].EA_Id == Em.getEA_parentid(E[j].EA_Id)) count += E[j].Equip_Num; } temp1.Equip_Num = count; cj.Add(temp1); count = 0; } WebApp.Controllers.A5dot1Controller.NameandNum temp = new WebApp.Controllers.A5dot1Controller.NameandNum(); temp.name = mi.Miss_Params["Pqname"].ToString(); List<Pq_Zz_map> Pq_Zz_map = Em.GetZzsofPq(mi.Miss_Params["Pqname"].ToString()); int count1 = 0; for (int j = 0; j < Pq_Zz_map.Count; j++) { for (int z = 0; z < E.Count; z++) { if (Pq_Zz_map[j].Zz_Name == Em.getEa_namebyid(E[z].EA_Id)) count1 += E[z].Equip_Num; } } temp.Equip_Num = count1; pq.Add(temp); double pq_bwh = 0.00; for (int i = 0; i < pq.Count; i++) { List<A5dot1Tab1> pq_list = tm.get_pq_bwh(pq[i].name, pq[i].Equip_Num); double pq_bxhcount = 0; int wzg_count = 0; if (pq_list.Count > 0) { pq_bxhcount = 0; wzg_count = 0; string sbcode_temp = pq_list[0].sbCode; for (int j = 0; j < pq_list.Count; j++) { pq_list = tm.get_cj_bwh(cj[i].name, cj[i].Equip_Num); if (pq_list[j].temp1 == null) { List<A5dot1Tab1> cj_bycode = tm.GetAll1_bycode(pq_list[j].sbCode); for (int k = 0; k < cj_bycode.Count; k++) { if (cj_bycode[k].isRectified == 0) { wzg_count++; } tm.modifytemp1_byid(cj_bycode[k].Id, "已合并"); } if (wzg_count > 0) { pq_bxhcount++; } wzg_count = 0; } // cjbwh.Add(f); } } for (int n = 0; n < pq_list.Count; n++) { tm.modifytemp1_byid(pq_list[n].Id, null); } pq_bwh=Math.Round(((double)pq_bxhcount / pq[i].Equip_Num), 6); } ViewBag.Pq_bwh = (1-pq_bwh)*100; return View(sm); }
public string A8ActiveList(string WorkFlow_Name) { string username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; string WE_Status = "0"; string query_list = "distinct E.WE_Ser, E.WE_Id, R.username"; string query_condition = "E.W_Name='" + WorkFlow_Name + "' and E.WE_Status='" + WE_Status + "' and R.username is not null"; string record_filter = "username is not null"; DataTable dt = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter); List <Gxqmodel> Gmlist = new List <Gxqmodel>(); for (int i = 0; i < dt.Rows.Count; i++) { Gxqmodel Gm = new Gxqmodel(); Gm.WE_Id = Convert.ToInt16(dt.Rows[i]["WE_Id"]); Gm.WE_Ser = dt.Rows[i]["WE_Ser"].ToString(); Gmlist.Add(Gm); } List <A8Model> Hm = new List <A8Model>(); ERPInfoManagement erp = new ERPInfoManagement(); foreach (var item in Gmlist) { A8Model h = new A8Model(); Dictionary <string, object> paras = new Dictionary <string, object>(); paras["Equip_GyCode"] = null; paras["Job_Order"] = null; //通过工单找通知单号 paras["Zz_Name"] = null; paras["Job_Name"] = null; //计划名称 UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(item.WE_Id, paras); h.zz_name = paras["Zz_Name"].ToString(); h.sb_gycode = paras["Equip_GyCode"].ToString(); h.job_order = paras["Job_Order"].ToString(); h.plan_name = paras["Job_Name"].ToString(); GD_InfoModal res = erp.getGD_Modal_GDId(paras["Job_Order"].ToString()); if (res != null) { h.notice_order = res.GD_Notice_Id; } h.gd_state = "检修中"; WorkFlows wfsd = new WorkFlows(); Mission db_missA8dot2 = wfsd.GetWFEntityMissions(item.WE_Id).Last(); //写if而不写else if是因为13.1和8.2是断开的,跳转8.2仍满足db_miss.Miss_Desc == "专业团队审核" if (db_missA8dot2.Miss_Desc == "检修单位按计划建立工单,完善工序、组件") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "检修计划提报") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "现场工程师审核工单") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "专业团队审1") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "可靠性工程师审1") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "机动处计划科审2") { if (res != null) { h.gd_state = res.GD_State; } } else if (db_missA8dot2.Miss_Desc == "物资处采购,填写到货时间") { h.gd_state = "物资采购中"; } else if (db_missA8dot2.Miss_Desc == "物资处确认到货并通知检修单位") { h.gd_state = "物资已到货"; } else if (db_missA8dot2.Miss_Desc == "检修单位上传检修方案" || db_missA8dot2.Miss_Desc == "专业团队审批" || db_missA8dot2.Miss_Desc == "检修单位填写检修内容及关键工序,关联作业指导书" || db_missA8dot2.Miss_Desc == "可靠性工程师审批") { h.gd_state = "检修方案制定与审判"; } else if (db_missA8dot2.Miss_Desc == "现场工程师确认是否可实施计划") { UI_MISSION ui = new UI_MISSION(); List <Mission_Param> mis_pars = wfsd.GetMissParams(db_missA8dot2.Miss_Id);//获取当前任务参数 foreach (var par in mis_pars) { CParam cp = new CParam(); ui.Miss_Params[cp.name] = cp.value; } if (ui.Miss_Params["ZzConfirmPlan_Result"].ToString() == "是") { h.gd_state = "检修计划实施中"; } else if (ui.Miss_Params["ZzConfirmPlan_Result"].ToString() == "否") { h.gd_state = "检修计划延期"; } } else if (db_missA8dot2.Miss_Desc == "检修单位确认施工完毕,上传交工资料") { h.gd_state = "处理完成"; } h.Data_Src = "待定"; h.detail = "待定"; Hm.Add(h); } List <object> or = new List <object>(); for (int i = 0; i < Hm.Count; i++) { object o = new { index = i + 1, equip_gycode = Hm[i].sb_gycode, job_order = Hm[i].job_order, notice_order = Hm[i].notice_order, gd_state = Hm[i].gd_state, datasrc = Hm[i].Data_Src, detail = Hm[i].detail, zzname = Hm[i].zz_name, planname = Hm[i].plan_name }; or.Add(o); } string str = JsonConvert.SerializeObject(or); return("{" + "\"data\": " + str + "}"); }