|
|
|
@@ -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 {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|