From ba6237853e7303fd5dcee46320a835a5da05aed5 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 4 Dec 2023 17:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=A3=81=E5=86=B3=E4=B9=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/constant/Constants.java | 8 + .../domain/ArbitrateRecord.java | 16 + .../wisdomarbitrate/domain/CaseAffiliate.java | 16 +- .../domain/CaseApplication.java | 152 ++++++ .../mapper/CaseAttachMapper.java | 1 + .../service/impl/AdjudicationServiceImpl.java | 120 +++-- .../impl/CaseApplicationServiceImpl.java | 507 +++++++++++++++--- .../ruoyi/wisdomarbitrate/utils/OCRUtils.java | 38 +- .../wisdomarbitrate/ArbitrateRecordMapper.xml | 18 +- .../CaseAffiliateLogMapper.xml | 9 +- .../wisdomarbitrate/CaseAffiliateMapper.xml | 14 +- .../CaseApplicationLogMapper.xml | 59 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 44 +- .../wisdomarbitrate/CaseAttachMapper.xml | 8 + 14 files changed, 875 insertions(+), 135 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 7fdb47f..e46e514 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -28,6 +28,14 @@ public class Constants * http请求 */ public static final String HTTP = "http://"; + /** + * br标签 + */ + public static final String BR = "
"; + /** + * pdf拼接符 + */ + public static final String PDFSTR = "∰"; /** * https请求 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index 6c4282b..e1286e6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -38,6 +38,22 @@ public class ArbitrateRecord extends BaseEntity { private Integer appliIsAbsen; /** 被申请人质证意见 */ private String responDefenOpini; + /** + * 本案争议焦点 + */ + private String caseFocus; + /** + * 本案事实 + */ + private String caseFacts; + /** + * 被申请人对上述材料的质证意见 + */ + private String respondentOpinion; + /** + * 申请人对上述材料的质证意见 + */ + private String applicantOpinion; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java index 895c126..6e154e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -61,6 +61,19 @@ public class CaseAffiliate extends BaseEntity { */ private String changeColumn; + /** + * 代理人邮箱 + */ + private String agentEmail; + + public String getAgentEmail() { + return agentEmail; + } + + public void setAgentEmail(String agentEmail) { + this.agentEmail = agentEmail; + } + public String getChangeColumn() { return changeColumn; } @@ -126,9 +139,6 @@ public class CaseAffiliate extends BaseEntity { this.responSex = responSex; } - - - /** 身份证号 */ @Excel(name = "身份证号") private String identityNum; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 1b1f923..d373731 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -829,6 +829,16 @@ public class CaseApplication extends BaseEntity { * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销 */ private Integer updateSubmitStatus; + /** 合同名称 */ + private String contractName; + + public String getContractName() { + return contractName; + } + + public void setContractName(String contractName) { + this.contractName = contractName; + } public Integer getVersion() { return version; @@ -1180,10 +1190,152 @@ public class CaseApplication extends BaseEntity { this.caseAffiliates = caseAffiliates; } + /** + * 事实和理由 + */ + private String facts; + /** + * 合同甲方 + */ + private String partyA; + /** + * 利率 + */ + private String interestRate; + /** + * 待还金额 + */ + private String outstandingMoney; + /** + * 调解达成协议内容 + */ + private String mediationAgreement; + /** + * 金融消费纠纷基本情况 + */ + private String disputes; + /** + * 贷款类型 + */ + private String loanType; + /** + * 贷款期限 + */ + private String loanTerm; + /** + * 本案争议焦点 + */ + private String caseFocus; + /** + * 本案事实 + */ + private String caseFacts; + /** + * 被申请人对上述材料的质证意见 + */ + private String respondentOpinion; + /** + * 申请人对上述材料的质证意见 + */ + private String applicantOpinion; + public String getCaseFocus() { + return caseFocus; + } + public void setCaseFocus(String caseFocus) { + this.caseFocus = caseFocus; + } + public String getCaseFacts() { + return caseFacts; + } + public void setCaseFacts(String caseFacts) { + this.caseFacts = caseFacts; + } + public String getRespondentOpinion() { + return respondentOpinion; + } + public void setRespondentOpinion(String respondentOpinion) { + this.respondentOpinion = respondentOpinion; + } + + public String getApplicantOpinion() { + return applicantOpinion; + } + + public void setApplicantOpinion(String applicantOpinion) { + this.applicantOpinion = applicantOpinion; + } + + public String getDisputes() { + return disputes; + } + + public void setDisputes(String disputes) { + this.disputes = disputes; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public String getLoanTerm() { + return loanTerm; + } + + public void setLoanTerm(String loanTerm) { + this.loanTerm = loanTerm; + } + + public String getMediationAgreement() { + return mediationAgreement; + } + + public void setMediationAgreement(String mediationAgreement) { + this.mediationAgreement = mediationAgreement; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getFacts() { + return facts; + } + + public void setFacts(String facts) { + this.facts = facts; + } + + public String getPartyA() { + return partyA; + } + + public void setPartyA(String partyA) { + this.partyA = partyA; + } + + public String getInterestRate() { + return interestRate; + } + + public void setInterestRate(String interestRate) { + this.interestRate = interestRate; + } + + public String getOutstandingMoney() { + return outstandingMoney; + } + + public void setOutstandingMoney(String outstandingMoney) { + this.outstandingMoney = outstandingMoney; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 1b939b8..8c9cbcd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -10,6 +10,7 @@ import java.util.List; @Mapper public interface CaseAttachMapper { int save(CaseAttach caseAttach); + int batchSave(@Param("list") List caseAttach); List queryAnnexPathByCaseId(Long id); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 6456593..ff53d09 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.deepoove.poi.data.PictureRenderData; @@ -31,12 +32,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.io.*; +import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; @@ -92,12 +95,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(id); List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + String applicantName=""; + String debtorName = ""; List nameAgentList = new ArrayList<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { for (CaseAffiliate affiliate : caseAffiliates) { //获取身份类型 int identityType = affiliate.getIdentityType(); if (identityType == 1) { //申请人 + applicantName=affiliate.getName(); datas.put("appName", affiliate.getName()); datas.put("appAddress", affiliate.getResidenAffili()); datas.put("appContactAddress", affiliate.getContactAddress()); @@ -107,6 +113,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); nameAgentList.add(affiliate.getNameAgent()); } else if (identityType == 2) { //被申请人 + debtorName=affiliate.getName(); datas.put("resName", affiliate.getName()); datas.put("resAddress", affiliate.getResidenAffili()); String responSex = affiliate.getResponSex(); @@ -119,7 +126,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } Date responBirth = affiliate.getResponBirth(); if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); String responBirthStr = sdf.format(responBirth); datas.put("resDateOfBirth", responBirthStr); } @@ -129,7 +136,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); // 将日期格式化为字符串 String createTimeStr = sdf.format(createTime); datas.put("submissionDate", createTimeStr); @@ -176,6 +183,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { Date hearDate = caseApplication1.getHearDate(); if (hearDate != null) { String hearDateStr = sdf.format(hearDate); + + //线上开庭时 if (arbitratMethod == 1) { String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; @@ -192,6 +201,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("written2", written2); } } + Integer isAbsence = caseApplication1.getIsAbsence(); if (isAbsence == null) { datas.put("absent1", null); @@ -246,7 +256,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("attend5", attend5); datas.put("attend6", attend6); datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); + datas.put("responCrossOpin", arbitrateRecord1.getRespondentOpinion()); datas.put("appAgentName2", nameAgentList.get(0)); datas.put("resAgentName", nameAgentList.get(1)); if (arbitratMethod == 1) { @@ -261,51 +271,93 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("attend9", attend9); } } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); + // 申请人的仲裁请求及事实和理由 申请人称 在事实与理由抓取 + datas.put("claims", caseApplication1.getFacts()); +// datas.put("request", caseApplication1.getRequestRule()); CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); + // todo 合同编号 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日"); + // datas.put("partyA", caseApplication2.getContractNumber()); + // Date loanStartDate = caseApplication2.getLoanStartDate(); + // datas.put("lonStartDate",simpleDateFormat.format(loanStartDate)); + // datas.put("contractNumber",caseApplication2.getContractNumber()); + // 合同名称 + // datas.put("contractName",caseApplication2.getContractName()); + // todo 查询该批号的裁决内容模板 + String template="一、被申请人{1}应于{2}前向申请人{3}一次性支付剩余贷款{4}元。\n" + + "二、本案仲裁费人民币{5}元(已由申请人预缴),由申请人{6}承担\n"; + Date loanEndDate = caseApplication2.getLoanEndDate(); + + String outstandingMoney = caseApplication2.getOutstandingMoney(); + NumberFormat format = NumberFormat.getInstance(); + String outstandingMoneyFormat=""; + + if(StrUtil.isNotEmpty(outstandingMoney)) { + outstandingMoneyFormat = format.format(new BigDecimal(outstandingMoney)); + } + String rulingFollows = template.replace("{1}", debtorName).replace("{2}", simpleDateFormat.format(loanEndDate)) + .replace("{3}", applicantName).replace("{4}", outstandingMoneyFormat) + .replace("{5}", String.valueOf(caseApplication2.getFeePayable())) + .replace("{6}", applicantName); + // 请求仲裁庭裁决 + datas.put("request", caseApplication1.getArbitratClaims()); List caseAttachList1 = caseApplication2.getCaseAttachList(); if (caseAttachList1 != null && caseAttachList1.size() > 0) { + StringBuilder debtorFiles=new StringBuilder(); + StringBuilder applicantFiles=new StringBuilder(); for (CaseAttach caseAttach : caseAttachList1) { if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - datas.put("resEvidenceMaterial", pictureRenderData); - } + debtorFiles.append(caseAttach.getAnnexName()).append("\r\n"); +// boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); +// if (isImageFile) { +// String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); +// System.out.println("路径是===========" + annexPath); +// PictureRenderData pictureRenderData = WordUtil +// .rebuildImageContent(100, 100, null, annexPath); +// datas.put("resEvidenceMaterial", pictureRenderData); +// } + } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - //申请人证据材料 - datas.put("appEvidenceMaterial", pictureRenderData); - } +// String annexName = caseAttach.getAnnexName(); +// boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); +// if (isImageFile) { +// String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); +// System.out.println("路径是===========" + annexPath); +// PictureRenderData pictureRenderData = WordUtil +// .rebuildImageContent(100, 100, null, annexPath); +// //申请人证据材料 +// datas.put("appEvidenceMaterial", pictureRenderData); +// } + applicantFiles.append(caseAttach.getAnnexName()).append("\r\n"); + } } + // //被申请人证据材料 + datas.put("resEvidenceMaterial", debtorFiles.toString()); + //申请人证据材料 + datas.put("appEvidenceMaterial", applicantFiles.toString()); } - datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实"); - - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("arbitrateThink", " 被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); + // 申请人对上述材料的质证意见为 + datas.put("applicaCrossOpin", arbitrateRecord1.getApplicantOpinion()); + // 仲裁庭经审理,查明本案事实如下: + datas.put("factDetermi", arbitrateRecord1.getCaseFacts()); + // 关于本案争议焦点 + datas.put("arbitrateThink", arbitrateRecord1.getCaseFocus()); +// datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); + // 最终裁决 + datas.put("rulingFollows", rulingFollows); LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); datas.put("year", year); String month = String.format("%02d", now.getMonthValue()); String day = String.format("%02d", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; - // String modalFilePath = "D:/develop/新裁决书模板.docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - // String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; + // todo 服务器路径 +// String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; + String modalFilePath = "D:/新裁决书模板.docx"; + // todo 服务器路径 + // String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String saveFolderPath = "D:/"; String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; String resultFilePath = saveFolderPath + "/" + fileName; @@ -1045,4 +1097,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return s; } } + + } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 615f3ae..616ba2d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -17,6 +17,7 @@ import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; @@ -66,11 +67,14 @@ import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.text.NumberFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.util.*; import java.util.function.Function; +import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -389,8 +393,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (file.isEmpty()) { return AjaxResult.error("请选择要上传的文件"); } - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; - // String targetPath = "D:\\home\\unzip\\"; + // todo 服务器上要放开 +// String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; + String targetPath = "D:/zip"; File zipFile = null; InputStream ins = null; try { @@ -407,7 +412,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String zipName = file.getOriginalFilename(); String subzipName = zipName.substring(0, zipName.indexOf(".zip")); // String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName; - String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName; + // todo 服务器上要放开 +// String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName; + String zipPath = "D:/" + subzipName; File dirUnzipPath = new File(zipPath); List allFiles = new ArrayList<>(); @@ -1360,7 +1367,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int deletecaseApplicationByIds(List ids) { int rows = caseApplicationMapper.batchDeletecaseApplication(ids); caseAffiliateMapper.batchDeletecaseAffiliate(ids); - caseApplicationLogMapper.batchDeleteLog(ids); + // caseApplicationLogMapper.batchDeleteLog(ids); return rows; } @@ -2296,14 +2303,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (createBy != null) { arbitrateRecordselect.setCreateBy(createBy); } - + // CaseApplication caseApplicationupdate = new CaseApplication(); caseApplicationupdate.setId(arbitrateRecordselect.getCaseAppliId()); caseApplicationupdate.setIsAbsence(arbitrateRecordselect.getIsAbsence()); caseApplicationupdate.setAppliIsAbsen(arbitrateRecordselect.getAppliIsAbsen()); - caseApplicationupdate.setResponCrossOpin(arbitrateRecordselect.getResponCrossOpin()); - caseApplicationupdate.setApplicaCrossOpin(arbitrateRecordselect.getApplicaCrossOpin()); - caseApplicationupdate.setResponDefenOpini(arbitrateRecordselect.getResponDefenOpini()); + caseApplicationupdate.setRespondentOpinion(arbitrateRecordselect.getRespondentOpinion()); + caseApplicationupdate.setApplicantOpinion(arbitrateRecordselect.getApplicantOpinion()); + caseApplicationupdate.setCaseFacts(arbitrateRecordselect.getCaseFacts()); + caseApplicationupdate.setCaseFocus(arbitrateRecordselect.getCaseFocus()); caseApplicationMapper.submitCaseApplication(caseApplicationupdate); //先判断案件是否已经提交过仲裁结果 @@ -2914,15 +2922,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return AjaxResult.error("请选择要上传的文件"); } UUID uuid = UUID.randomUUID(); - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/"; - //String targetPath = "D:/home/unzip/" + uuid + "/"; + // todo 服务器上要放开 +// String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/"; + String targetPath = "D:/zip"; File zipFile = null; InputStream ins = null; try { ins = file.getInputStream(); //上传的压缩包保存的路径 - String savePath = "/home/ruoyi/uploadPath/upload/zipFile/"; - //String savePath = "D:/home/zipFile/"; + // todo 服务器上要放开 +// String savePath = "/home/ruoyi/uploadPath/upload/zipFile/"; + String savePath = "D:/zip/"; String saveName = uuid + "_" + file.getOriginalFilename(); zipFile = new File(savePath + saveName); inputChangeToFile(ins, zipFile); @@ -2933,96 +2943,204 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath); if (unzipSuccess) { File directory = new File(targetPath); - List andConvertPDF = findAndConvertPDF(directory); + Map andConvertPDF = findAndConvertPDF(directory); if (andConvertPDF != null && andConvertPDF.size() > 0) { - //遍历路径 - for (String pdfUrl : andConvertPDF) { - //获取文件的页数 - System.out.println("这是查到的符合条件的文件路径====="+pdfUrl); - int fileNumPage = getFileNumPage(pdfUrl); - //文件转成base64 - String base64 = OCRUtils.pdfConvertBase64(pdfUrl); - if (base64 == null){ + Map> map = new HashMap<>(); + // oc识别pdf并组装数据 + // 抓取申请书 + if(!OCRAndBuildInfo(andConvertPDF, "仲裁申请书", map)){ return AjaxResult.error("文件转base64编码有误,请检查"); } - StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象 - for (int i = 0; i < fileNumPage; i++) { - //对接腾讯云接口.识别里面的数据 - String text = OCRUtils.pdfIdentifyText(base64, i + 1); - if (stringBuilder.length() > 0) { - stringBuilder.append(","); // 在已有内容的情况下添加逗号分隔符 - } - stringBuilder.append(text); // 拼接当前的字符串 - } - // 将字符串按逗号分隔符切割 - String[] fields = stringBuilder.toString().split(","); - Map> map = new HashMap<>(); - for (String field : fields) { - // 对于每个字段,再按冒号分隔符拆分出键和值 - String[] keyValue = field.split(":"); - if (keyValue.length >= 2) { - String key = keyValue[0]; - String value = keyValue[1]; - // 判断Map中是否已存在该键 - if (map.containsKey(key)) { - // 如果已存在,获取该键对应的值,并将新的值添加到集合中 - List values = map.get(key); - values.add(value); - } else { - // 如果不存在,创建一个新的集合,并将值添加到集合中 - List values = new ArrayList<>(); - values.add(value); - map.put(key, values); - } - } - } - if (map.size()>0){ + // 抓取调节协议书 + if(!OCRAndBuildInfo(andConvertPDF, "调解协议", map)){ + return AjaxResult.error("文件转base64编码有误,请检查"); + } + // 抓取合同 + if(!OCRAndBuildInfo(andConvertPDF, "合同", map)){ + return AjaxResult.error("文件转base64编码有误,请检查"); + } + if(!OCRAndBuildInfo(andConvertPDF, "授权委托书", map)){ + return AjaxResult.error("文件转base64编码有误,请检查"); + } + + if (map.size()>0){ + // todo 从压缩包中识别各字段填充到数据库 //调用新增案件的接口 CaseApplication caseApplication = new CaseApplication(); - //默认案件标的 + //默认案件标的 todo 案件标的是什么 caseApplication.setCaseSubjectAmount(new BigDecimal(1)); caseApplication.setApplicationOrganId(map.get("统一社会信用代码").get(0)); caseApplication.setArbitratClaims(map.get("仲裁请求").get(0)); + caseApplication.setFacts(map.get("事实和理由").get(0)); + String contractNumber = map.get("合同编号").get(0); + // 提取字母和数字 + String regx="[^a-zA-Z0-9]"; + String replaceAll = contractNumber.replaceAll(regx, ""); + + caseApplication.setContractNumber(replaceAll.toUpperCase()); + String lonStartDate = map.get("或委托代理人签字:").get(0); + SimpleDateFormat sdf = new SimpleDateFormat(); + sdf.applyPattern("yyyy年MM月dd日"); + try { + caseApplication.setLoanStartDate( sdf.parse(lonStartDate)); + } catch (ParseException e) { + e.printStackTrace(); + } + // todo 查询同一批号的模板 + // 金融消费纠纷基本情况 + String disputes = map.get("金融消费纠纷基本情况").get(0); + String disputesTemplate="本案当事人甲{1}(下称“甲方”)于{2}向本案当事人乙{3}(下称“乙方”)申请{3}贷款,贷款金额人民币{4}元,贷款期限{5}期。截至{6},甲方尚欠乙方金额总计人民币{7}元。因甲方诉求与乙方进行协商还款。乙方为妥善解决纠纷,故申请调解中心进行调解。"; + List disputeList = getReplaceList(disputesTemplate, disputes); + if(CollectionUtil.isNotEmpty(disputeList)){ + if(disputeList.size()>3){ + caseApplication.setLoanType(disputeList.get(3)); + } + if(disputeList.size()>4) { + String claimPrinciOwed = disputeList.get(4); + // 金额格式化 + try { + Double.parseDouble(claimPrinciOwed); + + caseApplication.setClaimPrinciOwed(new BigDecimal(claimPrinciOwed)); + } catch (NumberFormatException e) { + + String regEx = "[^0-9]"; + Pattern p = Pattern.compile(regEx); + Matcher m = p.matcher(claimPrinciOwed); + String result = m.replaceAll("").trim(); + BigDecimal bigDecimal = null; + if (claimPrinciOwed.contains("百")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100")); + } else if (claimPrinciOwed.contains("千")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000")); + } else if (claimPrinciOwed.contains("万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000")); + } else if (claimPrinciOwed.contains("百万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000000")); + } else if (claimPrinciOwed.contains("千万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000000")); + } else if (claimPrinciOwed.contains("亿")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100000000")); + } + // todo 生产裁决书时金额格式增加千分位 + // NumberFormat format = NumberFormat.getInstance(); + // String format1 = format.format(bigDecimal); + + caseApplication.setClaimPrinciOwed(bigDecimal); + } + } + + if(disputeList.size()>5){ + caseApplication.setLoanTerm(disputeList.get(5)); + } + } + // 调解协议 + String mediationAgreement = map.get("经调解,双方自愿达成如下协议").get(0); + caseApplication.setMediationAgreement(mediationAgreement); + String mediationAgreementTemplate="1、乙方从维系客户的角度出发,同意为甲方申请停催至{1},停催期间正常计息,且征信影响由甲方自行承担。2、甲方应于{2}停催到期前向乙方申请费息减免业务,并按人民币{3}元一次性结清剩余贷款。3、今后双方无涉,就此结案。"; + // 对比模板和pdf识别的内容,取出占位符对应的值 + List mediationAgreementList = getReplaceList(mediationAgreementTemplate, mediationAgreement); + if(CollectionUtil.isNotEmpty(mediationAgreementList)){ + // 截止日期 + String lonEndDate = mediationAgreementList.get(0); + try { + caseApplication.setLoanEndDate( sdf.parse(lonEndDate)); + } catch (ParseException e) { + e.printStackTrace(); + } + if(mediationAgreementList.size()>2){ + // 待还金额 + caseApplication.setOutstandingMoney(mediationAgreementList.get(2)); + } + } + // 合同甲方 + caseApplication.setPartyA(map.get("甲方(贷款人)").get(0)); List caseAffiliates = new ArrayList<>(); CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setIdentityType(1); caseAffiliate.setName(map.get("申请人").get(0)); caseAffiliate.setIdentityNum(map.get("统一社会信用代码").get(0)); caseAffiliate.setCompLegalPerson(map.get("负责人").get(0)); + if(map.get("职务").size()>0) { + // 法定代表人职务 + caseAffiliate.setCompLegalperPost(map.get("职务").get(0)); + if(map.get("职务").size()>1) { + // 代理人职务 + caseAffiliate.setAppliAgentTitle(map.get("职务").get(1)); + } + } caseAffiliate.setNameAgent(map.get("委托代理人").get(0)); caseAffiliate.setContactTelphoneAgent(map.get("联系电话").get(0)); caseAffiliate.setResidenAffili(map.get("住所").get(0)); caseAffiliate.setContactAddress(map.get("联系地址").get(0)); - caseAffiliate.setEmail(map.get("电子邮件").get(0).replaceAll("\\s", "")); + caseAffiliate.setAgentEmail(map.get("电子邮件").get(0).replaceAll("\\s", "")); + + //设置默认代理人的身份证号码,暂时写死 要不然新增方法报错 // caseAffiliate.setIdentityNumAgent("610423199603171716"); caseAffiliates.add(caseAffiliate); CaseAffiliate caseAffiliate1 = new CaseAffiliate(); caseAffiliate1.setIdentityType(2); caseAffiliate1.setName(map.get("被申请人").get(0)); - caseAffiliate1.setIdentityNum(map.get("居民身份证号码").get(0)); + // 被申请人身份证 + String identityNum = map.get("居民身份证号码").get(0); + caseAffiliate1.setIdentityNum(identityNum); + // 被申请人电子邮件 + if(map.get("乙方确认有效的电子信箱地址为").size()>1) { + if(map.get("乙方确认有效的电子信箱地址为").get(0).contains("/")) { + caseAffiliate1.setEmail(map.get("乙方确认有效的电子信箱地址为").get(1).replaceAll("\\s", "")); + }else { + caseAffiliate1.setEmail(map.get("乙方确认有效的电子信箱地址为").get(0).replaceAll("\\s", "")); + } + } + // 出生年月日,从身份证抓取 + if(StrUtil.isNotEmpty(identityNum)) { + Map identityNumMap = getBirAgeSex(identityNum); + String birthday = identityNumMap.get("birthday"); + if(StrUtil.isNotEmpty(birthday)) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + Date birthdayDate = null; + try { + birthdayDate = simpleDateFormat.parse(birthday); + } catch (Exception e) { + e.printStackTrace(); + } + caseAffiliate1.setResponBirth(birthdayDate); + } + //从身份证抓取性别 + caseAffiliate1.setResponSex(identityNumMap.get("sexCode")); + } caseAffiliate1.setContactTelphone(map.get("联系电话").get(1)); caseAffiliate1.setResidenAffili(map.get("住所").get(1)); - //设置默认的性别 2代表未知 - caseAffiliate1.setResponSex("2"); + caseAffiliates.add(caseAffiliate1); caseApplication.setCaseAffiliates(caseAffiliates); this.insertcaseApplication(caseApplication); if (null != caseApplication.getId()) { - // 绑定案件与申请书 - File file1 = new File(pdfUrl); - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttach.setAnnexPath(file1.getPath()); - caseAttach.setAnnexName(file1.getName()); - caseAttach.setAnnexType(1); - caseAttachMapper.save(caseAttach); + List caseAttachs=new ArrayList<>(); + for (Map.Entry entry : andConvertPDF.entrySet()) { + if(entry.getValue().contains("证据材料")){ + String pdfUrl = entry.getValue(); + File file1 = new File(pdfUrl); + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttach.setAnnexPath(file1.getPath()); + caseAttach.setAnnexName(file1.getName()); + // 申请人提供的证据材料 + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + } + } + if(CollectionUtil.isNotEmpty(caseAttachs)) { + // 新增申请人证据材料 + caseAttachMapper.batchSave(caseAttachs); + } return AjaxResult.success("导入成功"); } }else{ return AjaxResult.error("文件识别内容失败,请检查"); } - } + } else { // 没有找到符合条件的文件 return AjaxResult.error("未找到符合条件的文件"); @@ -3034,6 +3152,95 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return null; } + private boolean OCRAndBuildInfo( Map andConvertPDF, String mapKey, Map> map) { + String pdfUrl = andConvertPDF.get(mapKey); + if(StrUtil.isEmpty(pdfUrl)){ + return false; + } + //获取文件的页数 + int fileNumPage = getFileNumPage(pdfUrl); + //文件转成base64 + String base64 = OCRUtils.pdfConvertBase64(pdfUrl); + if (base64 == null){ + return false; + } + StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象 + for (int i = 0; i < fileNumPage; i++) { + //对接腾讯云接口.识别里面的数据 + String text = OCRUtils.pdfIdentifyText(base64, i + 1,mapKey); + if (stringBuilder.length() > 0) { + stringBuilder.append(Constants.BR); // 在已有内容的情况下添加逗号分隔符 + } + stringBuilder.append(text); // 拼接当前的字符串 + } + // 将字符串按逗号分隔符切割 + String[] fields = stringBuilder.toString().split(Constants.BR); + for (String field : fields) { + // 对于每个字段,再按冒号分隔符拆分出键和值 + String[] keyValue = field.split(Constants.PDFSTR); + if (keyValue.length >= 2) { + String key = keyValue[0]; + String value = keyValue[1]; + // 判断Map中是否已存在该键 + if (map.containsKey(key)) { + // 如果已存在,获取该键对应的值,并将新的值添加到集合中 + List values = map.get(key); + values.add(value); + } else { + // 如果不存在,创建一个新的集合,并将值添加到集合中 + List values = new ArrayList<>(); + values.add(value); + map.put(key, values); + } + } + } + return true; + } + + /** + * 通过身份证号码获取出生日期、性别、年龄 + * @param certificateNo + * @return 返回的出生日期格式:1990-01-01 性别格式:1-女,0-男 + */ + public static Map getBirAgeSex(String certificateNo) { + String birthday = ""; + String age = ""; + String sexCode = ""; + + int year = Calendar.getInstance().get(Calendar.YEAR); + char[] number = certificateNo.toCharArray(); + boolean flag = true; + if (number.length == 15) { + for (int x = 0; x < number.length; x++) { + if (!flag) return new HashMap(); + flag = Character.isDigit(number[x]); + } + } else if (number.length == 18) { + for (int x = 0; x < number.length - 1; x++) { + if (!flag) return new HashMap(); + flag = Character.isDigit(number[x]); + } + } + if (flag && certificateNo.length() == 15) { + birthday = "19" + certificateNo.substring(6, 8) + "-" + + certificateNo.substring(8, 10) + "-" + + certificateNo.substring(10, 12); + sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 3, certificateNo.length())) % 2 == 0 ? "1" : "0"; + age = (year - Integer.parseInt("19" + certificateNo.substring(6, 8))) + ""; + } else if (flag && certificateNo.length() == 18) { + birthday = certificateNo.substring(6, 10) + "-" + + certificateNo.substring(10, 12) + "-" + + certificateNo.substring(12, 14); + sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 4, certificateNo.length() - 1)) % 2 == 0 ? "1" : "0"; + age = (year - Integer.parseInt(certificateNo.substring(6, 10))) + ""; + } + Map map = new HashMap(); + map.put("birthday", birthday); + map.put("age", age); + map.put("sexCode", sexCode); + return map; + } + /** * 根据附件id修改案件id * @param caseAttach @@ -3045,12 +3252,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return success(); } - public static List findAndConvertPDF(File directory) { - List pdfPaths = new ArrayList<>(); + public static Map findAndConvertPDF(File directory) { + Map pdfPathMap= new HashMap<>(); if (directory.isFile()) { String path = ""; + String fileName = ""; // 如果传入的参数是一个文件 - if (directory.getName().contains("仲裁申请书")) { + // if (directory.getName().contains("仲裁申请书")) { if (isPDF(directory)) { // 如果文件名包含"仲裁申请书"且是PDF格式,直接返回路径 path = directory.getAbsolutePath(); @@ -3062,17 +3270,53 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } if (path != null) { - pdfPaths.add(path); + // 如果文件名包含"仲裁申请书"且是PDF格式,直接返回路径 + // 如果是PDF格式,直接添加到列表中 + String name=""; + if (directory.getName().contains("仲裁申请书")) { + name="仲裁申请书"; + } + if (directory.getName().contains("调解协议")) { + name="调解协议"; + } + if (directory.getName().contains("情况说明")) { + name="情况说明"; + } + if (directory.getName().contains("贷款合同")) { + name="贷款合同"; + } + if (directory.getName().contains("营业执照")) { + name="营业执照"; + } + if (directory.getName().contains("负责人证明")) { + name="负责人证明"; + } + if (directory.getName().contains("负责人身份证")) { + name="负责人身份证"; + } + if (directory.getName().contains("授权委托书")) { + name="授权委托书"; + } + if (directory.getName().contains("经办人员的劳动合同")) { + name="经办人员的劳动合同"; + } + if (directory.getName().contains("经办人员身份证")) { + name="经办人员的身份证"; + } + if (directory.getName().contains("自然人身份证")) { + name="自然人身份证"; + } + + pdfPathMap.put(name,path); } - } + // } } else if (directory.isDirectory()) { - searchAndConvertPDF(directory, pdfPaths); + searchAndConvertPDF(directory, pdfPathMap); } else { return null; } - return pdfPaths; + return pdfPathMap; } - public static boolean isPDF(File file) { String extension = getFileExtension(file); return extension.equalsIgnoreCase("pdf"); @@ -3088,27 +3332,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } - public static void searchAndConvertPDF(File directory, List pdfPaths) { + public static void searchAndConvertPDF(File directory, Map pdfPathMap) { File[] files = directory.listFiles(); if (files != null) { for (File file : files) { + if(file.getName().contains("zip")|| file.getName().contains("rar")){ + continue; + } if (file.isFile()) { - // 如果是文件且文件名包含"仲裁申请书" + String name=""; if (file.getName().contains("仲裁申请书")) { + name="仲裁申请书"; + } + if (file.getName().contains("调解协议")) { + name="调解协议"; + } + if (file.getName().contains("情况说明")) { + name="情况说明"; + } + if (file.getName().contains("贷款合同")) { + name="贷款合同"; + } + if (file.getName().contains("营业执照")) { + name="营业执照"; + } + if (file.getName().contains("负责人证明")) { + name="负责人证明"; + } + if (file.getName().contains("负责人身份证")) { + name="负责人身份证"; + } + if (file.getName().contains("授权委托书")) { + name="授权委托书"; + } + if (file.getName().contains("经办人员的劳动合同")) { + name="经办人员的劳动合同"; + } + if (file.getName().contains("经办人员的身份证")) { + name="经办人员身份证"; + } + if (file.getName().contains("自然人身份证")) { + name="自然人身份证"; + } + // 如果是文件且文件名包含"仲裁申请书" + // if (file.getName().contains("仲裁申请书")) { if (isPDF(file)) { // 如果是PDF格式,直接添加到列表中 - pdfPaths.add(file.getAbsolutePath()); + pdfPathMap.put(name,file.getAbsolutePath()); } else { // 如果不是PDF格式,进行转换成PDF并添加转换后的路径到列表中 - String pdfPath = convertToPDF(file); + String pdfPath = convertToPDF(file); if (pdfPath != null) { - pdfPaths.add(pdfPath); + // 如果是PDF格式,直接添加到列表中 + pdfPathMap.put(name,pdfPath); } } - } + + // } } else if (file.isDirectory()) { // 如果是目录,递归查找 - searchAndConvertPDF(file, pdfPaths); + searchAndConvertPDF(file, pdfPathMap); } } } @@ -3151,6 +3434,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return pageCount; } + + /** + * 获取模板和正文中替换符的内容 + * @param a + * @param b + * @return + */ + public static List getReplaceList(String a,String b){ + String aTmpe = filterString(a); + String bTmpe = filterString(b); + String regex = "(\\{[^}}]*})"; + String[] ptTemplate = aTmpe.replaceAll(regex, "@=").split("@="); + String replace = ""; + for (int i = 0; i < ptTemplate.length; i++) { + if(ptTemplate[i]==null || ptTemplate[i].equals(" "))continue; + if(replace.equals("")){ + replace = bTmpe.replace(ptTemplate[i], "@="); + }else { + replace = replace.replace(ptTemplate[i], "@="); + } + } + List aList = new ArrayList<>(); + String[] split = replace.split("@="); + for (int i =0; i 0) { - stringBuilder.append(","); // 在已有内容的情况下添加逗号分隔符 + stringBuilder.append(Constants.BR); // 在已有内容的情况下添加逗号分隔符 } stringBuilder.append(text); // 拼接当前的字符串 } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 795e630..b25c6a9 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -14,6 +14,10 @@ + + + + @@ -29,6 +33,10 @@ check_opinion, create_by, + case_focus, + case_facts, + respondent_opinion, + applicant_opinion, create_time )values( #{caseAppliId}, @@ -40,6 +48,10 @@ #{arbitrateThink}, #{checkOpinion}, #{createBy}, + #{caseFocus}, + #{caseFacts}, + #{respondentOpinion}, + #{applicantOpinion}, sysdate() ) @@ -57,6 +69,10 @@ check_opinion = #{checkOpinion}, annex_id = #{annexId}, update_by = #{updateBy}, + case_focus = #{caseFocus}, + case_facts = #{caseFacts}, + respondent_opinion = #{respondentOpinion}, + applicant_opinion = #{applicantOpinion}, update_time = sysdate() where id = #{id} @@ -65,7 +81,7 @@ @@ -66,7 +67,7 @@ contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, residen_affili,appli_agent_title, - contact_address_agent,email , send_email,track_num,applicant_agent_user_id) values + contact_address_agent,email , send_email,track_num,applicant_agent_user_id,agent_email) values (#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, @@ -76,7 +77,8 @@ #{item.email}, #{item.sendEmail}, #{item.trackNum}, - #{item.applicantAgentUserId} + #{item.applicantAgentUserId}, + #{item.agentEmail} ) @@ -113,6 +115,9 @@ residen_affili=#{residenAffili}, appli_agent_title=#{appliAgentTitle} + + ,agent_email=#{agentEmail} + where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index b89b6eb..d4334ba 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -33,6 +33,7 @@ + SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date, loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number, - create_by,version,update_submit_status,create_time,proper_preser + create_by,version,update_submit_status,create_time,proper_preser, interest_rate, + outstanding_money, + facts, + party_a, + disputes, + loan_type, + loan_term, + mediation_agreement FROM case_application_log WHERE case_appli_id = #{caseAppliId} and version=#{version} @@ -141,7 +178,14 @@ @@ -159,7 +203,14 @@ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index ee55d4f..db30144 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -46,6 +46,14 @@ + + + + + + + + @@ -1374,6 +1382,14 @@ create_by, import_flag, version, + interest_rate, + outstanding_money, + facts, + party_a, + disputes, + loan_type, + loan_term, + mediation_agreement, create_time )values( #{caseName}, @@ -1403,6 +1419,14 @@ #{createBy}, #{importFlag}, #{version}, + #{interestRate}, + #{outstandingMoney}, + #{facts}, + #{partyA}, + #{disputes}, + #{loanType}, + #{loanTerm}, + #{mediationAgreement}, sysdate() ) @@ -1435,7 +1459,15 @@ update_by = #{updateBy}, case_num = #{caseNum}, - version = #{version}, + version = #{version}, + interest_rate = #{interestRate}, + outstanding_money = #{outstandingMoney}, + facts = #{facts}, + party_a = #{partyA}, + disputes = #{disputes}, + loan_type = #{loanType}, + loan_term = #{loanTerm}, + mediation_agreement = #{mediationAgreement}, update_time = sysdate() where id = #{id} @@ -1517,7 +1549,15 @@ c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser, c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini , - c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName + c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName, + c.interest_rate, + c.outstanding_money, + c.facts, + c.party_a, + c.disputes, + c.loan_type, + c.loan_term, + c.mediation_agreement from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 78ae972..383b249 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -18,6 +18,14 @@ INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload}) + + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) + + + VALUES + (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload}) + + delete from case_attach where annex_id in