public string ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); A5dot2Tab1 new_5dot2 = new A5dot2Tab1(); new_5dot2.cjName = cjname; new_5dot2.zzName = item["Zz_Name"].ToString(); new_5dot2.sbGyCode = item["Equip_GyCode"].ToString(); new_5dot2.sbCode = item["Equip_Code"].ToString(); new_5dot2.sbType = item["Equip_Type"].ToString(); new_5dot2.zyType = item["Zy_Type"].ToString(); new_5dot2.problemDescription = item["problemDescription"].ToString(); new_5dot2.jxSubmitTime = DateTime.Now; new_5dot2.jxUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot2.isRectified = 0; new_5dot2.state = 0; new_5dot2.temp2 = item["wfe_id"].ToString(); bool res = Sx.AddSxItem(new_5dot2); string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //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(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot2/Index"); }
public string ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); CTimerTimeout timeout_job = new CTimerTimeout(); timeout_job.CreateTime = DateTime.Now; timeout_job.for_using = TIMER_USING.FOR_SYSTEM; timeout_job.mission_name = ""; timeout_job.status = TM_STATUS.TM_STATUS_ACTIVE; timeout_job.SetActionForWF("INVILID"); timeout_job.AttachWFEntityID = Convert.ToInt32(item["wfe_id"]); timeout_job.CustomAction = "http://localhost/CallBack/testCallBack"; timeout_job.EventName = "PqAessess"; timeout_job.SetTriggerTiming("0 0 0 20 * ?"); //保存该定时任务,并将其添加到激活任务列表 timeout_job.Save(); int m_timerMissionID = timeout_job.ID; CTimerManage.AppendMissionToActiveList(timeout_job); string[] notgood = item["Incomplete_content"].ToString().Split('|'); A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; string yearmonth = ""; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); string Username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; if (my.Day >= 15) { yearmonth = my.Year.ToString() + my.AddMonths(1).Month.ToString(); } else { yearmonth = my.Year.ToString() + my.Month.ToString(); } if (notgood[notgood.Count() - 1] == "") { for (int i = 0; i < notgood.Count() - 1; i++) { a5dot1Tab1.cjName = cjname; a5dot1Tab1.zzName = item["Zz_Name"].ToString(); a5dot1Tab1.sbGyCode = item["Equip_GyCode"].ToString(); a5dot1Tab1.sbCode = item["Equip_Code"].ToString(); a5dot1Tab1.sbType = item["Equip_Type"].ToString(); a5dot1Tab1.zyType = item["Zy_Type"].ToString(); a5dot1Tab1.notGoodContent = notgood[i]; a5dot1Tab1.isRectified = 0; a5dot1Tab1.zzSubmitTime = DateTime.Now; a5dot1Tab1.zzUserName = Username; a5dot1Tab1.yearMonthForStatistic = yearmonth; a5dot1Tab1.temp3 = m_timerMissionID.ToString(); if (item["wfe_id"].ToString() != "") { a5dot1Tab1.dataSource = item["wfe_id"].ToString(); } if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站") { a5dot1Tab1.pqName = a5dot1Tab1.cjName; } else { a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString()); } tm.Zzsubmit(a5dot1Tab1); } } else { for (int i = 0; i < notgood.Count(); i++) { a5dot1Tab1.cjName = cjname; a5dot1Tab1.zzName = item["Zz_Name"].ToString(); a5dot1Tab1.sbGyCode = item["Equip_GyCode"].ToString(); a5dot1Tab1.sbCode = item["Equip_Code"].ToString(); a5dot1Tab1.sbType = item["Equip_Type"].ToString(); a5dot1Tab1.zyType = item["Zy_Type"].ToString(); a5dot1Tab1.notGoodContent = notgood[i]; a5dot1Tab1.isRectified = 0; a5dot1Tab1.zzSubmitTime = DateTime.Now; a5dot1Tab1.zzUserName = Username; a5dot1Tab1.yearMonthForStatistic = yearmonth; a5dot1Tab1.temp3 = m_timerMissionID.ToString(); if (item["wfe_id"].ToString() != "") { a5dot1Tab1.dataSource = item["wfe_id"].ToString(); } if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站") { a5dot1Tab1.pqName = a5dot1Tab1.cjName; } else { a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString()); } tm.Zzsubmit(a5dot1Tab1); } } string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //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(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot1/Index"); }
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 ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); string[] notgood = item["Incomplete_content"].ToString().Split('|'); A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; string yearmonth = ""; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); string Username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; if (my.Day >= 15) { yearmonth = my.Year.ToString() + my.AddMonths(1).Month.ToString(); } else { yearmonth = my.Year.ToString() + my.Month.ToString(); } if (notgood[notgood.Count() - 1] == "") { for (int i = 0; i < notgood.Count() - 1; i++) { a5dot1Tab1.cjName = cjname; a5dot1Tab1.zzName = item["Zz_Name"].ToString(); a5dot1Tab1.sbGyCode = item["Equip_GyCode"].ToString(); a5dot1Tab1.sbCode = item["Equip_Code"].ToString(); a5dot1Tab1.sbType = item["Equip_Type"].ToString(); a5dot1Tab1.zyType = item["Zy_Type"].ToString(); a5dot1Tab1.notGoodContent = notgood[i]; a5dot1Tab1.isRectified = 0; a5dot1Tab1.zzSubmitTime = DateTime.Now; a5dot1Tab1.zzUserName = Username; a5dot1Tab1.yearMonthForStatistic = yearmonth; if (item["wfe_id"].ToString() != "") { a5dot1Tab1.dataSource = item["wfe_id"].ToString(); } if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站") { a5dot1Tab1.pqName = a5dot1Tab1.cjName; } else { a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString()); } tm.Zzsubmit(a5dot1Tab1); } } else { for (int i = 0; i < notgood.Count(); i++) { a5dot1Tab1.cjName = cjname; a5dot1Tab1.zzName = item["Zz_Name"].ToString(); a5dot1Tab1.sbGyCode = item["Equip_GyCode"].ToString(); a5dot1Tab1.sbCode = item["Equip_Code"].ToString(); a5dot1Tab1.sbType = item["Equip_Type"].ToString(); a5dot1Tab1.zyType = item["Zy_Type"].ToString(); a5dot1Tab1.notGoodContent = notgood[i]; a5dot1Tab1.isRectified = 0; a5dot1Tab1.zzSubmitTime = DateTime.Now; a5dot1Tab1.zzUserName = Username; a5dot1Tab1.yearMonthForStatistic = yearmonth; if (item["wfe_id"].ToString() != "") { a5dot1Tab1.dataSource = item["wfe_id"].ToString(); } if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站") { a5dot1Tab1.pqName = a5dot1Tab1.cjName; } else { a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString()); } tm.Zzsubmit(a5dot1Tab1); } } string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //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(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot1/Index"); }
public string ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); CTimerTimeout timeout_job = new CTimerTimeout(); timeout_job.CreateTime = DateTime.Now; timeout_job.for_using = TIMER_USING.FOR_SYSTEM; timeout_job.mission_name = ""; timeout_job.status = TM_STATUS.TM_STATUS_ACTIVE; timeout_job.SetActionForWF("INVILID"); timeout_job.AttachWFEntityID = Convert.ToInt32(item["wfe_id"]); timeout_job.CustomAction = "http://localhost/CallBack/testCallBack"; timeout_job.EventName = "PqAessess"; timeout_job.SetTriggerTiming("0 0 0 20 * ?"); //保存该定时任务,并将其添加到激活任务列表 timeout_job.Save(); int m_timerMissionID = timeout_job.ID; CTimerManage.AppendMissionToActiveList(timeout_job); // A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); A5dot2Tab1 new_5dot2 = new A5dot2Tab1(); new_5dot2.cjName = cjname; new_5dot2.zzName = item["Zz_Name"].ToString(); new_5dot2.sbGyCode = item["Equip_GyCode"].ToString(); new_5dot2.sbCode = item["Equip_Code"].ToString(); new_5dot2.sbType = item["Equip_Type"].ToString(); new_5dot2.zyType = item["Zy_Type"].ToString(); new_5dot2.problemDescription = item["problemDescription"].ToString(); new_5dot2.jxSubmitTime = DateTime.Now; new_5dot2.jxUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot2.isRectified = 0; new_5dot2.state = 0; new_5dot2.temp2 = item["wfe_id"].ToString(); new_5dot2.temp3 = m_timerMissionID.ToString(); bool res = Sx.AddSxItem(new_5dot2); string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //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(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot2/Index"); }