public HttpResponseMessage AddCaseSources() { HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request; Case_CaseSourcesBLL bll = new Case_CaseSourcesBLL(); Case_CaseSourcesModel model = new Case_CaseSourcesModel(); if (!string.IsNullOrEmpty(request["sourceid"])) { model.sourceid = Convert.ToInt32(request["sourceid"]); } if (!string.IsNullOrEmpty(request["yjdwid"])) { model.yjdwid = Convert.ToInt32(request["yjdwid"]); } model.contact = request["contact"]; model.contactphone = request["contactphone"]; model.contactaddress = request["contactaddress"]; model.wfxwfsdz = request["wfxwfsdz"]; model.cluecontent = request["cluecontent"]; model.processopinion = request["processopinion"]; model.notetaker = request["notetaker"]; if (!string.IsNullOrEmpty(request["casetype"])) { model.casetype = Convert.ToInt32(request["casetype"]); } model.createuserid = Convert.ToInt32(request["userid"]); model.createtime = DateTime.Now; if (!string.IsNullOrEmpty(request["status"])) { model.status = Convert.ToInt32(request["status"]); } if (!string.IsNullOrEmpty(request["notetime"])) { model.notetime = Convert.ToDateTime(request["notetime"]); } model.lastatus = 0; int caseid = bll.AddCaseSources(model); Case_WorkFlowManagerBLL wfbll = new Case_WorkFlowManagerBLL(); Case_WorkFlowClass wf = new Case_WorkFlowClass(); #region 案件流程 wf.FunctionName = "case_sources"; wf.WFID = "2017022219210001"; wf.WFDID = "2017022219200001"; wf.NextWFDID = "2017022219200002"; wf.NextWFUSERIDS = ""; //下一步流程ID wf.IsSendMsg = "false"; //是否发送短信 wf.WFCreateUserID = Convert.ToInt32(request.Form["userid"]); //当前流程创建人 wf.casetype = 1; wf.caseid = caseid; #endregion string wf_data = wfbll.WF_Submit(wf); #region 文书 List <Doc_WfsasModel> WfsasList = new List <Doc_WfsasModel>(); Doc_WfsasModel dwmodel = new Doc_WfsasModel(); dwmodel.wfsaid = wf_data.Split(new string[] { "wfsaid\":\"" }, StringSplitOptions.RemoveEmptyEntries)[1].Substring(0, 22); dwmodel.filetyoe = 3; dwmodel.ddid = 11; dwmodel.createuserid = Convert.ToInt32(request["userid"]); dwmodel.ddtablename = "case_casesources"; dwmodel.caseid = caseid; dwmodel.ddtableid = caseid; dwmodel.filename = "案件来源登记表"; dwmodel.status = 0; //生成WORD、PDF文件 DocumentReplaceHandleBLL drhbll = new DocumentReplaceHandleBLL(); Dictionary <string, string> dic = bll.ToWordPDF(dwmodel.filename, System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/" + dwmodel.filename + ".docx"), ConfigManageClass.LegalCasePath, drhbll.GetDocumentDictory(model)); dwmodel.lastwordpath = dic["WordPath"]; dwmodel.lastpdfpath = dic["PDFPath"]; WfsasList.Add(dwmodel); bll.function_AddWfsas(WfsasList); #endregion HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent("{\"success\":true,\"caseid\":" + caseid + "," + wf_data + "}", 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); }
public object AddSimpleCaseApi(Case_SimpleCasesModel csmodel) { Case_SimpleCasesBLL bll = new Case_SimpleCasesBLL(); Case_CaseSourcesBLL casesourcebll = new Case_CaseSourcesBLL(); Case_SimpleCasesModel model = new Case_SimpleCasesModel(); #region 图片处理 List <FileClass> List_FC = new List <FileClass>(); string OriginPath = ConfigManageClass.LegalCasePath; string smallPath = ConfigManageClass.LegalCasePath; if (csmodel.uploadpanelValue != null) { for (int i = 0; i < csmodel.uploadpanelValue.Length; i++) { string imgArray = csmodel.uploadpanelValue[i]; string[] spilt = imgArray.Split(','); if (spilt.Length > 0) { byte[] imgByte = Convert.FromBase64String(spilt[1]); FileClass imgFile = FileFactory.FileUpload(imgByte, ".jpg", OriginPath, smallPath, 100, 100); List_FC.Add(imgFile); } } } #endregion try { model.cfjdsbh = csmodel.cfjdsbh; model.casetypeid = csmodel.casetypeid; model.casename = csmodel.casename; model.qlsxid = csmodel.qlsxid; model.qlsx = csmodel.qlsx; model.casereason = csmodel.casereason; model.caseaddress = csmodel.caseaddress; model.sitedatetime = csmodel.sitedatetime; model.geographical84 = csmodel.geographical84; model.persontype = csmodel.persontype; if (csmodel.persontype == "type_zrr") { model.p_name = csmodel.p_name; model.f_card = csmodel.p_cardnum; } else { model.f_card = csmodel.f_cardnum; model.f_name = csmodel.f_name; model.f_dbr = csmodel.f_dbr; model.f_cardnum = csmodel.f_card; } model.p_sex = csmodel.p_sex; model.p_cardtype = csmodel.p_cardtype; model.f_cardtype = csmodel.p_cardtype; model.p_cardnum = csmodel.p_cardnum; model.f_wtr = csmodel.f_wtr; model.contactphone = csmodel.contactphone; model.contactaddress = csmodel.contactaddress; model.flfg = csmodel.flfg; model.clyj = csmodel.clyj; model.wfqx = csmodel.wfqx; model.cf = csmodel.cf; model.casecontent = csmodel.casecontent; model.jktype = csmodel.jktype; model.fk_money = csmodel.fk_money; model.bank_name = csmodel.bank_name; model.bank_account = csmodel.bank_account; model.bank_accountname = csmodel.bank_accountname; model.zfr_name = csmodel.zfr_name; model.zf_card = csmodel.zf_card; model.zf_time = csmodel.zf_time; model.zf_address = csmodel.zf_address; model.createuserid = csmodel.createuserid; model.isphone = 1; int simpleid = bll.AddSimpleCases(model); Case_WorkFlowManagerBLL wfbll = new Case_WorkFlowManagerBLL(); Case_WorkFlowClass wf = new Case_WorkFlowClass(); #region 案件流程 wf.FunctionName = "case_sources"; wf.WFID = "2017022219210001"; wf.WFDID = "2017022219200001"; wf.NextWFDID = "2017022219200002"; wf.NextWFUSERIDS = ""; //下一步流程ID wf.IsSendMsg = "false"; //是否发送短信 wf.casereason = csmodel.casereason; wf.WFCreateUserID = csmodel.createuserid; //当前流程创建人 wf.casetype = 3; wf.caseid = simpleid; #endregion string wf_data = wfbll.WF_Submit(wf); #region 简易案件文书 List <Doc_WfsasModel> WfsasList = new List <Doc_WfsasModel>(); Doc_WfsasModel dwmodel = new Doc_WfsasModel(); dwmodel.wfsaid = wf_data.Split(new string[] { "wfsaid\":\"" }, StringSplitOptions.RemoveEmptyEntries)[1].Substring(0, 22); dwmodel.filetyoe = 3; dwmodel.ddid = 12; dwmodel.createuserid = csmodel.createuserid; dwmodel.ddtablename = "case_simplecases"; dwmodel.caseid = simpleid; dwmodel.ddtableid = simpleid; dwmodel.filename = "立案审批表"; dwmodel.status = 0; //生成WORD、PDF文件 DocumentReplaceHandleBLL drhbll = new DocumentReplaceHandleBLL(); Dictionary <string, string> dic = casesourcebll.ToWordPDF(dwmodel.filename, System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/" + dwmodel.filename + (model.persontype == "type_zrr" ? "(个人)" : "(单位)") + ".docx"), ConfigManageClass.LegalCasePath, drhbll.GetDocumentDictory(model)); dwmodel.lastwordpath = dic["WordPath"]; dwmodel.lastpdfpath = dic["PDFPath"]; WfsasList.Add(dwmodel); casesourcebll.function_AddWfsas(WfsasList); #endregion #region 手机端上报图片文书 int i = 0; Dictionary <string, string> imgdic = new Dictionary <string, string>(); string abspath = System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/图片模板.docx"); foreach (var item in List_FC) { imgdic.Add(i.ToString(), OriginPath + item.OriginalPath); i++; } casesourcebll.ImagesToWordPDF(dwmodel.filename, abspath, ConfigManageClass.LegalCasePath, imgdic); #endregion #region 添加日志 SystemLogBLL slbll = new SystemLogBLL(); slbll.WriteSystemLog("简易案件", "", csmodel.createuserid); #endregion return(new { msg = "上报成功", resCode = 1 }); } catch (Exception) { return(new { msg = "json数据不正确", resCode = 0 }); } }
public HttpResponseMessage AddSimpleCase() { HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request; Case_SimpleCasesBLL bll = new Case_SimpleCasesBLL(); Case_CaseSourcesBLL casesourcebll = new Case_CaseSourcesBLL(); Case_SimpleCasesModel model = new Case_SimpleCasesModel(); model.cfjdsbh = request["cfjdsbh"]; model.casetypeid = request["casetypeid"]; model.casename = request["casename"]; model.qlsxid = request["qlsxid"]; model.qlsx = request["qlsx"]; model.casereason = request["casereason"]; model.fromcasesource = request["fromcasesource"]; model.caseaddress = request["caseaddress"]; model.sitedatetime = Convert.ToDateTime(request["sitedatetime"]); model.geographical84 = request["grometry"]; model.persontype = request["persontype"]; model.f_card = request["f_card"]; if (request["persontype"] == "type_zrr") { model.p_name = request["p_name"]; model.p_contactphone = request["contactphone"]; model.p_contactaddress = request["contactaddress"]; model.p_cardtypename = request["f_cardtype"] == "1" ? "身份证" : request["f_cardtype"] == "2" ? "军官证" : "护照"; } else { model.f_name = request["f_name"]; model.f_dbr = request["f_dbr"]; model.f_cardnum = request["f_cardnum"]; model.f_contactphone = request["contactphone"]; model.f_contactaddress = request["contactaddress"]; model.f_cardtypename = request["f_cardtype"] == "1" ? "组织机构代码证" : request["f_cardtype"] == "2" ? "营业执照" : request["f_cardtype"] == "3" ? "税务登记证" : "社会信用代码"; } model.p_sex = request["p_sex"]; model.p_cardtype = request["p_cardtype"]; model.p_cardnum = request["p_cardnum"]; model.f_cardtype = request["f_cardtype"]; model.f_wtr = request["f_wtr"]; model.contactphone = request["contactphone"]; model.contactaddress = request["contactaddress"]; model.flfg = request["flfg"]; model.clyj = request["clyj"]; model.wfqx = request["wfqx"]; model.cf = request["cf"]; model.zdmj = !string.IsNullOrEmpty(request["zdmj"]) ? Convert.ToDouble(request["zdmj"]) : 0; model.gdmj = !string.IsNullOrEmpty(request["gdmj"]) ? Convert.ToDouble(request["gdmj"]) : 0; model.gtjzmj = !string.IsNullOrEmpty(request["gtjzmj"]) ? Convert.ToDouble(request["gtjzmj"]) : 0; model.ghjzmj = !string.IsNullOrEmpty(request["ghjzmj"]) ? Convert.ToDouble(request["ghjzmj"]) : 0; model.casecontent = request["casecontent"]; model.jktype = request["jktype"]; if (!string.IsNullOrEmpty(request["fk_money"])) { model.fk_money = Convert.ToDecimal(request["fk_money"]); } model.bank_name = request["bank_name"]; model.bank_account = request["bank_account"]; model.bank_accountname = request["bank_accountname"]; model.zfr_name = request["zfr_name"]; model.zf_card = request["zf_card"]; model.zf_time = Convert.ToDateTime(request["zf_time"]); model.zf_address = request["zf_address"]; model.createuserid = Convert.ToInt32(request["userid"]); model.cswfsid = request["cswfsid"]; if (!string.IsNullOrEmpty(request["tzcsid"])) { model.tzcsid = Convert.ToInt32(request["tzcsid"]); } model.isphone = 0; int caseid = bll.AddSimpleCases(model); Case_WorkFlowManagerBLL wfbll = new Case_WorkFlowManagerBLL(); Case_WorkFlowClass wf = new Case_WorkFlowClass(); if (!string.IsNullOrEmpty(request["tzcsid"])) { casesourcebll.RegisterCaseSources(Convert.ToInt32(request["tzcsid"])); } #region 案件流程 wf.FunctionName = "case_simplecases"; wf.WFID = "2017022316200001"; wf.WFDID = "2017022316250001"; wf.NextWFDID = "2017022316250002"; wf.NextWFUSERIDS = ""; //下一步流程ID wf.IsSendMsg = "false"; //是否发送短信 wf.WFCreateUserID = Convert.ToInt32(request.Form["userid"]); //当前流程创建人 wf.caseid = caseid; wf.casetype = 3; wf.casereason = model.casereason; #endregion string wf_data = wfbll.WF_Submit(wf); #region 简易案件文书 List <Doc_WfsasModel> WfsasList = new List <Doc_WfsasModel>(); Doc_WfsasModel dwmodel = new Doc_WfsasModel(); dwmodel.wfsaid = wf_data.Split(new string[] { "wfsaid\":\"" }, StringSplitOptions.RemoveEmptyEntries)[1].Substring(0, 22); dwmodel.filetyoe = 3; dwmodel.ddid = 12; dwmodel.createuserid = Convert.ToInt32(request["userid"]); dwmodel.ddtablename = "case_simplecases"; dwmodel.caseid = caseid; dwmodel.ddtableid = caseid; dwmodel.filename = "立案审批表"; dwmodel.status = 0; //生成WORD、PDF文件 DocumentReplaceHandleBLL drhbll = new DocumentReplaceHandleBLL(); Dictionary <string, string> dic = casesourcebll.ToWordPDF(dwmodel.filename, System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/" + dwmodel.filename + (model.persontype == "type_zrr" ? "(个人)" : "(单位)") + ".docx"), ConfigManageClass.LegalCasePath, drhbll.GetDocumentDictory(model)); dwmodel.lastwordpath = dic["WordPath"]; dwmodel.lastpdfpath = dic["PDFPath"]; WfsasList.Add(dwmodel); casesourcebll.function_AddWfsas(WfsasList); #endregion #region 添加日志 SystemLogBLL slbll = new SystemLogBLL(); slbll.WriteSystemLog("简易案件", "", Convert.ToInt32(request["userid"])); #endregion HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent("{\"success\":true," + wf_data + "}", Encoding.GetEncoding("UTF-8"), "text/html"); return(response); }
public HttpResponseMessage EditSimpleCase() { HttpRequestBase request = ((HttpContextWrapper)this.Request.Properties["MS_HttpContext"]).Request; Case_SimpleCasesBLL bll = new Case_SimpleCasesBLL(); Case_CaseSourcesBLL casesourcebll = new Case_CaseSourcesBLL(); Case_SimpleCasesModel model = bll.GetSimpleCaseList(Convert.ToInt32(request["simpleid"])); model.cfjdsbh = request["cfjdsbh"]; model.casetypeid = request["casetypeid"]; model.casesourcename = request["casesourcename"]; model.casename = request["casename"]; model.qlsxid = request["qlsxid"]; model.qlsx = request["qlsx"]; model.casereason = request["casereason"]; model.fromcasesource = request["fromcasesource"]; model.caseaddress = request["caseaddress"]; model.sitedatetime = Convert.ToDateTime(request["sitedatetime"]); model.geographical84 = request["grometry"]; model.persontype = request["persontype"]; model.f_card = request["f_card"]; if (request["persontype"] == "type_zrr") { model.p_name = request["p_name"]; model.p_contactphone = request["contactphone"]; model.p_contactaddress = request["contactaddress"]; model.p_cardtypename = request["f_cardtype"] == "1" ? "身份证" : request["f_cardtype"] == "2" ? "军官证" : "护照"; } else { model.f_name = request["f_name"]; model.f_dbr = request["f_dbr"]; model.f_cardnum = request["f_cardnum"]; model.f_contactphone = request["contactphone"]; model.f_contactaddress = request["contactaddress"]; model.f_cardtypename = request["f_cardtype"] == "1" ? "组织机构代码证" : request["f_cardtype"] == "2" ? "营业执照" : request["f_cardtype"] == "3" ? "税务登记证" : "社会信用代码"; } model.p_sex = request["p_sex"]; model.p_cardtype = request["p_cardtype"]; model.p_cardnum = request["p_cardnum"]; model.f_cardtype = request["f_cardtype"]; model.f_wtr = request["f_wtr"]; model.contactphone = request["contactphone"]; model.contactaddress = request["contactaddress"]; model.flfg = request["flfg"]; model.clyj = request["clyj"]; model.wfqx = request["wfqx"]; model.cf = request["cf"]; model.zdmj = !string.IsNullOrEmpty(request["zdmj"]) ? Convert.ToDouble(request["zdmj"]) : 0; model.gdmj = !string.IsNullOrEmpty(request["gdmj"]) ? Convert.ToDouble(request["gdmj"]) : 0; model.gtjzmj = !string.IsNullOrEmpty(request["gtjzmj"]) ? Convert.ToDouble(request["gtjzmj"]) : 0; model.ghjzmj = !string.IsNullOrEmpty(request["ghjzmj"]) ? Convert.ToDouble(request["ghjzmj"]) : 0; model.casecontent = request["casecontent"]; model.jktype = request["jktype"]; if (!string.IsNullOrEmpty(request["fk_money"])) { model.fk_money = Convert.ToDecimal(request["fk_money"]); } model.bank_name = request["bank_name"]; model.bank_account = request["bank_account"]; model.bank_accountname = request["bank_accountname"]; model.zfr_name = request["zfr_name"]; model.zf_card = request["zf_card"]; model.zf_time = Convert.ToDateTime(request["zf_time"]); model.zf_address = request["zf_address"]; model.createuserid = Convert.ToInt32(request["userid"]); model.cswfsid = request["cswfsid"]; model.isphone = 0; bll.EditSimpleCases(model); #region 简易案件文书 //生成WORD、PDF文件 DocumentReplaceHandleBLL drhbll = new DocumentReplaceHandleBLL(); Dictionary <string, string> dic = casesourcebll.ToWordPDF("立案审批表", System.Web.Hosting.HostingEnvironment.MapPath("~/DocumentTemplate/" + "立案审批表" + (model.persontype == "type_zrr" ? "(个人)" : "(单位)") + ".docx"), ConfigManageClass.LegalCasePath, drhbll.GetDocumentDictory(model)); Doc_WfdddrsBLL dwbll = new Doc_WfdddrsBLL(); int result = dwbll.EditWFSASModel(Convert.ToInt32(request["dwfsasid"]), dic["WordPath"], dic["PDFPath"], Convert.ToInt32(request["userid"])); #endregion HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (result > 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); }