Example #1
0
 //修改设备
 public string modifyEquip(string json1)
 {
     try
     {
         EquipManagment EM        = new EquipManagment();
         Equip_Info     new_equip = new Equip_Info();
         string         Ea_name;
         JObject        item = (JObject)JsonConvert.DeserializeObject(json1);
         Ea_name = item["Equip_Archi"].ToString();
         EquipArchiManagment EAM = new EquipArchiManagment();
         int Zz_Id = EAM.getEa_idbyname(Ea_name);
         new_equip.Equip_ABCmark      = item["EquipABCMark"].ToString();
         new_equip.Equip_GyCode       = item["EquipName"].ToString();
         new_equip.Equip_Code         = item["EquipCode"].ToString();
         new_equip.Equip_Type         = item["EquipType"].ToString();
         new_equip.Equip_Specialty    = item["EquipSpecialty"].ToString();
         new_equip.Equip_PhaseB       = item["EquipPhaseB"].ToString();
         new_equip.Equip_Manufacturer = item["EquipManufacturer"].ToString();
         if (EM.modifyEquip(new_equip, Zz_Id))
         {
             return("保存成功!");
         }
         else
         {
             return("保存失败!");
         }
     }
     catch { return(""); };
 }
Example #2
0
        public ActionResult LsTaskHistoryDetail(string wfe_id)
        {
            EquipArchiManagment Em = new EquipArchiManagment();
            UI_MISSION          mi = new UI_MISSION();

            List <UI_MISSION> t = CWFEngine.GetHistoryMissions(int.Parse(wfe_id));

            mi = (UI_MISSION)t.ElementAt(1);
            Dictionary <string, object> mi_params = mi.Miss_Params;
            string cj_name      = mi.Miss_Params["Cj_Name"].ToString();
            string tempjob_name = mi.Miss_Params["Job_Name"].ToString();


            ViewBag.wfe_id = wfe_id;
            A6dot2dot2InfoModal infoModal = new A6dot2dot2InfoModal();

            infoModal.tempjob_name = tempjob_name;
            infoModal.cj_name      = cj_name;
            infoModal.wfe_id       = wfe_id;
            EquipManagment EM = new EquipManagment();

            infoModal.All_Zz = EM.getZzs_ofCj(Convert.ToInt32(cj_name));

            return(View(infoModal));
        }
Example #3
0
        //获得点击修改的设备的具体信息
        public JsonResult List_Equipinfo(string json1)
        {
            JObject item = (JObject)JsonConvert.DeserializeObject(json1);
            //取得设备编号
            string              e_code = item["equip_code"].ToString();
            EquipManagment      EM     = new EquipManagment();
            int                 EA_id  = EM.getEA_id_byCode(e_code);
            EquipArchiManagment EAM    = new EquipArchiManagment();

            Equip_Info mod_equip = new Equip_Info();

            mod_equip = EM.getEquip_Info(e_code);

            object mod = new
            {
                e_abc    = mod_equip.Equip_ABCmark,
                e_code   = mod_equip.Equip_Code,
                e_gycode = mod_equip.Equip_GyCode,
                e_man    = mod_equip.Equip_Manufacturer,
                e_phaseB = mod_equip.Equip_PhaseB,
                e_sp     = mod_equip.Equip_Specialty,
                e_type   = mod_equip.Equip_Type,
                e_Achi   = EAM.getEa_namebyId(EA_id)
            };

            return(Json(mod));
        }
        public List <EquipListModel> Zz_Equips(string Zz_name)
        {
            EquipManagment pm = new EquipManagment();

            EquipArchiManagment em = new EquipArchiManagment();



            List <Equip_Info>     Equips_of_Zz = new List <Equip_Info>();
            List <EquipListModel> Equip_obj    = new List <EquipListModel>();


            Equips_of_Zz = pm.getEquips_OfZz(em.getEa_idbyname(Zz_name.ToString()));
            foreach (var item in Equips_of_Zz)
            {
                EquipListModel io = new EquipListModel();
                io.Equip_Id        = item.Equip_Id;
                io.Equip_GyCode    = item.Equip_GyCode;
                io.Equip_Code      = item.Equip_Code;
                io.Equip_Type      = item.Equip_Type;
                io.Equip_Specialty = item.Equip_Specialty;
                io.Equip_ABCMark   = item.Equip_ABCmark;
                Equip_obj.Add(io);
            }

            return(Equip_obj);
        }
Example #5
0
        public ActionResult ZzSubmit(string wfe_id)
        {
            UI_MISSION mi = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);
            Dictionary <string, object> mi_params = mi.Miss_Params;
            EquipArchiManagment         em        = new EquipArchiManagment();
            int Zz_id = em.getEa_idbyname(mi.Miss_Params["Zz_Name"].ToString());

            ViewBag.Zz_id   = Zz_id;
            ViewBag.Zz_name = mi.Miss_Params["Zz_Name"].ToString();
            ViewBag.wfe_id  = wfe_id;
            return(View());
        }
Example #6
0
        public string LsTaskList(string wfe_id)
        {  //string wfe_id="[1,2]";
            EquipArchiManagment Em = new EquipArchiManagment();
            List <Object>       r  = new List <Object>();
            JArray item            = (JArray)JsonConvert.DeserializeObject(wfe_id);
            int    ii = 1;

            foreach (var i in item)
            {
                string workflow_entity;
                workflow_entity = i.ToString();

                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Cj_Name"]  = null;
                paras["Job_Name"] = null;


                paras["Submit_Done"] = null;
                UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(workflow_entity), paras);

                object o = new
                { ID = ii,

                  workflow_ser  = wfei.serial,
                  workflow_name = wfei.name,
                  cj_name       = Em.getEa_namebyId(Convert.ToInt16(paras["Cj_Name"])),
                  Zt_unit       = "",
                  status        = (int)wfei.Status,
                  workflow_id   = workflow_entity };
                r.Add(o);
                ii = ii + 1;
            }

            string str = JsonConvert.SerializeObject(r);

            return("{" + "\"data\": " + str + "}");
        }
Example #7
0
          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);
          }
Example #8
0
        //获取临时待处理任务
        public string getJobList()
        {
            Jobs            m      = new Jobs();
            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);
            int zytd;

            if (pv.Role_Names.Contains("专业团队") || pv.Role_Names.Contains("专家团队") || pv.Role_Names.Contains("专业团队负责人"))
            {
                zytd = 1;
            }
            else
            {
                zytd = 0;
            }
            List <Timer_Jobs> Joblist = m.GetAllTimerJob();

            List <object> r = new List <object>();

            for (int i = 0; i < Joblist.Count; i++)
            {
                if (Joblist[i].custom_flag == 1 && Joblist[i].Job_Type == TIMER_JOB_TYPE.CREATE_WORKFLOW)
                {
                    List <string> cjnames  = new List <string>();
                    string        Cj_Names = "";
                    JArray        jsonVal  = JArray.Parse(Joblist[i].run_params) as JArray;
                    dynamic       table2   = jsonVal;
                    foreach (dynamic T in table2)
                    {
                        WorkFlow_Define wfd = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID);
                        if (wfd.W_Name == "A6dot2dot2")
                        {
                            // JObject item = (JObject)JsonConvert.DeserializeObject(T.PARAMS);

                            string cjid    = T.PARAMS.Cj_Name.ToString();
                            string cj_name = Em.getEa_namebyId(Convert.ToInt16(cjid));
                            cjnames.Add(cj_name);
                        }
                        else
                        {
                            foreach (dynamic t in T.PARAMS)
                            {
                                string cjtemp = "";
                                cjtemp = t.Value;



                                cjnames.Add(cjtemp);
                            }
                        }
                    }
                    for (int k = 0; k < cjnames.Count; k++)
                    {
                        EquipArchiManagment em = new EquipArchiManagment();
                        // Cj_Names = Cj_Names + em.getEa_namebyId(Convert.ToInt16(cjnames[k])) + "、";
                        Cj_Names = Cj_Names + cjnames[k] + "、";
                    }
                    //string job_time = "";
                    //string[] job_timelist = Joblist[i].corn_express.Split(new char[] { ' ' });
                    //job_time = job_timelist[6] + "年" + job_timelist[4] + "月" + job_timelist[3] + "日";
                    string wf_name  = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Name + ":" + wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Attribution;
                    string job_desc = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Name;


                    object o = new
                    {
                        job_id     = Joblist[i].JOB_ID,
                        index      = i + 1,
                        jobName    = Joblist[i].job_name,
                        jobType    = wf_name,
                        job_desc   = job_desc,
                        jobTIme    = Joblist[i].STR_RES_2,
                        jobRunPara = Cj_Names,
                        jobStatus  = Joblist[i].status,
                        job_dep    = Joblist[i].STR_RES_1,
                        job_result = Joblist[i].run_result,
                        iszytd     = zytd
                    };
                    r.Add(o);
                }
            }
            string str = JsonConvert.SerializeObject(r);

            return("{" + "\"data\": " + str + "}");
        }