|
|
@@ -25,6 +25,7 @@ import com.ruoyi.system.mapper.*;
|
|
25
|
25
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
26
|
26
|
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
|
27
|
27
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
|
28
|
+import com.ruoyi.wisdomarbitrate.task.CaseZipImportTask;
|
|
28
|
29
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
29
|
30
|
import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
|
|
30
|
31
|
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
|
|
@@ -37,6 +38,8 @@ import java.io.*;
|
|
37
|
38
|
import java.math.BigDecimal;
|
|
38
|
39
|
import java.text.SimpleDateFormat;
|
|
39
|
40
|
import java.util.*;
|
|
|
41
|
+import java.util.concurrent.ExecutionException;
|
|
|
42
|
+import java.util.concurrent.Future;
|
|
40
|
43
|
import java.util.function.Function;
|
|
41
|
44
|
import java.util.regex.Matcher;
|
|
42
|
45
|
import java.util.regex.Pattern;
|
|
|
@@ -70,8 +73,6 @@ public class CaseZipImportImpl {
|
|
70
|
73
|
@Autowired
|
|
71
|
74
|
private SysUserRoleMapper userRoleMapper;
|
|
72
|
75
|
@Autowired
|
|
73
|
|
- private CaseApplicationLogMapper caseApplicationLogMapper;
|
|
74
|
|
- @Autowired
|
|
75
|
76
|
private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
|
76
|
77
|
@Autowired
|
|
77
|
78
|
private CaseAttachLogMapper caseAttachLogMapper;
|
|
|
@@ -85,11 +86,14 @@ public class CaseZipImportImpl {
|
|
85
|
86
|
private ColumnValueLogMapper columnValueLogMapper;
|
|
86
|
87
|
@Autowired
|
|
87
|
88
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
|
89
|
+ @Autowired
|
|
|
90
|
+ private CaseApplicationLogMapper caseApplicationLogMapper;
|
|
88
|
91
|
// 申请人角色id
|
|
89
|
92
|
private long roleId;
|
|
90
|
93
|
private Integer maxCaseNum;
|
|
91
|
94
|
private Integer maxBatchNumber;
|
|
92
|
95
|
|
|
|
96
|
+
|
|
93
|
97
|
public AjaxResult zipImport(MultipartFile file, Long templateId) {
|
|
94
|
98
|
UUID uuid = UUID.randomUUID();
|
|
95
|
99
|
// todo
|
|
|
@@ -113,51 +117,14 @@ public class CaseZipImportImpl {
|
|
113
|
117
|
boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
|
|
114
|
118
|
if (!unzipSuccess) {
|
|
115
|
119
|
// 解压失败
|
|
116
|
|
- return AjaxResult.error("解压失败");
|
|
|
120
|
+ throw new ServiceException("解压失败");
|
|
117
|
121
|
}
|
|
118
|
122
|
// 查询抓取规则
|
|
119
|
123
|
// todo 批次需要再上传压缩包时用户填写
|
|
120
|
124
|
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(templateId);
|
|
121
|
125
|
if (CollectionUtil.isEmpty(fatchRuleList)) {
|
|
122
|
|
- return error("未设置抓取规则");
|
|
123
|
|
- }
|
|
124
|
|
- File directory = new File(targetPath);
|
|
125
|
|
- // fileMap<caseId, List<File>>
|
|
126
|
|
- Map<Long, List<File>> fileMap = findAndConvertPDF(directory);
|
|
127
|
|
- if (fileMap == null || fileMap.size() <= 0) {
|
|
128
|
|
- // 解压失败
|
|
129
|
|
- return AjaxResult.error("未获取到文件");
|
|
130
|
|
- }
|
|
131
|
|
- Map<String, String> fatchMap = new HashMap<>();
|
|
132
|
|
- if (CollectionUtil.isNotEmpty(fatchRuleList)) {
|
|
133
|
|
-
|
|
134
|
|
- Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
|
|
135
|
|
- // 根据抓取规则循环抓取
|
|
136
|
|
- fileMap.forEach((key, fileList) -> {
|
|
137
|
|
- if (CollectionUtil.isNotEmpty(fileList)) {
|
|
138
|
|
- for (File caseFile : fileList) {
|
|
139
|
|
- if (fatchRuleMap.containsKey(caseFile.getName())) {
|
|
140
|
|
- // 抓取内容
|
|
141
|
|
- List<FatchRule> fatchRules = fatchRuleMap.get(caseFile.getName());
|
|
142
|
|
- getFatchContentList(caseFile, fatchMap, fatchRules, key);
|
|
143
|
|
- }
|
|
144
|
|
- }
|
|
145
|
|
- }
|
|
146
|
|
- });
|
|
147
|
|
-
|
|
148
|
|
- }
|
|
149
|
|
- if (fatchMap.size() <= 0) {
|
|
150
|
|
- return error("从压缩包中未抓取到内容,请检查抓取字段配置");
|
|
|
126
|
+ throw new ServiceException("未设置抓取规则");
|
|
151
|
127
|
}
|
|
152
|
|
- // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
|
|
153
|
|
- SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
154
|
|
- request.setTemplateId("1956159");
|
|
155
|
|
-
|
|
156
|
|
- // 新增的案件
|
|
157
|
|
- List<CaseApplication> caseApplications = new ArrayList<>();
|
|
158
|
|
- // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
|
|
159
|
|
- // 抓取规则,0-内置字段,1-自定义字段
|
|
160
|
|
- Map<Integer, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
|
|
161
|
128
|
// 在系统表中查询案件内置字段
|
|
162
|
129
|
SysDictData sysDictData = new SysDictData();
|
|
163
|
130
|
sysDictData.setDictType("case_built_type");
|
|
|
@@ -170,25 +137,8 @@ public class CaseZipImportImpl {
|
|
170
|
137
|
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
|
|
171
|
138
|
|
|
172
|
139
|
}
|
|
173
|
|
- // 角色用户
|
|
174
|
|
- List<SysUserRole> userRoleList = new ArrayList<>();
|
|
175
|
140
|
// 查询申请人角色id
|
|
176
|
141
|
roleId = roleMapper.selectRoleIdByName("申请人");
|
|
177
|
|
-
|
|
178
|
|
- // 案件基本信息
|
|
179
|
|
- caseApplications = new ArrayList<>();
|
|
180
|
|
- // 自定义字段,组装columnValue表
|
|
181
|
|
- List<ColumnValue> columnValueList = new ArrayList<>();
|
|
182
|
|
- // 案件人员
|
|
183
|
|
- List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
|
184
|
|
- // 组装机构
|
|
185
|
|
- List<SysDept> sysDepts = new ArrayList<>();
|
|
186
|
|
- // 案件附件
|
|
187
|
|
- List<CaseAttach> caseAttachs = new ArrayList<>();
|
|
188
|
|
- //发送短信列表
|
|
189
|
|
- List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
|
|
190
|
|
- // 短信记录
|
|
191
|
|
- List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
|
|
192
|
142
|
/**
|
|
193
|
143
|
* 用户表已存在的用户
|
|
194
|
144
|
*/
|
|
|
@@ -201,186 +151,299 @@ public class CaseZipImportImpl {
|
|
201
|
151
|
String currentDay = DateUtils.dateTime();
|
|
202
|
152
|
String caseNum = "zc" + currentDay;
|
|
203
|
153
|
maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
|
|
204
|
|
- // 需要新增的用户
|
|
205
|
|
- List<SysUser> addUsers = new ArrayList<>();
|
|
206
|
|
- for (Long caseId : fileMap.keySet()) {
|
|
207
|
|
- if (CollectionUtil.isEmpty(fileMap.get(caseId))) {
|
|
208
|
|
- continue;
|
|
209
|
|
- }
|
|
210
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
211
|
|
- caseApplications.add(caseApplication);
|
|
212
|
|
- caseApplication.setId(caseId);
|
|
213
|
|
- caseApplication.setTemplateId(templateId);
|
|
214
|
|
-
|
|
215
|
|
- caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
216
|
|
- caseApplication.setCaseLogId(IdWorkerUtil.getId());
|
|
217
|
|
- caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
|
218
|
|
- caseApplication.setCaseAppliId(caseApplication.getId());
|
|
219
|
|
-
|
|
220
|
|
- // 设置批号
|
|
221
|
|
- if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
|
|
222
|
|
- maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
|
|
223
|
|
- if (maxBatchNumber == null) {
|
|
224
|
|
- maxBatchNumber = 1;
|
|
225
|
|
- caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
226
|
|
- } else {
|
|
227
|
|
- maxBatchNumber = maxBatchNumber + 1;
|
|
228
|
|
- caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
229
|
|
- }
|
|
|
154
|
+ // 抓取内容
|
|
|
155
|
+ Map<String, String> fatchMap = new HashMap<>();
|
|
|
156
|
+ // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
|
|
|
157
|
+ // 抓取规则,0-内置字段,1-自定义字段
|
|
|
158
|
+ Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
|
|
|
159
|
+
|
|
|
160
|
+ File directory = new File(targetPath);
|
|
|
161
|
+ if (!directory.exists()) {
|
|
|
162
|
+ throw new ServiceException("文件不存在");
|
|
|
163
|
+ }
|
|
|
164
|
+ // 找出案件文件夹
|
|
|
165
|
+ if (!directory.isDirectory() || directory.listFiles() == null) {
|
|
|
166
|
+ throw new ServiceException("未找到文件夹");
|
|
|
167
|
+ }
|
|
|
168
|
+ File[] files = directory.listFiles();
|
|
|
169
|
+ CaseZipImportTask caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap,SecurityUtils.getLoginUser());
|
|
|
170
|
+ Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
|
|
|
171
|
+ try {
|
|
|
172
|
+ if(future.get()!=null){
|
|
|
173
|
+ return success("导入成功");
|
|
230
|
174
|
}
|
|
231
|
|
- // 设置编号
|
|
232
|
|
- String maxCaseNumStr = generateCaseNum();
|
|
233
|
|
- caseApplication.setCaseNum(maxCaseNumStr);
|
|
234
|
|
- caseApplication.setCreateBy(getUsername());
|
|
235
|
|
- caseApplication.setVersion(1);
|
|
236
|
|
- // 组装案件内置字段主表内容
|
|
237
|
|
-
|
|
238
|
|
- if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
|
|
239
|
|
- List<FatchRule> columnRules = fatchRuleMap.get(1);
|
|
240
|
|
- columnRules.forEach(columnRule -> {
|
|
241
|
|
- ColumnValue columnValue = new ColumnValue();
|
|
242
|
|
- columnValue.setColumn(columnRule.getColumn());
|
|
243
|
|
- columnValue.setName(columnRule.getColumnName());
|
|
244
|
|
- columnValue.setName(columnRule.getColumnName());
|
|
245
|
|
- columnValue.setValue(fatchMap.get(columnRule.getColumnName() + Constants.PDFSTR + caseId));
|
|
246
|
|
- columnValue.setIsDefault(1);
|
|
247
|
|
- columnValue.setCaseId(caseId);
|
|
248
|
|
- columnValue.setCaseAppliLogId(caseApplication.getCaseLogId());
|
|
249
|
|
- columnValueList.add(columnValue);
|
|
250
|
|
- });
|
|
|
175
|
+ } catch (InterruptedException e) {
|
|
|
176
|
+ e.printStackTrace();
|
|
|
177
|
+ } catch (ExecutionException e) {
|
|
|
178
|
+ e.printStackTrace();
|
|
|
179
|
+ }
|
|
|
180
|
+ return error("无可导入的案件");
|
|
|
181
|
+
|
|
|
182
|
+
|
|
|
183
|
+ }
|
|
|
184
|
+
|
|
|
185
|
+ public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, String> fatchMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser) {
|
|
|
186
|
+ // fileMap<caseId, List<File>>
|
|
|
187
|
+ Map<String, String> fileMap = findFile(file, fatchRuleList);
|
|
|
188
|
+ if (fileMap != null && fileMap.size()> 0) {
|
|
|
189
|
+ // 根据抓取规则循环抓取
|
|
|
190
|
+ for (Map.Entry<String, List<FatchRule>> entry : fatchRuleMap.entrySet()) {
|
|
|
191
|
+ getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue());
|
|
251
|
192
|
}
|
|
252
|
|
- caseApplication.setColumnValues(columnValueList);
|
|
253
|
|
- // 组装内置字段
|
|
254
|
|
- buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
|
|
255
|
|
- for (File caseFile : fileMap.get(caseId)) {
|
|
256
|
|
- String fileUrl = caseFile.getAbsolutePath();
|
|
257
|
|
- if (StrUtil.isEmpty(fileUrl)) {
|
|
258
|
|
- continue;
|
|
|
193
|
+
|
|
|
194
|
+ if (fatchMap.size() > 0) {
|
|
|
195
|
+
|
|
|
196
|
+ // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
|
|
|
197
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
198
|
+ request.setTemplateId("1956159");
|
|
|
199
|
+
|
|
|
200
|
+ // 新增的案件
|
|
|
201
|
+ // 组装案件内置字段主表内容
|
|
|
202
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
203
|
+ caseApplication.setId(IdWorkerUtil.getId());
|
|
|
204
|
+ caseApplication.setTemplateId(templateId);
|
|
|
205
|
+ Map<Integer, List<FatchRule>> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
|
|
|
206
|
+ // 自定义字段,组装columnValue表
|
|
|
207
|
+ List<ColumnValue> columnValueList = new ArrayList<>();
|
|
|
208
|
+ if (defaultRuleMap.size() > 0 && defaultRuleMap.containsKey(1)) {
|
|
|
209
|
+ List<FatchRule> columnRules = defaultRuleMap.get(1);
|
|
|
210
|
+ columnRules.forEach(columnRule -> {
|
|
|
211
|
+ ColumnValue columnValue = new ColumnValue();
|
|
|
212
|
+ columnValue.setColumn(columnRule.getColumn());
|
|
|
213
|
+ columnValue.setName(columnRule.getColumnName());
|
|
|
214
|
+ columnValue.setValue(fatchMap.get(columnRule.getColumnName()));
|
|
|
215
|
+ columnValue.setIsDefault(1);
|
|
|
216
|
+ columnValue.setCaseId(caseApplication.getId());
|
|
|
217
|
+ columnValueList.add(columnValue);
|
|
|
218
|
+ });
|
|
|
219
|
+ caseApplication.setColumnValues(columnValueList);
|
|
259
|
220
|
}
|
|
260
|
|
- // 上传
|
|
261
|
|
- String filePath = RuoYiConfig.getUploadPath();
|
|
262
|
|
-
|
|
263
|
|
- CaseAttach caseAttach = new CaseAttach();
|
|
264
|
|
- caseAttach.setCaseAppliId(caseApplication.getId());
|
|
265
|
|
- caseAttach.setCaseAppliLogId(caseApplication.getCaseLogId());
|
|
266
|
|
- caseAttach.setAnnexPath(filePath);
|
|
267
|
|
- if (StrUtil.isNotEmpty(fileUrl)) {
|
|
268
|
|
- String fileName = fileUrl.replace(filePath, "/profile/upload");
|
|
269
|
|
- caseAttach.setAnnexName(fileName);
|
|
|
221
|
+
|
|
|
222
|
+ // 角色用户
|
|
|
223
|
+ List<SysUserRole> userRoleList = new ArrayList<>();
|
|
|
224
|
+
|
|
|
225
|
+ // 组装机构
|
|
|
226
|
+ List<SysDept> sysDepts = new ArrayList<>();
|
|
|
227
|
+ // 案件附件
|
|
|
228
|
+ List<CaseAttach> caseAttachs = new ArrayList<>();
|
|
|
229
|
+ //发送短信列表
|
|
|
230
|
+ List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
|
|
|
231
|
+ // 短信记录
|
|
|
232
|
+ List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
|
|
|
233
|
+
|
|
|
234
|
+ // 需要新增的用户
|
|
|
235
|
+ List<SysUser> addUsers = new ArrayList<>();
|
|
|
236
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
|
237
|
+ caseApplication.setCaseLogId(IdWorkerUtil.getId());
|
|
|
238
|
+ caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
|
|
239
|
+ caseApplication.setCaseAppliId(caseApplication.getId());
|
|
|
240
|
+
|
|
|
241
|
+ // 设置批号
|
|
|
242
|
+ if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
|
|
|
243
|
+ maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
|
|
|
244
|
+ if (maxBatchNumber == null) {
|
|
|
245
|
+ maxBatchNumber = 1;
|
|
|
246
|
+ caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
|
247
|
+ } else {
|
|
|
248
|
+ maxBatchNumber = maxBatchNumber + 1;
|
|
|
249
|
+ caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
|
250
|
+ }
|
|
270
|
251
|
}
|
|
271
|
|
- // 申请人提供的证据材料
|
|
272
|
|
- caseAttach.setAnnexType(2);
|
|
273
|
|
- caseAttachs.add(caseAttach);
|
|
274
|
|
- if (fileUrl.contains("仲裁申请书")) {
|
|
275
|
|
- CaseAttach applyFile = new CaseAttach();
|
|
276
|
|
- BeanUtil.copyProperties(caseAttach, applyFile);
|
|
277
|
|
- applyFile.setAnnexType(1);
|
|
278
|
|
- caseAttachs.add(applyFile);
|
|
|
252
|
+ // 设置编号
|
|
|
253
|
+ String maxCaseNumStr = generateCaseNum();
|
|
|
254
|
+ caseApplication.setCaseNum(maxCaseNumStr);
|
|
|
255
|
+ caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin");
|
|
|
256
|
+ caseApplication.setVersion(1);
|
|
|
257
|
+ // 组装案件内置字段主表内容
|
|
|
258
|
+
|
|
|
259
|
+ // 组装内置字段
|
|
|
260
|
+ buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
|
|
|
261
|
+ // 组装附件
|
|
|
262
|
+ for (Map.Entry<String, String> entry : fileMap.entrySet()) {
|
|
|
263
|
+ String fileUrl = entry.getValue();
|
|
|
264
|
+ if (StrUtil.isEmpty(fileUrl)) {
|
|
|
265
|
+ continue;
|
|
|
266
|
+ }
|
|
|
267
|
+ // 上传
|
|
|
268
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
269
|
+
|
|
|
270
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
271
|
+ caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
272
|
+ caseAttach.setAnnexPath(filePath);
|
|
|
273
|
+ if (StrUtil.isNotEmpty(fileUrl)) {
|
|
|
274
|
+ String fileName = fileUrl.replace(filePath, "/profile/upload");
|
|
|
275
|
+ caseAttach.setAnnexName(fileName);
|
|
|
276
|
+ }
|
|
|
277
|
+ // 申请人提供的证据材料
|
|
|
278
|
+ caseAttach.setAnnexType(2);
|
|
|
279
|
+ caseAttachs.add(caseAttach);
|
|
|
280
|
+ if (fileUrl.contains("仲裁申请书")) {
|
|
|
281
|
+ CaseAttach applyFile = new CaseAttach();
|
|
|
282
|
+ BeanUtil.copyProperties(caseAttach, applyFile);
|
|
|
283
|
+ applyFile.setAnnexType(1);
|
|
|
284
|
+ caseAttachs.add(applyFile);
|
|
|
285
|
+ }
|
|
|
286
|
+
|
|
279
|
287
|
}
|
|
280
|
|
- }
|
|
281
|
|
- // 案件压缩包导入
|
|
282
|
|
- caseApplication.setImportFlag(2);
|
|
283
|
|
- // 组装短信
|
|
|
288
|
+ caseApplication.setCaseAttachList(caseAttachs);
|
|
|
289
|
+ // 案件压缩包导入
|
|
|
290
|
+ caseApplication.setImportFlag(2);
|
|
|
291
|
+ caseApplicationMapper.insertCaseApplication(caseApplication);
|
|
|
292
|
+ // 多线程执行
|
|
|
293
|
+ ThreadPoolUtil.execute(() -> {
|
|
|
294
|
+ caseApplicationLogMapper.insert(caseApplication);
|
|
|
295
|
+ // 多线程执行
|
|
|
296
|
+ if (CollectionUtil.isNotEmpty(addUsers)) {
|
|
|
297
|
+ userMapper.batchSave(addUsers);
|
|
284
|
298
|
|
|
285
|
|
- }
|
|
286
|
|
- // 多线程执行
|
|
287
|
|
- List<MultipleThreadListParam> execList = new ArrayList<>();
|
|
288
|
|
- if (CollectionUtil.isNotEmpty(addUsers)) {
|
|
289
|
|
- Function<List<SysUser>, Integer> function = userMapper::batchSave;
|
|
290
|
|
- execList.add(new MultipleThreadListParam(function, addUsers));
|
|
291
|
|
- }
|
|
292
|
|
- if (CollectionUtil.isNotEmpty(userRoleList)) {
|
|
293
|
|
- Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
|
|
294
|
|
- execList.add(new MultipleThreadListParam(function, userRoleList));
|
|
|
299
|
+ }
|
|
|
300
|
+ if (CollectionUtil.isNotEmpty(userRoleList)) {
|
|
|
301
|
+ userRoleMapper.batchUserRole(userRoleList);
|
|
295
|
302
|
|
|
296
|
|
- }
|
|
297
|
|
- if (CollectionUtil.isNotEmpty(sysDepts)) {
|
|
298
|
|
- Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
|
|
299
|
|
- execList.add(new MultipleThreadListParam(function, sysDepts));
|
|
|
303
|
+ }
|
|
|
304
|
+ if (CollectionUtil.isNotEmpty(sysDepts)) {
|
|
|
305
|
+ sysDeptMapper.batchSave(sysDepts);
|
|
300
|
306
|
|
|
301
|
|
- }
|
|
302
|
|
- if (CollectionUtil.isNotEmpty(caseApplications)) {
|
|
303
|
|
- Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
|
|
304
|
|
- execList.add(new MultipleThreadListParam(function, caseApplications));
|
|
305
|
|
- Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
|
|
306
|
|
- execList.add(new MultipleThreadListParam(functionLog, caseApplications));
|
|
|
307
|
+ }
|
|
|
308
|
+ if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) {
|
|
|
309
|
+ caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
|
|
|
310
|
+ caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
|
|
|
311
|
+ }
|
|
|
312
|
+ if (CollectionUtil.isNotEmpty(caseAttachs)) {
|
|
|
313
|
+ caseAttachMapper.batchSave(caseAttachs);
|
|
|
314
|
+ caseAttachLogMapper.batchSave(caseAttachs);
|
|
307
|
315
|
|
|
308
|
|
- }
|
|
309
|
|
- if (CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
310
|
|
- Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
|
|
311
|
|
- execList.add(new MultipleThreadListParam(function, caseAffiliates));
|
|
312
|
|
- Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
|
|
313
|
|
- execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
|
|
314
|
|
- }
|
|
315
|
|
- if (CollectionUtil.isNotEmpty(caseAttachs)) {
|
|
316
|
|
- Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
|
|
317
|
|
- execList.add(new MultipleThreadListParam(function, caseAttachs));
|
|
318
|
|
- Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
|
|
319
|
|
- execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
|
|
320
|
|
- }
|
|
321
|
|
- if (CollectionUtil.isNotEmpty(columnValueList)) {
|
|
322
|
|
- Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
|
|
323
|
|
- execList.add(new MultipleThreadListParam(function, columnValueList));
|
|
324
|
|
- Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
|
|
325
|
|
- execList.add(new MultipleThreadListParam(functionLog, columnValueList));
|
|
326
|
|
- }
|
|
327
|
|
- if (CollectionUtil.isNotEmpty(execList)) {
|
|
328
|
|
- MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
|
|
329
|
|
- }
|
|
330
|
|
- if (CollectionUtil.isNotEmpty(caseApplications)) {
|
|
331
|
|
- LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
332
|
|
- List<CaseLogRecord> logRecords = new ArrayList<>();
|
|
333
|
|
-
|
|
334
|
|
- caseApplications.forEach(caseApplication -> {
|
|
335
|
|
- CaseLogRecord operLog = new CaseLogRecord();
|
|
336
|
|
- // 获取当前的用户
|
|
337
|
|
-
|
|
338
|
|
- if (loginUser != null) {
|
|
339
|
|
- SysUser user = loginUser.getUser();
|
|
340
|
|
- operLog.setCreateBy(user.getUserName());
|
|
341
|
|
- operLog.setCreateNickName(user.getNickName());
|
|
342
|
|
- operLog.setUpdateBy(user.getUserName());
|
|
343
|
|
- } else {
|
|
344
|
|
- operLog.setCreateBy("admin");
|
|
345
|
|
- operLog.setCreateNickName("管理员");
|
|
346
|
|
- operLog.setUpdateBy("admin");
|
|
347
|
|
- }
|
|
348
|
|
- operLog.setCaseAppliId(caseApplication.getId());
|
|
349
|
|
- operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
|
|
350
|
|
- logRecords.add(operLog);
|
|
351
|
316
|
}
|
|
352
|
|
- );
|
|
353
|
|
- // todo 发送短信
|
|
354
|
|
- ThreadPoolUtil.execute(() -> {
|
|
355
|
|
- CaseLogUtils.batchInsertCaseLog(logRecords);
|
|
356
|
|
- // 发送短信
|
|
357
|
|
- if (CollectionUtil.isNotEmpty(smsRequestList)) {
|
|
358
|
|
- Map<Long, SmsSendRecord> sendRecordMap = null;
|
|
359
|
|
- if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
|
|
360
|
|
- sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
|
|
361
|
|
- for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
|
|
362
|
|
- Boolean aBoolean = SmsUtils.sendSms(request);
|
|
363
|
|
- if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
|
|
364
|
|
- if (aBoolean) {
|
|
365
|
|
- sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
|
|
366
|
|
- } else {
|
|
367
|
|
- sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
|
|
368
|
|
- }
|
|
|
317
|
+ if (CollectionUtil.isNotEmpty(columnValueList)) {
|
|
|
318
|
+ columnValueMapper.batchSave(columnValueList);
|
|
|
319
|
+ columnValueLogMapper.batchSave(columnValueList);
|
|
|
320
|
+ }
|
|
|
321
|
+ // 新增日志
|
|
|
322
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
|
|
|
323
|
+ // 发送短信
|
|
|
324
|
+ if (CollectionUtil.isNotEmpty(smsRequestList)) {
|
|
|
325
|
+ Map<Long, SmsSendRecord> sendRecordMap = null;
|
|
|
326
|
+ if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
|
|
|
327
|
+ sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
|
|
|
328
|
+ for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
|
|
|
329
|
+ Boolean aBoolean = SmsUtils.sendSms(request);
|
|
|
330
|
+ if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
|
|
|
331
|
+ if (aBoolean) {
|
|
|
332
|
+ sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
|
|
|
333
|
+ } else {
|
|
|
334
|
+ sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
|
|
369
|
335
|
}
|
|
370
|
336
|
}
|
|
371
|
|
- smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
|
|
372
|
337
|
}
|
|
373
|
|
-
|
|
374
|
|
-
|
|
|
338
|
+ smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
|
|
375
|
339
|
}
|
|
376
|
340
|
|
|
|
341
|
+
|
|
377
|
342
|
}
|
|
378
|
343
|
|
|
379
|
|
- );
|
|
|
344
|
+ });
|
|
|
345
|
+ return caseApplication;
|
|
|
346
|
+ }
|
|
|
347
|
+ }
|
|
|
348
|
+ return null;
|
|
|
349
|
+ }
|
|
|
350
|
+
|
|
|
351
|
+ /**
|
|
|
352
|
+ * 获取抓取内容
|
|
|
353
|
+ *
|
|
|
354
|
+ * @param andConvertPDF 文件路径map
|
|
|
355
|
+ * @param mapKey 文件名
|
|
|
356
|
+ * @param map 抓取内容map
|
|
|
357
|
+ * @param fatchRules 抓取规则
|
|
|
358
|
+ */
|
|
|
359
|
+ private void getFatchContent(Map<String, String> andConvertPDF, String mapKey, Map<String, String> map, List<FatchRule> fatchRules) {
|
|
|
360
|
+ String fileURL = andConvertPDF.get(mapKey);
|
|
|
361
|
+ if (StrUtil.isEmpty(fileURL)) {
|
|
|
362
|
+ return;
|
|
|
363
|
+ }
|
|
|
364
|
+ if (fileURL.endsWith("txt")) {
|
|
|
365
|
+ String readerFile = ReadFileUtils.readerTxtFile(fileURL);
|
|
|
366
|
+ OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map);
|
|
|
367
|
+ } else if (fileURL.endsWith("doc") || fileURL.endsWith("docx")) {
|
|
|
368
|
+ // doc,docx,text识别内容
|
|
|
369
|
+ String readerFile = null;
|
|
|
370
|
+ try {
|
|
|
371
|
+ readerFile = ReadFileUtils.readWord(fileURL);
|
|
|
372
|
+ } catch (Exception e) {
|
|
|
373
|
+ e.printStackTrace();
|
|
|
374
|
+ }
|
|
|
375
|
+ OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map);
|
|
|
376
|
+
|
|
|
377
|
+ } else if (fileURL.endsWith("pdf")) {
|
|
|
378
|
+ //获取文件的页数
|
|
|
379
|
+ int fileNumPage = getFileNumPage(fileURL);
|
|
|
380
|
+ //文件转成base64
|
|
|
381
|
+ String base64 = OCRUtils.pdfConvertBase64(fileURL);
|
|
|
382
|
+ if (base64 == null) {
|
|
|
383
|
+ throw new ServiceException("pdf转base64失败");
|
|
|
384
|
+ // return false;
|
|
|
385
|
+ }
|
|
|
386
|
+ StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象
|
|
|
387
|
+ for (int i = 1; i <= fileNumPage; i++) {
|
|
|
388
|
+ //对接腾讯云接口.识别里面的数据
|
|
|
389
|
+ String text = OCRUtils.pdfIdentifyText(base64, i, fatchRules);
|
|
|
390
|
+ ocrText.append(text); // 拼接当前的字符串
|
|
|
391
|
+
|
|
|
392
|
+
|
|
|
393
|
+ }
|
|
|
394
|
+ // 根据抓取规则截取内容
|
|
|
395
|
+ OCRUtils.fatchRuleGetContent(ocrText.toString(), fatchRules, map);
|
|
|
396
|
+ }
|
|
|
397
|
+
|
|
|
398
|
+
|
|
|
399
|
+ }
|
|
|
400
|
+
|
|
|
401
|
+ /**
|
|
|
402
|
+ * 查找文件
|
|
|
403
|
+ *
|
|
|
404
|
+ * @param directory
|
|
|
405
|
+ * @param fatchRuleList
|
|
|
406
|
+ * @return
|
|
|
407
|
+ */
|
|
|
408
|
+ private Map<String, String> findFile(File directory, List<FatchRule> fatchRuleList) {
|
|
|
409
|
+ Map<String, String> filePathMap = new HashMap<>();
|
|
|
410
|
+ if (directory.isFile()) {
|
|
|
411
|
+ String path = "";
|
|
|
412
|
+ // 如果传入的参数是一个文件
|
|
|
413
|
+ path = directory.getAbsolutePath();
|
|
|
414
|
+ filePathMap.put(directory.getName(), path);
|
|
|
415
|
+
|
|
|
416
|
+ } else if (directory.isDirectory()) {
|
|
|
417
|
+ searchAndConvertPDF(directory, filePathMap);
|
|
|
418
|
+ } else {
|
|
|
419
|
+ return null;
|
|
380
|
420
|
}
|
|
381
|
|
- // 案件日志
|
|
382
|
|
- return success("导入成功");
|
|
|
421
|
+ return filePathMap;
|
|
|
422
|
+ }
|
|
|
423
|
+
|
|
|
424
|
+ /**
|
|
|
425
|
+ * 递归查找文件夹
|
|
|
426
|
+ *
|
|
|
427
|
+ * @param directory
|
|
|
428
|
+ * @param filePathMap
|
|
|
429
|
+ */
|
|
|
430
|
+ public static void searchAndConvertPDF(File directory, Map<String, String> filePathMap) {
|
|
|
431
|
+ File[] files = directory.listFiles();
|
|
383
|
432
|
|
|
|
433
|
+ if (files != null) {
|
|
|
434
|
+ for (File file : files) {
|
|
|
435
|
+ if (file.getName().contains("zip") || file.getName().contains("rar")) {
|
|
|
436
|
+ continue;
|
|
|
437
|
+ }
|
|
|
438
|
+ if (file.isFile()) {
|
|
|
439
|
+
|
|
|
440
|
+ filePathMap.put(file.getName(), file.getAbsolutePath());
|
|
|
441
|
+ } else if (file.isDirectory()) {
|
|
|
442
|
+ // 如果是目录,递归查找
|
|
|
443
|
+ searchAndConvertPDF(file, filePathMap);
|
|
|
444
|
+ }
|
|
|
445
|
+ }
|
|
|
446
|
+ }
|
|
384
|
447
|
}
|
|
385
|
448
|
|
|
386
|
449
|
/**
|
|
|
@@ -584,13 +647,14 @@ public class CaseZipImportImpl {
|
|
584
|
647
|
* @param fatchMap 抓取字段内容
|
|
585
|
648
|
*/
|
|
586
|
649
|
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
|
|
587
|
|
- List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
|
|
|
650
|
+ Map<String, Long> deptMap, List<SysDept> sysDepts,
|
|
588
|
651
|
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
|
|
589
|
652
|
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
|
|
590
|
653
|
// 组装内置字段
|
|
591
|
654
|
if (CollectionUtil.isEmpty(dictDataList)) {
|
|
592
|
655
|
return;
|
|
593
|
656
|
}
|
|
|
657
|
+ List<CaseAffiliate> caseAffiliates = new ArrayList<>();
|
|
594
|
658
|
// 被申请人
|
|
595
|
659
|
CaseAffiliate debtorAffiliate = new CaseAffiliate();
|
|
596
|
660
|
debtorAffiliate.setCaseAppliId(caseApplication.getId());
|
|
|
@@ -610,27 +674,35 @@ public class CaseZipImportImpl {
|
|
610
|
674
|
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList);
|
|
611
|
675
|
} else if (dictData.getDictLabel().contains("合同编号")) {
|
|
612
|
676
|
// 合同编号
|
|
613
|
|
- String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
|
|
|
677
|
+ String contractNumber = fatchMap.get("合同编号" );
|
|
614
|
678
|
if (StrUtil.isNotEmpty(contractNumber)) {
|
|
615
|
679
|
// 提取字母和数字
|
|
616
|
680
|
String regx = "[^a-zA-Z0-9]";
|
|
617
|
681
|
String replaceAll = contractNumber.replaceAll(regx, "");
|
|
618
|
682
|
caseApplication.setContractNumber(replaceAll.toUpperCase());
|
|
619
|
683
|
}
|
|
620
|
|
- }else if(dictData.getDictLabel().contains("案件标的")){
|
|
621
|
|
- // todo 案件标的名字要改,字典配置中也要改
|
|
622
|
|
- if(null!=caseApplication.getCaseSubjectAmount()) {
|
|
623
|
|
- //todo 暂时设置计费比率为0.01
|
|
624
|
|
- BigDecimal feeRate = new BigDecimal(0.01);
|
|
625
|
|
- BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
626
|
|
- caseApplication.setFeePayable(feePayable);
|
|
|
684
|
+ } else if (dictData.getDictLabel().contains("案件标的")) {
|
|
|
685
|
+ String caseSubjectAmount = fatchMap.get(dictData.getDictLabel());
|
|
|
686
|
+ if(StrUtil.isNotEmpty(caseSubjectAmount)) {
|
|
|
687
|
+ try {
|
|
|
688
|
+ BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount);
|
|
|
689
|
+ caseApplication.setCaseSubjectAmount(bigDecimal);
|
|
|
690
|
+ // todo 案件标的名字要改,字典配置中也要改
|
|
|
691
|
+ //todo 暂时设置计费比率为0.01
|
|
|
692
|
+ BigDecimal feeRate = new BigDecimal(0.01);
|
|
|
693
|
+ BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
694
|
+ caseApplication.setFeePayable(feePayable);
|
|
|
695
|
+
|
|
|
696
|
+ } catch (Exception e) {
|
|
|
697
|
+ }
|
|
627
|
698
|
}
|
|
|
699
|
+
|
|
628
|
700
|
} else {
|
|
629
|
|
- ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
701
|
+ ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
|
|
630
|
702
|
}
|
|
631
|
703
|
|
|
632
|
704
|
} else {
|
|
633
|
|
- ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
705
|
+ ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
|
|
634
|
706
|
|
|
635
|
707
|
}
|
|
636
|
708
|
|
|
|
@@ -641,7 +713,7 @@ public class CaseZipImportImpl {
|
|
641
|
713
|
if (ObjectUtil.isNotEmpty(debtorAffiliate)) {
|
|
642
|
714
|
caseAffiliates.add(debtorAffiliate);
|
|
643
|
715
|
}
|
|
644
|
|
-
|
|
|
716
|
+ caseApplication.setCaseAffiliates(caseAffiliates);
|
|
645
|
717
|
|
|
646
|
718
|
}
|
|
647
|
719
|
|
|
|
@@ -662,7 +734,7 @@ public class CaseZipImportImpl {
|
|
662
|
734
|
// 申请人
|
|
663
|
735
|
switch (dictData.getDictLabel()) {
|
|
664
|
736
|
case "申请人姓名":
|
|
665
|
|
- affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
|
|
|
737
|
+ affiliate.setName((fatchMap.get(dictData.getDictLabel())));
|
|
666
|
738
|
if (StrUtil.isNotEmpty(affiliate.getName())) {
|
|
667
|
739
|
// 组装申请机构
|
|
668
|
740
|
// 将组织机构id设为申请人名称
|
|
|
@@ -690,25 +762,25 @@ public class CaseZipImportImpl {
|
|
690
|
762
|
}
|
|
691
|
763
|
break;
|
|
692
|
764
|
case "统一社会信用代码":
|
|
693
|
|
- affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
|
|
|
765
|
+ affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel())));
|
|
694
|
766
|
break;
|
|
695
|
767
|
case "法定代表人":
|
|
696
|
|
- affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
768
|
+ affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
|
|
697
|
769
|
break;
|
|
698
|
770
|
case "法定代表人职位":
|
|
699
|
|
- affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
|
|
|
771
|
+ affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel())));
|
|
700
|
772
|
break;
|
|
701
|
773
|
case "申请人住所":
|
|
702
|
|
- affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
|
|
|
774
|
+ affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel())));
|
|
703
|
775
|
break;
|
|
704
|
776
|
case "申请人联系地址":
|
|
705
|
|
- affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
777
|
+ affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()));
|
|
706
|
778
|
break;
|
|
707
|
779
|
case "委托代理人姓名":
|
|
708
|
|
- affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
780
|
+ affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()));
|
|
709
|
781
|
break;
|
|
710
|
782
|
case "委托代理人联系电话":
|
|
711
|
|
- affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
|
783
|
+ affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()));
|
|
712
|
784
|
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
|
|
713
|
785
|
SysUser agentUser = null;
|
|
714
|
786
|
// 用户已存在
|
|
|
@@ -754,11 +826,11 @@ public class CaseZipImportImpl {
|
|
754
|
826
|
}
|
|
755
|
827
|
if (addUsers != null) {
|
|
756
|
828
|
SysUser finalAgentUser = agentUser;
|
|
757
|
|
- if(CollectionUtil.isNotEmpty(smsRequestList)&& smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))){
|
|
758
|
|
- SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
759
|
|
- request.setTemplateId("1956159");
|
|
760
|
|
- request.setPhone(agentUser.getPhonenumber());
|
|
761
|
|
- request.setTemplateParamSet(new String[]{agentUser.getNickName()});
|
|
|
829
|
+ if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) {
|
|
|
830
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
831
|
+ request.setTemplateId("1956159");
|
|
|
832
|
+ request.setPhone(agentUser.getPhonenumber());
|
|
|
833
|
+ request.setTemplateParamSet(new String[]{agentUser.getNickName()});
|
|
762
|
834
|
smsRequestList.add(request);
|
|
763
|
835
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
764
|
836
|
smsSendRecord.setCaseId(caseApplication.getId());
|
|
|
@@ -777,10 +849,10 @@ public class CaseZipImportImpl {
|
|
777
|
849
|
}
|
|
778
|
850
|
break;
|
|
779
|
851
|
case "委托代理人电子邮件":
|
|
780
|
|
- affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()).replace("\n", "").replaceAll("\\s", "") : null);
|
|
781
|
|
-
|
|
|
852
|
+ affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null);
|
|
782
|
853
|
break;
|
|
783
|
854
|
default:
|
|
|
855
|
+ ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
|
|
784
|
856
|
break;
|
|
785
|
857
|
}
|
|
786
|
858
|
}
|
|
|
@@ -813,11 +885,11 @@ public class CaseZipImportImpl {
|
|
813
|
885
|
// 被申请人
|
|
814
|
886
|
switch (dictData.getDictLabel()) {
|
|
815
|
887
|
case "被申请人姓名":
|
|
816
|
|
- debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
|
888
|
+ debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() ));
|
|
817
|
889
|
break;
|
|
818
|
890
|
case "被申请人身份证号":
|
|
819
|
|
- String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
|
|
820
|
|
- debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
|
891
|
+ String identityNum = fatchMap.get(dictData.getDictLabel() );
|
|
|
892
|
+ debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() ));
|
|
821
|
893
|
// 出生年月日,从身份证抓取
|
|
822
|
894
|
if (StrUtil.isNotEmpty(identityNum)) {
|
|
823
|
895
|
identityNum = identityNum.replace("\n", "");
|
|
|
@@ -839,13 +911,13 @@ public class CaseZipImportImpl {
|
|
839
|
911
|
|
|
840
|
912
|
break;
|
|
841
|
913
|
case "被申请人住所":
|
|
842
|
|
- debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
|
914
|
+ debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() ));
|
|
843
|
915
|
break;
|
|
844
|
916
|
case "被申请人联系电话":
|
|
845
|
|
- debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
|
917
|
+ debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() ));
|
|
846
|
918
|
break;
|
|
847
|
919
|
case "被申请人电子邮件":
|
|
848
|
|
- debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
|
|
|
920
|
+ debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null);
|
|
849
|
921
|
|
|
850
|
922
|
break;
|
|
851
|
923
|
default:
|