Beispiel #1
0
        //获得点击修改的设备的具体信息
        public JsonResult List_Equipinfo(string json1)
        {
            JObject item = (JObject)JsonConvert.DeserializeObject(json1);
            //取得设备编号
            string              e_code = item["equip_code"].ToString();
            EquipManagment      EM     = new EquipManagment();
            int                 EA_id  = EM.getEA_id_byCode(e_code);
            EquipArchiManagment EAM    = new EquipArchiManagment();

            Equip_Info mod_equip = new Equip_Info();

            mod_equip = EM.getEquip_Info(e_code);

            object mod = new
            {
                e_abc    = mod_equip.Equip_ABCmark,
                e_code   = mod_equip.Equip_Code,
                e_gycode = mod_equip.Equip_GyCode,
                e_man    = mod_equip.Equip_Manufacturer,
                e_phaseB = mod_equip.Equip_PhaseB,
                e_sp     = mod_equip.Equip_Specialty,
                e_type   = mod_equip.Equip_Type,
                e_Achi   = EAM.getEa_namebyId(EA_id)
            };

            return(Json(mod));
        }
Beispiel #2
0
        public string ZzSubmit_Bcsignal(string json1)
        {
            try
            {
                JObject    item       = (JObject)JsonConvert.DeserializeObject(json1);
                A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1();
                DateTime   my         = DateTime.Now;
                int        cjid       = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"]));
                string     cjname     = Eam.getEa_namebyId(cjid);

                A5dot2Tab1 new_5dot2 = new A5dot2Tab1();
                new_5dot2.cjName             = cjname;
                new_5dot2.zzName             = item["Zz_Name"].ToString();
                new_5dot2.sbGyCode           = item["Equip_GyCode"].ToString();
                new_5dot2.sbCode             = item["Equip_Code"].ToString();
                new_5dot2.sbType             = item["Equip_Type"].ToString();
                new_5dot2.zyType             = item["Zy_Type"].ToString();
                new_5dot2.problemDescription = item["problemDescription"].ToString();
                new_5dot2.jxSubmitTime       = DateTime.Now;
                new_5dot2.jxUserName         = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                new_5dot2.isRectified        = 0;
                new_5dot2.state = 0;
                new_5dot2.temp2 = item["wfe_id"].ToString();
                bool res = Sx.AddSxItem(new_5dot2);



                string wfe_id = item["wfe_id"].ToString();
                //paras
                Dictionary <string, string> signal = new Dictionary <string, string>();
                signal["ZzSubmit_done"] = "true";

                //record
                Dictionary <string, string> record = new Dictionary <string, string>();
                record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                record["time"]     = DateTime.Now.ToString();
                //submit
                CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record);
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A5dot2/Index");
        }
Beispiel #3
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 + "}");
        }
Beispiel #4
0
        public string ZzSubmit_Bcsignal(string json1)
        {
            try
            {
                JObject item = (JObject)JsonConvert.DeserializeObject(json1);



                CTimerTimeout timeout_job = new CTimerTimeout();
                timeout_job.CreateTime   = DateTime.Now;
                timeout_job.for_using    = TIMER_USING.FOR_SYSTEM;
                timeout_job.mission_name = "";
                timeout_job.status       = TM_STATUS.TM_STATUS_ACTIVE;
                timeout_job.SetActionForWF("INVILID");
                timeout_job.AttachWFEntityID = Convert.ToInt32(item["wfe_id"]);
                timeout_job.CustomAction     = "http://localhost/CallBack/testCallBack";
                timeout_job.EventName        = "PqAessess";
                timeout_job.SetTriggerTiming("0 0 0 20 * ?");
                //保存该定时任务,并将其添加到激活任务列表
                timeout_job.Save();
                int m_timerMissionID = timeout_job.ID;
                CTimerManage.AppendMissionToActiveList(timeout_job);


                string[]   notgood    = item["Incomplete_content"].ToString().Split('|');
                A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1();
                DateTime   my         = DateTime.Now;
                string     yearmonth  = "";
                int        cjid       = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"]));
                string     cjname     = Eam.getEa_namebyId(cjid);
                string     Username   = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                if (my.Day >= 15)
                {
                    yearmonth = my.Year.ToString() + my.AddMonths(1).Month.ToString();
                }
                else
                {
                    yearmonth = my.Year.ToString() + my.Month.ToString();
                }

                if (notgood[notgood.Count() - 1] == "")
                {
                    for (int i = 0; i < notgood.Count() - 1; i++)
                    {
                        a5dot1Tab1.cjName                = cjname;
                        a5dot1Tab1.zzName                = item["Zz_Name"].ToString();
                        a5dot1Tab1.sbGyCode              = item["Equip_GyCode"].ToString();
                        a5dot1Tab1.sbCode                = item["Equip_Code"].ToString();
                        a5dot1Tab1.sbType                = item["Equip_Type"].ToString();
                        a5dot1Tab1.zyType                = item["Zy_Type"].ToString();
                        a5dot1Tab1.notGoodContent        = notgood[i];
                        a5dot1Tab1.isRectified           = 0;
                        a5dot1Tab1.zzSubmitTime          = DateTime.Now;
                        a5dot1Tab1.zzUserName            = Username;
                        a5dot1Tab1.yearMonthForStatistic = yearmonth;
                        a5dot1Tab1.temp3 = m_timerMissionID.ToString();
                        if (item["wfe_id"].ToString() != "")
                        {
                            a5dot1Tab1.dataSource = item["wfe_id"].ToString();
                        }
                        if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站")
                        {
                            a5dot1Tab1.pqName = a5dot1Tab1.cjName;
                        }
                        else
                        {
                            a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString());
                        }
                        tm.Zzsubmit(a5dot1Tab1);
                    }
                }
                else
                {
                    for (int i = 0; i < notgood.Count(); i++)
                    {
                        a5dot1Tab1.cjName                = cjname;
                        a5dot1Tab1.zzName                = item["Zz_Name"].ToString();
                        a5dot1Tab1.sbGyCode              = item["Equip_GyCode"].ToString();
                        a5dot1Tab1.sbCode                = item["Equip_Code"].ToString();
                        a5dot1Tab1.sbType                = item["Equip_Type"].ToString();
                        a5dot1Tab1.zyType                = item["Zy_Type"].ToString();
                        a5dot1Tab1.notGoodContent        = notgood[i];
                        a5dot1Tab1.isRectified           = 0;
                        a5dot1Tab1.zzSubmitTime          = DateTime.Now;
                        a5dot1Tab1.zzUserName            = Username;
                        a5dot1Tab1.yearMonthForStatistic = yearmonth;
                        a5dot1Tab1.temp3 = m_timerMissionID.ToString();
                        if (item["wfe_id"].ToString() != "")
                        {
                            a5dot1Tab1.dataSource = item["wfe_id"].ToString();
                        }
                        if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站")
                        {
                            a5dot1Tab1.pqName = a5dot1Tab1.cjName;
                        }
                        else
                        {
                            a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString());
                        }
                        tm.Zzsubmit(a5dot1Tab1);
                    }
                }
                string wfe_id = item["wfe_id"].ToString();
                //paras
                Dictionary <string, string> signal = new Dictionary <string, string>();
                signal["ZzSubmit_done"] = "true";

                //record
                Dictionary <string, string> record = new Dictionary <string, string>();
                record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                record["time"]     = DateTime.Now.ToString();
                //submit
                CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record);
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A5dot1/Index");
        }
Beispiel #5
0
        public string ZzSubmit_Bcsignal(string json1)
        {
            try
            {
                JObject    item       = (JObject)JsonConvert.DeserializeObject(json1);
                string[]   notgood    = item["Incomplete_content"].ToString().Split('|');
                A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1();
                DateTime   my         = DateTime.Now;
                string     yearmonth  = "";
                int        cjid       = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"]));
                string     cjname     = Eam.getEa_namebyId(cjid);
                string     Username   = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                if (my.Day >= 15)
                {
                    yearmonth = my.Year.ToString() + my.AddMonths(1).Month.ToString();
                }
                else
                {
                    yearmonth = my.Year.ToString() + my.Month.ToString();
                }

                if (notgood[notgood.Count() - 1] == "")
                {
                    for (int i = 0; i < notgood.Count() - 1; i++)
                    {
                        a5dot1Tab1.cjName                = cjname;
                        a5dot1Tab1.zzName                = item["Zz_Name"].ToString();
                        a5dot1Tab1.sbGyCode              = item["Equip_GyCode"].ToString();
                        a5dot1Tab1.sbCode                = item["Equip_Code"].ToString();
                        a5dot1Tab1.sbType                = item["Equip_Type"].ToString();
                        a5dot1Tab1.zyType                = item["Zy_Type"].ToString();
                        a5dot1Tab1.notGoodContent        = notgood[i];
                        a5dot1Tab1.isRectified           = 0;
                        a5dot1Tab1.zzSubmitTime          = DateTime.Now;
                        a5dot1Tab1.zzUserName            = Username;
                        a5dot1Tab1.yearMonthForStatistic = yearmonth;
                        if (item["wfe_id"].ToString() != "")
                        {
                            a5dot1Tab1.dataSource = item["wfe_id"].ToString();
                        }
                        if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站")
                        {
                            a5dot1Tab1.pqName = a5dot1Tab1.cjName;
                        }
                        else
                        {
                            a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString());
                        }
                        tm.Zzsubmit(a5dot1Tab1);
                    }
                }
                else
                {
                    for (int i = 0; i < notgood.Count(); i++)
                    {
                        a5dot1Tab1.cjName                = cjname;
                        a5dot1Tab1.zzName                = item["Zz_Name"].ToString();
                        a5dot1Tab1.sbGyCode              = item["Equip_GyCode"].ToString();
                        a5dot1Tab1.sbCode                = item["Equip_Code"].ToString();
                        a5dot1Tab1.sbType                = item["Equip_Type"].ToString();
                        a5dot1Tab1.zyType                = item["Zy_Type"].ToString();
                        a5dot1Tab1.notGoodContent        = notgood[i];
                        a5dot1Tab1.isRectified           = 0;
                        a5dot1Tab1.zzSubmitTime          = DateTime.Now;
                        a5dot1Tab1.zzUserName            = Username;
                        a5dot1Tab1.yearMonthForStatistic = yearmonth;
                        if (item["wfe_id"].ToString() != "")
                        {
                            a5dot1Tab1.dataSource = item["wfe_id"].ToString();
                        }
                        if (a5dot1Tab1.cjName == "消防队" || a5dot1Tab1.cjName == "计量站")
                        {
                            a5dot1Tab1.pqName = a5dot1Tab1.cjName;
                        }
                        else
                        {
                            a5dot1Tab1.pqName = pm.Get_PqnamebyCjname(a5dot1Tab1.cjName.ToString());
                        }
                        tm.Zzsubmit(a5dot1Tab1);
                    }
                }



                string wfe_id = item["wfe_id"].ToString();
                //paras
                Dictionary <string, string> signal = new Dictionary <string, string>();
                signal["ZzSubmit_done"] = "true";

                //record
                Dictionary <string, string> record = new Dictionary <string, string>();
                record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                record["time"]     = DateTime.Now.ToString();
                //submit
                CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record);
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A5dot1/Index");
        }
Beispiel #6
0
        //设置临时任务
        public string LSJob_Submit(string json1)
        {
            JObject item         = (JObject)JsonConvert.DeserializeObject(json1);
            string  WorkFlowName = item["Work_Name"].ToString();
            // WorkFlows ws = new WorkFlows();
            int    workflow_id = wfs.GetWorkFlowDefine(WorkFlowName).W_ID;
            string cj_ids      = item["Cj_Name"].ToString();
            string Zz_ids      = item["Zz_Name"].ToString();

            string[]       cjids      = cj_ids.Split(new char[] { ',' });
            string[]       zzids      = Zz_ids.Split(new char[] { ',' });
            string         Depts      = item["Dept"].ToString();
            string         qr_endtime = item["ZhengGaiTime"].ToString();
            CTimerCreateWF m          = new CTimerCreateWF();

            //使用lambda表达式过滤掉空字符串
            zzids = zzids.Where(t => !string.IsNullOrEmpty(t)).ToArray();

            //这里需要创建一个回调函数
            string TempJobName = item["Job_Name"].ToString();

            string corn            = "0 0 0 * * ?";
            string ReservationTime = item["ReservationTime"].ToString();


            m.Set_Res_Value("STR_RES_1", Depts);

            string[] s = ReservationTime.Split(new char[] { '-' });

            string[] ss      = s[0].Split(new char[] { '/' });
            string   endtime = s[1].Replace(" ", "");
            DateTime Endtime = DateTime.Parse(endtime);

            m.Set_Res_Value("STR_RES_2", Endtime);
            //11.12改
            if (qr_endtime != "")
            {
                m.Set_Res_Value("STR_RES_3", DateTime.Parse(qr_endtime));
            }

            corn = "0 0 0 " + ss[2] + "" + ss[1] + " " + "? " + ss[0];

            //未写
            if (WorkFlowName == "A6dot2")
            {
                for (int i = 0; i < cjids.Count(); i++)
                {
                    TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                    Dictionary <string, string> param  = new Dictionary <string, string>();
                    Dictionary <string, string> record = new Dictionary <string, string>();
                    param.Add("Cj_Name", Em.getEa_namebyId(Convert.ToInt16(cjids[i])));
                    record.Add("username", "system_temporary");
                    record.Add("time", DateTime.Now.ToString());
                    TCP.wf_params = param;
                    TCP.wf_record = record;
                    m.AppendCreateParam(TCP);

                    TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                    time_set.Time_start  = "wf_create";
                    time_set.Exact_time  = Endtime.ToString();
                    time_set.Offset_time = "";
                    time_set.Action      = "SUSPEND";
                    time_set.Call_back   = "";
                    TCP.AppendTimer("Xc_Sample", time_set);
                }
            }
            else if (WorkFlowName == "A5dot1")
            {
                for (int i = 0; i < zzids.Count(); i++)
                {
                    TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                    Dictionary <string, string> param  = new Dictionary <string, string>();
                    Dictionary <string, string> record = new Dictionary <string, string>();
                    param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                    record.Add("username", "system_temporary");
                    record.Add("time", DateTime.Now.ToString());
                    TCP.wf_params = param;
                    TCP.wf_record = record;
                    m.AppendCreateParam(TCP);

                    TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                    time_set.Time_start  = "wf_create";
                    time_set.Exact_time  = Endtime.ToString();
                    time_set.Offset_time = "";
                    time_set.Action      = "SUSPEND";
                    time_set.Call_back   = "";
                    TCP.AppendTimer("ZzSubmit", time_set);
                }
            }
            else if (WorkFlowName == "A11dot2dot1")
            {
                for (int i = 0; i < zzids.Count(); i++)
                {
                    TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                    Dictionary <string, string> param  = new Dictionary <string, string>();
                    Dictionary <string, string> record = new Dictionary <string, string>();
                    param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                    record.Add("username", "system_temporary");
                    record.Add("time", DateTime.Now.ToString());
                    TCP.wf_params = param;
                    TCP.wf_record = record;
                    m.AppendCreateParam(TCP);

                    TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                    time_set.Time_start  = "wf_create";
                    time_set.Exact_time  = Endtime.ToString();
                    time_set.Offset_time = "";
                    time_set.Action      = "SUSPEND";
                    time_set.Call_back   = "";
                    TCP.AppendTimer("ZzSubmit", time_set);
                }
            }
            else if (WorkFlowName == "A6dot2dot2")
            {
                for (int i = 0; i < cjids.Count(); i++)
                {
                    TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                    Dictionary <string, string> param  = new Dictionary <string, string>();
                    Dictionary <string, string> record = new Dictionary <string, string>();
                    param.Add("Cj_Name", cjids[i]);
                    param.Add("Job_Name", TempJobName);
                    param.Add("Job_Ztdanwei", Depts);
                    record.Add("username", "system_temporary");
                    record.Add("time", DateTime.Now.ToString());
                    TCP.wf_params = param;
                    TCP.wf_record = record;
                    m.AppendCreateParam(TCP);

                    TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                    time_set.Time_start  = "wf_create";
                    time_set.Exact_time  = Endtime.ToString();
                    time_set.Offset_time = "";
                    time_set.Action      = "SUSPEND";
                    time_set.Call_back   = "";
                    TCP.AppendTimer("ZzSubmit", time_set);
                }
            }
            else if (WorkFlowName == "A5dot2dot1")
            {
                for (int i = 0; i < zzids.Count(); i++)
                {
                    TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                    Dictionary <string, string> param  = new Dictionary <string, string>();
                    Dictionary <string, string> record = new Dictionary <string, string>();
                    param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                    record.Add("username", "system_temporary");
                    record.Add("time", DateTime.Now.ToString());
                    TCP.wf_params = param;
                    TCP.wf_record = record;
                    m.AppendCreateParam(TCP);

                    TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                    time_set.Time_start  = "wf_create";
                    time_set.Exact_time  = Endtime.ToString();
                    time_set.Offset_time = "";
                    time_set.Action      = "SUSPEND";
                    time_set.Call_back   = "";
                    TCP.AppendTimer("ZzSubmit", time_set);
                }
            }

            m.for_using  = TIMER_USING.FOR_CUSTOM;
            m.CreateTime = DateTime.Now;
            m.SetTriggerTiming(corn);
            m.mission_name = item["Job_Name"].ToString();
            m.status       = TM_STATUS.TM_STATUS_ACTIVE;
            //m.CreateCallback = "/zxhtest/QxFunction?depts="+Depts+"";//和权限有关的回调函数
            m.CustomFlag = 1;

            WorkFlow_Define wfd = wfs.GetWorkFlowDefineByID(workflow_id);

            m.attachTarget(wfd);
            m.GetAttachWorkFlow();//0910
            m.Save();

            CTimerManage.ActiveListActionForMission(m);
            return("/TempJob/index");
        }
Beispiel #7
0
        public string ZzSubmit_Bcsignal(string json1)
        {
            try
            {
                JObject item = (JObject)JsonConvert.DeserializeObject(json1);

                CTimerTimeout timeout_job = new CTimerTimeout();
                timeout_job.CreateTime   = DateTime.Now;
                timeout_job.for_using    = TIMER_USING.FOR_SYSTEM;
                timeout_job.mission_name = "";
                timeout_job.status       = TM_STATUS.TM_STATUS_ACTIVE;
                timeout_job.SetActionForWF("INVILID");
                timeout_job.AttachWFEntityID = Convert.ToInt32(item["wfe_id"]);
                timeout_job.CustomAction     = "http://localhost/CallBack/testCallBack";
                timeout_job.EventName        = "PqAessess";
                timeout_job.SetTriggerTiming("0 0 0 20 * ?");
                //保存该定时任务,并将其添加到激活任务列表
                timeout_job.Save();
                int m_timerMissionID = timeout_job.ID;
                CTimerManage.AppendMissionToActiveList(timeout_job);


                //  A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1();
                DateTime my     = DateTime.Now;
                int      cjid   = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"]));
                string   cjname = Eam.getEa_namebyId(cjid);

                A5dot2Tab1 new_5dot2 = new A5dot2Tab1();
                new_5dot2.cjName             = cjname;
                new_5dot2.zzName             = item["Zz_Name"].ToString();
                new_5dot2.sbGyCode           = item["Equip_GyCode"].ToString();
                new_5dot2.sbCode             = item["Equip_Code"].ToString();
                new_5dot2.sbType             = item["Equip_Type"].ToString();
                new_5dot2.zyType             = item["Zy_Type"].ToString();
                new_5dot2.problemDescription = item["problemDescription"].ToString();
                new_5dot2.jxSubmitTime       = DateTime.Now;
                new_5dot2.jxUserName         = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                new_5dot2.isRectified        = 0;
                new_5dot2.state = 0;
                new_5dot2.temp2 = item["wfe_id"].ToString();
                new_5dot2.temp3 = m_timerMissionID.ToString();
                bool res = Sx.AddSxItem(new_5dot2);

                string wfe_id = item["wfe_id"].ToString();
                //paras
                Dictionary <string, string> signal = new Dictionary <string, string>();
                signal["ZzSubmit_done"] = "true";

                //record
                Dictionary <string, string> record = new Dictionary <string, string>();
                record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                record["time"]     = DateTime.Now.ToString();
                //submit
                CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record);
            }
            catch (Exception e)
            {
                return("");
            }
            return("/A5dot2/Index");
        }
Beispiel #8
0
        public string DSJob_Submit(string json1)
        {
            JObject item         = (JObject)JsonConvert.DeserializeObject(json1);
            string  WorkFlowName = item["Work_Name"].ToString();
            // WorkFlows ws = new WorkFlows();
            int  workflow_id           = wfs.GetWorkFlowDefine(WorkFlowName).W_ID;
            Jobs job                   = new Jobs();
            List <Timer_Jobs> job_list = job.GetDSbyWorkflow(workflow_id);

            if (job_list.Count == 0)
            {
                string         cj_ids = item["Cj_Name"].ToString();
                string         Zz_ids = item["Zz_Name"].ToString();
                string[]       cjids  = cj_ids.Split(new char[] { ',' });
                string[]       zzids  = Zz_ids.Split(new char[] { ',' });
                CTimerCreateWF m      = new CTimerCreateWF();
                //这里需要创建一个回调函数
                string DingShiJobName = item["Job_Name"].ToString();

                //使用lambda表达式过滤掉空字符串
                zzids = zzids.Where(s => !string.IsNullOrEmpty(s)).ToArray();
                //未写
                if (WorkFlowName == "A6dot2")
                {
                    for (int i = 0; i < cjids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Cj_Name", Em.getEa_namebyId(Convert.ToInt16(cjids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        //time_set.Offset_time = (DateTime.Now.AddMinutes(3) - DateTime.Now).ToString();
                        time_set.Action    = "INVILID";
                        time_set.Call_back = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("Xc_Sample", time_set);
                    }
                }
                if (WorkFlowName == "A15dot1")
                {
                    List <string> pq_list = new List <string>();
                    pq_list.Add("联合一片区");
                    pq_list.Add("联合二片区");
                    pq_list.Add("联合三片区");
                    pq_list.Add("联合四片区");
                    pq_list.Add("化工片区");
                    pq_list.Add("综合片区");
                    pq_list.Add("其他");
                    //pq_list.Add("检修单位");
                    for (int i = 0; i < pq_list.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Pqname", pq_list[i]);
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);


                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(1) - DateTime.Now).ToString();
                        //time_set.Offset_time = (DateTime.Now.AddMinutes(3) - DateTime.Now).ToString();
                        time_set.Action    = "INVILID";
                        time_set.Call_back = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                else if (WorkFlowName == "A5dot1dot2")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        //time_set.Offset_time = (DateTime.Now.AddMinutes(3) - DateTime.Now).ToString();
                        time_set.Action    = "INVILID";
                        time_set.Call_back = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                else if (WorkFlowName == "A5dot2dot2")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        //time_set.Offset_time = (DateTime.Now.AddMinutes(3) - DateTime.Now).ToString();
                        time_set.Action    = "INVILID";
                        time_set.Call_back = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                else if (WorkFlowName == "A11dot2dot2")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        //time_set.Offset_time = (DateTime.Now.AddMinutes(3) - DateTime.Now).ToString();
                        time_set.Action    = "INVILID";
                        time_set.Call_back = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                if (WorkFlowName == "A12dot2dot1")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        time_set.Action      = "INVILID";
                        time_set.Call_back   = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                else if (WorkFlowName == "A6dot3")
                {
                    for (int i = 0; i < cjids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(1) - DateTime.Now).ToString();
                        time_set.Action      = "INVILID";
                        time_set.Call_back   = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("Ineligible_Submit", time_set);
                    }
                }
                else if (WorkFlowName == "A7dot1dot1")
                {
                    List <Equip_Info> Th_sb = new List <Equip_Info>();
                    EquipManagment    Epm   = new EquipManagment();
                    Th_sb = Epm.getAllThEquips();
                    for (int i = 0; i < Th_sb.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Equip_GyCode", Th_sb[i].Equip_GyCode);
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(1) - DateTime.Now).ToString();
                        time_set.Action      = "INVILID";
                        time_set.Call_back   = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }
                else if (WorkFlowName == "A14dot2")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Action      = "INVILID";
                        time_set.Call_back   = "http://localhost/CallBack/testCallBack";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        TCP.AppendTimer("JxdwSubmit", time_set);
                        //TCP.AppendTimer("ZzConfirm", time_set);
                    }
                }
                else if (WorkFlowName == "A14dot3dot2")
                {
                    for (int i = 0; i < zzids.Count(); i++)
                    {
                        TimerCreateWFPa             TCP    = new TimerCreateWFPa();//
                        Dictionary <string, string> param  = new Dictionary <string, string>();
                        Dictionary <string, string> record = new Dictionary <string, string>();
                        param.Add("Zz_Name", Em.getEa_namebyId(Convert.ToInt16(zzids[i])));
                        record.Add("username", "system_scheduled");
                        record.Add("time", DateTime.Now.ToString());
                        TCP.wf_params = param;
                        TCP.wf_record = record;
                        m.AppendCreateParam(TCP);

                        TimerCreateWFPa.TimerSetting time_set = new TimerCreateWFPa.TimerSetting();
                        time_set.Time_start  = "wf_create";
                        time_set.Exact_time  = "";
                        time_set.Offset_time = (DateTime.Now.AddDays(5) - DateTime.Now).ToString();
                        time_set.Action      = "SUSPEND";
                        time_set.Call_back   = "http://localhost/CallBack/testCallBack";
                        TCP.AppendTimer("ZzSubmit", time_set);
                    }
                }



                string corn            = "0 0 0 * * ?";
                string corn_express    = item["corn_express"].ToString();
                string ReservationTime = item["reservationtime"].ToString();
                m.Set_Res_Value("STR_RES_2", ReservationTime);
                corn         = corn_express;
                m.for_using  = TIMER_USING.FOR_CUSTOM;
                m.CreateTime = DateTime.Now;
                m.SetTriggerTiming(corn);
                m.mission_name = item["Job_Name"].ToString();
                m.status       = TM_STATUS.TM_STATUS_ACTIVE;
                //m.CreateCallback = "/zxhtest/QxFunction?depts="+Depts+"";//和权限有关的回调函数
                m.CustomFlag = 0;

                WorkFlow_Define wfd = wfs.GetWorkFlowDefineByID(workflow_id);

                m.attachTarget(wfd);
                m.GetAttachWorkFlow();//0910
                m.Save();

                CTimerManage.ActiveListActionForMission(m);
                return("成功发起定时任务");
            }
            else
            {
                return("该工作流已经提报过,请删除后再发起");
            }
        }