コード例 #1
0
        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");
        }
コード例 #2
0
        //zxh

        public string ListMission_zxh()
        {
            try
            {
                IObjectContextAdapter IOca = new EquipWebContext();

                List <UI_MISSION> miss = CWFEngine.GetActiveMissions <Person_Info>(IOca.ObjectContext);


                List <Object> miss_obj = new List <object>();
                string        userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString();
                foreach (UI_MISSION item in miss)
                {
                    MainMissionsModel mm = GetMainMissionsInfo(item.WE_Entity_Id);


                    Jobs   js      = new Jobs();
                    string endtime = "";
                    string lsh_xy  = "1";


                    if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id) != null)
                    {
                        if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime == null)
                        {
                            string        end_corn = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).corn_express;
                            TriggerTiming TT       = new TriggerTiming();
                            TT.FromString(end_corn);
                            TT.RefreshNextTiming(DateTime.Now);
                            endtime = TT.NextTiming.ToString();
                        }
                        else
                        {
                            endtime = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime.ToString();
                        }
                    }


                    if (mm.Equip_GyCode == null || mm.Equip_GyCode == "")
                    {
                        lsh_xy = "0";
                    }
                    object o = new
                    {
                        WF_ICON    = "fa fa-flash text-text-aqua",
                        MISS_Url   = item.Mission_Url,
                        WF_Name    = mm.WF_Name,
                        MISS_Name  = item.WE_Event_Desc,
                        wfe_serial = mm.wfe_serial,
                        sbCode     = mm.Equip_GyCode,
                        time       = mm.time,
                        endtime    = endtime,
                        lsh_xy     = lsh_xy
                    };
                    EquipManagment em = new EquipManagment();
                    if (mm.WF_Name.Contains("定时KPI月报"))
                    {
                        if (userName == "龚海桥" && mm.WF_Name.Contains("联合一片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "丁一刚" && mm.WF_Name.Contains("联合二片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "邓杰" && (mm.WF_Name.Contains("联合三片区") || mm.WF_Name.Contains("化工片区")))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "杨书毅" && mm.WF_Name.Contains("联合四片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "武文斌" && (mm.WF_Name.Contains("综合片区") || mm.WF_Name.Contains("系统片区")))
                        {
                            miss_obj.Add(o);
                        }
                    }
                    else
                    {
                        if (userName == "sa" || userName == "程聂")
                        {
                            miss_obj.Add(o);
                        }
                        else
                        {
                            if (lsh_xy == "1")
                            {
                                if (em.getEquip_ByGyCode(mm.Equip_GyCode).Equip_Specialty == "动")
                                {
                                    miss_obj.Add(o);
                                }
                            }
                            else
                            {
                                miss_obj.Add(o);
                            }
                        }
                    }
                }

                TablesManagment tm     = new TablesManagment();
                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("可靠性工程师"))
                {
                    string             wfe_ser = "";
                    List <string>      cjname  = new List <string>();
                    List <Equip_Archi> EA      = pm.Get_Person_Cj(UserId);
                    foreach (var ea in EA)
                    {
                        cjname.Add(ea.EA_Name);
                    }
                    List <A5dot1Tab1> E = tm.Getdcl_listbyisZG(0, cjname);

                    for (int i = 0; i < E.Count; i++)
                    {
                        if (E[i].dataSource != null)
                        {
                            wfe_ser = E[i].dataSource;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot1/Index",
                            WF_Name    = "设备完好",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = E[i].sbGyCode.ToString(),
                            time       = E[i].zzSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                    SxglManagment     Sx = new SxglManagment();
                    List <A5dot2Tab1> EE = Sx.GetSxItem(cjname);
                    foreach (var item in EE)
                    {
                        if (item.temp2 != null)
                        {
                            wfe_ser = item.temp2;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot2/Index",
                            WF_Name    = "竖向问题",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = item.sbGyCode.ToString(),
                            time       = item.jxSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                }

                string str = JsonConvert.SerializeObject(miss_obj);
                return("{" + "\"data\": " + str + "}");
            }
            catch (Exception e)
            {
                return(null);
            }
        }