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); }
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); }
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); }