public HttpResponseMessage AddWzjzs(WJ_WzjzsModel model) { int id = bll.AddWzjzs(model); model.parentid = id; int success = bll.AddWzjzs(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); } } WJ_FilesBLL filebll = new WJ_FilesBLL(); 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); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (success > 0) { #region 添加日志 SystemLogBLL slbll = new SystemLogBLL(); slbll.WriteSystemLog("违建管理", "", (int)model.createuserid); #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); }
public HttpResponseMessage EditCqxm(WJ_WzjzsModel model) { int success = bll.AddWzjzs(model); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (success > 0) { response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html"); } return(response); }
/// <summary> /// 添加违建 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddWzjzs(WJ_WzjzsModel model) { using (Entities db = new Entities()) { wj_wzjzs wwmodel = new wj_wzjzs(); wwmodel.wjid = model.wjid; wwmodel.wjholder = model.wjholder; wwmodel.contactphone = model.contactphone; wwmodel.holderidentity = model.holderidentity; wwmodel.householdnum = model.householdnum; wwmodel.address = model.address; wwmodel.landproperty = model.landproperty; wwmodel.completiontime = model.completiontime; wwmodel.landnum = model.landnum; wwmodel.propertynum = model.propertynum; wwmodel.coverarea = model.coverarea; wwmodel.buildarea = model.buildarea; wwmodel.builduse = model.builduse; wwmodel.buildstructure = model.buildstructure; wwmodel.buildlayers_up = model.buildlayers_up; wwmodel.buildlayers_down = model.buildlayers_down; wwmodel.geography = model.geography; wwmodel.wj_wjtype = model.wj_wjtype; wwmodel.wj_use = model.wj_use; wwmodel.wj_land = model.wj_land; wwmodel.wj_time = model.wj_time; wwmodel.wj_landarea = model.wj_landarea; wwmodel.wj_wjarea = model.wj_wjarea; wwmodel.wj_buildstructure = model.wj_buildstructure; wwmodel.wj_layerup = model.wj_layerup; wwmodel.wj_layerdown = model.wj_layerdown; wwmodel.process = model.process; wwmodel.isgd = model.isgd; wwmodel.foundtime = model.foundtime; wwmodel.limittime = model.limittime; wwmodel.reportuser = model.reportuser; wwmodel.reporttime = model.reporttime; wwmodel.remark = model.remark; wwmodel.parentid = model.parentid; wwmodel.createuserid = model.createuserid; wwmodel.createtime = DateTime.Now; wwmodel.citizenid = model.citizenid; db.wj_wzjzs.Add(wwmodel); db.SaveChanges(); return(wwmodel.wjid); } }
/// <summary> /// 获取违建详情 /// </summary> /// <param name="wjid"></param> /// <returns></returns> public WJ_WzjzsModel GetWzjzModel(int wjid) { WJ_WzjzsModel model = new WJ_WzjzsModel(); WJ_FilesDAL dal = new WJ_FilesDAL(); using (Entities db = new Entities()) { IQueryable <WJ_WzjzsModel> queryable = from a in db.wj_wzjzs join b_join in db.base_users on a.createuserid equals b_join.id into btmp from b in btmp.DefaultIfEmpty() join c_join in db.base_zds on new { a1 = a.wj_wjtype, b1 = "type_wj_wjlx" } equals new { a1 = c_join.zd_id, b1 = c_join.zd_type } into ctmp from c in ctmp.DefaultIfEmpty() where a.wjid == wjid select new WJ_WzjzsModel { wjid = a.wjid, wjholder = a.wjholder, contactphone = a.contactphone, holderidentity = a.holderidentity, householdnum = a.householdnum, address = a.address, landproperty = a.landproperty, completiontime = a.completiontime, landnum = a.landnum, propertynum = a.propertynum, coverarea = a.coverarea, buildarea = a.buildarea, builduse = a.builduse, buildstructure = a.buildstructure, buildlayers_up = a.buildlayers_up, buildlayers_down = a.buildlayers_down, geography = a.geography, wj_wjtype = a.wj_wjtype, wj_use = a.wj_use, wj_land = a.wj_land, wj_time = a.wj_time, wj_landarea = a.wj_landarea, limittime = a.limittime, wj_wjarea = a.wj_wjarea, wj_buildstructure = a.wj_buildstructure, wj_layerup = a.wj_layerup, wj_layerdown = a.wj_layerdown, process = a.process, isgd = a.isgd, reportuser = a.reportuser, reporttime = a.reporttime, foundtime = a.foundtime, remark = a.remark, parentid = a.parentid, createuserid = a.createuserid, createtime = a.createtime, createusername = b.displayname, zd_name = c.zd_name }; model = queryable.FirstOrDefault(); if (model != null) { model.wjfilelist = dal.GetFileList(model.wjid, 1); model.path = "IllegallyBuiltOriginalPath"; } return(model); } }
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); }
/// <summary> /// 添加违建 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddWzjzs(WJ_WzjzsModel model) { return(dal.AddWzjzs(model)); }