コード例 #1
0
        public string get_equip_info(string wfe_id)
        {
            WorkFlows wfsd    = new WorkFlows();
            Mission   db_miss = wfsd.GetWFEntityMissions(Convert.ToInt16(wfe_id)).Last();//获取该实体最后一个任务


            WorkFlow_Entity wfe = wfsd.GetWorkFlowEntity(Convert.ToInt16(wfe_id));
            //CWorkFlow wf = new CWorkFlow();
            WorkFlows  wfs = new WorkFlows();
            UI_MISSION ui  = new UI_MISSION();

            ui.WE_Entity_Ser = wfe.WE_Ser;
            ui.WE_Event_Desc = db_miss.Miss_Desc;
            ui.WE_Event_Name = db_miss.Event_Name;
            ui.WE_Name       = db_miss.Miss_Name;
            ui.Mission_Url   = "";                                               //历史任务的页面至空
            ui.Miss_Id       = db_miss.Miss_Id;
            List <Mission_Param> mis_pars = wfsd.GetMissParams(db_miss.Miss_Id); //获取当前任务参数

            foreach (var par in mis_pars)
            {
                CParam cp = new CParam();
                cp.type                     = par.Param_Type;
                cp.name                     = par.Param_Name;
                cp.value                    = par.Param_Value;
                cp.description              = par.Param_Desc;
                ui.Miss_Params[cp.name]     = cp.value;
                ui.Miss_ParamsDesc[cp.name] = cp.description;
            }
            List <EquipListModel> EquipList = Zz_Equips(ui.Miss_Params["Zz_Name"].ToString());
            List <object>         miss_obj  = new List <object>();
            int i = 1;

            foreach (var item in EquipList)
            {
                object m = new
                {
                    index           = i,
                    Equip_Id        = item.Equip_Id,
                    Equip_GyCode    = item.Equip_GyCode,
                    Equip_Code      = item.Equip_Code,
                    Equip_Type      = item.Equip_Type,
                    Equip_Specialty = item.Equip_Specialty,
                    Equip_ABCMark   = item.Equip_ABCMark
                };
                miss_obj.Add(m);
                i++;
            }

            string str = JsonConvert.SerializeObject(miss_obj);

            return("{" + "\"data\": " + str + "}");
        }
コード例 #2
0
        /// <summary>
        /// 获取某一工作流实体的历史任务
        /// </summary>
        /// <param name="entity_id">工作流实体ID</param>
        /// <returns></returns>
        public static List <UI_MISSION> GetHistoryMissions(int entity_id)
        {
            List <UI_MISSION> his_miss = new List <UI_MISSION>();

            WorkFlows      wfs     = new WorkFlows();
            List <Mission> db_miss = wfs.GetWFEntityMissions(entity_id);

            WorkFlow_Entity wfe = wfs.GetWorkFlowEntity(entity_id);
            //恢复工作流实体
            CWorkFlow   wf  = new CWorkFlow();
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(Encoding.Default.GetString(wfe.WE_Binary));
            wf.EntityID = wfe.WE_Id;
            wf.InstFromXmlNode(doc.DocumentElement);


            foreach (var mi in db_miss)
            {
                UI_MISSION ui_mi = new UI_MISSION();
                ui_mi.WE_Entity_Id  = entity_id;
                ui_mi.WE_Entity_Ser = wfe.WE_Ser;
                ui_mi.WE_Event_Desc = mi.Miss_Desc;
                ui_mi.WE_Event_Name = mi.Event_Name;
                ui_mi.WE_Name       = mi.Miss_Name;
                ui_mi.Mission_Url   = ""; //历史任务的页面至空
                ui_mi.Miss_Id       = mi.Miss_Id;

                List <Mission_Param> mis_pars = wfs.GetMissParams(mi.Miss_Id);
                foreach (var par in mis_pars)
                {
                    CParam cp = new CParam();
                    cp.type                          = par.Param_Type;
                    cp.name                          = par.Param_Name;
                    cp.value                         = par.Param_Value;
                    cp.description                   = par.Param_Desc;
                    ui_mi.Miss_Params[cp.name]       = cp.value;
                    ui_mi.Miss_ParamsAppRes[cp.name] = wf.paramstable[cp.name].linkEventsApp_res[ui_mi.WE_Event_Name];
                    ui_mi.Miss_ParamsDesc[cp.name]   = cp.description;//xwm modified
                }
                his_miss.Add(ui_mi);
            }
            return(his_miss);
        }
コード例 #3
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 + "}");
        }
コード例 #4
0
ファイル: A6dot1Controller.cs プロジェクト: ahyeah/equip-web
        public string JdcConfirm_submitsignal(string json1)
        {
            JObject                     item     = (JObject)JsonConvert.DeserializeObject(json1);
            string                      flowname = item["Flow_Name"].ToString();
            A6dot2Managment             WM       = new A6dot2Managment();
            FileItem                    file     = new FileItem();
            int                         Equip_Id = 0;
            Dictionary <string, string> signal   = new Dictionary <string, string>();

            //new input paras
            signal["JdcConfirm_Result"] = item["JdcConfirm_Result"].ToString();
            signal["JdcSupplement"]     = item["JdcSupplement"].ToString();
            //上传到File_Info

            if (signal["JdcConfirm_Result"] == "通过")
            {
                //向File_Info里写文件信息
                WorkFlows      wfsd    = new WorkFlows();
                List <Mission> db_miss = wfsd.GetWFEntityMissions(Convert.ToInt32(flowname));//获取该实体的所有任务
                for (int i = 0; i < db_miss.Count; i++)
                {
                    if (db_miss[i].Miss_Desc == "可靠性工程师修改再上传")
                    {
                        UI_MISSION ui_mi = new UI_MISSION();
                        ui_mi.WE_Entity_Id  = Convert.ToInt32(flowname);
                        ui_mi.WE_Event_Desc = db_miss[i].Miss_Desc;
                        ui_mi.WE_Event_Name = db_miss[i].Event_Name;
                        ui_mi.WE_Name       = db_miss[i].Miss_Name;
                        ui_mi.Mission_Url   = ""; //历史任务的页面至空
                        ui_mi.Miss_Id       = db_miss[i].Miss_Id;


                        List <Mission_Param> mis_pars = wfsd.GetMissParams(db_miss[i].Miss_Id);//获取当前任务参数
                        foreach (var par in mis_pars)
                        {
                            CParam cp = new CParam();
                            cp.type                    = par.Param_Type;
                            cp.name                    = par.Param_Name;
                            cp.value                   = par.Param_Value;
                            cp.description             = par.Param_Desc;
                            ui_mi.Miss_Params[cp.name] = cp.value;
                            // ui_mi.Miss_ParamsAppRes[cp.name] = wf.paramstable[cp.name].linkEventsApp_res[ui_mi.WE_Event_Name];
                            ui_mi.Miss_ParamsDesc[cp.name] = cp.description;//xwm modified
                        }
                        Equip_Id = WM.GetEquipIdBySbCode(ui_mi.Miss_Params["Equip_Code"].ToString());
                        string[] File_AllName = ui_mi.Miss_Params["ModifyOperInstruc"].ToString().Split(new char[] { '$' });
                        file.fileName        = File_AllName[0];
                        file.fileNamePresent = File_AllName[1];
                        file.ext             = Path.GetExtension(ui_mi.Miss_Params["ModifyOperInstruc"].ToString());
                        file.updateTime      = DateTime.Now.ToString();
                        file.Mission_Id      = db_miss[i].Miss_Id;
                        file.WfEntity_Id     = Convert.ToInt32(flowname);
                        //file.Self_Catalog_Catalog_Id = 28;
                        file.path = @"/Upload/A3dot3";
                        bool res = WM.AddNewFile(28, file);
                        break;
                    }
                }
                //通过上传时间找到刚才上传到File_Info的文件的File_Id
                int File_Id = WM.GetFileIdByUpdateTime(Convert.ToDateTime(file.updateTime));
                //调用File.cs里的AttachtoEuip使连接表产生数据,让设备与操作规程勾连,需要用到Equip_Id和File_Id
                bool les = WM.AttachtoEuipAndFile(File_Id, Equip_Id);
            }
            Dictionary <string, string> record = new Dictionary <string, string>();

            record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
            record["time"]     = DateTime.Now.ToString();
            CWFEngine.SubmitSignal(Convert.ToInt32(flowname), signal, record);
            return("/A6dot1/Index");
        }