Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #305.
This commit is contained in:
2023-12-12 19:09:28 +08:00
committed by Gitea
9 changed files with 195 additions and 86 deletions
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -13,4 +14,6 @@ public interface CaseLogRecordMapper {
List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord);
int insertCaseLogRecord(CaseLogRecord caseLogRecord);
void batchInsertRecord(@Param("list")List<CaseLogRecord> list);
}
@@ -55,7 +55,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
private ColumnValueLogMapper columnValueLogMapper;
// 对比两个版本修改的字段,基本字段对比
private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
"claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
"claimPrinciOwed","arbitratClaims","properPreser","requestRule","facts"};
// 人员字段对比
private static final String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email",
"nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
@@ -926,6 +926,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
caseApplication.setCreateBy(getUsername());
caseApplication.setVersion(1);
caseApplication.setId(IdWorkerUtil.getId());
// 新增立案信息
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
if (rows == 0) {
@@ -1010,10 +1011,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 新增案件日志表
caseApplication.setCaseAppliId(caseApplication.getId());
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
caseApplication.setCaseLogId(IdWorkerUtil.getId());
int insertRow = caseApplicationLogMapper.insert(caseApplication);
// 插入案件相关人员表日志
if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
}
@@ -1025,7 +1027,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
for (CaseAttach caseAttach : filterList) {
// 查询附件表
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
attach.setCaseAppliLogId(caseApplication.getId());
attach.setCaseAppliLogId(caseApplication.getCaseLogId());
caseAttachLogMapper.save(attach);
}
}
@@ -1033,7 +1035,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
// 插入columnValueLog自定义字段日志表
if (CollectionUtil.isNotEmpty(columnValueList)) {
columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
columnValueLogMapper.batchSave(columnValueList);
}
@@ -1168,10 +1170,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
ThreadPoolUtil.execute(() -> {
try {
caseApplication.setCaseAppliId(caseApplication.getId());
caseApplication.setCaseLogId(IdWorkerUtil.getId());
int insertRow = caseApplicationLogMapper.insert(caseApplication);
if (insertRow != 0) {
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
// 插入案件日志人员相关表
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
}
@@ -1182,7 +1185,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
for (CaseAttach caseAttach : filterList) {
// 查询附件表
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
attach.setCaseAppliLogId(caseApplication.getId());
attach.setCaseAppliLogId(caseApplication.getCaseLogId());
caseAttachLogMapper.save(attach);
}
}
@@ -1190,7 +1193,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
// 插入案件columnValueLog自定义字段表
if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) {
caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getId()));
caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId()));
columnValueLogMapper.batchSave(caseApplication.getColumnValues());
}
@@ -1534,6 +1537,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
caseApplicationItera.setCreateBy(getUsername());
caseApplicationItera.setImportFlag(1);
caseApplicationItera.setId(IdWorkerUtil.getId());
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
if (rows == 0) {
continue;
@@ -1553,7 +1557,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseApplicationItera.setCaseAppliId(caseApplicationItera.getId());
caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
caseApplicationItera.setVersion(1);
caseApplicationItera.setCaseLogId(IdWorkerUtil.getId());
int insertRow = caseApplicationLogMapper.insert(caseApplicationItera);
if (insertRow > 0) {
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId()));
@@ -1845,9 +1849,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION);
String notes="";
if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){
notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject();
}
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
@@ -1875,14 +1883,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
if (agreeOrNotCheck.intValue() == 1) {
caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
String notes="";
if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){
notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject();
}
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes);
}
return success();
}
@@ -1895,6 +1909,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
//提交立案审查
int rows = 0;
for (Long id : ids) {
String notes="";
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
caseApplication.setAgreeOrNotCheck(agreeOrNotCheck);
@@ -1902,6 +1917,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
rows += caseApplicationMapper.submitCaseApplication(caseApplication);
} else if (agreeOrNotCheck == 2) {//拒绝审核
notes="驳回立案申请,驳回原因:"+caseCheckReject;
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
rows += caseApplicationMapper.submitCaseApplication(caseApplication);
ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
@@ -1912,13 +1928,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
}else {
arbitrateRecordsel.setCaseCheckReject(caseCheckReject);
arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
}
}
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes);
}
@@ -2853,15 +2871,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Transactional
@Override
public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) {
CaseApplication caseApplication=null;
AjaxResult ajaxResult = caseZipImportImpl.zipImport( file, templateId);
if(ajaxResult.isSuccess()&&caseApplication!=null) {
// 新增案件基本信息表
this.insertcaseApplication(caseApplication);
return success("导入成功");
}else {
return ajaxResult;
}
return ajaxResult;
}
@@ -34,6 +34,9 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService {
if(StrUtil.isNotEmpty(record.getContent())){
contentBuilder.append(record.getContent());
}
if(StrUtil.isNotEmpty(record.getNotes())){
contentBuilder.append(",").append(record.getNotes());
}
record.setContent(contentBuilder.toString());
});
@@ -9,6 +9,7 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.UpdateSubmitStatus;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.config.RuoYiConfig;
@@ -18,14 +19,13 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
import com.ruoyi.common.utils.thread.ThreadPoolUtil;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.*;
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
@@ -149,6 +149,10 @@ public class CaseZipImportImpl {
if (fatchMap.size() <= 0) {
return error("从压缩包中未抓取到内容,请检查抓取字段配置");
}
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
// 新增的案件
List<CaseApplication> caseApplications = new ArrayList<>();
// 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
@@ -181,6 +185,10 @@ public class CaseZipImportImpl {
List<SysDept> sysDepts = new ArrayList<>();
// 案件附件
List<CaseAttach> caseAttachs = new ArrayList<>();
//发送短信列表
List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
// 短信记录
List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
/**
* 用户表已存在的用户
*/
@@ -192,7 +200,7 @@ public class CaseZipImportImpl {
//查询出当天的案件编号的最大值
String currentDay = DateUtils.dateTime();
String caseNum = "zc" + currentDay;
maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
// 需要新增的用户
List<SysUser> addUsers = new ArrayList<>();
for (Long caseId : fileMap.keySet()) {
@@ -218,15 +226,15 @@ public class CaseZipImportImpl {
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
if (maxBatchNumber == null) {
maxBatchNumber=1;
maxBatchNumber = 1;
caseApplication.setBatchNumber(maxBatchNumber.toString());
} else {
maxBatchNumber=maxBatchNumber+1;
caseApplication.setBatchNumber( maxBatchNumber.toString());
maxBatchNumber = maxBatchNumber + 1;
caseApplication.setBatchNumber(maxBatchNumber.toString());
}
}
// 设置编号
String maxCaseNumStr=generateCaseNum();
String maxCaseNumStr = generateCaseNum();
caseApplication.setCaseNum(maxCaseNumStr);
caseApplication.setCreateBy(getUsername());
caseApplication.setVersion(1);
@@ -248,7 +256,7 @@ public class CaseZipImportImpl {
}
caseApplication.setColumnValues(columnValueList);
// 组装内置字段
buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList);
buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
for (File caseFile : fileMap.get(caseId)) {
String fileUrl = caseFile.getAbsolutePath();
if (StrUtil.isEmpty(fileUrl)) {
@@ -277,55 +285,95 @@ public class CaseZipImportImpl {
}
// 案件压缩包导入
caseApplication.setImportFlag(2);
// 组装短信
}
// 多线程执行
List<MultipleThreadListParam> execList=new ArrayList<>();
List<MultipleThreadListParam> execList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(addUsers)) {
Function<List<SysUser>,Integer> function=userMapper::batchSave;
execList.add(new MultipleThreadListParam(function,addUsers));
Function<List<SysUser>, Integer> function = userMapper::batchSave;
execList.add(new MultipleThreadListParam(function, addUsers));
}
if (CollectionUtil.isNotEmpty(userRoleList)) {
Function<List<SysUserRole>,Integer> function=userRoleMapper::batchUserRole;
execList.add(new MultipleThreadListParam(function,userRoleList));
Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
execList.add(new MultipleThreadListParam(function, userRoleList));
}
if (CollectionUtil.isNotEmpty(sysDepts)) {
Function<List<SysDept>,Integer> function=sysDeptMapper::batchSave;
execList.add(new MultipleThreadListParam(function,sysDepts));
Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
execList.add(new MultipleThreadListParam(function, sysDepts));
}
if (CollectionUtil.isNotEmpty(caseApplications)) {
Function<List<CaseApplication>,Integer> function=caseApplicationMapper::batchSave;
execList.add(new MultipleThreadListParam(function,caseApplications));
Function<List<CaseApplication>,Integer> functionLog=caseApplicationLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog,caseApplications));
Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
execList.add(new MultipleThreadListParam(function, caseApplications));
Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, caseApplications));
}
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
Function<List<CaseAffiliate>,Integer> function=caseAffiliateMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(function,caseAffiliates));
Function<List<CaseAffiliate>,Integer> functionLog=caseAffiliateLogMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(functionLog,caseAffiliates));
Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(function, caseAffiliates));
Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
}
if (CollectionUtil.isNotEmpty(caseAttachs)) {
Function<List<CaseAttach>,Integer> function=caseAttachMapper::batchSave;
execList.add(new MultipleThreadListParam(function,caseAttachs));
Function<List<CaseAttach>,Integer> functionLog=caseAttachLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog,caseAttachs));
Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
execList.add(new MultipleThreadListParam(function, caseAttachs));
Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
}
if (CollectionUtil.isNotEmpty(columnValueList)) {
Function<List<ColumnValue>,Integer> function=columnValueMapper::batchSave;
execList.add(new MultipleThreadListParam(function,columnValueList));
Function<List<ColumnValue>,Integer> functionLog=columnValueLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog,columnValueList));
Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
execList.add(new MultipleThreadListParam(function, columnValueList));
Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, columnValueList));
}
if(CollectionUtil.isNotEmpty(execList)){
if (CollectionUtil.isNotEmpty(execList)) {
MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
}
if (CollectionUtil.isNotEmpty(caseApplications)) {
LoginUser loginUser = SecurityUtils.getLoginUser();
List<CaseLogRecord> logRecords = new ArrayList<>();
caseApplications.forEach(caseApplication -> {
CaseLogRecord operLog = new CaseLogRecord();
// 获取当前的用户
if (loginUser != null) {
SysUser user = loginUser.getUser();
operLog.setCreateBy(user.getUserName());
operLog.setCreateNickName(user.getNickName());
operLog.setUpdateBy(user.getUserName());
} else {
operLog.setCreateBy("admin");
operLog.setCreateNickName("管理员");
operLog.setUpdateBy("admin");
}
operLog.setCaseAppliId(caseApplication.getId());
operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
logRecords.add(operLog);
}
);
// todo 发送短信
// ThreadPoolUtil.execute(() -> {
// CaseLogUtils.batchInsertCaseLog(logRecords);
// // 发送短信
// if (CollectionUtil.isNotEmpty(smsRequestList)) {
// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
// Boolean aBoolean = SmsUtils.sendSms(request);
// }
// }
//
// }
//
// );
}
// 案件日志
return success("导入成功");
}
/**
* 获取自动编码
*
@@ -339,15 +387,16 @@ public class CaseZipImportImpl {
if (null == maxCaseNum) {
maxCaseNum=1;
maxCaseNum = 1;
caseNum = caseNum + "001";
} else {
maxCaseNum=maxCaseNum+1;
maxCaseNum = maxCaseNum + 1;
caseNum = caseNum + String.format("%03d", maxCaseNum);
}
return caseNum;
}
public void inputChangeToFile(InputStream instream, File file) {
try {
OutputStream outStr = new FileOutputStream(file);
@@ -527,7 +576,8 @@ public class CaseZipImportImpl {
*/
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList) {
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
// 组装内置字段
if (CollectionUtil.isEmpty(dictDataList)) {
return;
@@ -544,14 +594,14 @@ public class CaseZipImportImpl {
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
if (dictData.getDictLabel().contains("被申请人")) {
// 组装被申请人内置自段
buildDebtorColumn(dictData, fatchMap, debtorAffiliate,caseApplication.getId());
buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId());
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
// 组装申请人内置自段
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList,caseApplication.getId());
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication.getId(), smsSendRecords, smsRequestList);
} else if (dictData.getDictLabel().contains("合同编号")) {
// 合同编号
String contractNumber = fatchMap.get("合同编号"+ Constants.PDFSTR + caseApplication.getId());
String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
if (StrUtil.isNotEmpty(contractNumber)) {
// 提取字母和数字
String regx = "[^a-zA-Z0-9]";
@@ -559,11 +609,11 @@ public class CaseZipImportImpl {
caseApplication.setContractNumber(replaceAll.toUpperCase());
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
}
@@ -587,14 +637,15 @@ public class CaseZipImportImpl {
*/
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
Map<String, Long> deptMap, List<SysDept> sysDepts,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,Long caseId) {
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, Long caseId,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
affiliate.setIdentityType(1);
// 申请人
switch (dictData.getDictLabel()) {
case "申请人姓名":
affiliate.setName((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
if (StrUtil.isNotEmpty(affiliate.getName())) {
// 组装申请机构
// 将组织机构id设为申请人名称
@@ -622,29 +673,30 @@ public class CaseZipImportImpl {
}
break;
case "统一社会信用代码":
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "法定代表人":
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "法定代表人职位":
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "申请人住所":
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "申请人联系地址":
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "委托代理人姓名":
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "委托代理人联系电话":
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
SysUser agentUser = null;
// 用户已存在
if (userMap.containsKey(affiliate.getContactTelphoneAgent())) {
SysUser agentUser = userMap.get(affiliate.getContactTelphoneAgent());
agentUser = userMap.get(affiliate.getContactTelphoneAgent());
if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
// 同步用户表和案件关联人表的手机号和名称
affiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
@@ -670,7 +722,7 @@ public class CaseZipImportImpl {
}
} else {
// 用户不存在,新增
SysUser agentUser = new SysUser();
agentUser = new SysUser();
agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId()));
agentUser.setIdCard(affiliate.getIdentityNumAgent());
agentUser.setNickName(affiliate.getNameAgent());
@@ -683,10 +735,29 @@ public class CaseZipImportImpl {
insertAgentUserRole(agentUser, roleId, userRoleList);
}
if (addUsers != null) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
request.setPhone(agentUser.getPhonenumber());
request.setTemplateParamSet(new String[]{agentUser.getNickName()});
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseId);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
smsSendRecords.add(smsSendRecord);
smsRequestList.add(request);
}
}
break;
case "委托代理人电子邮件":
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
@@ -716,17 +787,17 @@ public class CaseZipImportImpl {
* @param fatchMap 抓取内容
* @param debtorAffiliate 被申请人
*/
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate,Long caseId) {
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate, Long caseId) {
debtorAffiliate.setIdentityType(2);
// 被申请人
switch (dictData.getDictLabel()) {
case "被申请人姓名":
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人身份证号":
String identityNum = fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId);
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
// 出生年月日,从身份证抓取
if (StrUtil.isNotEmpty(identityNum)) {
identityNum = identityNum.replace("\n", "");
@@ -748,13 +819,13 @@ public class CaseZipImportImpl {
break;
case "被申请人住所":
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人联系电话":
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人电子邮件":
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
@@ -807,5 +878,4 @@ public class CaseZipImportImpl {
}
}
@@ -10,6 +10,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 案件记录日志文件
@@ -46,6 +47,14 @@ public class CaseLogUtils
operLog.setNotes(notes);
caseLogRecordMapper.insertCaseLogRecord(operLog);
}
/**
* 批量新增案件日志
* @param list
*/
public static void batchInsertCaseLog(List<CaseLogRecord> list ){
caseLogRecordMapper.batchInsertRecord(list);
}
}
@@ -60,6 +60,7 @@
</resultMap>
<insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application_log(
<if test="caseLogId != null ">id ,</if>
<if test="caseAppliId != null ">case_appli_id ,</if>
<if test="caseName != null and caseName != ''">case_name ,</if>
<if test="caseNum != null and caseNum != ''">case_num,</if>
@@ -89,6 +90,7 @@
mediation_agreement,
create_time
)values(
<if test="caseLogId != null ">#{id} ,</if>
<if test="caseAppliId != null">#{caseAppliId},</if>
<if test="caseName != null and caseName != ''">#{caseName},</if>
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
@@ -901,6 +901,7 @@
</select>
<insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application(
<if test="id != null''">id ,</if>
<if test="caseName != null and caseName != ''">case_name ,</if>
<if test="caseNum != null and caseNum != ''">case_num,</if>
<if test="caseSubjectAmount != null">case_subject_amount,</if>
@@ -934,6 +935,7 @@
batch_number,
create_time
)values(
<if test="id != null''">#{id} ,</if>
<if test="caseName != null and caseName != ''">#{caseName},</if>
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
<if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
@@ -20,17 +20,26 @@
#{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},#{createNickName},sysdate(),#{updateBy},sysdate()
)
</insert>
<insert id="batchInsertRecord">
insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.caseAppliId},#{item.caseNode},sysdate(),#{item.notes},#{item.createBy},#{item.createNickName},sysdate(),#{item.updateBy},sysdate()
)
</foreach>
</insert>
<select id="selectCaseLogRecordList" resultType="com.ruoyi.wisdomarbitrate.domain.CaseLogRecord">
select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes ,cl.id ,cl.case_appli_id caseAppliId,
cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
CASE cl.case_node 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 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 26 then '证据确认成功'
when 31 then '修改开庭时间'
when 18 then '仲裁员审核仲裁文书'
ELSE '无案件状态'
END content,
CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问'