Ejemplo n.º 1
0
        public HttpResponseMessage SpecialTaskEnd()
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            WorkFlowManagerBLL  bll     = new WorkFlowManagerBLL();
            zxzz_tasks          ztmodel = new zxzz_tasks();
            WorkFlowClass       wf      = new WorkFlowClass();
            Zxzz_SpecialTaskBLL zpbll   = new Zxzz_SpecialTaskBLL();

            #region 专项整治流程
            wf.FunctionName   = "zxzz_tasks";
            wf.WFID           = "2017041214100001";
            wf.WFDID          = request["wfdid"];
            wf.NextWFDID      = "2017041214200004";
            wf.NextWFUSERIDS  = zpbll.AddSummarizeXZXKK();
            wf.WFSAID         = request["wfsaid"];
            wf.WFSID          = request["wfsid"];
            wf.DEALCONTENT    = "";
            wf.IsSendMsg      = "false";
            wf.WFCreateUserID = Convert.ToInt32(request["userid"]);
            #endregion

            string wf_data = bll.WF_Submit(wf, ztmodel);

            //结束所有wfsu用户的未处理
            zpbll.OverAllWFSU(wf.WFSAID, wf_data.Split(',')[1], (int)wf.WFCreateUserID);

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true,\"wfsaid\":\"" + wf_data.Split(',')[1] + "\"}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage SpecialTaskSummarize(Zxzz_TaskModel model)
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            WorkFlowManagerBLL  bll     = new WorkFlowManagerBLL();
            zxzz_tasks          ztmodel = new zxzz_tasks();
            WorkFlowClass       wf      = new WorkFlowClass();
            List <FileClass>    list    = new List <FileClass>();
            Zxzz_SpecialTaskBLL ztbll   = new Zxzz_SpecialTaskBLL();

            string[] fileClass = model.uploadpanelValue;

            ztmodel.summarytime   = model.summarytime;
            ztmodel.summaryuserid = model.summaryuserid;
            ztmodel.summary       = model.summary;
            ztmodel.results       = model.results;
            ztmodel.experiences   = model.experiences;

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass infileClass = new FileClass();
                    JObject   jo          = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(infileClass);
                }
            }

            #region 专项整治流程
            wf.FunctionName   = "zxzz_tasks";
            wf.WFID           = "2017041214100001";
            wf.WFDID          = "2017041214200004";
            wf.NextWFDID      = "2017041214200005";
            wf.NextWFUSERIDS  = ztbll.GetUseridsByUnitids(model.xdzd);
            wf.WFSAID         = model.wfsaid;
            wf.WFSID          = model.wfsid;
            wf.IsSendMsg      = "false";
            wf.WFCreateUserID = model.summaryuserid;
            wf.files          = list;
            #endregion

            bll.WF_Submit(wf, ztmodel);
            //结束总结所有wfsu用户的未处理
            ztbll.EndAllWFSU(wf.WFSAID);

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 3
0
        public int SmassignTeam(Audit_project_wModel model, List <FileClass> list)
        {
            int            userid = Convert.ToInt32(model.createuserid);
            approvalDetail result = bll.GetApprovalDetail(model.syncrowguid);

            string[]      wfdidlist = { "2017070414250001", "2017070414250002", "2017070414250003", "2017070414250004", "2017070414250005" };
            WorkFlowClass wf        = new WorkFlowClass();

            wf.FunctionName = "audit_project_w";  //行政审批表名
            wf.WFID         = "2017070414220001"; //工作流程编号
            wf.WFDID        = model.wfdid;        //工作详细编号
            if (result != null)
            {
                wf.WFSID  = result.wfsid;
                wf.WFSAID = result.wfsaid;
            }
            wf.NextWFDID      = model.nextwfdid;             //下一步流程详细编号
            wf.NextWFUSERIDS  = model.nextuserid.ToString(); //下一步流程用户id
            wf.IsSendMsg      = "false";                     //是否发送短信
            wf.WFCreateUserID = model.createuserid;          //当前流程创建人
            wf.DEALCONTENT    = model.advice;                //处理意见
            wf.syncrowguid    = model.syncrowguid;
            wf.Remark         = model.geography;
            wf.files          = list;
            if (wf.WFDID == wfdidlist[0])
            {
                wf.Remark       = model.xzxkaddress;
                wf.satisfaction = model.xzxkstarttime;
                wf.processmode  = model.xzxkendtime;
            }
            else if (wf.WFDID == wfdidlist[2])
            {
                wf.Remark = model.geography;
            }
            WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
            string             wf_id = wfbll.WF_Submit(wf, model);

            #region 发送短信
            int success = wf_id != null ? 1 : 0;
            if (wf.NextWFUSERIDS != null && model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
            {
                UserBLL userbll = new UserBLL();
                string  phone   = model.phone;
                //phone="18768196242";
                string[]       numbers = phone.Split(',');
                string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                smsbll.SendMessage(numbers, msg);
            }
            #endregion
            return(success);
        }
Ejemplo n.º 4
0
        public HttpResponseMessage SpecialTaskFiring(Zxzz_TaskModel model)
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            WorkFlowManagerBLL  bll   = new WorkFlowManagerBLL();
            WorkFlowClass       wf    = new WorkFlowClass();
            List <FileClass>    list  = new List <FileClass>();
            Zxzz_SpecialTaskBLL zpbll = new Zxzz_SpecialTaskBLL();

            string[] fileClass = model.uploadpanelValue;

            zxzz_tasks ztmodel = new zxzz_tasks();

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass infileClass = new FileClass();
                    JObject   jo          = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(infileClass);
                }
            }

            #region 专项整治流程
            wf.FunctionName   = "zxzz_tasks";
            wf.WFID           = "2017041214100001";
            wf.WFDID          = model.wfdid;
            wf.NextWFDID      = model.nextwfdid;
            wf.processmode    = model.nextwfdid;
            wf.NextWFUSERIDS  = zpbll.GetUseridsByUnitids(model.xdzd);
            wf.WFSAID         = model.wfsaid;
            wf.WFSID          = model.wfsid;
            wf.DEALCONTENT    = model.dealcontent;
            wf.IsSendMsg      = "false";
            wf.WFCreateUserID = model.createuserid;
            wf.files          = list;
            #endregion

            string wf_data = bll.WF_Submit(wf, ztmodel);
            //初始化WFSU
            zpbll.ReloadWFSU(wf_data.Split(',')[1]);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 5
0
        //行动中队回复
        public void WF_Reply(WorkFlowClass workflow)
        {
            WorkFlowManagerDAL wfdal  = new WorkFlowManagerDAL();
            string             WFSUID = wfdal.function_WF_DealCurentActivityUser(workflow.WFSAID, workflow.WFCreateUserID.Value, workflow.DEALCONTENT, 2, DateTime.Now, "false", "", workflow.WFCreateUserID.Value, "", "", "");

            //WFSUID为空时是回复,有值时是编辑回复
            if (string.IsNullOrEmpty(workflow.WFSUID))
            {
                wfdal.function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, null);
            }
            else
            {
                wfdal.function_WF_WorkFlowAttrach_smsj(workflow.WFSUID, workflow.files, null);
            }
        }
Ejemplo n.º 6
0
        public object AddYhTaskApi(YH_YhtaskModel model)
        {
            #region 图片处理
            List <FileClass> List_FC    = new List <FileClass>();
            string           OriginPath = ConfigManageClass.YhTaskOriginalPath;
            string           smallPath  = ConfigManageClass.YhTaskFilesPath;

            for (int i = 0; i < model.uploadpanelValue.Length; i++)
            {
                string   imgArray = model.uploadpanelValue[i];
                string[] spilt    = imgArray.Split(',');
                if (spilt.Length > 0)
                {
                    byte[]    imgByte = Convert.FromBase64String(spilt[1]);
                    FileClass imgFile = FileFactory.FileUpload(imgByte, ".jpg", OriginPath, smallPath, 100, 100);
                    List_FC.Add(imgFile);
                }
            }

            #endregion

            yh_yhtasks yhmodel = new yh_yhtasks();
            yhmodel.yhcompany    = model.yhcompany;
            yhmodel.foundtime    = model.foundtime;
            yhmodel.fileename    = model.fileename;
            yhmodel.wtsource     = model.wtsource;
            yhmodel.yhtype       = model.yhtype;
            yhmodel.wtbigclass   = model.wtbigclass;
            yhmodel.wtsmallclass = model.wtsmallclass;
            yhmodel.yhobject     = model.yhobject;
            yhmodel.weather      = model.weather;
            yhmodel.duetime      = model.duetime;
            yhmodel.outlay       = model.outlay;
            yhmodel.workload     = model.workload;
            yhmodel.yhcontract   = model.yhcontract;
            yhmodel.wtaddress    = model.wtaddress;
            yhmodel.wtdescribe   = model.wtdescribe;
            yhmodel.geography84  = model.geography84;
            yhmodel.wtnature     = model.wtnature;
            yhmodel.points       = model.points;
            yhmodel.debit        = model.debit;
            yhmodel.sendusername = model.sendusername;
            yhmodel.sendopinion  = model.sendopinion;
            yhmodel.createuserid = model.createuserid;
            WorkFlowClass wf = new WorkFlowClass();

            wf.FunctionName   = "yh_yhtasks";                  //市民事件表名
            wf.WFID           = "2017040610490001";            //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = "2017040610570001";            //工作流详细编号 2017021410240001 上报事件
            wf.NextWFDID      = "2017040610570003";            //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = model.createuserid.ToString(); //下一步流程ID
            wf.IsSendMsg      = "false";                       //是否发送短信
            wf.WFCreateUserID = model.createuserid;            //当前流程创建人
            wf.files          = List_FC;

            try
            {
                WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
                string             wf_id = wfbll.WF_Submit(wf, yhmodel);
                return(new
                {
                    msg = "上报成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
                // return "{\"msg\":\"json数据不正确\",\"resCode\":\"0\"}";
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 流程提交
 /// </summary>
 /// <param name="workflow">流程实例模型</param>
 /// <param name="TableModel">具体表模型</param>
 /// <returns></returns>
 public string WF_Submit(WorkFlowClass workflow, object TableModel)
 {
     return(dal.WF_Submit(workflow, TableModel));
 }
Ejemplo n.º 8
0
        public object CizitenEventFlowLink(DealWithLinkModel scmodel)
        {
            try
            {
                sm_citizenservices model   = new sm_citizenservices();
                UserBLL            userbll = new UserBLL();
                #region 图片处理
                List <FileClass> List_FC    = new List <FileClass>();
                string           OriginPath = ConfigManageClass.CitizenServiceOriginalPath;
                string           smallPath  = ConfigManageClass.CitizenServiceFilesPath;


                if (scmodel.photo1 != null && scmodel.photo1.Length != 0)
                {
                    string[] spilt = scmodel.photo1.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo2 != null && scmodel.photo2.Length != 0)
                {
                    string[] spilt = scmodel.photo2.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo3 != null && scmodel.photo3.Length != 0)
                {
                    string[] spilt = scmodel.photo3.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo4 != null && scmodel.photo4.Length != 0)
                {
                    string[] spilt = scmodel.photo4.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                #endregion

                model.processmode   = scmodel.processmode;
                model.satisfaction  = scmodel.satisfaction;
                model.processuserid = scmodel.processuserid;
                if (scmodel.nextwfdid == "2017021410240006")
                {
                    model.gdsj = DateTime.Now;
                }
                if (scmodel.wfdid == "2017021410240001")
                {
                    model.officeuserid = scmodel.wfcreateuserid;
                    model.workflowtype = scmodel.nextwfdid;
                    model.suggest      = scmodel.dealcontent;
                }
                WorkFlowManagerBLL bll        = new WorkFlowManagerBLL();
                string             nextperson = scmodel.nextwfuserids;
                if (nextperson == "0")
                {
                    WF_WorkFlowLinkOld oldmodel = bll.GetOldLink(scmodel.wfsid, scmodel.nextwfdid);
                    if (oldmodel != null && scmodel.wfdid != "2017021410240008")
                    {
                        nextperson = oldmodel.dealuserid.ToString();
                    }
                }
                if (nextperson == "0")
                {
                    string userids = "";

                    //获取指挥中心人员id
                    foreach (UserModel item in userbll.GetUsersStaffList(2))
                    {
                        userids += item.ID + ",";
                    }
                    nextperson = "," + userids;
                }



                WorkFlowClass wf = new WorkFlowClass();

                #region 事件流程
                wf.FunctionName   = "sm_citizenservices"; //市民事件表名
                wf.WFID           = "2017021409560001";   //工作流程编号 2017021409560001 事件流程
                wf.WFDID          = scmodel.wfdid;        //工作流详细编号 2017021410240003 事件处理
                wf.NextWFDID      = scmodel.nextwfdid;    //下一步流程编号 2017021410240004 中队长审核
                wf.NextWFUSERIDS  = nextperson;           //下一步流程用户ID
                wf.WFSAID         = scmodel.wfsaid;
                wf.WFSID          = scmodel.wfsid;
                wf.DEALCONTENT    = scmodel.dealcontent;
                wf.IsSendMsg      = "false";                //是否发送短信
                wf.WFCreateUserID = scmodel.wfcreateuserid; //当前流程创建人
                wf.files          = List_FC;
                #endregion

                bll.WF_Submit(wf, model);


                //#region 发送短信
                //if (scmodel.isSendMsg == "1" && !string.IsNullOrEmpty(wf.NextWFUSERIDS))
                //{
                //    string phone = userbll.GetPhones(wf.NextWFUSERIDS);//15888309757,18768196242
                //    string[] phones = phone.Split(',');
                //    string content = "您有一条新的市民事件需要处理,限办期限:" + scmodel.limittime + ",请及时处理";
                //    SMSMessagesBLL smsbll = new SMSMessagesBLL();
                //    smsbll.SendMessage(phones, content);
                //}
                //#endregion
                return(new
                {
                    msg = "提交成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
            }
        }
Ejemplo n.º 9
0
        public object AddCitizenService(AddCitizenEventModel scmodel)
        {
            try
            {
                SM_CitizenServicesBLL scbll = new SM_CitizenServicesBLL();
                WorkFlowClass         wf    = new WorkFlowClass();
                UserBLL            userbll  = new UserBLL();
                sm_citizenservices model    = new sm_citizenservices();
                string             userids  = "";

                //获取指挥中心人员id
                foreach (UserModel item in userbll.GetUsersStaffList(2))
                {
                    userids += item.ID + ",";
                }
                userids = "," + userids;

                #region 图片处理
                List <FileClass> List_FC    = new List <FileClass>();
                string           OriginPath = ConfigManageClass.CitizenServiceOriginalPath;
                string           smallPath  = ConfigManageClass.CitizenServiceFilesPath;


                if (scmodel.photo1 != null && scmodel.photo1.Length != 0)
                {
                    string[] spilt = scmodel.photo1.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo2 != null && scmodel.photo2.Length != 0)
                {
                    string[] spilt = scmodel.photo2.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo3 != null && scmodel.photo3.Length != 0)
                {
                    string[] spilt = scmodel.photo3.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                if (scmodel.photo4 != null && scmodel.photo4.Length != 0)
                {
                    string[] spilt = scmodel.photo4.Split(',');
                    if (spilt.Length > 1)
                    {
                        byte[]    myByte = Convert.FromBase64String(spilt[1]);
                        FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                        List_FC.Add(FC);
                    }
                }
                #endregion

                #region 事件流程
                if (scmodel.processingType == 1)
                {
                    wf.FunctionName   = "sm_citizenservices";            //市民事件表名
                    wf.WFID           = "2017021409560001";              //工作流程编号 2017021409560001 事件流程
                    wf.WFDID          = "2017021410240010";              //工作流详细编号 2017021410240001 上报事件
                    wf.NextWFDID      = "2017021410240003";              //下一步流程编号 2017021410240002 事件派遣
                    wf.NextWFUSERIDS  = scmodel.createuserid.ToString(); //下一步流程ID
                    wf.IsSendMsg      = "false";                         //是否发送短信
                    wf.WFCreateUserID = scmodel.createuserid;            //当前流程创建人
                    wf.files          = List_FC;
                }
                else
                {
                    wf.FunctionName   = "sm_citizenservices"; //市民事件表名
                    wf.WFID           = "2017021409560001";   //工作流程编号 2017021409560001 事件流程
                    wf.WFDID          = "2017021410240010";   //工作流详细编号 2017021410240001 上报事件
                    wf.NextWFDID      = "2017021410240001";   //下一步流程编号 2017021410240002 事件派遣
                    wf.NextWFUSERIDS  = userids;              //下一步流程ID
                    wf.IsSendMsg      = "false";              //是否发送短信
                    wf.WFCreateUserID = scmodel.createuserid; //当前流程创建人
                    wf.files          = List_FC;
                }
                #endregion
                string id = (scbll.GetCitizenAutoID()["AutoXCFXDayID"] + 1).ToString();
                if (id.Length == 1)
                {
                    id = "00" + id;
                }
                else if (id.Length == 2)
                {
                    id = "0" + id;
                }
                model.dutytime       = scmodel.dutytime;
                model.eventid        = "巡查发现" + DateTime.Now.ToString("yyyyMMdd") + id; //scmodel.eventid;
                model.sourceid       = scmodel.sourceid;
                model.complainant    = scmodel.complainant;
                model.cnumber        = scmodel.cnumber;
                model.foundtime      = scmodel.foundtime;
                model.contactphone   = scmodel.contactphone;
                model.contactaddress = scmodel.contactaddress;
                model.eventaddress   = scmodel.eventaddress;
                model.eventtitle     = scmodel.eventtitle;
                model.eventcontent   = scmodel.eventcontent;
                model.bigtypeid      = scmodel.bigtypeid;
                model.smalltypeid    = scmodel.smalltypeid;
                model.limittime      = scmodel.limittime;
                model.recorduser     = scmodel.recorduser;
                model.grometry       = scmodel.grometry;
                model.sfzxzz         = scmodel.sfzxzz;
                model.srid           = scmodel.srid;
                model.createtime     = DateTime.Now;
                model.createuserid   = scmodel.createuserid;
                WorkFlowManagerBLL bll   = new WorkFlowManagerBLL();
                string             wf_id = bll.WF_Submit(wf, model);

                //#region 发送短信
                //if (scmodel.isSendMsg == "1")
                //{
                //    string phone = userbll.GetPhones(wf.NextWFUSERIDS);//15888309757,18768196242
                //    string[] phones = phone.Split(',');
                //    string content = "您有一条新的市民事件需要处理,限办期限:" + scmodel.limittime + ",请及时处理";
                //    SMSMessagesBLL smsbll = new SMSMessagesBLL();
                //    smsbll.SendMessage(phones, content);
                //}
                //#endregion
                //return "{\"msg\":\"上报成功!\",\"resCode\":\"1\"}";
                return(new
                {
                    msg = "上报成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
                // return "{\"msg\":\"json数据不正确\",\"resCode\":\"0\"}";
            }
        }
Ejemplo n.º 10
0
        public HttpResponseMessage AddCizitenEvent(RSM_CitizenModel cmmodel)
        {
            UserBLL         userbll = new UserBLL();
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;
            //文件上传
            HttpFileCollectionBase files = request.Files;
            sm_citizenservices     model = new sm_citizenservices();
            List <FileClass>       list  = new List <FileClass>();

            string[] fileClass = cmmodel.uploadpanelValue;

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass infileClass = new FileClass();
                    JObject   jo          = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(infileClass);
                }
            }

            if (!string.IsNullOrEmpty(request.Form["dutytime"]))
            {
                model.dutytime = Convert.ToDateTime(request.Form["dutytime"]);
            }
            model.eventid     = request.Form["eventid"];
            model.sourceid    = Convert.ToInt32(request.Form["sourceid"]);
            model.complainant = request.Form["complainant"];
            if (!string.IsNullOrEmpty(request.Form["cnumber"]))
            {
                model.cnumber = Convert.ToInt32(request.Form["cnumber"]);
            }
            if (!string.IsNullOrEmpty(request.Form["foundtime"]))
            {
                model.foundtime = Convert.ToDateTime(request.Form["foundtime"]);
            }
            model.contactphone   = request.Form["contactphone"];
            model.contactaddress = request.Form["contactaddress"];
            model.eventaddress   = request.Form["eventaddress"];
            model.eventtitle     = request.Form["eventtitle"];
            model.eventcontent   = request.Form["eventcontent"];
            model.bigtypeid      = Convert.ToInt32(request.Form["bigtypeid"]);
            model.smalltypeid    = Convert.ToInt32(request.Form["smalltypeid"]);
            if (!string.IsNullOrEmpty(request.Form["limittime"]))
            {
                model.limittime = Convert.ToDateTime(request.Form["limittime"]);
            }
            model.recorduser = request.Form["recorduser"];
            model.grometry   = request.Form["grometry"];
            model.sfzxzz     = Convert.ToInt32(request.Form["sfzxzz"]);
            if (!string.IsNullOrEmpty(request.Form["srid"]))
            {
                model.srid = Convert.ToInt32(request.Form["srid"]);
            }
            model.createtime   = DateTime.Now;
            model.createuserid = Convert.ToInt32(request.Form["userid"]);
            model.workflowtype = request.Form["zptype"];
            model.suggest      = request.Form["suggest"];
            model.officeuserid = Convert.ToInt32(request.Form["userid"]);
            if (!string.IsNullOrEmpty(request.Form["xzid"]))
            {
                model.xzid   = Convert.ToInt32(request.Form["xzid"]);
                model.pqxzid = request.Form["xzid"];
            }
            WorkFlowClass wf      = new WorkFlowClass();
            WorkFlowClass wfs     = new WorkFlowClass();
            string        userids = request.Form["userid"];

            if (!string.IsNullOrEmpty(userids))
            {
                string useridsstr = "";
                foreach (UserModel item in userbll.GetUsersStaffList(2))
                {
                    useridsstr += item.ID + ",";
                }
                userids = "," + useridsstr;
            }


            #region 事件流程
            wf.FunctionName   = "sm_citizenservices";                                                                //市民事件表名
            wf.WFID           = "2017021409560001";                                                                  //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = "2017021410240010";                                                                  //工作流详细编号 2017021410240001 上报事件
            wf.NextWFDID      = request.Form["zptype"];                                                              //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = request.Form["zptype"] == "2017021410240001" ? userids : request.Form["nextperson"]; //下一步流程ID
            wf.DEALCONTENT    = request.Form["suggest"];
            wf.IsSendMsg      = "false";                                                                             //是否发送短信
            wf.WFCreateUserID = Convert.ToInt32(request.Form["userid"]);                                             //当前流程创建人
            wf.files          = list;
            #endregion

            WorkFlowManagerBLL bll       = new WorkFlowManagerBLL();
            string             wf_id     = bll.WF_Submit(wf, model);
            string[]           wf_ids    = null;
            string             wfsid     = "";
            string             wfasid    = "";
            string             citizenid = "";
            if (!string.IsNullOrEmpty(wf_id))
            {
                wf_ids    = wf_id.Split(',');
                wfsid     = wf_ids[0];
                wfasid    = wf_ids[1];
                citizenid = wf_ids[2];
            }

            #region 违章建筑同步信息
            if (request.Form["sfwj"] == "1")
            {
                WJ_WzjzsBLL   wjbll   = new WJ_WzjzsBLL();
                WJ_WzjzsModel wjmodel = new WJ_WzjzsModel();
                WJ_FilesBLL   filebll = new WJ_FilesBLL();
                wjmodel.wjholder     = model.eventtitle;
                wjmodel.citizenid    = citizenid;
                wjmodel.foundtime    = model.foundtime;
                wjmodel.address      = model.eventaddress;
                wjmodel.contactphone = model.contactphone;

                int wjid = wjbll.AddWzjzs(wjmodel);
                wjmodel.parentid = wjid;
                int success = wjbll.AddWzjzs(wjmodel);

                foreach (var item in list)
                {
                    WJ_FilesModel wjfilemodel = new WJ_FilesModel();
                    wjfilemodel.filetype = item.OriginalType;
                    wjfilemodel.filename = item.OriginalName;
                    wjfilemodel.filepath = item.OriginalPath;
                    wjfilemodel.source   = 1;
                    wjfilemodel.sourceid = success;
                    wjfilemodel.filesize = item.size;
                    filebll.AddCqxm(wjfilemodel);

                    //复制文件
                    DateTime dt = DateTime.Now;
                    if (!Directory.Exists(ConfigManageClass.IllegallyBuiltOriginalPath))
                    {
                        Directory.CreateDirectory(ConfigManageClass.IllegallyBuiltOriginalPath);
                    }
                    string OriginalPathYear = ConfigManageClass.IllegallyBuiltOriginalPath + "\\" + dt.Year;
                    if (!Directory.Exists(OriginalPathYear))
                    {
                        Directory.CreateDirectory(OriginalPathYear);
                    }
                    string OriginalPathdate = OriginalPathYear + "\\" + dt.ToString("yyyyMMdd");
                    if (!Directory.Exists(OriginalPathdate))
                    {
                        Directory.CreateDirectory(OriginalPathdate);
                    }
                    File.Copy(ConfigManageClass.CitizenServiceOriginalPath + wjfilemodel.filepath, ConfigManageClass.IllegallyBuiltOriginalPath + wjfilemodel.filepath, true);
                }
            }
            #endregion

            #region 添加日志
            SystemLogBLL slbll = new SystemLogBLL();
            slbll.WriteSystemLog("市民事件", "", Convert.ToInt32(request.Form["userid"]));
            #endregion

            //#region 发送短信
            //string phone = "";//15888309757,18768196242
            //SMS_Messages sm = new SMS_Messages();
            //string[] phones = phone.Split(',');
            //string content = "您有一条新的市民事件需要处理,限办期限:" + model.limittime + ",请及时处理";
            //sm.SendMessage(phones, content);
            //#endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 11
0
        public HttpResponseMessage CizitenEventFlow(RSM_CitizenModel cmmodel)
        {
            HttpRequestBase    request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;
            sm_citizenservices model   = new sm_citizenservices();
            //文件上传
            HttpFileCollectionBase files = request.Files;

            List <FileClass> list = new List <FileClass>();

            string[] fileClass = cmmodel.uploadpanelValue;

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass infileClass = new FileClass();
                    JObject   jo          = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(infileClass);
                }
            }

            model.processmode  = request.Form["processmode"];
            model.satisfaction = request.Form["satisfaction"];
            if (!string.IsNullOrEmpty(request.Form["userid"]))
            {
                model.processuserid = Convert.ToInt32(request.Form["userid"]);
            }
            if (request.Form["nextwfdid"] == "2017021410240006" || request.Form["nextwfdid"] == "2017021410240009")
            {
                model.gdsj = DateTime.Now;
            }
            if (request.Form["wfdid"] == "2017021410240001" && !string.IsNullOrEmpty(request.Form["userid"]))
            {
                model.officeuserid = Convert.ToInt32(request.Form["userid"]);
                model.workflowtype = request.Form["nextwfdid"];
                model.suggest      = request.Form["suggest"];
            }
            WorkFlowManagerBLL wfbll      = new WorkFlowManagerBLL();
            string             nextperson = request.Form["nextperson"];

            if (request.Form["nextperson"] == "0")
            {
                WF_WorkFlowLinkOld oldmodel = wfbll.GetOldLink(request.Form["wfsid"], "2017021410240001");
                if (oldmodel != null)
                {
                    nextperson = oldmodel.dealuserid.ToString();
                }
            }
            if (nextperson == "0")
            {
                string  userids = "";
                UserBLL userbll = new UserBLL();
                //获取指挥中心人员id
                foreach (UserModel item in userbll.GetUsersStaffList(2))
                {
                    userids += item.ID + ",";
                }
                nextperson = "," + userids;
            }

            WorkFlowClass wf = new WorkFlowClass();

            #region 事件完成生成交办单
            if (request.Form["nextwfdid"] == "2017021410240006")
            {
                SM_CitizenServicesBLL       smbll         = new SM_CitizenServicesBLL();
                Case_CaseSourcesBLL         casesourcebll = new Case_CaseSourcesBLL();
                DocumentReplaceHandleBLL    drhbll        = new DocumentReplaceHandleBLL();
                SM_CitizenServicesModel     smmodel       = smbll.GetCitizenServiceModel(request["citizenid"]);
                Dictionary <string, string> dic           = casesourcebll.ToWordPDF("事件交办单", System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/市民事件交办单.docx"), ConfigManageClass.CitizenServiceOriginalPath, drhbll.GetDocumentDictory(smmodel));
                FileClass infileClass = new FileClass();
                infileClass.OriginalPath = dic["PDFPath"];
                infileClass.OriginalName = "事件交办单";
                infileClass.OriginalType = ".pdf";
                list.Add(infileClass);
            }
            #endregion

            #region 事件流程
            wf.FunctionName   = "sm_citizenservices";      //市民事件表名
            wf.WFID           = "2017021409560001";        //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = request.Form["wfdid"];     //工作流详细编号 2017021410240003 事件处理
            wf.NextWFDID      = request.Form["nextwfdid"]; //下一步流程编号 2017021410240004 中队长审核
            wf.NextWFUSERIDS  = nextperson;                //下一步流程ID
            wf.WFSAID         = request.Form["wfsaid"];
            wf.WFSID          = request.Form["wfsid"];
            wf.DEALCONTENT    = request.Form["suggest"];
            wf.IsSendMsg      = "false";                                 //是否发送短信
            wf.WFCreateUserID = Convert.ToInt32(request.Form["userid"]); //当前流程创建人
            wf.files          = list;
            #endregion

            WorkFlowManagerBLL bll = new WorkFlowManagerBLL();
            bll.WF_Submit(wf, model);

            //#region 发送短信
            //string phone = "";//15888309757,18768196242
            //SMS_Messages sm = new SMS_Messages();
            //string[] phones = phone.Split(',');
            //string content = "您有一条新的市民事件需要处理,限办期限:" + model.limittime + ",请及时处理";
            //sm.SendMessage(phones, content);
            //#endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 流程提交
        /// </summary>
        /// <param name="workflow">流程实例模型</param>
        /// <param name="TableModel">具体表模型</param>
        /// <returns></returns>
        public string WF_Submit(WorkFlowClass workflow, object TableModel)
        {
            #region 获取数据
            string tableName     = workflow.FunctionName;  //获取表名
            string WFID          = workflow.WFID;          //工作流编号
            string WFDID         = workflow.WFDID;         //工作流环节编号
            string WFSID         = workflow.WFSID;         //活动实例编号
            string WFSAID        = workflow.WFSAID;        //当前环节实例编号
            string dealContent   = workflow.DEALCONTENT;   //会签意见
            string NextWFDID     = workflow.NextWFDID;     //下一个环节编号
            string NextWFUSERIDS = workflow.NextWFUSERIDS; //获取下一个环节的用户
            string IsSendMsg     = workflow.IsSendMsg;     //是否发送短信
            string Remark        = workflow.Remark;
            string processmode   = workflow.processmode;
            string satisfaction  = workflow.satisfaction;
            #endregion

            #region 增加/修改 对应的流程
            string TABLENAMEID = string.Empty; //对应表数据编号
            string WFSNAME     = string.Empty; //活动流程名称
            switch (workflow.FunctionName)
            {
            case "sm_citizenservices":    //市民服务基础表
                TABLENAMEID = function_citizenservices(out WFSNAME, workflow.WFSID, (sm_citizenservices)TableModel);
                break;

            case "yh_yhtasks":    //养护任务基础表
                TABLENAMEID = function_yhtasks(out WFSNAME, workflow.WFSID, (yh_yhtasks)TableModel);
                break;

            case "zxzz_tasks":    //专项整治基础表
                TABLENAMEID = function_specialtasks(out WFSNAME, workflow.WFSID, (zxzz_tasks)TableModel);
                break;

            case "audit_project_w":    //行政审批基础表
                TABLENAMEID = workflow.syncrowguid;
                break;

            default:
                break;
            }
            #endregion

            #region 检查是否存在当前实例,如果不存在则增加当前活动实例

            wf_workflowspecifics WFSModel = null;
            if (!string.IsNullOrEmpty(workflow.WFSID))
            {
                WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(workflow.WFSID);
                if (WFSModel == null)
                {
                    WFSID = "";
                }
                else
                {
                    WFSModel.wfsname = WFSNAME;
                    new WF_WorkFlowSpecificDAL().Update(WFSModel);
                }
            }

            if (string.IsNullOrEmpty(WFSID))
            {
                WFSModel              = new wf_workflowspecifics();
                WFSModel.wfsid        = GetNewId();
                WFSModel.wfid         = WFID;
                WFSModel.tablename    = tableName;
                WFSModel.createuserid = workflow.WFCreateUserID;
                WFSModel.createtime   = DateTime.Now;
                WFSModel.status       = 1;
                WFSModel.tablenameid  = TABLENAMEID;
                WFSModel.wfsname      = WFSNAME;
                new WF_WorkFlowSpecificDAL().Add(WFSModel);
                WFSID = WFSModel.wfsid;
            }
            #endregion

            #region 增加活动实例具体的流程

            #region 更新当前环节
            decimal oldStatus;//当前环节是否已经处理完成 1:未处理,2已经处理
            //更新或者增加当前流程的具体事例---返回当前环节编号
            WFSAID = function_WF_DealCurentActivity(WFSAID, WFSID, workflow.WFCreateUserID.Value, 2, WFDID, out oldStatus);
            //更新或者增加当前环节用户处理的意见---返回当前环节用户需要处理的编号
            string WFSUID = function_WF_DealCurentActivityUser(WFSAID, workflow.WFCreateUserID.Value, dealContent, 2, DateTime.Now, "false", WFSNAME, workflow.WFCreateUserID.Value, Remark, processmode, satisfaction);
            //增加当前处理用户的附件
            switch (workflow.FunctionName)
            {
            case "sm_citizenservices":    //市民服务
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "yh_yhtasks":    //养护任务
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "zxzz_tasks":    //专项整治
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "audit_project_w":    //行政审批基础表
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            default:
                break;
            }

            #endregion
            //当前状态为处理,则说明是第一个人处理,则需要增加下一个环节,如果当前环节已经处理,则不需要增加下一个环节
            string NextWFSAID = "";
            if (oldStatus == 1)
            {
                //获取该环节是否为最后一个环节
                wf_workflowdetails wfdModel = new WF_WorkFlowDetailDAL().GetSingle(NextWFDID);
                //如果下一个环节的子环节存在,则状态为执行中,内容为空,否则下一个环节状态为结束,内容为已结束
                int    status_wfsa  = 0;
                string content_wfsa = string.Empty;
                if (wfdModel != null && !string.IsNullOrEmpty(wfdModel.nextid))
                {
                    status_wfsa  = 1;
                    content_wfsa = "";
                }
                else
                {
                    //结束该流程
                    WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);
                    if (WFSModel != null)
                    {
                        WFSModel.status = 2;
                        new WF_WorkFlowSpecificDAL().Update(WFSModel);
                    }
                    status_wfsa  = 2;
                    content_wfsa = "已结束";
                }

                #region 增加下一个环节

                //增加环节
                NextWFSAID = function_WF_DealCurentActivity("", WFSID, workflow.WFCreateUserID.Value, status_wfsa, NextWFDID, out oldStatus);

                #region 更新活动实例的当前环节编号
                WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);
                if (WFSModel != null)
                {
                    WFSModel.currentwfsaid = NextWFSAID;
                    WFSModel.status        = status_wfsa;
                    new WF_WorkFlowSpecificDAL().Update(WFSModel);
                }
                #endregion

                //增加下一个环节的能操作的用户
                if (!string.IsNullOrEmpty(NextWFUSERIDS))
                {
                    string[] NextWFUSERIDS_split = NextWFUSERIDS.Split(',');
                    foreach (var item in NextWFUSERIDS_split)
                    {
                        decimal  userid;
                        DateTime?dealTime = null;
                        if (decimal.TryParse(item, out userid))
                        {
                            if (status_wfsa == 2)
                            {
                                userid    = workflow.WFCreateUserID.Value;
                                dealTime  = DateTime.Now;
                                IsSendMsg = "false";
                            }
                            //增加流程能操作的用户
                            function_WF_DealCurentActivityUser(NextWFSAID, (int)userid, content_wfsa, status_wfsa, dealTime, IsSendMsg, WFSNAME, workflow.WFCreateUserID, Remark, processmode, satisfaction);
                        }
                    }
                }

                #endregion
            }
            #endregion
            return(WFSID + "," + NextWFSAID + "," + TABLENAMEID);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 活动流程
        /// </summary>
        /// <param name="WFID">流程ID</param>
        /// <param name="WFSID">实例编号</param>
        /// <returns></returns>
        public WorkFlowClass ProcessIndex(string WFID, string WFDID, string WFSID, string WFSAID)
        {
            WorkFlowClass workflow = new WorkFlowClass();

            if (!string.IsNullOrEmpty(WFID))
            {
                wf_workflows wfModel = new WF_WorkFlowsDAL().GetSingle(WFID);
                if (wfModel != null)
                {
                    workflow.currentActivityName = wfModel.wfname;
                    //跳转的方法
                    workflow.FunctionName    = wfModel.tablename;
                    workflow.WFID            = WFID;
                    workflow.WFDID           = WFDID;
                    workflow.WFSID           = WFSID;
                    workflow.WFSAID          = WFSAID;
                    workflow.GetTableColumns = new WF_WorkFlowsDAL().GetTableColumns(wfModel.tablename);
                }
                else
                {
                    workflow.WorkFlowState = 1;//表示该流程不存在
                }


                IList <wf_workflowdetails> wfdList = new WF_WorkFlowDetailDAL()
                                                     .GetList().Where(a => a.wfid == WFID).ToList();//获取当前流程所有环节
                if (wfdList == null && wfdList.Count() <= 0)
                {
                    workflow.WorkFlowState = 2;
                    return(workflow);
                }
                ////获取主要内容
                //if (!string.IsNullOrEmpty(WFSID))
                //{
                //    workflow.contentPath = new WF_WorkFlowSpecificDAL().GetContentPath(WFSID);
                //}

                #region 获取下一步流程

                //下一步流程编号集合 格式为:【,流程编号,流程编号,流程编号,】
                string             nextWFDIDS = string.Empty;
                wf_workflowdetails wfdModel   = new WF_WorkFlowDetailDAL().GetSingle(WFDID);
                if (wfdModel != null)
                {
                    nextWFDIDS = wfdModel.nextid;
                }
                else
                {
                    workflow.WorkFlowState = 2;
                    return(workflow);
                }

                if (!string.IsNullOrEmpty(nextWFDIDS))
                {
                    #region  一步的所有流程
                    //下一步流程 格式为:【;流程编号,流程名称,是否有下一个流程;流程编号,流程名称,是否有下一个流程;流程编号,流程名称,是否有下一个流程;】
                    string nextWFDIDNames = "";

                    string[] nextWFDIDS_split = nextWFDIDS.Split(',');
                    foreach (string NEXTID in nextWFDIDS_split)
                    {
                        if (!string.IsNullOrEmpty(NEXTID))
                        {
                            string             temp     = "";
                            string             WFDNAME  = string.Empty;
                            wf_workflowdetails wfdMpdel = wfdList.FirstOrDefault(a => a.wfdid == NEXTID);
                            if (wfdMpdel == null || string.IsNullOrEmpty(wfdMpdel.wfdname))
                            {
                                workflow.WorkFlowState = 2;
                                return(workflow);
                            }
                            else
                            {
                                WFDNAME = wfdMpdel.wfdname;
                            }
                            //int isNextW = 0;//是否还有下步流程,如果没有则表示结束
                            //if (string.IsNullOrEmpty(wfdMpdel.nextid))
                            //    isNextW = 1;

                            temp += NEXTID;

                            if (!string.IsNullOrEmpty(nextWFDIDNames))
                            {
                                nextWFDIDNames += temp + ";";
                            }
                            else
                            {
                                nextWFDIDNames += ";" + temp + ";";
                            }
                        }
                    }

                    workflow.nextWFDIDNames = nextWFDIDNames;//下一步流程
                    #endregion

                    #region 查找下一步默认的用户 如果默认下一个步骤只有一步,并且明确制定用户,则直接将对应的用户加载出来
                    string UserIDs   = string.Empty;
                    string UserNames = string.Empty;
                    string NextWFDID = string.Empty;

                    if (!string.IsNullOrEmpty(wfdModel.nextiddefaultuser))
                    {
                        string[] nextDefaultUser = wfdModel.nextiddefaultuser.Split(',');
                        for (int i = 0; i < nextDefaultUser.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(nextDefaultUser[i]))
                            {
                                UserNames += ",";
                                if (nextDefaultUser[i] == "0")
                                {
                                    UserNames += "暂无,";
                                }
                                else
                                {
                                    UserNames += UserDAL.GetUserNameByUserID(Convert.ToDecimal(nextDefaultUser[i])) + ",";
                                }
                            }
                        }

                        workflow.NextWFUSERIDS = wfdModel.nextiddefaultuser;
                        workflow.NextUserNames = UserNames;
                        workflow.NextWFDID     = wfdModel.nextiddefault;
                    }
                    if (!string.IsNullOrEmpty(wfdModel.nextiddefaultdept))
                    {
                        string[] nextDefaultDept = wfdModel.nextiddefaultdept.Split(',');
                        for (int i = 0; i < nextDefaultDept.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(nextDefaultDept[i]))
                            {
                                UserNames += ",";
                                if (nextDefaultDept[i] == "0")
                                {
                                    UserNames += "暂无,";
                                }
                                else
                                {
                                    UserNames += UserDAL.GetUserNameByDeptID(Convert.ToDecimal(nextDefaultDept[i])) + ",";
                                }
                                UserNames = "";
                            }
                        }
                        workflow.NextWFUSERIDS = wfdModel.nextiddefaultuser;
                        workflow.NextUserNames = UserNames;
                        workflow.NextWFDID     = wfdModel.nextiddefault;
                    }

                    if (!string.IsNullOrEmpty(wfdModel.nextiddefaultrole))
                    {
                        string[] nextDefaultRole = wfdModel.nextiddefaultrole.Split(',');
                        for (int i = 0; i < nextDefaultRole.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(nextDefaultRole[i]))
                            {
                                UserNames += ",";
                                if (nextDefaultRole[i] == "0")
                                {
                                    UserNames += "暂无,";
                                }
                                else
                                {
                                    UserNames += UserDAL.GetUserNameByRoleID(Convert.ToDecimal(nextDefaultRole[i])) + ",";
                                }
                            }
                        }
                        workflow.NextWFUSERIDS = wfdModel.nextiddefaultuser;
                        workflow.NextUserNames = UserNames;
                        workflow.NextWFDID     = wfdModel.nextiddefault;
                    }

                    #endregion
                }
                #endregion
            }
            return(workflow);
        }
Ejemplo n.º 14
0
        public HttpResponseMessage AddSpecialTask(Zxzz_TaskModel model)
        {
            HttpRequestBase    request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;
            WorkFlowManagerBLL bll     = new WorkFlowManagerBLL();
            WorkFlowClass      wf      = new WorkFlowClass();
            List <FileClass>   list    = new List <FileClass>();
            zxzz_tasks         ztmodel = new zxzz_tasks();

            ztmodel.title        = model.title;
            ztmodel.tasktype     = model.tasktype;
            ztmodel.level        = model.level;
            ztmodel.term         = model.term;
            ztmodel.starttime    = model.starttime;
            ztmodel.endtime      = model.endtime;
            ztmodel.region       = model.region;
            ztmodel.taskexplain  = model.taskexplain;
            ztmodel.grometry     = model.grometry;
            ztmodel.fqr          = model.fqr;
            ztmodel.fqtime       = model.fqtime;
            ztmodel.leader       = model.leader;
            ztmodel.createuserid = model.fqr;
            ztmodel.createtime   = DateTime.Now;

            string[] fileClass     = model.uploadpanelValue;
            string[] fileClassXDZD = model.xdzdValue;

            foreach (var item in fileClassXDZD)
            {
                model.xdzd += item + ",";
            }
            ztmodel.xdzd = model.xdzd.Substring(0, model.xdzd.Length - 1);

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass infileClass = new FileClass();
                    JObject   jo          = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(infileClass);
                }
            }

            #region 专项整治流程
            wf.FunctionName   = "zxzz_tasks";
            wf.WFID           = "2017041214100001";
            wf.WFDID          = "2017041214200001";
            wf.NextWFDID      = "2017041214200002";
            wf.NextWFUSERIDS  = model.leader.ToString();
            wf.IsSendMsg      = "false";
            wf.WFCreateUserID = model.fqr;
            wf.files          = list;
            #endregion

            bll.WF_Submit(wf, ztmodel);

            #region 添加日志
            SystemLogBLL slbll = new SystemLogBLL();
            slbll.WriteSystemLog("专项整治", "", (int)model.fqr);
            #endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 15
0
        public object YHTaskFlowLink(YHDealWithLinkModel scmodel)
        {
            try
            {
                yh_yhtasks model = new yh_yhtasks();

                #region 图片处理
                List <FileClass> List_FC   = new List <FileClass>();
                string[]         fileClass = scmodel.uploadpanelValue;
                if (fileClass != null && fileClass.Length > 0)
                {
                    foreach (var item in fileClass)
                    {
                        FileClass infileClass = new FileClass();
                        JObject   jo          = new JObject();
                        jo = (JObject)JsonConvert.DeserializeObject(item);
                        infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                        infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                        infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                        infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                        List_FC.Add(infileClass);
                    }
                }
                #endregion
                if (scmodel.wfdid == "2017040610570002")
                {
                    model.pqrid = scmodel.wfcreateuserid;
                }

                WorkFlowManagerBLL bll     = new WorkFlowManagerBLL();
                SMS_Messages       sm      = new SMS_Messages();
                UserBLL            userbll = new UserBLL();
                if (scmodel.nextwfuserids == "0")//回退
                {
                    WF_WorkFlowLinkOld oldmodel = bll.GetOldLink(scmodel.wfsid, scmodel.nextwfdid);
                    if (oldmodel != null)
                    {
                        scmodel.nextwfuserids = oldmodel.dealuserid.ToString();
                    }
                }
                if (scmodel.nextwfuserids == "-1")//无派遣
                {
                    scmodel.nextwfuserids = "";
                    //获取市容环卫科人员ID
                    foreach (UserModel item in userbll.GetUsersStaff(8))
                    {
                        scmodel.nextwfuserids += item.ID + ",";
                    }
                    scmodel.nextwfuserids = "," + scmodel.nextwfuserids;
                }
                #region 发送短信
                //if (!string.IsNullOrEmpty(scmodel.mobile))
                //{
                //    sm.SendMessage(scmodel.mobile);
                //}
                #endregion



                WorkFlowClass wf = new WorkFlowClass();

                #region 事件流程
                wf.FunctionName   = "yh_yhtasks";          //市民事件表名
                wf.WFID           = "2017040610490001";    //工作流程编号 2017021409560001 事件流程
                wf.WFDID          = scmodel.wfdid;         //工作流详细编号 2017021410240003 事件处理
                wf.NextWFDID      = scmodel.nextwfdid;     //下一步流程编号 2017021410240004 中队长审核
                wf.NextWFUSERIDS  = scmodel.nextwfuserids; //下一步流程用户ID
                wf.WFSAID         = scmodel.wfsaid;
                wf.WFSID          = scmodel.wfsid;
                wf.DEALCONTENT    = scmodel.dealcontent;
                wf.IsSendMsg      = "false";                //是否发送短信
                wf.WFCreateUserID = scmodel.wfcreateuserid; //当前流程创建人
                wf.files          = List_FC;
                #endregion

                bll.WF_Submit(wf, model);
                return(new
                {
                    msg = "上报成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
            }
        }
Ejemplo n.º 16
0
        public HttpResponseMessage AddYhTask(YH_YhtaskModel model)
        {
            string[]         fileClass = model.uploadpanelValue;
            List <FileClass> list      = new List <FileClass>();

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass file = new FileClass();
                    JObject   jo   = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    file.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    file.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    file.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    file.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(file);
                }
            }


            yh_yhtasks yhmodel = new yh_yhtasks();

            yhmodel.yhcompany    = model.yhcompany;
            yhmodel.foundtime    = model.foundtime;
            yhmodel.fileename    = model.fileename;
            yhmodel.wtsource     = model.wtsource;
            yhmodel.yhtype       = model.yhtype;
            yhmodel.wtbigclass   = model.wtbigclass;
            yhmodel.wtsmallclass = model.wtsmallclass;
            yhmodel.yhobject     = model.yhobject;
            yhmodel.weather      = model.weather;
            yhmodel.duetime      = model.duetime;
            yhmodel.outlay       = model.outlay;
            yhmodel.workload     = model.workload;
            yhmodel.yhcontract   = model.yhcontract;
            yhmodel.wtaddress    = model.wtaddress;
            yhmodel.wtdescribe   = model.wtdescribe;
            yhmodel.geography84  = model.geography84;
            //if (!string.IsNullOrEmpty(model.geography84))
            //{
            //    yhmodel.geography2000=new MapXYConvent().WGS84ToCGCS2000(model.geography84);
            //}
            yhmodel.wtnature     = model.wtnature;
            yhmodel.points       = model.points;
            yhmodel.debit        = model.debit;
            yhmodel.sendusername = model.sendusername;
            yhmodel.sendopinion  = model.sendopinion;
            yhmodel.createuserid = model.createuserid;
            WorkFlowClass wf = new WorkFlowClass();

            wf.FunctionName   = "yh_yhtasks";                  //市民事件表名
            wf.WFID           = "2017040610490001";            //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = "2017040610570001";            //工作流详细编号 2017021410240001 上报事件
            wf.NextWFDID      = "2017040610570002";            //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = model.createuserid.ToString(); //下一步流程ID
            wf.IsSendMsg      = "false";                       //是否发送短信
            wf.WFCreateUserID = model.createuserid;            //当前流程创建人
            wf.files          = list;
            WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
            string             wf_id = wfbll.WF_Submit(wf, yhmodel);

            #region 添加日志
            SystemLogBLL slbll = new SystemLogBLL();
            slbll.WriteSystemLog("养护问题", "", (int)model.createuserid);
            #endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Ejemplo n.º 17
0
        public HttpResponseMessage assignTeam(Audit_project_wModel model)
        {
            #region 获取上传附件
            string[]         fileClass = model.uploadpanelValue;
            List <FileClass> list      = new List <FileClass>();
            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass file = new FileClass();
                    JObject   jo   = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    file.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    file.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    file.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    file.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(file);
                }
            }
            #endregion

            int userid = Convert.ToInt32(model.createuserid);
            //获取当前流程wfdid
            approvalDetail result    = bll.GetApprovalDetail(model.syncrowguid);
            string[]       wfdidlist = { "2017070414250001", "2017070414250002", "2017070414250003", "2017070414250004", "2017070414250005", "2017070414250006" };
            WorkFlowClass  wf        = new WorkFlowClass();
            wf.FunctionName = "audit_project_w";  //行政审批表名
            wf.WFID         = "2017070414220001"; //工作流程编号=.=固定
            wf.WFDID        = model.wfdid;        //工作详细编号
            if (result != null)
            {
                wf.WFSID  = result.wfsid;
                wf.WFSAID = result.wfsaid;
            }
            wf.NextWFDID      = model.nextwfdid;             //下一步流程详细编号
            wf.NextWFUSERIDS  = model.nextuserid.ToString(); //下一步流程用户id
            wf.IsSendMsg      = "false";                     //是否发送短信
            wf.WFCreateUserID = model.createuserid;          //当前流程创建人
            wf.DEALCONTENT    = model.advice;                //处理意见
            wf.syncrowguid    = model.syncrowguid;
            wf.files          = list;
            if (wf.WFDID == wfdidlist[0])
            {
                wf.Remark       = model.xzxkaddress;
                wf.satisfaction = model.xzxkstarttime;
                wf.processmode  = model.xzxkendtime;
            }
            else if (wf.WFDID == wfdidlist[2])
            {
                wf.Remark = model.geography;
            }

            WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
            string             wf_id = wfbll.WF_Submit(wf, model);

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            if (wf_id != null && model.isSendMsg == 1)
            {
                #region 发送短信
                if (wf.NextWFUSERIDS != null && model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
                {
                    UserBLL userbll = new UserBLL();
                    string  phone   = model.phone;
                    //phone="18768196242";
                    string[]       numbers = phone.Split(',');
                    string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                    SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                    smsbll.SendMessage(numbers, msg);
                }
                #endregion

                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            else
            {
                response.Content = new StringContent("{\"success\":false}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }