生成裁决书修改 #273
@@ -28,6 +28,14 @@ public class Constants
|
||||
* http请求
|
||||
*/
|
||||
public static final String HTTP = "http://";
|
||||
/**
|
||||
* br标签
|
||||
*/
|
||||
public static final String BR = "</br>";
|
||||
/**
|
||||
* pdf拼接符
|
||||
*/
|
||||
public static final String PDFSTR = "∰";
|
||||
|
||||
/**
|
||||
* https请求
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface CaseAttachMapper {
|
||||
int save(CaseAttach caseAttach);
|
||||
int batchSave(@Param("list") List<CaseAttach> caseAttach);
|
||||
|
||||
List<CaseAttach> queryAnnexPathByCaseId(Long id);
|
||||
|
||||
|
||||
+87
-33
@@ -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<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
String applicantName="";
|
||||
String debtorName = "";
|
||||
List<String> 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<CaseAttach> 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+425
-82
@@ -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<File> allFiles = new ArrayList<>();
|
||||
@@ -1360,7 +1367,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
public int deletecaseApplicationByIds(List<Long> 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<String> andConvertPDF = findAndConvertPDF(directory);
|
||||
Map<String,String> 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<String, List<String>> 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<String, List<String>> 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<String> values = map.get(key);
|
||||
values.add(value);
|
||||
} else {
|
||||
// 如果不存在,创建一个新的集合,并将值添加到集合中
|
||||
List<String> 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<String> 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<String> 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<CaseAffiliate> 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<String, String> 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<CaseAttach> caseAttachs=new ArrayList<>();
|
||||
for (Map.Entry<String, String> 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<String, String> andConvertPDF, String mapKey, Map<String, List<String>> 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<String> values = map.get(key);
|
||||
values.add(value);
|
||||
} else {
|
||||
// 如果不存在,创建一个新的集合,并将值添加到集合中
|
||||
List<String> values = new ArrayList<>();
|
||||
values.add(value);
|
||||
map.put(key, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过身份证号码获取出生日期、性别、年龄
|
||||
* @param certificateNo
|
||||
* @return 返回的出生日期格式:1990-01-01 性别格式:1-女,0-男
|
||||
*/
|
||||
public static Map<String, String> 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<String, String>();
|
||||
flag = Character.isDigit(number[x]);
|
||||
}
|
||||
} else if (number.length == 18) {
|
||||
for (int x = 0; x < number.length - 1; x++) {
|
||||
if (!flag) return new HashMap<String, String>();
|
||||
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<String, String> map = new HashMap<String, String>();
|
||||
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<String> findAndConvertPDF(File directory) {
|
||||
List<String> pdfPaths = new ArrayList<>();
|
||||
public static Map<String,String> findAndConvertPDF(File directory) {
|
||||
Map<String,String> 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<String> pdfPaths) {
|
||||
public static void searchAndConvertPDF(File directory, Map<String,String> 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<String> 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<String> aList = new ArrayList<>();
|
||||
String[] split = replace.split("@=");
|
||||
for (int i =0; i<split.length; i++){
|
||||
if(split[i] == "" || split[i].equals("")) continue;
|
||||
aList.add(split[i]);
|
||||
}
|
||||
return aList;
|
||||
}
|
||||
|
||||
// 去掉内容中的换行符
|
||||
public static String filterString(String str){
|
||||
if(str == null || str.equals("")) return null;
|
||||
String regEx= "[\\r\\n]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(str);
|
||||
return m.replaceAll(" ").trim();
|
||||
}
|
||||
|
||||
// 检索时,转换特殊字符
|
||||
public static String escapeQueryChars(String s) {
|
||||
if (StringUtils.isBlank(s)) {
|
||||
return s;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
// These characters are part of the query syntax and must be escaped
|
||||
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')'
|
||||
|| c == ':' || c == '^' || c == '[' || c == ']' || c == '\"'
|
||||
|| c == '{' || c == '}' || c == '~' || c == '*' || c == '?'
|
||||
|| c == '|' || c == '&' || c == ';' || c == '/' || c == '.'
|
||||
|| c == '$' || Character.isWhitespace(c)) {
|
||||
sb.append('\\');
|
||||
}
|
||||
sb.append(c);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.utils;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.tencentcloudapi.bsca.v20210811.models.LicenseSummary;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
@@ -23,8 +24,26 @@ public class OCRUtils {
|
||||
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
|
||||
//API的SecretKey
|
||||
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
|
||||
// 仲裁申请书识别字段
|
||||
private static final String[] applicantName = {"申请人", "统一社会信用代码", "负责人", "住所", "联系地址"
|
||||
, "委托代理人", "联系电话", "电子邮件", "被申请人", "居民身份证号码", "仲裁请求", "事实和理由"};
|
||||
// 贷款合同识别字段
|
||||
private static final String[] contractName = {
|
||||
"合同编号","甲方(贷款人)" ,"或委托代理人签字:","本合同的初始贷款年利率为","乙方确认有效的电子信箱地址为"};
|
||||
// 调解协议识别字段
|
||||
private static final String[] accordName = {"金融消费纠纷基本情况","经调解,双方自愿达成如下协议"};
|
||||
// 授权委托书识别字段
|
||||
private static final String[] powerAttorneyName = {"职务"};
|
||||
|
||||
public static String pdfIdentifyText(String imageBase64, Integer pageNumber) {
|
||||
|
||||
/**
|
||||
* pdf识别成文字
|
||||
* @param imageBase64
|
||||
* @param pageNumber
|
||||
* @param type pdf类型
|
||||
* @return
|
||||
*/
|
||||
public static String pdfIdentifyText(String imageBase64, Integer pageNumber,String type) {
|
||||
try {
|
||||
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
|
||||
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
|
||||
@@ -43,9 +62,16 @@ public class OCRUtils {
|
||||
req.setImageBase64(imageBase64);
|
||||
req.setIsPdf(true);
|
||||
req.setPdfPageNumber(pageNumber.longValue());
|
||||
String[] itemNames1 = {"申请人", "统一社会信用代码", "负责人", "住所", "联系地址"
|
||||
, "委托代理人", "联系电话", "电子邮件", "被申请人", "居民身份证号码", "仲裁请求", "事实和理由"};
|
||||
req.setItemNames(itemNames1);
|
||||
if(type.contains("申请书")){
|
||||
req.setItemNames(applicantName);
|
||||
}else if(type.contains("调解协议")){
|
||||
// req.setItemNames(accordName);
|
||||
}else if(type.contains("合同")){
|
||||
req.setItemNames(contractName);
|
||||
}else if(type.contains("授权委托书")){
|
||||
req.setItemNames(powerAttorneyName);
|
||||
}
|
||||
|
||||
// 返回的resp是一个SmartStructuralOCRV2Response的实例,与请求对象对应
|
||||
SmartStructuralOCRV2Response resp = client.SmartStructuralOCRV2(req);
|
||||
// 输出json格式的字符串回包
|
||||
@@ -67,9 +93,9 @@ public class OCRUtils {
|
||||
JSONObject value = line.getJSONObject("Value");
|
||||
String autoName = key.getString("AutoName");
|
||||
String autoContent = value.getString("AutoContent");
|
||||
String text = autoName + ":" + autoContent;
|
||||
String text = autoName + Constants.PDFSTR + autoContent;
|
||||
if (stringBuilder.length() > 0) {
|
||||
stringBuilder.append(","); // 在已有内容的情况下添加逗号分隔符
|
||||
stringBuilder.append(Constants.BR); // 在已有内容的情况下添加逗号分隔符
|
||||
}
|
||||
stringBuilder.append(text); // 拼接当前的字符串
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
<result property="verificaOpinion" column="verifica_opinion" />
|
||||
<result property="checkOpinion" column="check_opinion" />
|
||||
<result property="annexId" column="annex_id" />
|
||||
<result property="caseFocus" column="case_focus" />
|
||||
<result property="caseFacts" column="case_facts" />
|
||||
<result property="respondentOpinion" column="respondent_opinion" />
|
||||
<result property="applicantOpinion" column="applicant_opinion" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
@@ -29,6 +33,10 @@
|
||||
|
||||
<if test="checkOpinion != null and checkOpinion != ''">check_opinion,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
case_focus,
|
||||
case_facts,
|
||||
respondent_opinion,
|
||||
applicant_opinion,
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseAppliId != null ">#{caseAppliId},</if>
|
||||
@@ -40,6 +48,10 @@
|
||||
<if test="arbitrateThink != null and arbitrateThink != ''">#{arbitrateThink},</if>
|
||||
<if test="checkOpinion != null and checkOpinion != ''">#{checkOpinion},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
#{caseFocus},
|
||||
#{caseFacts},
|
||||
#{respondentOpinion},
|
||||
#{applicantOpinion},
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -57,6 +69,10 @@
|
||||
<if test="checkOpinion != null and checkOpinion != ''">check_opinion = #{checkOpinion},</if>
|
||||
<if test="annexId != null ">annex_id = #{annexId},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="caseFocus != null and caseFocus != ''">case_focus = #{caseFocus},</if>
|
||||
<if test="caseFacts != null and caseFacts != ''">case_facts = #{caseFacts},</if>
|
||||
<if test="respondentOpinion != null and respondentOpinion != ''">respondent_opinion = #{respondentOpinion},</if>
|
||||
<if test="applicantOpinion != null and applicantOpinion != ''">applicant_opinion = #{applicantOpinion},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
@@ -65,7 +81,7 @@
|
||||
|
||||
<select id="selectArbitrateRecord" parameterType="ArbitrateRecord" resultMap="ArbitrateRecordResult">
|
||||
SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows ,
|
||||
a.verifica_opinion ,a.check_opinion,a.annex_id
|
||||
a.verifica_opinion ,a.check_opinion,a.annex_id,a.case_focus,a.case_facts,a.respondent_opinion,a.applicant_opinion
|
||||
from arbitrate_record a
|
||||
<where>
|
||||
<if test="caseAppliId != null ">
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<result property="email" column="email" />
|
||||
<result property="sendEmail" column="send_email" />
|
||||
<result property="applicantAgentUserId" column="applicant_agent_user_id" />
|
||||
<result property="agentEmail" column="agent_email" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
|
||||
@@ -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
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{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}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -113,6 +115,9 @@
|
||||
residen_affili=#{residenAffili},
|
||||
appli_agent_title=#{appliAgentTitle}
|
||||
|
||||
<if test="agentEmail !=null and agentEmail!=''">
|
||||
,agent_email=#{agentEmail}
|
||||
</if>
|
||||
where id = #{id}
|
||||
|
||||
</update>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<result property="email" column="email" />
|
||||
<result property="sendEmail" column="send_email" />
|
||||
<result property="applicantAgentUserId" column="applicant_agent_user_id" />
|
||||
<result property="agentEmail" column="agent_email" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
|
||||
@@ -83,7 +84,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
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
|
||||
#{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent},
|
||||
@@ -93,7 +94,8 @@
|
||||
#{item.email},
|
||||
#{item.sendEmail},
|
||||
#{item.trackNum},
|
||||
#{item.applicantAgentUserId}
|
||||
#{item.applicantAgentUserId},
|
||||
#{item.agentEmail}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -128,6 +130,10 @@
|
||||
respon_birth=#{responBirth},
|
||||
residen_affili=#{residenAffili},
|
||||
appli_agent_title=#{appliAgentTitle}
|
||||
|
||||
<if test="agentEmail !=null and agentEmail!=''">
|
||||
,agent_email=#{agentEmail}
|
||||
</if>
|
||||
where id = #{id}
|
||||
|
||||
</update>
|
||||
@@ -161,6 +167,10 @@
|
||||
respon_birth=#{item.responBirth},
|
||||
residen_affili=#{item.residenAffili},
|
||||
appli_agent_title=#{item.appliAgentTitle}
|
||||
|
||||
<if test="agentEmail !=null and agentEmail!=''">
|
||||
,agent_email=#{agentEmail}
|
||||
</if>
|
||||
</set>
|
||||
where case_appli_id = #{caseAppliId} and identity_type= #{item.identityType};
|
||||
</foreach>
|
||||
|
||||
+55
-4
@@ -49,6 +49,14 @@
|
||||
<result property="version" column="version" />
|
||||
<result property="updateSubmitStatus" column="update_submit_status" />
|
||||
<result property="properPreser" column="proper_preser" />
|
||||
<result property="interestRate" column="interest_rate" />
|
||||
<result property="outstandingMoney" column="outstanding_money" />
|
||||
<result property="facts" column="facts" />
|
||||
<result property="partyA" column="party_a" />
|
||||
<result property="disputes" column="disputes" />
|
||||
<result property="loanType" column="loan_type" />
|
||||
<result property="loanTerm" column="loan_term" />
|
||||
<result property="mediationAgreement" column="mediation_agreement" />
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into case_application_log(
|
||||
@@ -71,6 +79,14 @@
|
||||
<if test="version != null ">version,</if>
|
||||
<if test="updateSubmitStatus != null ">update_submit_status,</if>
|
||||
<if test="properPreser != null ">proper_preser,</if>
|
||||
interest_rate,
|
||||
outstanding_money,
|
||||
facts,
|
||||
party_a,
|
||||
disputes,
|
||||
loan_type,
|
||||
loan_term,
|
||||
mediation_agreement,
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseAppliId != null">#{caseAppliId},</if>
|
||||
@@ -92,6 +108,14 @@
|
||||
<if test="version != null ">#{version},</if>
|
||||
<if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
|
||||
<if test="properPreser != null ">#{properPreser},</if>
|
||||
#{interestRate},
|
||||
#{outstandingMoney},
|
||||
#{facts},
|
||||
#{partyA},
|
||||
#{disputes},
|
||||
#{loanType},
|
||||
#{loanTerm},
|
||||
#{mediationAgreement},
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -121,7 +145,13 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
);
|
||||
|
||||
delete a from case_attach_log a
|
||||
join case_application_log l on l.id=a.case_appli_log_id
|
||||
where l.id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
);
|
||||
delete from case_application_log l where l.id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
@@ -133,7 +163,14 @@
|
||||
<select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
|
||||
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}
|
||||
</select>
|
||||
@@ -141,7 +178,14 @@
|
||||
<select id="selectLatestCase" resultMap="CaseApplicationResult">
|
||||
SELECT 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} ORDER BY version DESC limit 1
|
||||
</select>
|
||||
@@ -159,7 +203,14 @@
|
||||
<select id="selectBeforeCase" resultMap="CaseApplicationResult">
|
||||
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 = #{caseId} and version < #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
|
||||
</select>
|
||||
|
||||
@@ -46,6 +46,14 @@
|
||||
<result property="properPreser" column="proper_preser" />
|
||||
<result property="adjudicaCounter" column="adjudica_counter" />
|
||||
<result property="lockStatus" column="lock_status" />
|
||||
<result property="interestRate" column="interest_rate" />
|
||||
<result property="outstandingMoney" column="outstanding_money" />
|
||||
<result property="facts" column="facts" />
|
||||
<result property="partyA" column="party_a" />
|
||||
<result property="disputes" column="disputes" />
|
||||
<result property="loanType" column="loan_type" />
|
||||
<result property="loanTerm" column="loan_term" />
|
||||
<result property="mediationAgreement" column="mediation_agreement" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -1374,6 +1382,14 @@
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="importFlag != null ">import_flag,</if>
|
||||
<if test="version != null ">version,</if>
|
||||
interest_rate,
|
||||
outstanding_money,
|
||||
facts,
|
||||
party_a,
|
||||
disputes,
|
||||
loan_type,
|
||||
loan_term,
|
||||
mediation_agreement,
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseName != null and caseName != ''">#{caseName},</if>
|
||||
@@ -1403,6 +1419,14 @@
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="importFlag != null ">#{importFlag},</if>
|
||||
<if test="version != null ">#{version},</if>
|
||||
#{interestRate},
|
||||
#{outstandingMoney},
|
||||
#{facts},
|
||||
#{partyA},
|
||||
#{disputes},
|
||||
#{loanType},
|
||||
#{loanTerm},
|
||||
#{mediationAgreement},
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -1435,7 +1459,15 @@
|
||||
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
|
||||
<if test="version != null and version != ''">version = #{version},</if>
|
||||
<if test="version != null ">version = #{version},</if>
|
||||
<if test="interestRate != null and interestRate != ''">interest_rate = #{interestRate},</if>
|
||||
<if test="outstandingMoney != null and outstandingMoney != ''">outstanding_money = #{outstandingMoney},</if>
|
||||
<if test="facts != null and facts != ''">facts = #{facts},</if>
|
||||
<if test="partyA != null and partyA != ''">party_a = #{partyA},</if>
|
||||
<if test="disputes != null and disputes != ''">disputes = #{disputes},</if>
|
||||
<if test="loanType != null and loanType != ''">loan_type = #{loanType},</if>
|
||||
<if test="loanTerm != null and loanTerm != ''">loan_term = #{loanTerm},</if>
|
||||
<if test="mediationAgreement != null and mediationAgreement != ''">mediation_agreement = #{mediationAgreement},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
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
|
||||
|
||||
|
||||
@@ -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>
|
||||
<insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
|
||||
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
|
||||
VALUES
|
||||
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteByFileIds">
|
||||
delete from case_attach
|
||||
where annex_id in
|
||||
|
||||
Reference in New Issue
Block a user