Ejemplo n.º 1
0
        public static List <UI_WFEntity_Info> GetWFEntityByHistoryDone(System.Linq.Expressions.Expression <Func <Mission, bool> > condition)
        {
            List <UI_WFEntity_Info> wfe_info = new List <UI_WFEntity_Info>();

            WorkFlows wfs = new WorkFlows();

            List <WorkFlow_Entity> wfes = null;

            //List<WorkFlow_Entity> wfes = wfs.GetWFEntityByConditon(s => s.Process_Info.wh );
            try
            {
                using (var db = new WorkFlowContext())
                {
                    wfes = db.mission.Where(condition).Select(a => a.Miss_WFentity).Distinct().Where(s => s.WE_Status == WE_STATUS.DONE).ToList();
                }
            }
            catch (Exception e)
            {
                return(null);
            }

            foreach (WorkFlow_Entity fe in wfes)
            {
                UI_WFEntity_Info fe_info = new UI_WFEntity_Info();
                fe_info.name        = wfs.GetWorkFlowEntityName(fe.WE_Id);
                fe_info.Status      = fe.WE_Status;
                fe_info.EntityID    = fe.WE_Id;
                fe_info.description = wfs.GetWorkFlowEntityDesc(fe.WE_Id);
                fe_info.serial      = fe.WE_Ser;
                wfe_info.Add(fe_info);
            }
            return(wfe_info);
        }
Ejemplo n.º 2
0
        //fhp添加方法结束-----

        /// <summary>
        /// 或的工作流的信息以及指定变量的值
        /// </summary>
        /// <param name="wfe_id">工作流实体ID</param>
        /// <param name="paras">变量列表
        /// 例如: 要获得工作流(ID 为 4)的Equip_GyCode的当前值,则:
        /// Dictionary paras = new Dictionary();
        /// paras["Equip_GyCode"] = null;
        /// UI_WFEntity_Info wfei = GetWorkFlowEntityWithParams(4, paras);
        ///
        /// 调用完成后, wfei返回了 name, description, EntityID, serial, Status
        /// 而paras["Equip_GyCode"] 将会被设置为正确值
        /// </param>
        /// <returns></returns>
        public static UI_WFEntity_Info GetWorkFlowEntityWithParams(int wfe_id, IDictionary <string, object> paras)
        {
            UI_WFEntity_Info wfe  = new UI_WFEntity_Info();
            WorkFlows        wfs  = new WorkFlows();
            WorkFlow_Entity  wfe1 = wfs.GetWorkFlowEntity(wfe_id);

            CWorkFlow   wf  = new CWorkFlow();
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(Encoding.Default.GetString(wfe1.WE_Binary));
            XmlNode xml = doc.DocumentElement;

            wf.ParaseBaseInfo(xml);
            wf.ParseParams(xml.SelectSingleNode("paramtable"));

            Dictionary <string, object> _tmp = new Dictionary <string, object>(paras);

            foreach (var par in _tmp)
            {
                paras[par.Key] = wf.paramstable[par.Key].value;
            }


            wfe.name        = wf.name;
            wfe.description = wf.description;
            wfe.EntityID    = wf.EntityID;
            wfe.serial      = wf.EntitySerial;
            wfe.Status      = wfe1.WE_Status;
            return(wfe);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 通过工作流实体的id获得工作流实体
        /// </summary>
        /// <param name="wfe_id"></param>
        /// <returns></returns>
        public static UI_WFEntity_Info GetWorkFlowEntiy(int wfe_id, bool FullInfo = false)
        {
            UI_WFEntity_Info wfe  = new UI_WFEntity_Info();
            WorkFlows        wfs  = new WorkFlows();
            WorkFlow_Entity  wfe1 = wfs.GetWorkFlowEntity(wfe_id);

            if (FullInfo)
            {
                CWorkFlow   wf  = new CWorkFlow();
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(Encoding.Default.GetString(wfe1.WE_Binary));
                XmlNode xml = doc.DocumentElement;
                wf.ParaseBaseInfo(xml);
                WorkFlow_Define wfd = wfs.GetWorkFlowDefine(wfe_id);
                //wfe.name = wfd.W_Name;
                //wfe.description = wfd.W_Attribution;
                wfe.Binary      = Encoding.Default.GetString(wfe1.WE_Binary);
                wfe.name        = wf.name;
                wfe.description = wf.description;
            }

            wfe.EntityID       = wfe1.WE_Id;
            wfe.serial         = wfe1.WE_Ser;
            wfe.Status         = wfe1.WE_Status;
            wfe.Last_TransTime = wfe1.Last_Trans_Time;
            return(wfe);
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 5
0
        //fhp添加方法开始----

        public static UI_WFEntity_Info GetMainWorkFlowEntity(string wfe_ser)
        {
            UI_WFEntity_Info wfe  = new UI_WFEntity_Info();
            WorkFlows        wfs  = new WorkFlows();
            WorkFlow_Entity  wfe1 = wfs.GetMainWorkFlowEntity(wfe_ser);

            CWorkFlow   wf  = new CWorkFlow();
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(Encoding.Default.GetString(wfe1.WE_Binary));
            wf.InstFromXmlNode(doc.DocumentElement);
            wfe.description = wf.description;
            wfe.name        = wf.name;

            wfe.EntityID = wfe1.WE_Id;
            wfe.serial   = wfe1.WE_Ser;
            wfe.Status   = wfe1.WE_Status;
            return(wfe);
        }
Ejemplo n.º 6
0
        public ActionResult CaiGouConfirm(string wfe_id)
        {
            Dictionary <string, object> paras1 = new Dictionary <string, object>();

            paras1["Job_OrderState"] = null;

            UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(wfe_id), paras1);

            ViewBag.Job_OrderState = paras1["Job_OrderState"].ToString();
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_Role   = pv.Role_Names;
            ViewBag.user_Depart = pv.Department_Name;
            UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);

            ViewBag.currentMiss = miss;
            return(View(getWFDetail_Model(wfe_id)));
        }
Ejemplo n.º 7
0
        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)));
        }
Ejemplo n.º 8
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 + "}");
        }
Ejemplo n.º 9
0
        public string A14HistoryList(string WorkFlow_Name, string yearandmonth)
        {
            string username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;


            string WE_Status       = "3";
            string query_list      = "distinct E.WE_Ser, E.WE_Id, R.username,R.time";
            string query_condition = "E.W_Name='" + WorkFlow_Name + "' and E.WE_Status='" + WE_Status + "' and R.username is not null";
            string record_filter;
            string nexttimepoint;

            string[] month = yearandmonth.Split('/');
            nexttimepoint = month[0] + "/" + (Convert.ToInt16(month[1]) + 1).ToString();
            record_filter = "time >= '" + yearandmonth + "/" + "1" + " 00:00:00'" + "and  time <= '" + nexttimepoint + "/" + "1" + " 00:00:00'";
            DataTable dt  = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter);
            DataTable dt2 = DeleteSameRow(dt, "WE_Ser");
            string    str = "";//存返回结果

            List <Gxqmodel> Gmlist = new List <Gxqmodel>();

            for (int i = 0; i < dt2.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 <HistroyModel> Hm = new List <HistroyModel>();

            foreach (var item in Gmlist)
            {
                HistroyModel h = new HistroyModel();
                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Equip_GyCode"] = null;
                UI_WFEntity_Info  wfei           = CWFEngine.GetWorkFlowEntityWithParams(item.WE_Id, paras);
                List <UI_MISSION> AllHistoryMiss = CWFEngine.GetHistoryMissions(item.WE_Id);
                int Miss_Id = AllHistoryMiss[0].Miss_Id;
                h.miss_LastStatusdesc = AllHistoryMiss[AllHistoryMiss.Count - 1].WE_Event_Desc;
                IDictionary <string, string> r = CWFEngine.GetMissionRecordInfo(Miss_Id);
                if (r.Count > 0)
                {
                    h.missStartName = r["username"];
                    h.missStartTime = r["time"];
                }
                else
                {
                    h.missStartName = "";
                    h.missStartTime = "";
                }

                h.wfe_serial = item.WE_Ser;
                // h.miss_wfe_Id = wfei.EntityID;
                h.miss_wfe_Id  = item.WE_Id;
                h.workFlowName = wfei.description;
                h.sbGycode     = paras["Equip_GyCode"].ToString();
                Hm.Add(h);
            }
            List <object> or = new List <object>();

            for (int i = 0; i < Hm.Count; i++)
            {
                object o = new
                {
                    wfe_serial          = Hm[i].wfe_serial,
                    equip_gycode        = Hm[i].sbGycode,
                    workflow_name       = Hm[i].workFlowName,
                    missStartName       = Hm[i].missStartName,
                    missStartTime       = Hm[i].missStartTime,
                    miss_LastStatusdesc = Hm[i].miss_LastStatusdesc,
                    miss_wfe_Id         = Hm[i].miss_wfe_Id
                };
                or.Add(o);
            }
            str = JsonConvert.SerializeObject(or);

            return("{" + "\"data\": " + str + "}");
        }
Ejemplo n.º 10
0
        public JsonResult A6dot2GetTimerJobs(string run_result)
        {
            string        run_results  = run_result.TrimStart('[').TrimEnd(']');
            List <string> run_enity_id = new List <string>();
            List <object> res          = new List <object>();


            if (run_results.Contains(','))
            {
                run_enity_id = run_results.Split(new char[] { ',' }).ToList();
            }
            else
            {
                run_enity_id.Add(run_results);
            }

            for (int i = 0; i < run_enity_id.Count; i++)
            {
                List <string> Zz_list = new List <string>();                 //整改方案

                List <string> equip_list              = new List <string>(); //设备name
                List <string> equip_code_list         = new List <string>(); //设备code
                List <string> equip_file_list         = new List <string>(); //整改方案
                List <string> equip_check_result_list = new List <string>(); //化验结果



                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Cj_Name"]            = null;
                paras["Equip_Info"]         = null;
                paras["Assay_Result"]       = null;
                paras["Time_Assay"]         = null;
                paras["Assay_File"]         = null;
                paras["Xc_Confirm"]         = null;
                paras["Assay_Result_Again"] = null;

                UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt16(run_enity_id[i]), paras);
                if (paras["Equip_Info"].ToString() != "")
                {
                    JArray  jsonVal = JArray.Parse(paras["Equip_Info"].ToString());
                    dynamic table   = jsonVal;
                    foreach (dynamic T in table)
                    {
                        string eq_name = T.equip_name;
                        equip_list.Add(eq_name);
                        string eq_code = T.equip_code;
                        equip_code_list.Add(eq_code);
                        string equip_file = T.equip_file;
                        equip_file_list.Add(equip_file);
                        string equip_check_result = T.equip_check_result;
                        equip_check_result_list.Add(equip_check_result);
                    }

                    for (int k = 0; k < equip_list.Count; k++)
                    {
                        object o = new
                        {
                            ID                  = k + 1,
                            zz_name             = Em.getZzName(Convert.ToInt16(Em.getEA_id_byCode(equip_code_list[k]))),
                            jz_name             = equip_list[k],
                            sb_code             = equip_code_list[k],
                            last_check_month    = paras["Time_Assay"].ToString(),
                            check_result        = equip_check_result_list[k],
                            zz_file             = equip_file_list[k],
                            zz_done             = paras["Xc_Confirm"].ToString(),
                            second_check_result = paras["Assay_Result_Again"].ToString()
                        };

                        res.Add(o);
                    }
                }
            }



            return(Json(new { data = res.ToArray() }));
        }
Ejemplo n.º 11
0
        public string getdcllist(string jobName, string time, string depts, string wfe_ids)
        {
            string        run_results  = wfe_ids.TrimStart('[').TrimEnd(']');
            List <string> run_enity_id = new List <string>();
            List <int>    wfe_id       = new List <int>();

            if (run_results.Contains(','))
            {
                run_enity_id = run_results.Split(new char[] { ',' }).ToList();
            }
            else
            {
                run_enity_id.Add(run_results);
            }
            for (int i = 0; i < run_enity_id.Count(); i++)
            {
                wfe_id.Add(Convert.ToInt16(run_enity_id[i]));
            }


            // string WorkFlow_Name = "A5dot1";
            List <LSA5Model> Am = new List <LSA5Model>();
            // List<UI_MISSION> miss;
            List <object> or = new List <object>();

            //miss = CWFEngine.GetActiveMissions<Person_Info>(((IObjectContextAdapter)(new EquipWebContext())).ObjectContext, WorkFlow_Name, true);
            foreach (var item in wfe_id)
            {
                LSA5Model o = new LSA5Model();
                Dictionary <string, object> paras = new Dictionary <string, object>();
                paras["Zz_Name"] = null;
                UI_WFEntity_Info wfei   = CWFEngine.GetWorkFlowEntityWithParams(item, paras);
                UI_MISSION       lastMi = CWFEngine.GetHistoryMissions(item).Last();

                int Miss_Id = lastMi.Miss_Id;
                IDictionary <string, string> r = CWFEngine.GetMissionRecordInfo(Miss_Id);
                if (r.Count > 0)
                {
                    //o.userName = r["username"];
                    o.missTime = r["time"];
                }
                else
                {
                    // o.userName = "";
                    o.missTime = "";
                }
                //if (item.Mission_Url.Contains("dot"))
                //    o.miss_url = item.Mission_Url;
                //else
                //    o.miss_url = "";
                o.wfe_serial = wfei.serial;
                o.zz_name    = paras["Zz_Name"].ToString();
                o.miss_url   = "/LSA5dot2/ZzSubmit/?wfe_id=" + item.ToString();
                Am.Add(o);
            }
            for (int i = 0; i < Am.Count; i++)
            {
                object o = new
                {
                    wfe_serial = Am[i].wfe_serial,
                    zz_Name    = Am[i].zz_name,
                    job_name   = jobName,
                    time       = time,
                    missTime   = Am[i].missTime,
                    depts      = depts,
                    miss_url   = Am[i].miss_url
                };
                or.Add(o);
            }
            string str = JsonConvert.SerializeObject(or);

            return("{" + "\"data\": " + str + "}");
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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 + "}");
        }
Ejemplo n.º 14
0
        //A11dot2临时任务在线编辑部分
        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> )
                {
                    Dictionary <string, string> signal = new Dictionary <string, string>();
                    if (dd.Key == "problem_desc")
                    {
                        signal["Problem_Desc"]  = dd.Value.ToString();
                        signal["ZzSubmit_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);
                    }
                }
            }


            Dictionary <string, object> paras = new Dictionary <string, object>();

            paras["Zz_Name"]            = null;
            paras["Equip_GyCode"]       = null;
            paras["Equip_Code"]         = null;
            paras["Problem_Desc"]       = null; //隐患问题描述
            paras["RiskMatrix_Color"]   = null; //隐患评估结果
            paras["Supervise_done"]     = null; //片区监督实施是否完成
            paras["ImplementPlan_done"] = 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();//获取该实体最后一个任务
                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["problem_desc"]     = paras["Problem_Desc"].ToString();
                m_kv["riskMatrix_color"] = paras["RiskMatrix_Color"].ToString();



                m_kv["missionname"] = db_miss.Miss_Desc;
                dt.data.Add(m_kv);
            }
            return(dt);
        }