Exemplo n.º 1
0
 public object EditExtension(string citizenid, int day, string extensioncontent)
 {
     try
     {
         SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();
         int id = bll.EditExtension(citizenid, day, extensioncontent);
         if (id > 0)
         {
             return(new
             {
                 msg = "上报成功",
                 resCode = 1
             });
         }
         else
         {
             return(new
             {
                 msg = "json数据不正确",
                 resCode = 0
             });
         }
     }
     catch (Exception)
     {
         return(new
         {
             msg = "json数据不正确",
             resCode = 0
         });
         // return "{\"msg\":\"json数据不正确\",\"resCode\":\"0\"}";
     }
 }
Exemplo n.º 2
0
        public Paging <List <SM_CitizenServicesModel> > GetAllCitizenServicesReviewList(string filter, int start, int limit)
        {
            List <Filter>         filters = JsonConvert.DeserializeObject <List <Filter> >(filter);
            SM_CitizenServicesBLL bll     = new SM_CitizenServicesBLL();

            return(bll.GetAllCitizenServicesReviewList(filters, start, limit, 0, 0));
        }
Exemplo n.º 3
0
        public HttpResponseMessage EditEventReview(SM_CitizenServicesModel model)
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            if (model == null)
            {
                model                 = new SM_CitizenServicesModel();
                model.citizenid       = request["citizenid"];
                model.reviewextension = string.IsNullOrEmpty(request["reviewextension"]) ? 0 : Convert.ToInt32(request["reviewextension"]);
                model.extensiontime   = string.IsNullOrEmpty(request["extensiontime"]) ? 0 : Convert.ToInt32(request["extensiontime"]);
                model.auditopinion    = request["auditopinion"];
            }
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();
            int success = bll.EditEventReview(model);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            if (success > 0)
            {
                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);
        }
Exemplo n.º 4
0
        public Paging <List <SM_CitizenServicesModel> > GetAlreadyCitizenServicesList(string filter, int start, int limit, int userid, int status)
        {
            List <Filter>         filters = JsonConvert.DeserializeObject <List <Filter> >(filter);
            SM_CitizenServicesBLL bll     = new SM_CitizenServicesBLL();

            return(bll.GetAlreadyCitizenServicesList(filters, start, limit, userid, status));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 事件统计
        /// </summary>
        /// <returns></returns>
        public string getEvent()
        {
            SM_CitizenServicesBLL bll    = new SM_CitizenServicesBLL();
            List <int>            events = bll.getEvent();
            string str = JsonConvert.SerializeObject(events).ToString();

            return(str);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 各中队事件概况
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public string getEventProfile(int type)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();
            List <int>            sbs = bll.GetSbsEventTypeStatistics(type);
            List <int>            cls = bll.GetClsEventTypeStatistics(type);
            List <int>            jas = bll.GetJasEventTypeStatistics(type);
            string str = JsonConvert.SerializeObject(sbs).ToString() + "|" + JsonConvert.SerializeObject(cls).ToString() + "|" + JsonConvert.SerializeObject(jas).ToString();

            return(str);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 七天事件趋势图
        /// </summary>
        /// <returns></returns>
        public string getEventTrend()
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            List <string> listlegend        = bll.GetEventLinelegend();
            string        linelegend        = JsonConvert.SerializeObject(listlegend).ToString();
            List <int>    eventReporred     = bll.GetEventLineReportedData();
            string        eventReporredLine = JsonConvert.SerializeObject(eventReporred).ToString();
            string        str = linelegend + "|" + eventReporredLine;

            return(str);
        }
Exemplo n.º 8
0
        public HttpResponseMessage ExportExcel(string excelname, string exceltitle, string exceldata, string filter = null)
        {
            List <Filter> filters = null;

            if (filter != "[]")
            {
                filters = JsonConvert.DeserializeObject <List <Filter> >(filter);
            }

            SM_CitizenServicesBLL          bll  = new SM_CitizenServicesBLL();
            List <SM_CitizenServicesModel> list = bll.GetAllCitizenServicesListExcel(filters);

            //获取导出的Excel表
            CommonFunctionBLL <SM_CitizenServicesModel> cfBll = new CommonFunctionBLL <SM_CitizenServicesModel>(exceldata);

            return(cfBll.saveExcel(list, excelname, exceltitle));
        }
Exemplo n.º 9
0
        public string eventAll()
        {
            SM_CitizenServicesBLL bll        = new SM_CitizenServicesBLL();
            List <spiderMap>      list       = bll.getEventData();
            string        radardata          = JsonConvert.SerializeObject(list).ToString();
            List <string> listlegend         = bll.GetEventLinelegend();
            string        linelegend         = JsonConvert.SerializeObject(listlegend).ToString();
            List <int>    eventReporred      = bll.GetEventLineReportedData();
            string        eventReporredLine  = JsonConvert.SerializeObject(eventReporred).ToString();
            List <int>    eventInProcess     = bll.GetEventLineInProcess();
            string        eventInProcessLine = JsonConvert.SerializeObject(eventInProcess).ToString();
            List <int>    eventFinished      = bll.GetEventLineFinished();
            string        eventFinishedLine  = JsonConvert.SerializeObject(eventFinished).ToString();
            List <JXXZ.ZHCG.Model.CitizenServiceModel.EventModel> eventlist = bll.GetAllByNowDay();
            string eventlists = JsonConvert.SerializeObject(eventlist).ToString();
            string alldata    = radardata + "|" + linelegend + "|" + eventReporredLine + "|" + eventInProcessLine + "|" + eventFinishedLine + "|" + eventlists;

            return(alldata);
        }
Exemplo n.º 10
0
        public List <WF_WorkFlowOldModel> GetOldList(string wfsid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetOldList(wfsid));
        }
Exemplo n.º 11
0
        public List <FileClass> GetCitizenServicesAttr(string citizenid, string wfdid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetCitizenServicesAttr(citizenid, wfdid));
        }
Exemplo n.º 12
0
        public List <SM_CitizenServicesModel> GetCitizenModel(int userid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetCitizenModel(userid));
        }
Exemplo n.º 13
0
        public bool IsCitizenRepeat(string eventid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.IsCitizenRepeat(eventid));
        }
Exemplo n.º 14
0
        public Dictionary <string, int?> GetCitizenAutoID()
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetCitizenAutoID());
        }
Exemplo n.º 15
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\"}";
            }
        }
Exemplo n.º 16
0
        public Paging <List <SM_CitizenServicesModel> > GetAllCitizenServicesReviewList(int start, int limit)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetAllCitizenServicesReviewList(null, start, limit, 0, 0));
        }
Exemplo n.º 17
0
        public bool EventIsHandle(string wfsaid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.EventIsHandle(wfsaid));
        }
Exemplo n.º 18
0
        public SM_CitizenServicesModel GetCitizenServiceModel(string citizenid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetCitizenServiceModel(citizenid));
        }
Exemplo n.º 19
0
        private async Task ProcessWSChat(AspNetWebSocketContext context)
        {
            WebSocket socket = context.WebSocket;
            string    user   = context.QueryString["user"].ToString().Trim();

            try
            {
                #region 用户添加连接池
                //不存在添加
                if (!CONNECT_POOL.ContainsKey(user))
                {
                    CONNECT_POOL.Add(user, socket);
                }
                else
                //当前对象不一致,更新
                if (socket != CONNECT_POOL[user])
                {
                    CONNECT_POOL[user] = socket;
                }
                #endregion

                #region 离线消息处理
                if (MESSAGE_POOL.ContainsKey(user))
                {
                    List <MessageInfo> msgs = MESSAGE_POOL[user];
                    foreach (MessageInfo item in msgs)
                    {
                        await socket.SendAsync(item.MsgContent, WebSocketMessageType.Text, true, CancellationToken.None);
                    }
                    //移除离线消息
                    MESSAGE_POOL.Remove(user);
                }
                #endregion

                while (true)
                {
                    if (socket.State == WebSocketState.Open)
                    {
                        ArraySegment <byte>    buffer = new ArraySegment <byte>(new byte[2048]);
                        WebSocketReceiveResult result = await socket.ReceiveAsync(buffer, CancellationToken.None);

                        #region 消息处理(字符截取、消息转发)
                        try
                        {
                            #region 关闭Socket处理,删除连接池
                            //连接关闭
                            if (socket.State != WebSocketState.Open)
                            {
                                //删除连接池
                                if (CONNECT_POOL.ContainsKey(user))
                                {
                                    CONNECT_POOL.Remove(user);
                                }
                                break;
                            }
                            #endregion

                            string userMsg   = Encoding.UTF8.GetString(buffer.Array, 0, result.Count);//发送过来的消息
                            var    array     = userMsg.Split(',');
                            string type      = array[0];
                            string thisusers = array[1];
                            //目的用户
                            string descUser = thisusers.Trim();
                            string thisdata = "";
                            string alldata  = "";
                            //死循环保证服务器一直刷新发送数据到客户端
                            for (int i = 1; i < 2; --i)
                            {
                                switch (type)
                                {
                                case "sj":
                                    SM_CitizenServicesBLL bll        = new SM_CitizenServicesBLL();
                                    List <spiderMap>      list       = bll.getEventData();
                                    string        radardata          = JsonConvert.SerializeObject(list).ToString();
                                    List <string> listlegend         = bll.GetEventLinelegend();
                                    string        linelegend         = JsonConvert.SerializeObject(listlegend).ToString();
                                    List <int>    eventReporred      = bll.GetEventLineReportedData();
                                    string        eventReporredLine  = JsonConvert.SerializeObject(eventReporred).ToString();
                                    List <int>    eventInProcess     = bll.GetEventLineInProcess();
                                    string        eventInProcessLine = JsonConvert.SerializeObject(eventInProcess).ToString();
                                    List <int>    eventFinished      = bll.GetEventLineFinished();
                                    string        eventFinishedLine  = JsonConvert.SerializeObject(eventFinished).ToString();
                                    List <JXXZ.ZHCG.Model.CitizenServiceModel.EventModel> eventlist = bll.GetAllByNowDay();
                                    string eventlists = JsonConvert.SerializeObject(eventlist).ToString();
                                    alldata = radardata + "|" + linelegend + "|" + eventReporredLine + "|" + eventInProcessLine + "|" + eventFinishedLine + "|" + eventlists;
                                    buffer  = new ArraySegment <byte>(Encoding.UTF8.GetBytes(alldata));
                                    break;
                                }

                                //string[] msgList = userMsg.Split('|');
                                //if (msgList.Length == 2)
                                //{
                                //    if (msgList[0].Trim().Length > 0)
                                //        descUser = msgList[0].Trim();//记录消息目的用户
                                //    buffer = new ArraySegment<byte>(Encoding.UTF8.GetBytes(msgList[1]));
                                //}
                                //else
                                //    buffer = new ArraySegment<byte>(Encoding.UTF8.GetBytes(userMsg));
                                //判断客户端是否在线
                                if (CONNECT_POOL.ContainsKey(descUser) && thisdata != alldata)
                                {
                                    thisdata = alldata;
                                    WebSocket destSocket = CONNECT_POOL[descUser];//目的客户端
                                    if (destSocket != null && destSocket.State == WebSocketState.Open)
                                    {
                                        await destSocket.SendAsync(buffer, WebSocketMessageType.Text, true, CancellationToken.None);
                                    }
                                }
                                //else
                                //{
                                //    //Task.Run(() =>
                                //    //{
                                //    //    if (!MESSAGE_POOL.ContainsKey(descUser))//将用户添加至离线消息池中
                                //    //        MESSAGE_POOL.Add(descUser, new List<MessageInfo>());
                                //    //    MESSAGE_POOL[descUser].Add(new MessageInfo(DateTime.Now, buffer));//添加离线消息
                                //    //});

                                //}
                            }
                        }
                        catch (Exception ex)
                        {
                            //消息转发异常处理,本次消息忽略 继续监听接下来的消息
                            Console.Write(ex.Message);
                        }
                        #endregion
                    }
                }
            }
            catch (Exception ex)
            {
                //整体异常处理
                if (CONNECT_POOL.ContainsKey(user))
                {
                    CONNECT_POOL.Remove(user);
                }
            }
        }
Exemplo n.º 20
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);
        }
Exemplo n.º 21
0
        public HttpResponseMessage CizitenEventEdit(RSM_CitizenModel cmmodel)
        {
            SM_CitizenServicesBLL bll     = new SM_CitizenServicesBLL();
            HttpRequestBase       request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;
            //文件上传
            HttpFileCollectionBase files = request.Files;
            sm_citizenservices     model = new sm_citizenservices();

            string[] fileClass = cmmodel.uploadpanelValue;

            if (fileClass != null && fileClass.Length > 0)
            {
                //当有图片时,获取上报时的用户活动实例
                string wfsuid = bll.GetEditWFSUID(request.Form["wfsid"]);

                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"];
                    infileClass.wfsuid       = wfsuid;
                    bll.AddEditPictures(infileClass);
                }
            }

            model.citizenid = request.Form["citizenid"];
            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"];

            bll.CizitenEventEdit(model);

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

            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Exemplo n.º 22
0
        public Paging <List <SM_CitizenServicesModel> > GetAllCitizenServicesList(int start, int limit, int?XZID = null)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetAllCitizenServicesList(null, start, limit, 0, 0, XZID));
        }
Exemplo n.º 23
0
        public Paging <List <SM_CitizenServicesModel> > GetAlreadyCitizenServicesList(int start, int limit, int userid, int status)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetAlreadyCitizenServicesList(null, start, limit, userid, status));
        }
Exemplo n.º 24
0
        public Dictionary <string, string> GetQuickReportUsers(string wfsid)
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.GetQuickReportUsers(wfsid));
        }
Exemplo n.º 25
0
        public QuantityModel Quantity(int userid, string type = "7,")
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.Quantity(userid, type));
        }
Exemplo n.º 26
0
        /// <summary>
        /// 案件来源前六数据
        /// </summary>
        /// <returns></returns>
        public string getEventBytype()
        {
            SM_CitizenServicesBLL bll = new SM_CitizenServicesBLL();

            return(bll.getEventBytype());
        }
Exemplo n.º 27
0
        public HttpResponseMessage AddAccountRegister(AccountRegisterModel model)
        {
            HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request;

            string[] fileClass           = model.uploadpanelValue;
            string   AccountRegisterPath = ConfigManageClass.AccountRegisterPath;
            List <FileUploadClass> list  = new List <FileUploadClass>();
            List <Dictionary <string, string> > XGDicList = new List <Dictionary <string, string> >();

            #region 生成Word文件夹
            DateTime dt = DateTime.Now;
            string   AccountRegisterWordPath = ConfigManageClass.AccountRegisterWordPath;
            //原图 创建文件夹
            if (!Directory.Exists(AccountRegisterWordPath))
            {
                Directory.CreateDirectory(AccountRegisterWordPath);
            }
            string OriginalPathYear = AccountRegisterWordPath + "\\" + dt.Year;
            if (!Directory.Exists(OriginalPathYear))
            {
                Directory.CreateDirectory(OriginalPathYear);
            }
            string OriginalPathdate = OriginalPathYear + "\\" + dt.ToString("yyyyMMdd");
            if (!Directory.Exists(OriginalPathdate))
            {
                Directory.CreateDirectory(OriginalPathdate);
            }
            string timeStr = dt.ToString("yyyyMMddHHmmssffff") + new Random().Next(10000, 99999);

            string fileName = model.title + new Random().Next(10000, 99999) + ".docx";

            string OPath = Path.Combine(OriginalPathdate, fileName);

            #endregion
            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileUploadClass file = new FileUploadClass();
                    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);
                    Dictionary <string, string> dic = new Dictionary <string, string>();
                    dic.Add("$相关照片$", AccountRegisterPath + file.OriginalPath);
                    XGDicList.Add(dic);
                }
            }
            model.createtime = dt;



            if (!string.IsNullOrEmpty(request.Form["userid"]))
            {
                model.createuserid = Convert.ToInt32(request.Form["userid"]);
            }
            model.createtime = DateTime.Now;

            #region 获取事件附件生成台帐
            string           citizenid = model.citizenid;
            List <FileClass> imgList   = new List <FileClass>();
            if (!string.IsNullOrEmpty(citizenid))
            {
                SM_CitizenServicesModel eventModel = new SM_CitizenServicesBLL().GetCitizenServiceModel(citizenid);
                if (eventModel != null)
                {
                    string   abspath = System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/AccountDoc/自动事件生成台帐清单.docx");
                    WordInfo word    = new WordInfo(abspath, OPath, "pdf");
                    Dictionary <string, string> dic = new Dictionary <string, string>();

                    //找到图片存入
                    dic.Add("$事件标题$", eventModel.eventtitle);
                    dic.Add("$当 事 人$", eventModel.complainant);
                    dic.Add("$事件内容$", eventModel.eventcontent);
                    dic.Add("$发现时间$", eventModel.foundtime.ToString("yyyy-MM-dd HH:mm:ss"));
                    dic.Add("$问题大类$", eventModel.bigtypename);
                    dic.Add("$问题小类$", eventModel.smalltypename);
                    dic.Add("$处理情况$", eventModel.processmode);
                    word.ReplaceRangs(dic);
                    List <Dictionary <string, string> > qdicList = new List <Dictionary <string, string> >();
                    List <Dictionary <string, string> > hdicList = new List <Dictionary <string, string> >();

                    if (eventModel.attachment != null && eventModel.attachment.Count > 0)
                    {
                        imgList = eventModel.attachment;
                        string OriginalPath = ConfigManageClass.CitizenServiceOriginalPath;

                        for (int i = 0; i < imgList.Count; i++)
                        {
                            if (imgList[i].WFDID == "2017021410240010")
                            {
                                Dictionary <string, string> qdic = new Dictionary <string, string>();
                                qdic.Add("$处理前照片$", OriginalPath + imgList[i].OriginalPath);
                                qdicList.Add(qdic);

                                string fileLast = System.IO.Path.GetFileName(OriginalPath + imgList[i].OriginalPath);

                                string fileLastPath = AccountRegisterPath + imgList[i].OriginalPath;

                                string AccountLastPath = fileLastPath.Substring(0, (fileLastPath.Length - fileLast.Length));

                                if (!Directory.Exists(AccountLastPath))
                                {
                                    Directory.CreateDirectory(AccountLastPath);
                                }

                                System.IO.File.Copy(OriginalPath + imgList[i].OriginalPath, AccountRegisterPath + imgList[i].OriginalPath, true);
                            }
                            else
                            {
                                Dictionary <string, string> hdic = new Dictionary <string, string>();
                                hdic.Add("$处理后照片$", OriginalPath + imgList[i].OriginalPath);
                                hdicList.Add(hdic);

                                string fileLast = System.IO.Path.GetFileName(OriginalPath + imgList[i].OriginalPath);

                                string fileLastPath = AccountRegisterPath + imgList[i].OriginalPath;

                                string AccountLastPath = fileLastPath.Substring(0, (fileLastPath.Length - fileLast.Length));

                                if (!Directory.Exists(AccountLastPath))
                                {
                                    Directory.CreateDirectory(AccountLastPath);
                                }

                                System.IO.File.Copy(OriginalPath + imgList[i].OriginalPath, AccountRegisterPath + imgList[i].OriginalPath, true);
                            }
                        }

                        word.AddPictures(qdicList);
                        word.AddPictures(hdicList);
                        word.Dispose();
                    }
                }
            }
            else
            {
                TZWord(model, XGDicList, OPath);
            }
            #endregion

            model.wordname = fileName;
            model.wordpath = dt.Year + "/" + dt.ToString("yyyyMMdd") + "/" + fileName;

            int result = bll.AddAccountRegister(model, list, imgList);

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