//法制科科员回复 public int WF_Reply(Case_WorkFlowClass workflow) { using (Entities db = new Entities()){ case_workflowspecificusers model = db.case_workflowspecificusers.FirstOrDefault(t => t.userid == workflow.WFCreateUserID && t.wfsaid == workflow.WFSAID); model.content = workflow.DEALCONTENT; model.dealtime = DateTime.Now; model.status = 2; return(db.SaveChanges()); } }
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 int WF_Reply(Case_WorkFlowClass workflow) { return(dal.WF_Reply(workflow)); }
public string WF_Submit(Case_WorkFlowClass workflow) { return(dal.WF_Submit(workflow)); }
public string WF_Submit(Case_WorkFlowClass workflow) { string FunctionName = workflow.FunctionName; //具体表名 string WFID = workflow.WFID; //工作流编号 string WFDID = workflow.WFDID; //工作流环节编号 string WFSID = workflow.WFSID; //活动实例编号 string WFSAID = workflow.WFSAID; //当前环节实例编号 string dealContent = workflow.DEALCONTENT; //会签意见 string NextWFDID = workflow.NextWFDID; //下一个环节编号 string NextWFUSERIDS = workflow.NextWFUSERIDS; //获取下一个环节的用户 string IsSendMsg = workflow.IsSendMsg; //是否发送短信 int? casetype = workflow.casetype; //案件类型 int? casesourceid = workflow.casesourceid; //案件来源 string casebh = workflow.casebh; //立案编号 string casereason = workflow.casereason; //案由 string casetypeid = workflow.casetypeid; //案件类型 string contact = workflow.contact; //联系人 string contactphone = workflow.contactphone; //联系电话 string address = workflow.address; //案发地址 string cswfsid = workflow.cswfsid; //案源表标识 string casemode = workflow.casemode; //一般案件状态 string casestatus = workflow.casestatus; //案件属于类型 int? caseid = workflow.caseid; DateTime?stime = workflow.STIME; DateTime?etime = workflow.ETIME; #region 检查是否存在当前实例,如果不存在则增加当前活动实例 case_workflowdetails cwfsmodel = new Case_WorkFlowDetailsDAL().GetSingle(NextWFDID); string wfsname = cwfsmodel.wfdname;//活动流程名称 case_workflowspecifics WFSModel = null; if (!string.IsNullOrEmpty(workflow.WFSID)) { WFSModel = new Case_WorkFlowSpecificsDAL().GetSingle(workflow.WFSID); if (WFSModel == null) { WFSID = ""; } else { WFSModel.wfsname = wfsname; new Case_WorkFlowSpecificsDAL().Update(WFSModel); } } if (string.IsNullOrEmpty(WFSID)) { WFSModel = new case_workflowspecifics(); WFSModel.wfsid = GetNewId(); WFSModel.wfid = WFID; WFSModel.createuserid = workflow.WFCreateUserID; WFSModel.createtime = DateTime.Now; WFSModel.status = 1; WFSModel.wfsname = wfsname; WFSModel.currentwfsaid = WFDID; WFSModel.filestatus = 1; WFSModel.casetype = casetype; WFSModel.casebh = casebh; WFSModel.casesourceid = casesourceid; WFSModel.casereason = casereason; WFSModel.casetypeid = casetypeid; WFSModel.contact = contact; WFSModel.contactphone = contactphone; WFSModel.address = address; WFSModel.cswfsid = cswfsid; WFSModel.casemode = casemode; WFSModel.caseid = caseid; WFSModel.casestatus = casestatus; new Case_WorkFlowSpecificsDAL().Add(WFSModel); WFSID = WFSModel.wfsid; } #endregion string wfdname = "当前环节名称"; decimal oldStatus;//当前环节是否已经处理完成 1:未处理,2已经处理 //更新或者增加当前流程的具体事例---返回当前环节编号 WFSAID = function_Case_DealCurentActivity(WFSAID, WFSID, workflow.WFCreateUserID.Value, 2, WFDID, out oldStatus, stime, etime); //更新或者增加当前环节用户处理的意见---返回当前环节用户需要处理的编号 string WFSUID = function_WF_DealCurentActivityUser(WFSAID, workflow.WFCreateUserID.Value, dealContent, 2, DateTime.Now, "false", wfsname, workflow.WFCreateUserID.Value); #region 附件处理 //增加当前处理用户的附件 //switch (workflow.FunctionName) //{ // case "case_casesources"://案源管理 // function_Case_WorkFlowAttrach_smsj(WFSAID, workflow.WfsasModel); // break; // default: // break; //} #endregion //当前状态为处理,则说明是第一个人处理,则需要增加下一个环节,如果当前环节已经处理,则不需要增加下一个环节 string NextWFSAID = ""; if (oldStatus == 1) { //获取该环节是否为最后一个环节 case_workflowdetails wfdModel = new Case_WorkFlowDetailsDAL().GetSingle(NextWFDID); //如果下一个环节的子环节存在,则状态为执行中,内容为空,否则下一个环节状态为结束,内容为已结束 int status_wfsa = 0; string content_wfsa = string.Empty; if (wfdModel != null && !string.IsNullOrEmpty(wfdModel.nextid)) { status_wfsa = 1; content_wfsa = ""; } else { wfdname = wfdModel.wfdname; //结束该流程 WFSModel = new Case_WorkFlowSpecificsDAL().GetSingle(WFSID); if (WFSModel != null) { WFSModel.status = 2; new Case_WorkFlowSpecificsDAL().Update(WFSModel); } status_wfsa = 2; content_wfsa = "已结束"; } wfdname = wfdModel.wfdname; #region 增加下一个环节 //增加环节 NextWFSAID = function_Case_DealCurentActivity("", WFSID, workflow.WFCreateUserID.Value, status_wfsa, NextWFDID, out oldStatus, stime, etime); #region 更新活动实例的当前环节编号 WFSModel = new Case_WorkFlowSpecificsDAL().GetSingle(WFSID); if (WFSModel != null) { WFSModel.currentwfsaid = NextWFSAID; WFSModel.status = status_wfsa; WFSModel.wfsname = wfsname; new Case_WorkFlowSpecificsDAL().Update(WFSModel); } #endregion //增加下一个环节的能操作的用户 if (!string.IsNullOrEmpty(NextWFUSERIDS)) { string[] NextWFUSERIDS_split = NextWFUSERIDS.Split(','); foreach (var item in NextWFUSERIDS_split) { decimal userid; DateTime?dealTime = null; if (decimal.TryParse(item, out userid)) { if (status_wfsa == 2) { userid = workflow.WFCreateUserID.Value; dealTime = DateTime.Now; IsSendMsg = "false"; } //增加流程能操作的用户 function_WF_DealCurentActivityUser(NextWFSAID, (int)userid, content_wfsa, status_wfsa, dealTime, IsSendMsg, wfsname, workflow.WFCreateUserID); } } } #endregion } return("\"wfsid\":\"" + WFSID + "\",\"wfsaid\":\"" + WFSAID + "\",\"nextwfsaid\":\"" + NextWFSAID + "\",\"wfdid\":\"" + WFDID + "\",\"wfdname\":\"" + wfdname + "\""); }
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 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 }); } }