Example #1
0
        //DRBPM平台低能效机泵-筛选-自动提报-2016.07.25
        public string Auto_ZzSubmit_submitsignal(string json1)
        {
            try
            {
                JObject item       = (JObject)JsonConvert.DeserializeObject(json1);
                string  Equip_Code = item["Equip_Code"].ToString();
                //string Problem_Desc = item["gyState_PMGList"].ToString();
                string             flowname = "A7dot2";
                UI_WorkFlow_Entity wfe      = CWFEngine.CreateAWFEntityByName(flowname);
                if (wfe != null)
                {
                    EquipManagment              em             = new EquipManagment();
                    Equip_Info                  eqinfo         = em.getEquip_Info(Equip_Code);
                    List <Equip_Archi>          Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id);
                    Dictionary <string, string> record         = wfe.GetRecordItems();
                    record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"]     = DateTime.Now.ToString();
                    wfe.Start(record);
                    int flow_id = wfe.EntityID;

                    Dictionary <string, string> signal1 = new Dictionary <string, string>();
                    signal1["start_done"] = "true";
                    CWFEngine.SubmitSignal(flow_id, signal1, record);

                    //paras
                    Dictionary <string, string> signal = new Dictionary <string, string>();
                    signal["ZzSubmit_done"] = "true";
                    signal["Cj_Name"]       = Equip_ZzBelong[1].EA_Name; //Cj_Name
                    signal["Zz_Name"]       = Equip_ZzBelong[0].EA_Name; //Zz_Name
                    signal["Equip_GyCode"]  = eqinfo.Equip_GyCode;
                    signal["Equip_Code"]    = eqinfo.Equip_Code;
                    signal["Equip_Type"]    = eqinfo.Equip_Type;
                    signal["Zy_Type"]       = eqinfo.Equip_Specialty;
                    signal["Zy_SubType"]    = eqinfo.Equip_PhaseB;
                    signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark;
                    signal["Data_Src"]      = "DRBPM平台低能效机泵";
                    signal["Problem_Desc"]  = GetGyStateDescription(item["gyState_PMGList"].ToString(), true);

                    //record
                    record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"]     = DateTime.Now.ToString();
                    //submit
                    CWFEngine.SubmitSignal(flow_id, signal, record);
                    return("/A7dot2/Index");
                }
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A7dot2/Index");
        }
Example #2
0
        public string click_submitsignal(string json1)
        {
            try
            {
                JObject            item       = (JObject)JsonConvert.DeserializeObject(json1);
                string             Equip_Code = item["Equip_Code"].ToString();
                string             Jx_Reason  = item["Jx_Reason"].ToString();
                string             flowname   = "A8dot2";
                UI_WorkFlow_Entity wfe        = CWFEngine.CreateAWFEntityByName(flowname);
                if (wfe != null)
                {
                    EquipManagment              em             = new EquipManagment();
                    Equip_Info                  eqinfo         = em.getEquip_Info(Equip_Code);
                    List <Equip_Archi>          Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id);
                    Dictionary <string, string> record         = wfe.GetRecordItems();
                    record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"]     = DateTime.Now.ToString();
                    wfe.Start(record);
                    int flow_id = wfe.EntityID;
                    //paras
                    Dictionary <string, string> signal = new Dictionary <string, string>();
                    signal["JxSubmit_done"] = "true";
                    signal["Cj_Name"]       = Equip_ZzBelong[1].EA_Name; //Cj_Name
                    signal["Zz_Name"]       = Equip_ZzBelong[0].EA_Name; //Zz_Name
                    signal["Equip_GyCode"]  = eqinfo.Equip_GyCode;
                    signal["Equip_Code"]    = eqinfo.Equip_Code;
                    signal["Equip_Type"]    = eqinfo.Equip_Type;
                    signal["Zy_Type"]       = eqinfo.Equip_Specialty;
                    signal["Zy_SubType"]    = eqinfo.Equip_PhaseB;
                    signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark;
                    signal["Jx_Reason"]     = Jx_Reason;//计划检修原因 PM?
                    signal["Data_Src"]      = "A14dot1";
                    //record
                    record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"]     = DateTime.Now.ToString();
                    //submit
                    CWFEngine.SubmitSignal(flow_id, signal, record);
                    return("/A8dot2/Index");
                }
                else
                {
                    return("/A14dot1/Index");
                }
            }
            catch (Exception e)
            {
                return("");
            }

            //return ("/A14dot1/Index");
        }
Example #3
0
        /// <summary>
        /// 有以前的通过Excel表读取数据模式改为现在的直接读取ERP中数据,通过周期调用此函数,周期存库
        /// </summary>
        /// <param name="json1"></param>
        /// <returns></returns>
        public void ERPSubmit()
        {
            try
            {
                PersonManagment   PM       = new PersonManagment();
                A6dot2Managment   WM       = new A6dot2Managment();
                A6dot2Tab1        WDT_list = new A6dot2Tab1();
                ERPInfoManagement erp      = new ERPInfoManagement();
                EquipManagment    EM       = new EquipManagment();

                string EquipPhaseB;
                WDT_list.uploadDesc      = ""; //字段保留,(以前用于上传五定表的描述)
                WDT_list.uuploadFileName = ""; //字段保留,(以前用于上传五定表的名字)
                //string[] savedFileName = WDT_list.uuploadFileName.Split(new char[] { '$' });
                //string wdt_filename = Path.Combine(Request.MapPath("~/Upload"), savedFileName[1]);//没有用到的变量
                //WDT_list.userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                WDT_list.userName   = "******";
                WDT_list.uploadtime = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
                //WDT_list.pqName = PM.Get_Person_Depart((Session["User"] as EquipModel.Entities.Person_Info).Person_Id).Depart_Name;
                WDT_list.pqName = "待定";
                int WDT_ID = WM.add_WDT_list(WDT_list);

                List <OilInfo> OilInfo_Overdue = erp.getOilInfo_overdue();

                List <A6dot2Tab2> wdt_list = new List <A6dot2Tab2>();
                foreach (var i in OilInfo_Overdue)
                {
                    A6dot2Tab2 tmp = new A6dot2Tab2();
                    tmp.isValid            = 1;
                    tmp.equipCode          = i.oil_EquipCode;
                    tmp.equipDesc          = i.oil_EquipDesc;
                    tmp.funLoc             = i.oil_Fun_Loc;
                    tmp.funLoc_desc        = i.oil_Fun_LocDesc;
                    tmp.oilLoc             = i.oil_Loc;
                    tmp.oilLoc_desc        = i.oil_Loc;
                    tmp.oilInterval        = Convert.ToInt32(i.oil_Interval);
                    tmp.unit               = i.oil_Unit;
                    tmp.lastOilTime        = i.oil_LastDate;
                    tmp.lastOilNumber      = Convert.ToDouble(i.oil_LastNum);
                    tmp.lastOilUnit        = i.oil_Unit;
                    tmp.NextOilTime        = i.oil_NextDate.ToString();
                    tmp.NextOilNumber      = Convert.ToDouble(i.oil_NextNum);
                    tmp.NextOilUnit        = i.oil_Unit2;
                    tmp.oilCode            = i.oil_Code;
                    tmp.oilCode_desc       = i.oil_Desc;
                    tmp.substiOilCode      = "";
                    tmp.substiOilCode_desc = "";
                    if (EM.getEquip_Info(tmp.equipCode) != null)
                    {
                        EquipPhaseB = EM.getEquip_Info(tmp.equipCode).Equip_PhaseB;
                        if (EquipPhaseB == null)
                        {
                            tmp.isOilType = 0;
                        }
                        else
                        {
                            if (EquipPhaseB.Equals("机泵") || EquipPhaseB.Equals("风机"))
                            {
                                tmp.isOilType = 1;
                            }
                            else
                            {
                                tmp.isOilType = 0;
                            }
                        }
                        List <Equip_Archi> ZzCj = EM.getEquip_ZzBelong(EM.getEquip_Info(tmp.equipCode).Equip_Id);
                        tmp.equip_ZzName = ZzCj.First().EA_Name;
                        tmp.equip_CjName = ZzCj.Last().EA_Name;
                        tmp.equip_PqName = EM.GetPqofZz(tmp.equip_ZzName).Pq_Name;
                    }

                    tmp.isExceed = 1;
                    tmp.Tab1_Id  = WDT_ID;
                    wdt_list.Add(tmp);
                }
                WM.add_WDT_content(WDT_ID, wdt_list);

                /*  foreach(var i in wdt_content)
                 * {
                 *    return i.equip_CjName;
                 * }
                 * */

                // return "/A6dot2/Index_Tj";
            }
            catch { }
        }
        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);
            }
            string jx_reason    = "";
            string E_code       = "";
            string job_order    = "";
            string notice_order = "";

            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();

                    //sb_code、jxreason与设备绑定在一起传过来,当通知单号工单号填完后满足向A8.2跳转条件
                    if (dd.Key == "sb_code")
                    {
                        E_code = dd.Value.ToString();
                    }
                    if (dd.Key == "jxreason")
                    {
                        jx_reason = dd.Value.ToString();
                    }
                    if (dd.Key == "notice_order2")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        notice_order = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_Notice(notice_order);
                        if (res != null)
                        {
                            job_order = res.GD_Id;
                        }
                    }
                    if (dd.Key == "job_order2")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        job_order = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_GDId(job_order);
                        if (res != null)
                        {
                            notice_order = res.GD_Notice_Id;
                        }
                    }
                    //if (dd.Key == "JumpA8dot2DR")
                    //{
                    //    string Equip_Code = E_code;
                    //    string Jx_Reason = jx_reason;
                    //    string flowname = "A8dot2";
                    //    UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname);
                    //    if (wfe != null)
                    //    {
                    //        EquipManagment em = new EquipManagment();
                    //        Equip_Info eqinfo = em.getEquip_Info(Equip_Code);
                    //        List<Equip_Archi> Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id);
                    //        Dictionary<string, string> record = wfe.GetRecordItems();
                    //        record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    //        record["time"] = DateTime.Now.ToString();
                    //        wfe.Start(record);
                    //        int flow_id = wfe.EntityID;
                    //        //paras
                    //        Dictionary<string, string> signal = new Dictionary<string, string>();
                    //        signal["JxSubmit_done"] = "true";
                    //        signal["Cj_Name"] = Equip_ZzBelong[1].EA_Name; //Cj_Name
                    //        signal["Zz_Name"] = Equip_ZzBelong[0].EA_Name; //Zz_Name
                    //        signal["Equip_GyCode"] = eqinfo.Equip_GyCode;
                    //        signal["Equip_Code"] = eqinfo.Equip_Code;
                    //        signal["Equip_Type"] = eqinfo.Equip_Type;
                    //        signal["Zy_Type"] = eqinfo.Equip_Specialty;
                    //        signal["Zy_SubType"] = eqinfo.Equip_PhaseB;
                    //        signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark;
                    //        signal["Jx_Reason"] = Jx_Reason;//计划检修原因 PM?
                    //        signal["Job_Name"] = "来自DRBPM";
                    //        signal["Job_Order"] = job_order;
                    //        //record
                    //        record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    //        record["time"] = DateTime.Now.ToString();
                    //        //submit
                    //        CWFEngine.SubmitSignal(flow_id, signal, record);

                    //    }
                    //}
                }
            }


            Dictionary <string, object> m_kv   = new Dictionary <string, object>();
            EquipManagment     em1             = new EquipManagment();
            Equip_Info         eqinfo1         = em1.getEquip_Info(E_code);
            List <Equip_Archi> Equip_ZzBelong1 = em1.getEquip_ZzBelong(eqinfo1.Equip_Id);


            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"]       = Equip_ZzBelong1[0].EA_Name; //Zz_Name
            m_kv["sb_gycode"]     = eqinfo1.Equip_GyCode;
            m_kv["sb_code"]       = E_code;
            m_kv["sb_type"]       = eqinfo1.Equip_Type;
            m_kv["sb_ABCMark"]    = eqinfo1.Equip_ABCmark;
            m_kv["plan_name"]     = "来自DRBPM";
            m_kv["jxreason"]      = jx_reason;
            m_kv["kkconfirm2"]    = "同意";
            m_kv["zytdconfirm2"]  = "同意";
            m_kv["job_order2"]    = job_order;
            m_kv["notice_order2"] = notice_order;
            m_kv["missionname"]   = "完善工单与通知单后跳转";
            m_kv["role"]          = pv.Role_Names;
            dt.data.Add(m_kv);


            return(dt);
        }