压缩包上传,裁决书生成,案件修改,修改后对比信息
This commit is contained in:
+3
@@ -32,6 +32,9 @@ public class AdjudicationController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/document")
|
||||
public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
|
||||
if (caseApplication.getId() == null) {
|
||||
return AjaxResult.error("案件id不能为空");
|
||||
}
|
||||
return adjudicationService.createDocument(caseApplication);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
@@ -7,6 +9,9 @@ import java.lang.reflect.Field;
|
||||
*/
|
||||
public class ObjectFieldUtils {
|
||||
public static String getValue(Object obj,String fieldName){
|
||||
if(obj==null || StrUtil.isEmpty(fieldName)){
|
||||
return "";
|
||||
}
|
||||
Field field=null;
|
||||
try{
|
||||
field=obj.getClass().getDeclaredField(fieldName);
|
||||
@@ -28,6 +33,9 @@ public class ObjectFieldUtils {
|
||||
}
|
||||
|
||||
public static void setValue(Object obj,String fieldName,Object value){
|
||||
if(obj==null || StrUtil.isEmpty(fieldName)||value==null){
|
||||
return;
|
||||
}
|
||||
Field field=null;
|
||||
try{
|
||||
field=obj.getClass().getDeclaredField(fieldName);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,13 @@ public class ColumnValue {
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 是否为自定义字段,0-否,1-是
|
||||
*/
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 案件日志表id
|
||||
*/
|
||||
private Long caseAppliLogId;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ public class CompareCaseVO {
|
||||
* 变化字段,多个用,拼接
|
||||
*/
|
||||
private String changeColumn;
|
||||
|
||||
/**
|
||||
* 自定义字段变化字段,多个用,拼接
|
||||
*/
|
||||
private String columnValueChangeColumn;
|
||||
|
||||
}
|
||||
|
||||
+3
-9
@@ -118,17 +118,11 @@ public interface CaseApplicationMapper {
|
||||
*/
|
||||
void updateVersionById(@Param("id")Long id, @Param("version")Integer version);
|
||||
|
||||
/**
|
||||
* 查询秘书案件
|
||||
* @param caseApplication
|
||||
* @return
|
||||
*/
|
||||
List<CaseApplication> selectSecretaryCase(CaseApplication caseApplication);
|
||||
|
||||
/**
|
||||
* 查询申请人案件
|
||||
* @param caseApplication
|
||||
* 查询最大批号
|
||||
* @return
|
||||
*/
|
||||
List<CaseApplication> selectApplicationCase(CaseApplication caseApplication);
|
||||
Integer selectBatchNumberLike();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 动态配置字段表
|
||||
*/
|
||||
@Repository
|
||||
public interface ColumnValueLogMapper {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
void batchSave(@Param("list") List<ColumnValue> list);
|
||||
void batchUpdate(@Param("list") List<ColumnValue> list);
|
||||
|
||||
/**
|
||||
* 根据案件id查询字段及值
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
List<ColumnValue> listBycaseAppliLogId(@Param("caseId") Long caseId);
|
||||
|
||||
List<ColumnValue> queryColumnValueList(ColumnValue columnValue);
|
||||
}
|
||||
@@ -27,4 +27,9 @@ public interface ColumnValueMapper {
|
||||
List<ColumnValue> listByCaseId(@Param("caseId") Long caseId);
|
||||
|
||||
List<ColumnValue> queryColumnValueList(ColumnValue columnValue);
|
||||
/**
|
||||
* 批量修改
|
||||
*/
|
||||
void batchUpdate(@Param("list") List<ColumnValue> list);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||
@@ -18,7 +19,7 @@ public interface ICaseApplicationService {
|
||||
List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication);
|
||||
|
||||
|
||||
int insertcaseApplication(CaseApplication caseApplication, Map<String,String> fatchMap);
|
||||
int insertcaseApplication(CaseApplication caseApplication, List<ColumnValue> columnValueList);
|
||||
|
||||
int selectCaseApplicationCount(CaseApplication caseApplication);
|
||||
|
||||
|
||||
+350
-203
@@ -7,15 +7,14 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.*;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.EmailOutUtil;
|
||||
import com.ruoyi.common.utils.WordUtil;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
|
||||
@@ -49,6 +48,7 @@ import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -84,6 +84,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
private TemplateManageMapper templateManageMapper;
|
||||
@Autowired
|
||||
private ColumnValueMapper columnValueMapper;
|
||||
@Autowired
|
||||
private FatchRuleMapper fatchRuleMapper;
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
|
||||
// 仲裁反请求模板内容
|
||||
private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
|
||||
"《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
|
||||
@@ -123,246 +128,105 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
// 被申请人缺席
|
||||
String resAbsent="(二)当事人提供的证据材料\n" +
|
||||
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
|
||||
// 日期格式化年月日
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult createDocument(CaseApplication caseApplicationReq) {
|
||||
String templatePath="";
|
||||
String templateName="";
|
||||
String agentName="";
|
||||
String resName="";
|
||||
String templatePath = "";
|
||||
String templateName = "";
|
||||
String agentName = "";
|
||||
String resName = "";
|
||||
try {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
Long id = caseApplicationReq.getId();
|
||||
if (id == null) {
|
||||
return AjaxResult.error("案件id不能为空");
|
||||
}
|
||||
|
||||
//获取案件详细信息
|
||||
CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(caseApplicationReq);
|
||||
|
||||
if(caseApplicationById==null){
|
||||
if (caseApplicationById == null) {
|
||||
return AjaxResult.error("案件不存在");
|
||||
}
|
||||
|
||||
if (caseApplicationById.getTemplateId() == null) {
|
||||
return AjaxResult.error("请先指定裁决书模板");
|
||||
}
|
||||
// 根据模板id查找对应的模板
|
||||
if(caseApplicationById.getTemplateId()!=null) {
|
||||
TemplateManage templateManage = new TemplateManage();
|
||||
templateManage.setId(caseApplicationById.getTemplateId());
|
||||
List<TemplateManage> templateManages = templateManageMapper.selectTemplateList(templateManage);
|
||||
if(CollectionUtil.isEmpty(templateManages)){
|
||||
if (CollectionUtil.isEmpty(templateManages)) {
|
||||
return AjaxResult.error("请先指定裁决书模板");
|
||||
}
|
||||
templatePath=templateManages.get(0).getTemOrigPath();
|
||||
templateName=templateManages.get(0).getFileName();
|
||||
}
|
||||
templatePath = templateManages.get(0).getTemOrigPath();
|
||||
templateName = templateManages.get(0).getFileName();
|
||||
// 查询案件相关表信息
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(id);
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
//获取仲裁记录表里的相关信息
|
||||
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
||||
arbitrateRecord.setCaseAppliId(id);
|
||||
ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||
|
||||
// todo 获取模板中的所有占位符,该占位符字段必须和抓取字段一致,暂时写死
|
||||
// todo 生成裁决书的内容从key-value表中取,不从案件基本信息表取,会有问题,如果修改的话会有问题,暂不考虑该情况
|
||||
|
||||
// 在系统表中查询案件内置字段
|
||||
SysDictData sysDictData = new SysDictData();
|
||||
sysDictData.setDictType("case_built_type");
|
||||
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
|
||||
// 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取
|
||||
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId());
|
||||
// 抓取规则,0-内置字段,1-自定义字段
|
||||
Map<Integer, List<FatchRule>> fatchRuleMap = new HashMap<>();
|
||||
// 裁决书需要的字段和内容,占位符需要配置成中文
|
||||
Map<String, String> valueMap = new HashMap<>();
|
||||
// 如果未设置抓取规则,则从主表取数据,设置内置字段值
|
||||
if (CollectionUtil.isNotEmpty(fatchRuleList)) {
|
||||
fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
|
||||
}
|
||||
// 自定义字段,从columnValue值取
|
||||
if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) {
|
||||
// 根据案件id查询key-value表
|
||||
List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId());
|
||||
if (CollectionUtil.isNotEmpty(columnValueList)) {
|
||||
columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue()));
|
||||
}
|
||||
}
|
||||
// 组装内置字段,在主表中查出内容
|
||||
buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById);
|
||||
|
||||
// 获取模板中的占位符key
|
||||
List<String> bookmarkList = getBookmarkByDocx(templatePath);
|
||||
if(CollectionUtil.isEmpty(bookmarkList)){
|
||||
if (CollectionUtil.isEmpty(bookmarkList)) {
|
||||
// 直接保存模板为裁决书
|
||||
saveArbitorFile(id,templateName,templatePath,caseApplicationById,arbitrateRecordSelect);
|
||||
saveArbitorFile(id, templateName, templatePath, caseApplicationById, arbitrateRecordSelect);
|
||||
return AjaxResult.success("生成裁决书成功");
|
||||
}
|
||||
// 如果该表没值,在从主表填充裁决书模板
|
||||
if(CollectionUtil.isNotEmpty(columnValueList)){
|
||||
Map<String, String> columnValueMap = columnValueList.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue));
|
||||
agentName=columnValueMap.get("agentName");
|
||||
resName=columnValueMap.get("respondentName");
|
||||
// 懒得if,暂时这样
|
||||
//
|
||||
for (String bookmark : bookmarkList) {
|
||||
if(columnValueMap.containsKey(bookmark)){
|
||||
if(bookmark.equals("resSex")){
|
||||
String responSex = columnValueMap.get(bookmark);
|
||||
if (responSex.equals("0")) {
|
||||
datas.put(bookmark, "男");
|
||||
} else {
|
||||
datas.put(bookmark, "女");
|
||||
}
|
||||
}else if(bookmark.equals("arbitratClaims")){
|
||||
// 请求仲裁庭裁决
|
||||
String arbitratClaims = columnValueMap.get(bookmark);
|
||||
if(StrUtil.isNotEmpty(arbitratClaims)){
|
||||
String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人");
|
||||
datas.put("arbitratClaims", replace);
|
||||
|
||||
}else {
|
||||
datas.put("arbitratClaims", "");
|
||||
}
|
||||
}else if(bookmark.equals("mediationAgreement")){
|
||||
// 查询本案事实如下
|
||||
String mediationAgreement = columnValueMap.get(bookmark);
|
||||
if(StrUtil.isNotEmpty(mediationAgreement)){
|
||||
String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人");
|
||||
datas.put("mediationAgreement", replace);
|
||||
|
||||
}else {
|
||||
datas.put("mediationAgreement", "");
|
||||
}
|
||||
}
|
||||
else {
|
||||
datas.put(bookmark, columnValueMap.get(bookmark));
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
// 遍历书签,给书签赋值
|
||||
replaceBookmark(bookmarkList,datas,valueMap);
|
||||
// 根据条件替换书签
|
||||
conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect);
|
||||
// 裁决书生成时间
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
datas.put("year", year);
|
||||
datas.put("裁决书生成时间", year);
|
||||
//生成编码
|
||||
String equipmentNo = getNewEquipmentNo();
|
||||
// 裁决书编号
|
||||
datas.put("num", equipmentNo);
|
||||
datas.put("裁决书编号", equipmentNo);
|
||||
// 仲裁费
|
||||
datas.put("arbitrationFee", caseApplicationById.getFeePayable().toString());
|
||||
datas.put("仲裁费", caseApplicationById.getFeePayable().toString());
|
||||
// 案件创建时间
|
||||
Date createTime = caseApplicationById.getCreateTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
// 将日期格式化为字符串
|
||||
String createTimeStr = sdf.format(createTime);
|
||||
datas.put("submissionDate", createTimeStr);
|
||||
datas.put("案件创建时间", createTimeStr);
|
||||
// 立案日期
|
||||
Date registerDate = caseApplicationById.getRegisterDate();
|
||||
String registerDateStr = sdf.format(registerDate);
|
||||
datas.put("acceptDate", registerDateStr);
|
||||
|
||||
// 如果有仲裁反请求,该字段设置值
|
||||
Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter();
|
||||
if (adjudicaCounter!=null&&adjudicaCounter == 1) {
|
||||
datas.put("counterclaim", counterclaim);
|
||||
}
|
||||
//财产保全
|
||||
Integer properPreser = caseApplicationById.getProperPreser();
|
||||
if (properPreser!=null&&properPreser == 1) {
|
||||
datas.put("preservation", preservation);
|
||||
}
|
||||
//管辖权异议
|
||||
Integer objectiJuris = caseApplicationById.getObjectiJuris();
|
||||
if (objectiJuris!=null&&objectiJuris == 1) {
|
||||
datas.put("jurisdictionalObjection", jurisdictionalObjection);
|
||||
}
|
||||
|
||||
// 出席庭审人员角色名称
|
||||
String attendName="秘书、";
|
||||
boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0);
|
||||
boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0);
|
||||
if(isAbsenceFlag||appIsAbsenceFlag){
|
||||
if(isAbsenceFlag) {
|
||||
attendName += "申请代理人" + agentName+"、";
|
||||
}
|
||||
if(appIsAbsenceFlag) {
|
||||
attendName += "被申请人" + resName;
|
||||
}
|
||||
if(attendName.endsWith("、")){
|
||||
attendName=attendName.replace("、","");
|
||||
}
|
||||
datas.put("attendName", attendName);
|
||||
}
|
||||
|
||||
// 仲裁员名称
|
||||
datas.put("arbitratorName", caseApplicationById.getArbitratorName());
|
||||
// 审理方式
|
||||
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
|
||||
Date hearDate = caseApplicationById.getHearDate();
|
||||
if (hearDate != null) {
|
||||
// 审理日期
|
||||
String hearDateStr = sdf.format(hearDate);
|
||||
datas.put("hearDate",hearDateStr);
|
||||
// todo 线上仲裁/线下仲裁方式未选择
|
||||
//线上开庭时
|
||||
if (arbitratMethod == 1) {
|
||||
String replace = onLine.replace(onLineDate, Optional.ofNullable(hearDateStr).orElse(""));
|
||||
datas.put("onLine", replace);
|
||||
|
||||
} else {
|
||||
//书面仲裁时
|
||||
String replace = written.replace(writtenDate, Optional.ofNullable(hearDateStr).orElse(""));
|
||||
datas.put("written", replace);
|
||||
|
||||
}
|
||||
}
|
||||
// 所有附件
|
||||
List<CaseAttach> caseAttachList = caseApplicationById.getCaseAttachList();
|
||||
Map<Integer, List<CaseAttach>> caseAttachMap=new HashMap<>();
|
||||
if(caseAttachList!=null&&caseAttachList.size()>0){
|
||||
caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType));
|
||||
}
|
||||
// 被申请人是否缺席
|
||||
Integer isAbsence = caseApplicationById.getIsAbsence();
|
||||
// 线上开庭
|
||||
if (arbitratMethod == 1) {
|
||||
if (isAbsence != null && isAbsence == 1) {
|
||||
// 被申请人缺席
|
||||
String absentReplace = absent.replace("{{agentName}}", Optional.ofNullable(agentName).orElse(""));
|
||||
datas.put("absent",absentReplace);
|
||||
// 被申请人缺席
|
||||
String resAbsentReplace=resAbsent;
|
||||
if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))){
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString());
|
||||
}
|
||||
datas.put("resAbsent",resAbsentReplace);
|
||||
} else {
|
||||
// 出席
|
||||
String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse(""));
|
||||
datas.put("attend",attendReplace);
|
||||
// 被申请人证据
|
||||
if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))){
|
||||
// 开庭+出席+被申提供证据
|
||||
datas.put("onLineAttendFile",onLineAttendFile);
|
||||
// 被申请人出席+被申请人提供了资料
|
||||
String resFileRplace=resFile;
|
||||
if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))){
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(6);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resFileRplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect==null||arbitrateRecordSelect.getApplicantOpinion()==null?"":arbitrateRecordSelect.getApplicantOpinion()));
|
||||
}
|
||||
datas.put("resFile",resFileRplace);
|
||||
}else {
|
||||
// 开庭+出席+被申未提供证据
|
||||
datas.put("onLineAttend",onLineAttend);
|
||||
}
|
||||
// 被申请人出席答辩意见
|
||||
String resAttendOpinionReplace=resAttendOpinion;
|
||||
if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))){
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect==null||arbitrateRecordSelect.getRespondentOpinion()==null)?"":arbitrateRecordSelect.getRespondentOpinion());
|
||||
}
|
||||
|
||||
datas.put("resAttendOpinion",resAttendOpinionReplace);
|
||||
}
|
||||
}
|
||||
|
||||
datas.put("立案日期", registerDateStr);
|
||||
|
||||
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
String day = String.format("%02d", now.getDayOfMonth());
|
||||
// todo
|
||||
// String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
|
||||
String modalFilePath = templatePath;
|
||||
// todo
|
||||
// String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
@@ -370,6 +234,29 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
// todo
|
||||
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
// 将word中的标签替换掉,生成新的word
|
||||
String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName);
|
||||
|
||||
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
||||
// 保存裁决书附件
|
||||
saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
|
||||
|
||||
return AjaxResult.success("裁决书已生成");
|
||||
} catch (IOException e) {
|
||||
return AjaxResult.error(e + "请检查文件路径是否有误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将word中的标签替换掉,生成新的word
|
||||
* @param modalFilePath 裁决书模板路径
|
||||
* @param datas 替换标签的内容
|
||||
* @param saveFolderPath 保存路径
|
||||
* @param fileName 保存文件名
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
private String wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath,String fileName) throws IOException {
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
@@ -386,13 +273,273 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
XWPFDocument xwpfDocument = new XWPFDocument(in);
|
||||
WordUtil.changeText(xwpfDocument);
|
||||
}
|
||||
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
||||
// 保存裁决书附件
|
||||
saveArbitorFile(id,saveName,savePath,caseApplicationById,arbitrateRecordSelect);
|
||||
return docFilePath;
|
||||
}
|
||||
|
||||
return AjaxResult.success("裁决书已生成");
|
||||
} catch (IOException e) {
|
||||
return AjaxResult.error(e + "请检查文件路径是否有误");
|
||||
/**
|
||||
* 根据条件判断裁决书中是否需要该内容
|
||||
* @param caseApplicationById 案件信息
|
||||
* @param datas 替换标签值
|
||||
* @param agentName 代理人名称
|
||||
* @param resName 被申请人名称
|
||||
* @param arbitrateRecordSelect 仲裁记录
|
||||
*/
|
||||
private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map<String, Object> datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) {
|
||||
// 如果有仲裁反请求,该字段设置值
|
||||
Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter();
|
||||
if (adjudicaCounter != null && adjudicaCounter == 1) {
|
||||
datas.put("仲裁反请求", counterclaim);
|
||||
}
|
||||
//财产保全
|
||||
Integer properPreser = caseApplicationById.getProperPreser();
|
||||
if (properPreser != null && properPreser == 1) {
|
||||
datas.put("财产保全", preservation);
|
||||
}
|
||||
//管辖权异议
|
||||
Integer objectiJuris = caseApplicationById.getObjectiJuris();
|
||||
if (objectiJuris != null && objectiJuris == 1) {
|
||||
datas.put("管辖权异议", jurisdictionalObjection);
|
||||
}
|
||||
|
||||
// 出席庭审人员角色名称
|
||||
String attendName = "秘书、";
|
||||
boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0);
|
||||
boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0);
|
||||
if (isAbsenceFlag || appIsAbsenceFlag) {
|
||||
if (isAbsenceFlag) {
|
||||
attendName += "申请代理人" + agentName + "、";
|
||||
}
|
||||
if (appIsAbsenceFlag) {
|
||||
attendName += "被申请人" + resName;
|
||||
}
|
||||
if (attendName.endsWith("、")) {
|
||||
attendName = attendName.replace("、", "");
|
||||
}
|
||||
datas.put("出席庭审人员", attendName);
|
||||
}
|
||||
|
||||
// 仲裁员名称
|
||||
datas.put("仲裁员姓名", caseApplicationById.getArbitratorName());
|
||||
// 审理方式
|
||||
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
|
||||
Date hearDate = caseApplicationById.getHearDate();
|
||||
String hearDateStr = "";
|
||||
if (hearDate != null) {
|
||||
// 审理日期
|
||||
hearDateStr = sdf.format(hearDate);
|
||||
datas.put("审理日期", hearDateStr);
|
||||
}
|
||||
// todo 线上仲裁/线下仲裁方式未选择
|
||||
//线上开庭时+线上仲裁
|
||||
if (arbitratMethod!=null&&arbitratMethod == 1) {
|
||||
String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse(""));
|
||||
datas.put("线上开庭并线上仲裁", replace);
|
||||
// 所有附件
|
||||
List<CaseAttach> caseAttachList = caseApplicationById.getCaseAttachList();
|
||||
Map<Integer, List<CaseAttach>> caseAttachMap = new HashMap<>();
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType));
|
||||
}
|
||||
// 被申请人是否缺席
|
||||
Integer isAbsence = caseApplicationById.getIsAbsence();
|
||||
if (isAbsence != null && isAbsence == 1) {
|
||||
// 被申请人缺席,开庭+缺席审理
|
||||
String absentReplace = absent.replace("{{agentName}}", Optional.of(agentName).orElse(""));
|
||||
|
||||
// 被申请人缺席
|
||||
String resAbsentReplace = resAbsent;
|
||||
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) {
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString());
|
||||
}
|
||||
datas.put("开庭并缺席", absentReplace + resAbsentReplace);
|
||||
} else {
|
||||
// 被申出席
|
||||
String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse(""));
|
||||
datas.put("开庭并出席", attendReplace);
|
||||
// 被申请人证据
|
||||
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))) {
|
||||
// 开庭+出席+被申提供证据
|
||||
|
||||
// 开庭+出席+被申提供证据
|
||||
String resFileReplace = resFile;
|
||||
if (CollectionUtil.isNotEmpty(caseAttachMap.get(6))) {
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(6);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resFileReplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getApplicantOpinion() == null ? "" : arbitrateRecordSelect.getApplicantOpinion()));
|
||||
}
|
||||
datas.put("开庭并出席并被申提供证据", onLineAttendFile + resFileReplace);
|
||||
} else {
|
||||
// 开庭+出席+被申未提供证据
|
||||
datas.put("开庭并出席并被申未提供证据", onLineAttend);
|
||||
}
|
||||
// 被申请人出席答辩意见
|
||||
String resAttendOpinionReplace = resAttendOpinion;
|
||||
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) {
|
||||
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (CaseAttach caseAttach : caseAttaches) {
|
||||
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
|
||||
}
|
||||
resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getRespondentOpinion() == null) ? "" : arbitrateRecordSelect.getRespondentOpinion());
|
||||
}
|
||||
|
||||
datas.put("被申请人出席答辩意见", resAttendOpinionReplace);
|
||||
}
|
||||
|
||||
} else {
|
||||
//书面仲裁时
|
||||
String replace = written.replace(writtenDate, Optional.of(hearDateStr).orElse(""));
|
||||
datas.put("书面仲裁", replace);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 给模板中的占位符赋值
|
||||
* @param bookmarkList 书签
|
||||
* @param datas 书签赋值
|
||||
* @param valueMap 案件内容
|
||||
*/
|
||||
private void replaceBookmark(List<String> bookmarkList, Map<String, Object> datas, Map<String, String> valueMap) {
|
||||
for (String bookmark : bookmarkList) {
|
||||
if (valueMap.containsKey(bookmark)) {
|
||||
if (bookmark.equals("仲裁请求")) {
|
||||
// 请求仲裁庭裁决
|
||||
String arbitratClaims = valueMap.get(bookmark);
|
||||
if (StrUtil.isNotEmpty(arbitratClaims)) {
|
||||
String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人");
|
||||
datas.put(bookmark, replace);
|
||||
|
||||
} else {
|
||||
datas.put(bookmark, "");
|
||||
}
|
||||
} else if (bookmark.equals("本案事实")) {
|
||||
// 查询本案事实如下
|
||||
String mediationAgreement = valueMap.get(bookmark);
|
||||
if (StrUtil.isNotEmpty(mediationAgreement)) {
|
||||
String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人");
|
||||
datas.put(bookmark, replace);
|
||||
|
||||
} else {
|
||||
datas.put(bookmark, "");
|
||||
}
|
||||
} else {
|
||||
datas.put(bookmark, valueMap.get(bookmark));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装案件内置字段值,即主表和相关人员表信息
|
||||
* @param dictDataList 内置字段
|
||||
* @param caseAffiliates 关联人员
|
||||
* @param valueMap 组装的值
|
||||
*/
|
||||
private void buildDefaultColumnValue(List<SysDictData> dictDataList, List<CaseAffiliate> caseAffiliates, Map<String, String> valueMap, CaseApplication caseApplication) {
|
||||
if (CollectionUtil.isNotEmpty(dictDataList)) {
|
||||
Map<Integer, CaseAffiliate> affiliateMap = caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, Function.identity(), (n1, n2) -> n2));
|
||||
for (SysDictData dictData : dictDataList) {
|
||||
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
|
||||
if (dictData.getDictLabel().contains("被申请人")) {
|
||||
CaseAffiliate affiliate = affiliateMap.get(2);
|
||||
if (affiliate == null) {
|
||||
continue;
|
||||
}
|
||||
// 被申请人
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "被申请人姓名":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getName());
|
||||
break;
|
||||
case "被申请人身份证号":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum());
|
||||
break;
|
||||
case "被申请人住所":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
|
||||
break;
|
||||
case "被申请人联系电话":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone());
|
||||
break;
|
||||
case "被申请人电子邮件":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getEmail());
|
||||
break;
|
||||
case "被申请人性别":
|
||||
if (dictData.getDictLabel().equals("被申请人性别")) {
|
||||
String responSex = affiliate.getResponSex();
|
||||
if (responSex.equals("0")) {
|
||||
valueMap.put(dictData.getDictLabel(), "男");
|
||||
} else {
|
||||
valueMap.put(dictData.getDictLabel(), "女");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "被申请人出生年月日":
|
||||
Date responBirth = affiliate.getResponBirth();
|
||||
if (responBirth != null) {
|
||||
valueMap.put(dictData.getDictLabel(), sdf.format(responBirth));
|
||||
} else {
|
||||
valueMap.put(dictData.getDictLabel(), "");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|
||||
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位")
|
||||
|| dictData.getDictLabel().contains("代理人")) {
|
||||
CaseAffiliate affiliate = affiliateMap.get(1);
|
||||
if (affiliate == null) {
|
||||
continue;
|
||||
}
|
||||
// 申请人
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "申请人姓名":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getName());
|
||||
break;
|
||||
case "统一社会信用代码":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum());
|
||||
break;
|
||||
case "法定代表人":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson());
|
||||
break;
|
||||
case "法定代表人职位":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost());
|
||||
break;
|
||||
case "申请人住所":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
|
||||
break;
|
||||
case "申请人联系地址":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress());
|
||||
break;
|
||||
case "委托代理人姓名":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent());
|
||||
break;
|
||||
case "委托代理人联系电话":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent());
|
||||
break;
|
||||
case "委托代理人电子邮件":
|
||||
valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
|
||||
}
|
||||
}else {
|
||||
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+70
-4
@@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
@@ -50,6 +51,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
private SmsRecordMapper smsRecordMapper;
|
||||
@Autowired
|
||||
private ICaseApplicationService caseApplicationService;
|
||||
@Autowired
|
||||
private ColumnValueLogMapper columnValueLogMapper;
|
||||
// 对比两个版本修改的字段,基本字段对比
|
||||
private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
|
||||
"claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
|
||||
@@ -158,6 +161,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
caseAttachMapper.updateCaseAttach(caseAttach);
|
||||
}
|
||||
}
|
||||
// 更新自定义字段表
|
||||
// 根据caseLogId查询自定义字段表
|
||||
List<ColumnValue> columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId());
|
||||
if(CollectionUtil.isNotEmpty(columnValueList)){
|
||||
for (ColumnValue columnValue : columnValueList) {
|
||||
columnValue.setCaseAppliLogId(vo.getCaseId());
|
||||
|
||||
}
|
||||
columnValueLogMapper.batchUpdate(columnValueList);
|
||||
}
|
||||
} else {
|
||||
// 拒绝,将日志表改版本的状态改为拒绝
|
||||
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
|
||||
@@ -231,10 +244,12 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setCaseAppliId(vo.getCaseId());
|
||||
caseApplication.setId(vo.getCaseId());
|
||||
CaseApplication beforeCase= caseApplicationService.selectCaseApplication(caseApplication);
|
||||
CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
|
||||
// 查询案件关联人员
|
||||
afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId()));
|
||||
// 查询自定义字段表
|
||||
afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId()));
|
||||
// 查询附件
|
||||
CaseAttach caseAttach = new CaseAttach();
|
||||
caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
|
||||
@@ -242,7 +257,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
|
||||
caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
|
||||
List<CaseAttach> afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
|
||||
if(CollectionUtil.isNotEmpty(afterAttachList)){
|
||||
if (CollectionUtil.isNotEmpty(afterAttachList)) {
|
||||
for (CaseAttach attach : afterAttachList) {
|
||||
String annexName = attach.getAnnexName();
|
||||
String prefix = "/profile";
|
||||
@@ -284,9 +299,49 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
|
||||
}
|
||||
// 对比案件人员字段
|
||||
compareAffilate(beforeCase,afterCase);
|
||||
compareAffilate(beforeCase, afterCase);
|
||||
// 对比申请人证据资料
|
||||
compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase,afterCase,changeColumn).toString());
|
||||
compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString());
|
||||
// 对比自定义字段
|
||||
//
|
||||
List<ColumnValue> beforeColumnValues = beforeCase.getColumnValues();
|
||||
List<ColumnValue> afterColumnValues = afterCase.getColumnValues();
|
||||
StringBuilder columnValueChange = new StringBuilder();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) {
|
||||
Map<String, String> beforeColumnValueMap = beforeColumnValues.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue, (n1, n2) -> n2));
|
||||
for (ColumnValue afterColumnValue : afterColumnValues) {
|
||||
// 改变前字段不包含改变后字段
|
||||
if (!beforeColumnValueMap.containsKey(afterColumnValue.getColumn())) {
|
||||
columnValueChange.append(afterColumnValue.getColumn()).append(",");
|
||||
} else {
|
||||
// 都有这个字段,比较内容是否相同
|
||||
// 修改后为空,修改前不为空
|
||||
if (StrUtil.isEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
|
||||
columnValueChange.append(afterColumnValue.getColumn()).append(",");
|
||||
} else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
|
||||
// 修改前为空,修改后不为空
|
||||
columnValueChange.append(afterColumnValue.getColumn()).append(",");
|
||||
} else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))
|
||||
&& !afterColumnValue.getValue().equals(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
|
||||
// 修改前不为空,修改后不为空,内容不同
|
||||
columnValueChange.append(afterColumnValue.getColumn()).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (CollectionUtil.isEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) {
|
||||
for (ColumnValue afterColumnValue : afterColumnValues) {
|
||||
columnValueChange.append(afterColumnValue.getColumn()).append(",");
|
||||
}
|
||||
|
||||
} else if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isEmpty(afterColumnValues)) {
|
||||
for (ColumnValue beforeColumn : beforeColumnValues) {
|
||||
columnValueChange.append(beforeColumn.getColumn()).append(",");
|
||||
}
|
||||
|
||||
}
|
||||
compareCaseVO.setColumnValueChangeColumn(columnValueChange.toString());
|
||||
|
||||
return AjaxResult.success(compareCaseVO);
|
||||
}
|
||||
@@ -442,5 +497,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
||||
caseAttachMapper.updateCaseAttach(caseAttach);
|
||||
}
|
||||
}
|
||||
// 根据caseLogId查询自定义字段表
|
||||
List<ColumnValue> columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId());
|
||||
|
||||
// 更新相关人员主表
|
||||
if(CollectionUtil.isNotEmpty(columnValueList)){
|
||||
for (ColumnValue columnValue : columnValueList) {
|
||||
columnValue.setCaseAppliLogId(vo.getCaseId());
|
||||
|
||||
}
|
||||
columnValueLogMapper.batchUpdate(columnValueList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+277
-183
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -31,10 +32,7 @@ import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.thread.ThreadPoolUtil;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||
@@ -67,6 +65,7 @@ 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;
|
||||
@@ -140,7 +139,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
private FatchRuleMapper fatchRuleMapper;
|
||||
@Autowired
|
||||
private ColumnValueMapper columnValueMapper;
|
||||
|
||||
@Autowired
|
||||
private ColumnValueLogMapper columnValueLogMapper;
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
// 手机号正则
|
||||
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||
// 邮箱正则
|
||||
@@ -938,7 +940,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertcaseApplication(CaseApplication caseApplication,Map<String,String> fatchMap) {
|
||||
public int insertcaseApplication(CaseApplication caseApplication, List<ColumnValue> columnValueList) {
|
||||
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
||||
//根据仲裁费用计费规则计算应缴费用
|
||||
@@ -949,6 +951,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 获取自动编码
|
||||
String caseNum = generateCaseNum();
|
||||
caseApplication.setCaseNum(caseNum);
|
||||
// 设置批号
|
||||
if(StrUtil.isEmpty(caseApplication.getBatchNumber())){
|
||||
Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
|
||||
if(maxBatchNumber==null){
|
||||
caseApplication.setBatchNumber("1");
|
||||
}else {
|
||||
caseApplication.setBatchNumber(maxBatchNumber+1+"");
|
||||
}
|
||||
}
|
||||
caseApplication.setCreateBy(getUsername());
|
||||
caseApplication.setVersion(1);
|
||||
// 新增立案信息
|
||||
@@ -1016,12 +1027,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
|
||||
// 异步新增案件日志
|
||||
ThreadPoolUtil.execute(() -> {
|
||||
// 批量新增columnValue自定义字段
|
||||
if(CollectionUtil.isNotEmpty(columnValueList)) {
|
||||
columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId()));
|
||||
columnValueMapper.batchSave(columnValueList);
|
||||
}
|
||||
// 新增案件日志表
|
||||
caseApplication.setCaseAppliId(caseApplication.getId());
|
||||
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
||||
int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
||||
// 插入案件相关人员表日志
|
||||
if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
|
||||
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
||||
// 插入案件日志人员相关表
|
||||
|
||||
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
||||
}
|
||||
// 插入附件表日志
|
||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
|
||||
// 插入日志附件表
|
||||
@@ -1035,10 +1056,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
|
||||
}
|
||||
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
||||
// 插入columnValueLog自定义字段日志表
|
||||
if (CollectionUtil.isNotEmpty(columnValueList)) {
|
||||
columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
||||
columnValueLogMapper.batchSave(columnValueList);
|
||||
|
||||
}
|
||||
// 新增动态配置字段值表
|
||||
insertColumnValue(fatchMap,caseApplication.getCaseAppliId());
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -1082,8 +1106,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
caseApplication.setUpdateBy(getUsername());
|
||||
// 立案申请状态直接修改主表信息
|
||||
if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
|
||||
|
||||
// 修改内置字段
|
||||
if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) {
|
||||
caseApplicationMapper.updataCaseApplication(caseApplication);
|
||||
}else {
|
||||
// 修改自定义字段
|
||||
columnValueMapper.batchUpdate(caseApplication.getColumnValues());
|
||||
}
|
||||
// 修改记录表状态为同意提交修改的内容
|
||||
caseApplication.setUpdateSubmitStatus(0);
|
||||
} else {
|
||||
@@ -1193,6 +1222,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
|
||||
}
|
||||
// 插入案件columnValueLog自定义字段表
|
||||
if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) {
|
||||
caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getId()));
|
||||
|
||||
columnValueLogMapper.batchSave(caseApplication.getColumnValues());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -3044,183 +3079,53 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
if (fatchMap.size() <= 0) {
|
||||
return error("从压缩包中未抓取到内容,请检查抓取字段配置");
|
||||
}
|
||||
|
||||
// todo 从压缩包中识别各字段填充到数据库
|
||||
//调用新增案件的接口
|
||||
// 组装案件内置字段主表内容
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setTemplateId(templateId);
|
||||
//默认案件标的 todo 案件标的是什么,默认写死
|
||||
caseApplication.setCaseSubjectAmount(new BigDecimal(10000));
|
||||
// todo 这些以后要去掉,不在案件基本信息表维护,现在往基本信息表设置字段是因为修改以及查询详情的时候页面中字段是固定的,以后也要动态维护字段
|
||||
// 仲裁请求
|
||||
caseApplication.setArbitratClaims(fatchMap.get("arbitrationClaims"));
|
||||
// 事实和理由
|
||||
caseApplication.setFacts(fatchMap.get("factsAndReason"));
|
||||
// 合同编号
|
||||
String contractNumber = fatchMap.get("contractNumber");
|
||||
if (StrUtil.isNotEmpty(contractNumber)) {
|
||||
// 提取字母和数字
|
||||
String regx = "[^a-zA-Z0-9]";
|
||||
String replaceAll = contractNumber.replaceAll(regx, "");
|
||||
|
||||
caseApplication.setContractNumber(replaceAll.toUpperCase());
|
||||
// todo 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
|
||||
// 抓取规则,0-内置字段,1-自定义字段
|
||||
Map<Integer, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
|
||||
// 自定义字段,组装columnValue表
|
||||
List<ColumnValue> columnValueList = new ArrayList<>();
|
||||
if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
|
||||
List<FatchRule> columnRules = fatchRuleMap.get(1);
|
||||
columnRules.forEach(columnRule -> {
|
||||
ColumnValue columnValue = new ColumnValue();
|
||||
columnValue.setColumn(columnRule.getColumn());
|
||||
columnValue.setName(columnRule.getColumnName());
|
||||
columnValue.setValue(fatchMap.get(columnRule.getColumnName())); columnValue.setIsDefault(columnRule.getIsDefault());
|
||||
columnValueList.add(columnValue);
|
||||
});
|
||||
}
|
||||
// 在系统表中查询案件内置字段
|
||||
SysDictData sysDictData = new SysDictData();
|
||||
sysDictData.setDictType("case_built_type");
|
||||
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
|
||||
// 组装内置字段
|
||||
buildDefaultColumn(caseApplication,dictDataList,fatchMap);
|
||||
// 借款开始日期
|
||||
String lonStartDate = fatchMap.get("lonStartDate:");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat();
|
||||
sdf.applyPattern("yyyy年MM月dd日");
|
||||
if (StrUtil.isNotEmpty(lonStartDate)) {
|
||||
try {
|
||||
caseApplication.setLoanStartDate(sdf.parse(lonStartDate));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// todo 查询同一批号的模板
|
||||
// 金融消费纠纷基本情况
|
||||
String disputes = fatchMap.get("disputes");
|
||||
caseApplication.setDisputes(disputes);
|
||||
// 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);
|
||||
// // 金额格式化
|
||||
// String lonStartDate = fatchMap.get("借款开始日期:");
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
// if (StrUtil.isNotEmpty(lonStartDate)) {
|
||||
// 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 = fatchMap.get("mediationAgreement");
|
||||
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));
|
||||
// caseApplication.setLoanStartDate(sdf.parse(lonStartDate));
|
||||
// } catch (ParseException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// if(mediationAgreementList.size()>2){
|
||||
// // 待还金额
|
||||
// caseApplication.setOutstandingMoney(mediationAgreementList.get(2));
|
||||
// }
|
||||
// }
|
||||
// 合同甲方(贷款人)
|
||||
caseApplication.setPartyA(fatchMap.get("partyA"));
|
||||
List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setIdentityType(1);
|
||||
// 申请人
|
||||
caseAffiliate.setName(fatchMap.get("applicantName"));
|
||||
// 统一社会信用代码
|
||||
caseAffiliate.setIdentityNum(fatchMap.get("creditCode"));
|
||||
// 法定代表人
|
||||
caseAffiliate.setCompLegalPerson(fatchMap.get("legalRepresentative"));
|
||||
// 申请人联系电话
|
||||
caseAffiliate.setContactTelphone(fatchMap.get("applicantPhone"));
|
||||
// 申请人住所
|
||||
caseAffiliate.setResidenAffili(fatchMap.get("applicantHome"));
|
||||
// 申请人联系地址
|
||||
caseAffiliate.setContactAddress(fatchMap.get("applicantAddress"));
|
||||
// // 法定代表人职务
|
||||
caseAffiliate.setCompLegalperPost(fatchMap.get("compLegalperPost"));
|
||||
// 委托代理人
|
||||
caseAffiliate.setNameAgent(fatchMap.get("agentName"));
|
||||
// 委托代理人联系电话
|
||||
caseAffiliate.setContactTelphoneAgent(fatchMap.get("agentPhone"));
|
||||
|
||||
// 代理人电子邮件
|
||||
caseAffiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get("agentEmail")) ? fatchMap.get("agentEmail").replaceAll("\\s", "") : null);
|
||||
|
||||
|
||||
//设置默认代理人的身份证号码,暂时写死 要不然新增方法报错
|
||||
// caseAffiliate.setIdentityNumAgent("610423199603171716");
|
||||
caseAffiliates.add(caseAffiliate);
|
||||
// 被申请人信息
|
||||
CaseAffiliate respondentAffiliate = new CaseAffiliate();
|
||||
respondentAffiliate.setIdentityType(2);
|
||||
// 被申请人名称
|
||||
respondentAffiliate.setName(fatchMap.get("respondentName"));
|
||||
// 被申请人身份证
|
||||
String identityNum = fatchMap.get("respondentCard");
|
||||
// 出生年月日,从身份证抓取
|
||||
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();
|
||||
// 设置批号
|
||||
if(StrUtil.isEmpty(caseApplication.getBatchNumber())){
|
||||
Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
|
||||
if(maxBatchNumber==null){
|
||||
caseApplication.setBatchNumber("1");
|
||||
}else {
|
||||
caseApplication.setBatchNumber(maxBatchNumber+1+"");
|
||||
}
|
||||
fatchMap.put("resDateOfBirth", sdf.format(birthdayDate));
|
||||
respondentAffiliate.setResponBirth(birthdayDate);
|
||||
}
|
||||
//从身份证抓取性别
|
||||
fatchMap.put("resSex", identityNumMap.get("sexCode"));
|
||||
respondentAffiliate.setResponSex(identityNumMap.get("sexCode"));
|
||||
}
|
||||
respondentAffiliate.setIdentityNum(identityNum);
|
||||
// 被申请人电子邮件
|
||||
// if(map.get("乙方确认有效的电子信箱地址为").size()>1) {
|
||||
// if(map.get("乙方确认有效的电子信箱地址为").get(0).contains("/")) {
|
||||
// respondentAffiliate.setEmail(map.get("乙方确认有效的电子信箱地址为").get(1).replaceAll("\\s", ""));
|
||||
// }else {
|
||||
// respondentAffiliate.setEmail(map.get("乙方确认有效的电子信箱地址为").get(0).replaceAll("\\s", ""));
|
||||
// }
|
||||
// }
|
||||
// 被申请人电子邮件
|
||||
respondentAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get("respondentEmail")) ? fatchMap.get("respondentEmail").replaceAll("\\s", "") : null);
|
||||
// 被申请人联系电话
|
||||
respondentAffiliate.setContactTelphone(fatchMap.get("respondentPhone"));
|
||||
// 被申请人住所
|
||||
respondentAffiliate.setResidenAffili(fatchMap.get("respondentHome"));
|
||||
|
||||
caseAffiliates.add(respondentAffiliate);
|
||||
caseApplication.setCaseAffiliates(caseAffiliates);
|
||||
// 新增案件基本信息表
|
||||
this.insertcaseApplication(caseApplication, fatchMap);
|
||||
this.insertcaseApplication(caseApplication, columnValueList);
|
||||
if (null != caseApplication.getId()) {
|
||||
List<CaseAttach> caseAttachs = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : andConvertPDF.entrySet()) {
|
||||
@@ -3254,6 +3159,195 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装内置字段
|
||||
* @param caseApplication 案件信息
|
||||
* @param dictDataList 内置字段
|
||||
* @param fatchMap 抓取字段内容
|
||||
*/
|
||||
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap) {
|
||||
// 组装内置字段
|
||||
if (CollectionUtil.isEmpty(dictDataList)) {
|
||||
return;
|
||||
}
|
||||
List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
||||
CaseAffiliate debtorAffiliate = new CaseAffiliate();
|
||||
CaseAffiliate affiliate = new CaseAffiliate();
|
||||
for (SysDictData dictData : dictDataList) {
|
||||
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
|
||||
if(dictData.getDictLabel().contains("被申请人")) {
|
||||
// 组装被申请人内置自段
|
||||
buildDebtorColumn(dictData, fatchMap, debtorAffiliate);
|
||||
}else if( dictData.getDictLabel().contains("申请人")|| dictData.getDictLabel().contains("统一社会信用代码")
|
||||
|| dictData.getDictLabel().contains("法定代表人")|| dictData.getDictLabel().contains("委托代理人")) {
|
||||
// 组装申请人内置自段
|
||||
buildAffilcateColumn(dictData, fatchMap, affiliate);
|
||||
}else if( dictData.getDictLabel().contains("合同编号")) {
|
||||
// 合同编号
|
||||
String contractNumber = fatchMap.get("合同编号");
|
||||
if (StrUtil.isNotEmpty(contractNumber)) {
|
||||
// 提取字母和数字
|
||||
String regx = "[^a-zA-Z0-9]";
|
||||
String replaceAll = contractNumber.replaceAll(regx, "");
|
||||
caseApplication.setContractNumber(replaceAll.toUpperCase());
|
||||
}
|
||||
}else {
|
||||
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()));
|
||||
}
|
||||
|
||||
} else {
|
||||
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(debtorAffiliate)){
|
||||
caseAffiliates.add(debtorAffiliate);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(affiliate)){
|
||||
caseAffiliates.add(affiliate);
|
||||
}
|
||||
caseApplication.setCaseAffiliates(caseAffiliates);
|
||||
|
||||
}
|
||||
/**
|
||||
* 组装申请人内置字段
|
||||
* @param dictData 内置字段
|
||||
* @param fatchMap 抓取内容
|
||||
* @param affiliate 案件人员
|
||||
*/
|
||||
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate) {
|
||||
|
||||
affiliate.setIdentityType(1);
|
||||
|
||||
// 申请人
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "申请人姓名":
|
||||
affiliate.setName((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "统一社会信用代码":
|
||||
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "法定代表人":
|
||||
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "法定代表人职位":
|
||||
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "申请人住所":
|
||||
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel())));
|
||||
break;
|
||||
case "申请人联系地址":
|
||||
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人姓名":
|
||||
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人联系电话":
|
||||
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "委托代理人电子邮件":
|
||||
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n","").replaceAll("\\s", "") : null);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装被申请人内置字段
|
||||
* @param dictData 内置字段
|
||||
* @param fatchMap 抓取内容
|
||||
* @param debtorAffiliate 被申请人
|
||||
*/
|
||||
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate) {
|
||||
|
||||
debtorAffiliate.setIdentityType(2);
|
||||
// 被申请人
|
||||
switch (dictData.getDictLabel()) {
|
||||
case "被申请人姓名":
|
||||
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "被申请人身份证号":
|
||||
String identityNum = fatchMap.get(dictData.getDictLabel());
|
||||
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel()));
|
||||
// 出生年月日,从身份证抓取
|
||||
if (StrUtil.isNotEmpty(identityNum)) {
|
||||
identityNum=identityNum.replace("\n","");
|
||||
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();
|
||||
}
|
||||
debtorAffiliate.setResponBirth(birthdayDate);
|
||||
}
|
||||
//从身份证抓取性别
|
||||
debtorAffiliate.setResponSex(identityNumMap.get("sexCode"));
|
||||
}
|
||||
|
||||
break;
|
||||
case "被申请人住所":
|
||||
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "被申请人联系电话":
|
||||
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel()));
|
||||
break;
|
||||
case "被申请人电子邮件":
|
||||
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n","").replaceAll("\\s", "") : null);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额格式化,增加千分位
|
||||
* @param money
|
||||
* @return
|
||||
*/
|
||||
private String moneyFormat(String money) {
|
||||
// 金额格式化
|
||||
try {
|
||||
Double.parseDouble(money);
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
String regEx = "[^0-9]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(money);
|
||||
String result = m.replaceAll("").trim();
|
||||
BigDecimal bigDecimal = null;
|
||||
if (money.contains("百")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100"));
|
||||
} else if (money.contains("千")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000"));
|
||||
} else if (money.contains("万")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000"));
|
||||
} else if (money.contains("百万")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000000"));
|
||||
} else if (money.contains("千万")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000000"));
|
||||
} else if (money.contains("亿")) {
|
||||
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100000000"));
|
||||
}
|
||||
|
||||
NumberFormat format = NumberFormat.getInstance();
|
||||
return format.format(bigDecimal);
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增动态配置字段值表
|
||||
* @param fatchMap
|
||||
@@ -3327,19 +3421,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
XWPFDocument xdoc = new XWPFDocument(fis);
|
||||
XWPFWordExtractor extractor = new XWPFWordExtractor(xdoc);
|
||||
buffer = extractor.getText();
|
||||
|
||||
sb.append(buffer!=null?buffer:"");
|
||||
|
||||
|
||||
// OPCPackage opcPackage = POIXMLDocument.openPackage(filePath);
|
||||
// XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||
// buffer = extractor.getText();
|
||||
if(buffer.length() > 0){
|
||||
//使用换行符分割字符串
|
||||
String [] arry = buffer.split("\r\n");
|
||||
for (String string : arry) {
|
||||
sb.append(string.trim());
|
||||
}
|
||||
}
|
||||
// if(buffer.length() > 0){
|
||||
// //使用换行符分割字符串
|
||||
// String [] arry = buffer.split("\n");
|
||||
// for (String string : arry) {
|
||||
// sb.append(string.trim());
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -3379,7 +3473,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
//文件转成base64
|
||||
String base64 = OCRUtils.pdfConvertBase64(pdfUrl);
|
||||
if (base64 == null) {
|
||||
throw new ServiceException("文件转成base64,转码失败");
|
||||
throw new ServiceException("pdf转base64失败");
|
||||
// return false;
|
||||
}
|
||||
StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
|
||||
import com.tencentcloudapi.bsca.v20210811.models.LicenseSummary;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
@@ -218,27 +219,26 @@ public class OCRUtils {
|
||||
if (StrUtil.isEmpty(fatchRule.getStartContent())) {
|
||||
continue;
|
||||
}
|
||||
// 开始截取字符串 申请人:赵会
|
||||
// String[] startContentSplit = ocrText.split(fatchRule.getStartContent());
|
||||
int startFirstIndex = ocrText.indexOf(fatchRule.getStartContent()) + fatchRule.getStartContent().length();
|
||||
if(startFirstIndex<0){
|
||||
continue;
|
||||
}
|
||||
if (ocrText.length() >= startFirstIndex) {
|
||||
ocrText = ocrText.substring(startFirstIndex);
|
||||
|
||||
if (StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isNotEmpty(fatchRule.getEndContent())) {
|
||||
String s = StringUtils.substringBetween(ocrText, fatchRule.getStartContent(), fatchRule.getEndContent());
|
||||
if(StrUtil.isNotEmpty(s)){
|
||||
fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s));
|
||||
}else {
|
||||
fatchMap.put(fatchRule.getColumnName(),"");
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(fatchRule.getEndContent())) {
|
||||
if(ocrText.indexOf(fatchRule.getEndContent())>=0) {
|
||||
int endFirstIndex = ocrText.indexOf(fatchRule.getEndContent()) + fatchRule.getEndContent().length();
|
||||
if (ocrText.length() >= (endFirstIndex - fatchRule.getEndContent().length())) {
|
||||
fatchMap.put(fatchRule.getColumn(), ocrText.substring(0, endFirstIndex - fatchRule.getEndContent().length()));
|
||||
ocrText = ocrText.substring(endFirstIndex - fatchRule.getEndContent().length());
|
||||
}else if(StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isEmpty(fatchRule.getEndContent())){
|
||||
String s = StringUtils.substringAfter(ocrText,fatchRule.getStartContent());
|
||||
if(StrUtil.isNotEmpty(s)){
|
||||
fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s));
|
||||
}else {
|
||||
fatchMap.put(fatchRule.getColumnName(),"");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,13 +46,9 @@
|
||||
<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="batchNumber" column="batch_number" />
|
||||
<result property="mediationAgreement" column="mediation_agreement" />
|
||||
</resultMap>
|
||||
|
||||
@@ -63,7 +59,7 @@
|
||||
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
|
||||
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
|
||||
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
|
||||
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
|
||||
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number
|
||||
from(
|
||||
<trim suffixOverrides="union">
|
||||
<!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
|
||||
@@ -76,7 +72,7 @@
|
||||
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
|
||||
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
|
||||
t.arbitrator_id,t.identity_num ,
|
||||
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus
|
||||
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number
|
||||
from(
|
||||
select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
||||
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
||||
@@ -100,7 +96,7 @@
|
||||
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
|
||||
as applicantName,
|
||||
c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
|
||||
updateSubmitStatus
|
||||
updateSubmitStatus,c.batch_number
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
<!--查询条件-->
|
||||
@@ -207,7 +203,7 @@
|
||||
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
|
||||
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
|
||||
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
|
||||
as updateSubmitStatus
|
||||
as updateSubmitStatus,c.batch_number
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
|
||||
|
||||
@@ -287,7 +283,8 @@
|
||||
c.arbitrator_id,ca.identity_num ,ca.identity_type,
|
||||
c.filearbitra_url,
|
||||
c.lock_status,c.version,
|
||||
null as updateSubmitStatus
|
||||
null as updateSubmitStatus,
|
||||
c.batch_number
|
||||
FROM
|
||||
case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
||||
@@ -382,7 +379,7 @@
|
||||
ca.application_organ_id ,
|
||||
ca.application_organ_name AS applicantName,
|
||||
c.arbitrator_id,ca.identity_num ,ca.identity_type,
|
||||
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
|
||||
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number
|
||||
FROM
|
||||
case_application c
|
||||
JOIN case_application_log l ON c.id = l.case_appli_id
|
||||
@@ -814,7 +811,7 @@
|
||||
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from
|
||||
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
|
||||
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
|
||||
as updateSubmitStatus
|
||||
as updateSubmitStatus,c.batch_number
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
|
||||
JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
|
||||
@@ -902,328 +899,6 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectApplicationCase" resultMap="CaseApplicationResult">
|
||||
SELECT
|
||||
l.case_appli_id id,
|
||||
l.id AS caseLogId,
|
||||
l.version,
|
||||
l.case_num,
|
||||
l.case_subject_amount,
|
||||
c.register_date,
|
||||
c.arbitrat_method,
|
||||
CASE
|
||||
c.arbitrat_method
|
||||
WHEN 1 THEN
|
||||
'开庭审理'
|
||||
WHEN 2 THEN
|
||||
'书面审理' ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
c.case_status,
|
||||
CASE
|
||||
c.case_status
|
||||
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
when 18 then '待仲裁员审核仲裁文书'
|
||||
when 31 then '待修改开庭时间' ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date,
|
||||
l.arbitrat_claims,
|
||||
l.loan_start_date,
|
||||
l.loan_end_date,
|
||||
l.claim_princi_owed,
|
||||
l.claim_interest_owed,
|
||||
l.claim_liquid_damag,
|
||||
l.fee_payable,
|
||||
c.begin_video_date,
|
||||
c.online_video_person,
|
||||
l.contract_number,
|
||||
l.create_by,
|
||||
c.create_time,
|
||||
c.lock_status,
|
||||
l.update_by,
|
||||
l.update_time,
|
||||
c.arbitrator_name,
|
||||
ca.application_organ_id applicationOrganId,
|
||||
ca.application_organ_name AS applicantName,
|
||||
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
|
||||
FROM
|
||||
case_application c
|
||||
JOIN case_application_log l ON c.id = l.case_appli_id
|
||||
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
|
||||
AND ca.identity_type = 1
|
||||
WHERE
|
||||
ca.identity_type=1
|
||||
|
||||
<if test="applicationOrganId != null and applicationOrganId != ''">
|
||||
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
|
||||
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
|
||||
and (t.case_status <= 10 or t.case_status=31))
|
||||
<!-- and t.case_status in (0,2,17))-->
|
||||
|
||||
</if>
|
||||
<if test="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
</if>
|
||||
<if test="lockStatus != null">
|
||||
AND c.lock_status = #{lockStatus}
|
||||
</if>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND c.case_num = #{caseNum}
|
||||
</if>
|
||||
<if test="nameId != null and nameId != ''">
|
||||
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
||||
</if>
|
||||
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
|
||||
<!-- and c.case_status in (1,5)-->
|
||||
<!-- </if>-->
|
||||
<!-- 查询该案件的最新记录 -->
|
||||
AND l.version = (
|
||||
SELECT
|
||||
max( version ) version
|
||||
FROM
|
||||
case_application_log
|
||||
WHERE case_appli_id = t.id
|
||||
update_submit_status IN ( 1, 2 ))
|
||||
order by c.create_time desc,c.case_num desc
|
||||
</select>
|
||||
<select id="selectSecretaryCase" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
||||
SELECT
|
||||
t.id,
|
||||
t.caseLogId,
|
||||
max( version ) version,
|
||||
t.case_num,
|
||||
t.case_subject_amount,
|
||||
t.register_date,
|
||||
t.arbitrat_method,
|
||||
t.caseStatusName,
|
||||
t.hear_date,
|
||||
t.arbitrat_claims,
|
||||
t.loan_start_date,
|
||||
t.loan_end_date,
|
||||
t.claim_princi_owed,
|
||||
t.claim_interest_owed,
|
||||
t.claim_liquid_damag,
|
||||
t.fee_payable,
|
||||
t.begin_video_date,
|
||||
t.online_video_person,
|
||||
t.contract_number,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.lock_status,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
t.arbitrator_name,
|
||||
t.applicationOrganId,
|
||||
t.applicantName,
|
||||
t.filearbitra_url,
|
||||
t.updateSubmitStatus,t.case_name
|
||||
FROM
|
||||
(
|
||||
<!-- 查询案件主表 -->
|
||||
SELECT
|
||||
c.id,
|
||||
'' AS caseLogId,
|
||||
c.version,
|
||||
c.case_num,
|
||||
c.case_subject_amount,
|
||||
c.register_date,
|
||||
c.arbitrat_method,
|
||||
CASE
|
||||
c.arbitrat_method
|
||||
WHEN 1 THEN
|
||||
'开庭审理'
|
||||
WHEN 2 THEN
|
||||
'书面审理' ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
c.case_status,
|
||||
CASE
|
||||
c.case_status
|
||||
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
when 18 then '待仲裁员审核仲裁文书'
|
||||
when 31 then '待修改开庭时间' ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date,
|
||||
c.arbitrat_claims,
|
||||
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.lock_status,
|
||||
c.update_by,
|
||||
c.update_time,
|
||||
c.arbitrator_name,
|
||||
ca.application_organ_id applicationOrganId,
|
||||
ca.application_organ_name AS applicantName,
|
||||
c.filearbitra_url,null as updateSubmitStatus,c.case_name
|
||||
FROM
|
||||
case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
||||
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and l.version = (
|
||||
SELECT
|
||||
max( version ) version
|
||||
FROM
|
||||
case_application_log
|
||||
WHERE case_appli_id = c.id
|
||||
update_submit_status IN ( 1, 2 ))
|
||||
WHERE
|
||||
ca.identity_type=1 and c.case_status in (1,5)
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
and ca.application_organ_id in
|
||||
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
</if>
|
||||
<if test="lockStatus != null">
|
||||
AND c.lock_status = #{lockStatus}
|
||||
</if>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND c.case_num = #{caseNum}
|
||||
</if>
|
||||
<if test="nameId != null and nameId != ''">
|
||||
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
||||
</if>
|
||||
|
||||
UNION
|
||||
<!-- 查询案件记录表修改提交申请和撤销申请的案件 -->
|
||||
SELECT
|
||||
l.case_appli_id id,
|
||||
l.id AS caseLogId,
|
||||
l.version,
|
||||
l.case_num,
|
||||
l.case_subject_amount,
|
||||
c.register_date,
|
||||
c.arbitrat_method,
|
||||
CASE
|
||||
c.arbitrat_method
|
||||
WHEN 1 THEN
|
||||
'开庭审理'
|
||||
WHEN 2 THEN
|
||||
'书面审理' ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
c.case_status,
|
||||
CASE
|
||||
c.case_status
|
||||
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
when 18 then '待仲裁员审核仲裁文书'
|
||||
when 31 then '待修改开庭时间' ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date,
|
||||
l.arbitrat_claims,
|
||||
l.loan_start_date,
|
||||
l.loan_end_date,
|
||||
l.claim_princi_owed,
|
||||
l.claim_interest_owed,
|
||||
l.claim_liquid_damag,
|
||||
l.fee_payable,
|
||||
c.begin_video_date,
|
||||
c.online_video_person,
|
||||
l.contract_number,
|
||||
l.create_by,
|
||||
c.create_time,
|
||||
c.lock_status,
|
||||
l.update_by,
|
||||
l.update_time,
|
||||
c.arbitrator_name,
|
||||
ca.application_organ_id applicationOrganId,
|
||||
ca.application_organ_name AS applicantName,
|
||||
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
|
||||
FROM
|
||||
case_application c
|
||||
JOIN case_application_log l ON c.id = l.case_appli_id
|
||||
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
|
||||
AND ca.identity_type = 1
|
||||
WHERE
|
||||
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
and ca.application_organ_id in
|
||||
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
</if>
|
||||
<if test="lockStatus != null">
|
||||
AND c.lock_status = #{lockStatus}
|
||||
</if>
|
||||
<if test="caseNum != null and caseNum != ''">
|
||||
AND c.case_num = #{caseNum}
|
||||
</if>
|
||||
<if test="nameId != null and nameId != ''">
|
||||
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
||||
</if>
|
||||
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
|
||||
<!-- and c.case_status in (1,5)-->
|
||||
<!-- </if>-->
|
||||
<!-- 查询该案件的最新记录 -->
|
||||
AND l.version = (
|
||||
SELECT
|
||||
max( version ) version
|
||||
FROM
|
||||
case_application_log
|
||||
WHERE
|
||||
update_submit_status IN ( 1, 2 ))
|
||||
) t
|
||||
GROUP BY
|
||||
t.id,
|
||||
t.caseLogId,
|
||||
t.version,
|
||||
t.case_num,
|
||||
t.case_subject_amount,
|
||||
t.register_date,
|
||||
t.arbitrat_method,
|
||||
t.caseStatusName,
|
||||
t.hear_date,
|
||||
t.arbitrat_claims,
|
||||
t.loan_start_date,
|
||||
t.loan_end_date,
|
||||
t.claim_princi_owed,
|
||||
t.claim_interest_owed,
|
||||
t.claim_liquid_damag,
|
||||
t.fee_payable,
|
||||
t.begin_video_date,
|
||||
t.online_video_person,
|
||||
t.contract_number,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.lock_status,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
t.arbitrator_name,
|
||||
t.applicationOrganId,
|
||||
t.applicantName,
|
||||
t.filearbitra_url,
|
||||
t.updateSubmitStatus,
|
||||
t.case_name
|
||||
ORDER BY
|
||||
t.create_time DESC,
|
||||
t.case_num DESC
|
||||
|
||||
</select>
|
||||
<insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into case_application(
|
||||
<if test="caseName != null and caseName != ''">case_name ,</if>
|
||||
@@ -1254,14 +929,9 @@
|
||||
<if test="importFlag != null ">import_flag,</if>
|
||||
<if test="version != null ">version,</if>
|
||||
<if test="templateId != null ">template_id,</if>
|
||||
interest_rate,
|
||||
outstanding_money,
|
||||
facts,
|
||||
party_a,
|
||||
disputes,
|
||||
loan_type,
|
||||
loan_term,
|
||||
mediation_agreement,
|
||||
batch_number,
|
||||
create_time
|
||||
)values(
|
||||
<if test="caseName != null and caseName != ''">#{caseName},</if>
|
||||
@@ -1292,14 +962,10 @@
|
||||
<if test="importFlag != null ">#{importFlag},</if>
|
||||
<if test="version != null ">#{version},</if>
|
||||
<if test="templateId != null ">#{templateId},</if>
|
||||
#{interestRate},
|
||||
#{outstandingMoney},
|
||||
|
||||
#{facts},
|
||||
#{partyA},
|
||||
#{disputes},
|
||||
#{loanType},
|
||||
#{loanTerm},
|
||||
#{mediationAgreement},
|
||||
#{batchNumber},
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -1333,13 +999,7 @@
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</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>
|
||||
@@ -1425,13 +1085,8 @@
|
||||
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.interest_rate,
|
||||
c.outstanding_money,
|
||||
c.batch_number,
|
||||
c.facts,
|
||||
c.party_a,
|
||||
c.disputes,
|
||||
c.loan_type,
|
||||
c.loan_term,
|
||||
c.mediation_agreement,c.template_id templateId
|
||||
from case_application c
|
||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||
@@ -1463,7 +1118,10 @@
|
||||
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.batch_number,
|
||||
c.facts,
|
||||
c.mediation_agreement,c.template_id templateId
|
||||
from case_application c
|
||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||
|
||||
@@ -1492,7 +1150,7 @@
|
||||
when 31 then '待修改开庭时间'
|
||||
ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date ,c.arbitrat_claims ,
|
||||
c.hear_date ,c.arbitrat_claims , c.batch_number,c.facts,c.mediation_agreement,c.template_id templateId,
|
||||
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.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
|
||||
@@ -1521,7 +1179,10 @@
|
||||
select max(room_id+1) as maxRoomId
|
||||
from reserved_conference ;
|
||||
</select>
|
||||
|
||||
<select id="selectBatchNumberLike" resultType="java.lang.Integer">
|
||||
select max(batch_number) as maxBatchNumber
|
||||
from case_application ;
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.ColumnValueLogMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue" >
|
||||
<result column="id" property="id" />
|
||||
<result column="column" property="column" />
|
||||
<result column="name" property="name" />
|
||||
<result column="value" property="value" />
|
||||
<result column="case_appli_log_id" property="caseAppliLogId" />
|
||||
</resultMap>
|
||||
<insert id="batchSave">
|
||||
INSERT INTO column_value_log ( `COLUMN`, `NAME`, `VALUE`, case_appli_log_id )
|
||||
values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
|
||||
(#{item.column},#{item.name},#{item.value},#{item.caseAppliLogId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="listBycaseAppliLogId" resultMap="BaseResultMap">
|
||||
select * from column_value_log where case_appli_log_id=#{caseAppliLogId}
|
||||
</select>
|
||||
<update id="batchUpdate">
|
||||
<foreach collection="list" item="item" >
|
||||
update column_value_log
|
||||
<set>
|
||||
<if test="item.value != null and item.value != ''">
|
||||
`VALUE` = #{item.value},
|
||||
</if>
|
||||
`id`=#{item.id}
|
||||
</set>
|
||||
where `COLUMN`=#{item.column} and `NAME`=#{item.name} and case_appli_log_id=#{item.caseAppliLogId};
|
||||
</foreach>
|
||||
</update>
|
||||
<select id="queryColumnValueList" parameterType="ColumnValue" resultMap="BaseResultMap">
|
||||
select * from column_value_log c
|
||||
<where>
|
||||
<if test="caseAppliLogId != null">
|
||||
AND c.case_appli_log_id = #{caseAppliLogId}
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
AND c.is_default = #{isDefault}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -18,6 +18,18 @@
|
||||
(#{item.column},#{item.name},#{item.value},#{item.caseId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="batchUpdate">
|
||||
<foreach collection="list" item="item" >
|
||||
update column_value
|
||||
<set>
|
||||
<if test="item.value != null and item.value != ''">
|
||||
`VALUE` = #{item.value},
|
||||
</if>
|
||||
`id`=#{item.id}
|
||||
</set>
|
||||
where id=#{item.id};
|
||||
</foreach>
|
||||
</update>
|
||||
<select id="listByCaseId" resultMap="BaseResultMap">
|
||||
select * from column_value where case_id=#{caseId}
|
||||
</select>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result column="end_content" property="endContent" />
|
||||
<result column="column" property="column" />
|
||||
<result column="column_name" property="columnName" />
|
||||
<result column="is_default" property="isDefault" />
|
||||
</resultMap>
|
||||
<select id="listByTemplateId" resultMap="BaseResultMap">
|
||||
select fr.* from fatch_rule fr join template_fatch_rule tfr on fr.id=tfr.fatch_rule_id
|
||||
|
||||
Reference in New Issue
Block a user