Пример #1
0
        public HttpResponseMessage AddLeadersupervise(Case_LeadersuperviseModel model)
        {
            int success = bll.AddLeadersupervise(model);

            #region 发送短信
            int    isSendMsg = model.isSendMsg;
            string phone     = model.phone;
            //string phone = "18768196242";
            string casename       = model.casename;
            string supopinion     = model.supopinion;
            string date           = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            string createusername = model.createusernmae;
            if (isSendMsg == 1 && phone != null && phone.Length > 0)
            {
                string[]       numbers = phone.Split(',');
                string         msg     = createusername + "领导在" + date + "时对" + casename + "案件提出督办,督办意见:" + supopinion;
                SMSMessagesBLL message = new SMSMessagesBLL();
                message.SendMessage(numbers, msg);
            }
            #endregion
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            if (success > 0)
            {
                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }
Пример #2
0
        public HttpResponseMessage assignTeamber(Audit_project_wModel model)
        {
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            int success = bll.assignTeamber(model);

            if (success > 0)
            {
                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
                try
                {
                    #region 处理成功后发送短信
                    if (model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
                    {
                        UserBLL        userbll = new UserBLL();
                        string         phone   = model.phone;
                        string[]       numbers = phone.Split(',');
                        string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                        SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                        smsbll.SendMessage(numbers, msg);
                    }
                }
                catch (Exception e)
                {
                    //短信异常
                }
                #endregion
            }
            else
            {
                response.Content = new StringContent("{\"success\":false}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }
Пример #3
0
        public HttpResponseMessage assignMidTeam(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

            model.filelist = list;

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            int success = bll.assignMidTeam(model);

            if (success > 0)
            {
                response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
                #region 处理成功后发送短信
                try
                {
                    if (model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
                    {
                        UserBLL        userbll = new UserBLL();
                        string         phone   = model.phone;
                        string[]       numbers = phone.Split(',');
                        string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                        SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                        smsbll.SendMessage(numbers, msg);
                    }
                }
                catch
                {
                    //短信异常
                }
                #endregion
            }
            else
            {
                response.Content = new StringContent("{\"success\":false}", Encoding.GetEncoding("UTF-8"), "text/html");
            }
            return(response);
        }
Пример #4
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);
        }
Пример #5
0
        public object SmassignTeamber(Audit_project_wModel model)
        {
            int success = bll.assignTeamber(model);

            if (success > 0)
            {
                return(new
                {
                    success = true,
                    msg = "流程处理成功"
                });

                try
                {
                    #region 处理成功后发送短信
                    if (model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
                    {
                        UserBLL        userbll = new UserBLL();
                        string         phone   = model.phone;
                        string[]       numbers = phone.Split(',');
                        string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                        SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                        smsbll.SendMessage(numbers, msg);
                    }
                    #endregion
                }
                catch (Exception e)
                {
                    //处理短信发送异常
                }
            }
            else
            {
                return(new
                {
                    success = false,
                    msg = "流程派遣失败",
                });
            }
        }
Пример #6
0
 public object AddLeadersuperviseApi(Case_LeadersuperviseModel model)
 {
     try
     {
         if (!string.IsNullOrEmpty(model.mobile))
         {
             string[]       phones  = model.mobile.Split(',');
             SMSMessagesBLL message = new SMSMessagesBLL();
             message.SendMessage(phones, "");
         }
         int id = bll.AddLeadersupervise(model);
         if (id > 0)
         {
             return(new
             {
                 msg = "上报成功",
                 resCode = 1
             });
         }
         else
         {
             return(new
             {
                 msg = "json数据不正确",
                 resCode = 0
             });
         }
     }
     catch (Exception)
     {
         return(new
         {
             msg = "json数据不正确",
             resCode = 0
         });
     }
 }
Пример #7
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);
        }
Пример #8
0
        public object SmassignMidTeam(Audit_project_wModel model)
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;
            //文件上传
            List <FileClass> list       = new List <FileClass>();
            string           OriginPath = ConfigManageClass.AdminApprovalOrignalPath;
            string           smallPath  = ConfigManageClass.AdminApprovalSmallPath;

            if (model.base64 != null)
            {
                for (int i = 0; i < model.base64.Length; i++)
                {
                    string   imgArray = model.base64[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.Add(imgFile);
                    }
                }
            }
            model.filelist = list;
            int success = bll.assignMidTeam(model);

            if (success > 0)
            {
                return(new
                {
                    success = true,
                    msg = "流程处理成功"
                });

                try
                {
                    #region 处理成功后发送短信
                    if (model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0)
                    {
                        UserBLL        userbll = new UserBLL();
                        string         phone   = model.phone;
                        string[]       numbers = phone.Split(',');
                        string         msg     = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")";
                        SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                        smsbll.SendMessage(numbers, msg);
                    }
                    #endregion
                }
                catch (Exception e)
                {
                    //处理短信发送异常
                }
            }
            else
            {
                return(new
                {
                    success = false,
                    msg = "流程派遣失败",
                });
            }
        }
Пример #9
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
                });
            }
        }
Пример #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"];
            //指挥中心派遣到乡镇
            if (!string.IsNullOrEmpty(request.Form["pqxzid"]))
            {
                model.pqxzid = request.Form["pqxzid"];
            }
            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      = "2017021410240001";                      //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = userids;                                 //下一步流程ID
            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

            wfs.FunctionName   = "sm_citizenservices";                    //市民事件表名
            wfs.WFID           = "2017021409560001";                      //工作流程编号 2017021409560001 事件流程
            wfs.WFDID          = "2017021410240010";                      //工作流详细编号 2017021410240001 上报事件
            wfs.NextWFDID      = request.Form["zptype"];                  //下一步流程编号 2017021410240002 事件派遣
            wfs.NextWFUSERIDS  = request.Form["nextperson"];              //下一步流程ID
            wfs.DEALCONTENT    = request.Form["suggest"];
            wfs.IsSendMsg      = "false";                                 //是否发送短信
            wfs.WFCreateUserID = Convert.ToInt32(request.Form["userid"]); //当前流程创建人
            wfs.WFSID          = wfsid;
            wfs.WFSAID         = wfasid;
            sm_citizenservices model1 = new sm_citizenservices();
            model1.officeuserid = Convert.ToInt32(request.Form["userid"]);
            bll.WF_Submit(wfs, model1);

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

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

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Пример #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"];
            }
            //指挥中心派遣到乡镇
            if (!string.IsNullOrEmpty(request.Form["pqxzid"]))
            {
                model.pqxzid = request.Form["pqxzid"];
            }

            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 发送短信
            if (request.Form["isSendMsg"] == "1" && !string.IsNullOrEmpty(nextperson))
            {
                UserBLL        userbll = new UserBLL();
                string         phone   = userbll.GetPhones(nextperson);//15888309757,18768196242
                string[]       phones  = phone.Split(',');
                string         content = "您有一条新的市民事件需要处理,限办期限:" + request.Form["limittime"] + ",请及时处理";
                SMSMessagesBLL smsbll  = new SMSMessagesBLL();
                smsbll.SendMessage(phones, content);
            }
            #endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }