Exemplo n.º 1
0
        public string CreateFlow(string flowname)
        {
            UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname);

            if (wfe != null)
            {
                Dictionary <string, string> record = wfe.GetRecordItems();

                if (record.ContainsKey("username"))
                {
                    record["username"] = "******";
                }

                if (record.ContainsKey("time"))
                {
                    record["time"] = DateTime.Now.ToString();
                }

                return(wfe.Start(record));
                //Json(new { url = wfe.Start(record), wfe_id = wfe.EntityID });
                //"{url:'" + wfe.Start(record) + "', wfe_id:'" + wfe.EntityID + "'}";
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
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");
        }
Exemplo n.º 3
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");
        }
Exemplo n.º 4
0
        // GET: /A7dot1dot1/机动处确认
        public void createA13dot1(string from_wfe_id)
        {
            //create new flow A13.1
            UI_MISSION miss           = CWFEngine.GetActiveMission <Person_Info>(Convert.ToInt32(from_wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);
            string     th_problem     = Convert.ToString(miss.Miss_Params["Th_ProblemRecords"]);
            JArray     j_Problem_data = JArray.Parse(th_problem);

            for (int i = 0; i < j_Problem_data.Count; i++)
            {
                JObject j_obj            = JObject.Parse(j_Problem_data[i].ToString());
                string  problem_catalogy = j_obj["problem_catalogy"].ToString();
                string  problem_detail   = j_obj["problem_detail"].ToString();
                //将7.1.1的串号赋给新产生的13.1的工作流
                WorkFlows          wfsd       = new WorkFlows();
                WorkFlow_Entity    wfecurrent = wfsd.GetWorkFlowEntity(Convert.ToInt32(from_wfe_id));
                UI_WorkFlow_Entity wfe        = CWFEngine.CreateAWFEntityByName("A13dot1", wfecurrent.WE_Ser);

                if (wfe != null)
                {
                    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"]              = miss.Miss_Params["Cj_Name"].ToString();
                    signal["Zz_Name"]              = miss.Miss_Params["Zz_Name"].ToString();
                    signal["Equip_GyCode"]         = miss.Miss_Params["Equip_GyCode"].ToString();
                    signal["Equip_Code"]           = miss.Miss_Params["Equip_Code"].ToString();
                    signal["Equip_Type"]           = miss.Miss_Params["Equip_Type"].ToString();
                    signal["Problem_Desc"]         = problem_detail;
                    signal["Problem_DescFilePath"] = "";
                    signal["Zy_Type"]              = problem_catalogy;
                    signal["Zy_SubType"]           = miss.Miss_Params["Zy_SubType"].ToString();
                    signal["Equip_ABCMark"]        = miss.Miss_Params["Equip_ABCMark"].ToString();
                    signal["Data_Src"]             = "特护记录";

                    //submit
                    //record
                    //record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"] = DateTime.Now.ToString();
                    //submit
                    CWFEngine.SubmitSignal(flow_id, signal, record);
                }
            }
        }
Exemplo n.º 5
0
        //public string CreateFlow(string flowname)
        //{
        //    UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname);
        //    if (wfe != null)
        //    {
        //        Dictionary<string, string> record = wfe.GetRecordItems();
        //            record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
        //            record["time"] = DateTime.Now.ToString();
        //        return wfe.Start(record);
        //        //Json(new { url = wfe.Start(record), wfe_id = wfe.EntityID });
        //        //"{url:'" + wfe.Start(record) + "', wfe_id:'" + wfe.EntityID + "'}";

        //    }
        //    else
        //        return null;
        //}
        public string CreateFlow(string flowname)
        {
            UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname);

            if (wfe != null)
            {
                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);
                Dictionary <string, string> signal = new Dictionary <string, string>();

                signal["currentuser"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                signal["start_done"]  = "true";
                //submit
                CWFEngine.SubmitSignal(wfe.EntityID, signal, record);



                CWorkFlow   wf  = new CWorkFlow();
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(CWFEngine.GetWorkFlowEntiy(wfe.EntityID, true).Binary);
                wf.InstFromXmlNode(doc.DocumentElement);

                string returl = "";
                if (wf.GetCurrentEvent().CheckAuthority <Person_Info>((Dictionary <string, object>)Session[CWFEngine.authority_params], ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext))
                {
                    returl = wf.GetCurrentEvent().currentaction + "?wfe_id=" + wfe.EntityID.ToString();
                    //如果权限认证通过则返回正确的页面URL
                    return(returl);
                    //return returl;
                }
                else
                {
                    //如果权限认证不通过, 则删除刚创建的工作流实体, 并返回 -1
                    CWFEngine.RemoveWFEntity(wfe.EntityID);
                    return("-1");
                }
                //Json(new { url = wfe.Start(record), wfe_id = wfe.EntityID });
                //"{url:'" + wfe.Start(record) + "', wfe_id:'" + wfe.EntityID + "'}";
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 6
0
        public string CreateA12dot2_submitsignal(string json1)
        {
            try
            {
                JObject        item    = (JObject)JsonConvert.DeserializeObject(json1);
                EquipManagment tm      = new EquipManagment();
                string         temp    = item["sample"].ToString();
                JArray         jsonVal = JArray.Parse(temp) as JArray;
                dynamic        table2  = jsonVal;
                foreach (dynamic T in table2)
                {
                    UI_WorkFlow_Entity          wfe    = CWFEngine.CreateAWFEntityByName("A12dot2");
                    Dictionary <string, string> record = wfe.GetRecordItems();
                    record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    record["time"]     = DateTime.Now.ToString();

                    string returl = wfe.Start(record);
                    Dictionary <string, string> signal = new Dictionary <string, string>();
                    string Equip_Code           = T.Equip_Code;
                    int    Equip_location_EA_Id = tm.getEA_id_byCode(Equip_Code);
                    signal["currentuser"]   = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    signal["start_done"]    = "true";
                    signal["Zz_Name"]       = tm.getZzName(Equip_location_EA_Id);
                    signal["Equip_GyCode"]  = T.Equip_GyCode;
                    signal["Equip_Code"]    = T.Equip_Code;
                    signal["Equip_ABCMark"] = T.Equip_ABCMark;

                    //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.EntityID), signal, record1);
                }
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A12dot2/Index");
        }