|
|
@@ -9,6 +9,7 @@ import com.ruoyi.common.constant.Constants;
|
|
9
|
9
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
10
|
10
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
11
|
11
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
12
|
+import com.ruoyi.common.core.domain.model.LoginUser;
|
|
12
|
13
|
import com.ruoyi.common.enums.UpdateSubmitStatus;
|
|
13
|
14
|
import com.ruoyi.common.utils.*;
|
|
14
|
15
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
@@ -18,14 +19,13 @@ import com.ruoyi.common.exception.ServiceException;
|
|
18
|
19
|
import com.ruoyi.common.utils.file.FileUtils;
|
|
19
|
20
|
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
|
|
20
|
21
|
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
|
|
|
22
|
+import com.ruoyi.common.utils.thread.ThreadPoolUtil;
|
|
21
|
23
|
import com.ruoyi.system.domain.SysUserRole;
|
|
22
|
24
|
import com.ruoyi.system.mapper.*;
|
|
23
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
24
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
25
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
|
26
|
|
-import com.ruoyi.wisdomarbitrate.domain.FatchRule;
|
|
|
25
|
+import com.ruoyi.wisdomarbitrate.domain.*;
|
|
27
|
26
|
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
|
|
28
|
27
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
|
28
|
+import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
29
|
29
|
import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
|
|
30
|
30
|
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
|
31
|
31
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
|
|
@@ -149,6 +149,10 @@ public class CaseZipImportImpl {
|
|
149
|
149
|
if (fatchMap.size() <= 0) {
|
|
150
|
150
|
return error("从压缩包中未抓取到内容,请检查抓取字段配置");
|
|
151
|
151
|
}
|
|
|
152
|
+ // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
|
|
|
153
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
154
|
+ request.setTemplateId("1956159");
|
|
|
155
|
+
|
|
152
|
156
|
// 新增的案件
|
|
153
|
157
|
List<CaseApplication> caseApplications = new ArrayList<>();
|
|
154
|
158
|
// 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
|
|
|
@@ -181,6 +185,10 @@ public class CaseZipImportImpl {
|
|
181
|
185
|
List<SysDept> sysDepts = new ArrayList<>();
|
|
182
|
186
|
// 案件附件
|
|
183
|
187
|
List<CaseAttach> caseAttachs = new ArrayList<>();
|
|
|
188
|
+ //发送短信列表
|
|
|
189
|
+ List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
|
|
|
190
|
+ // 短信记录
|
|
|
191
|
+ List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
|
|
184
|
192
|
/**
|
|
185
|
193
|
* 用户表已存在的用户
|
|
186
|
194
|
*/
|
|
|
@@ -192,7 +200,7 @@ public class CaseZipImportImpl {
|
|
192
|
200
|
//查询出当天的案件编号的最大值
|
|
193
|
201
|
String currentDay = DateUtils.dateTime();
|
|
194
|
202
|
String caseNum = "zc" + currentDay;
|
|
195
|
|
- maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
|
|
|
203
|
+ maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
|
|
196
|
204
|
// 需要新增的用户
|
|
197
|
205
|
List<SysUser> addUsers = new ArrayList<>();
|
|
198
|
206
|
for (Long caseId : fileMap.keySet()) {
|
|
|
@@ -218,15 +226,15 @@ public class CaseZipImportImpl {
|
|
218
|
226
|
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
|
|
219
|
227
|
maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
|
|
220
|
228
|
if (maxBatchNumber == null) {
|
|
221
|
|
- maxBatchNumber=1;
|
|
|
229
|
+ maxBatchNumber = 1;
|
|
222
|
230
|
caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
223
|
231
|
} else {
|
|
224
|
|
- maxBatchNumber=maxBatchNumber+1;
|
|
225
|
|
- caseApplication.setBatchNumber( maxBatchNumber.toString());
|
|
|
232
|
+ maxBatchNumber = maxBatchNumber + 1;
|
|
|
233
|
+ caseApplication.setBatchNumber(maxBatchNumber.toString());
|
|
226
|
234
|
}
|
|
227
|
235
|
}
|
|
228
|
236
|
// 设置编号
|
|
229
|
|
- String maxCaseNumStr=generateCaseNum();
|
|
|
237
|
+ String maxCaseNumStr = generateCaseNum();
|
|
230
|
238
|
caseApplication.setCaseNum(maxCaseNumStr);
|
|
231
|
239
|
caseApplication.setCreateBy(getUsername());
|
|
232
|
240
|
caseApplication.setVersion(1);
|
|
|
@@ -248,7 +256,7 @@ public class CaseZipImportImpl {
|
|
248
|
256
|
}
|
|
249
|
257
|
caseApplication.setColumnValues(columnValueList);
|
|
250
|
258
|
// 组装内置字段
|
|
251
|
|
- buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList);
|
|
|
259
|
+ buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
|
|
252
|
260
|
for (File caseFile : fileMap.get(caseId)) {
|
|
253
|
261
|
String fileUrl = caseFile.getAbsolutePath();
|
|
254
|
262
|
if (StrUtil.isEmpty(fileUrl)) {
|
|
|
@@ -277,55 +285,95 @@ public class CaseZipImportImpl {
|
|
277
|
285
|
}
|
|
278
|
286
|
// 案件压缩包导入
|
|
279
|
287
|
caseApplication.setImportFlag(2);
|
|
|
288
|
+ // 组装短信
|
|
280
|
289
|
|
|
281
|
290
|
}
|
|
282
|
291
|
// 多线程执行
|
|
283
|
|
- List<MultipleThreadListParam> execList=new ArrayList<>();
|
|
|
292
|
+ List<MultipleThreadListParam> execList = new ArrayList<>();
|
|
284
|
293
|
if (CollectionUtil.isNotEmpty(addUsers)) {
|
|
285
|
|
- Function<List<SysUser>,Integer> function=userMapper::batchSave;
|
|
286
|
|
- execList.add(new MultipleThreadListParam(function,addUsers));
|
|
|
294
|
+ Function<List<SysUser>, Integer> function = userMapper::batchSave;
|
|
|
295
|
+ execList.add(new MultipleThreadListParam(function, addUsers));
|
|
287
|
296
|
}
|
|
288
|
297
|
if (CollectionUtil.isNotEmpty(userRoleList)) {
|
|
289
|
|
- Function<List<SysUserRole>,Integer> function=userRoleMapper::batchUserRole;
|
|
290
|
|
- execList.add(new MultipleThreadListParam(function,userRoleList));
|
|
|
298
|
+ Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
|
|
|
299
|
+ execList.add(new MultipleThreadListParam(function, userRoleList));
|
|
291
|
300
|
|
|
292
|
301
|
}
|
|
293
|
302
|
if (CollectionUtil.isNotEmpty(sysDepts)) {
|
|
294
|
|
- Function<List<SysDept>,Integer> function=sysDeptMapper::batchSave;
|
|
295
|
|
- execList.add(new MultipleThreadListParam(function,sysDepts));
|
|
|
303
|
+ Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
|
|
|
304
|
+ execList.add(new MultipleThreadListParam(function, sysDepts));
|
|
296
|
305
|
|
|
297
|
306
|
}
|
|
298
|
307
|
if (CollectionUtil.isNotEmpty(caseApplications)) {
|
|
299
|
|
- Function<List<CaseApplication>,Integer> function=caseApplicationMapper::batchSave;
|
|
300
|
|
- execList.add(new MultipleThreadListParam(function,caseApplications));
|
|
301
|
|
- Function<List<CaseApplication>,Integer> functionLog=caseApplicationLogMapper::batchSave;
|
|
302
|
|
- execList.add(new MultipleThreadListParam(functionLog,caseApplications));
|
|
|
308
|
+ Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
|
|
|
309
|
+ execList.add(new MultipleThreadListParam(function, caseApplications));
|
|
|
310
|
+ Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
|
|
|
311
|
+ execList.add(new MultipleThreadListParam(functionLog, caseApplications));
|
|
303
|
312
|
|
|
304
|
313
|
}
|
|
305
|
314
|
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
306
|
|
- Function<List<CaseAffiliate>,Integer> function=caseAffiliateMapper::batchCaseAffiliate;
|
|
307
|
|
- execList.add(new MultipleThreadListParam(function,caseAffiliates));
|
|
308
|
|
- Function<List<CaseAffiliate>,Integer> functionLog=caseAffiliateLogMapper::batchCaseAffiliate;
|
|
309
|
|
- execList.add(new MultipleThreadListParam(functionLog,caseAffiliates));
|
|
|
315
|
+ Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
|
|
|
316
|
+ execList.add(new MultipleThreadListParam(function, caseAffiliates));
|
|
|
317
|
+ Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
|
|
|
318
|
+ execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
|
|
310
|
319
|
}
|
|
311
|
320
|
if (CollectionUtil.isNotEmpty(caseAttachs)) {
|
|
312
|
|
- Function<List<CaseAttach>,Integer> function=caseAttachMapper::batchSave;
|
|
313
|
|
- execList.add(new MultipleThreadListParam(function,caseAttachs));
|
|
314
|
|
- Function<List<CaseAttach>,Integer> functionLog=caseAttachLogMapper::batchSave;
|
|
315
|
|
- execList.add(new MultipleThreadListParam(functionLog,caseAttachs));
|
|
|
321
|
+ Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
|
|
|
322
|
+ execList.add(new MultipleThreadListParam(function, caseAttachs));
|
|
|
323
|
+ Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
|
|
|
324
|
+ execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
|
|
316
|
325
|
}
|
|
317
|
326
|
if (CollectionUtil.isNotEmpty(columnValueList)) {
|
|
318
|
|
- Function<List<ColumnValue>,Integer> function=columnValueMapper::batchSave;
|
|
319
|
|
- execList.add(new MultipleThreadListParam(function,columnValueList));
|
|
320
|
|
- Function<List<ColumnValue>,Integer> functionLog=columnValueLogMapper::batchSave;
|
|
321
|
|
- execList.add(new MultipleThreadListParam(functionLog,columnValueList));
|
|
|
327
|
+ Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
|
|
|
328
|
+ execList.add(new MultipleThreadListParam(function, columnValueList));
|
|
|
329
|
+ Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
|
|
|
330
|
+ execList.add(new MultipleThreadListParam(functionLog, columnValueList));
|
|
322
|
331
|
}
|
|
323
|
|
- if(CollectionUtil.isNotEmpty(execList)){
|
|
|
332
|
+ if (CollectionUtil.isNotEmpty(execList)) {
|
|
324
|
333
|
MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
|
|
325
|
334
|
}
|
|
|
335
|
+ if (CollectionUtil.isNotEmpty(caseApplications)) {
|
|
|
336
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
337
|
+ List<CaseLogRecord> logRecords = new ArrayList<>();
|
|
|
338
|
+
|
|
|
339
|
+ caseApplications.forEach(caseApplication -> {
|
|
|
340
|
+ CaseLogRecord operLog = new CaseLogRecord();
|
|
|
341
|
+ // 获取当前的用户
|
|
|
342
|
+
|
|
|
343
|
+ if (loginUser != null) {
|
|
|
344
|
+ SysUser user = loginUser.getUser();
|
|
|
345
|
+ operLog.setCreateBy(user.getUserName());
|
|
|
346
|
+ operLog.setCreateNickName(user.getNickName());
|
|
|
347
|
+ operLog.setUpdateBy(user.getUserName());
|
|
|
348
|
+ } else {
|
|
|
349
|
+ operLog.setCreateBy("admin");
|
|
|
350
|
+ operLog.setCreateNickName("管理员");
|
|
|
351
|
+ operLog.setUpdateBy("admin");
|
|
|
352
|
+ }
|
|
|
353
|
+ operLog.setCaseAppliId(caseApplication.getId());
|
|
|
354
|
+ operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
|
|
|
355
|
+ logRecords.add(operLog);
|
|
|
356
|
+ }
|
|
|
357
|
+ );
|
|
|
358
|
+ // todo 发送短信
|
|
|
359
|
+// ThreadPoolUtil.execute(() -> {
|
|
|
360
|
+// CaseLogUtils.batchInsertCaseLog(logRecords);
|
|
|
361
|
+// // 发送短信
|
|
|
362
|
+// if (CollectionUtil.isNotEmpty(smsRequestList)) {
|
|
|
363
|
+// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
|
|
|
364
|
+// Boolean aBoolean = SmsUtils.sendSms(request);
|
|
|
365
|
+// }
|
|
|
366
|
+// }
|
|
|
367
|
+//
|
|
|
368
|
+// }
|
|
|
369
|
+//
|
|
|
370
|
+// );
|
|
|
371
|
+ }
|
|
|
372
|
+ // 案件日志
|
|
326
|
373
|
return success("导入成功");
|
|
327
|
374
|
|
|
328
|
375
|
}
|
|
|
376
|
+
|
|
329
|
377
|
/**
|
|
330
|
378
|
* 获取自动编码
|
|
331
|
379
|
*
|
|
|
@@ -339,15 +387,16 @@ public class CaseZipImportImpl {
|
|
339
|
387
|
|
|
340
|
388
|
|
|
341
|
389
|
if (null == maxCaseNum) {
|
|
342
|
|
- maxCaseNum=1;
|
|
|
390
|
+ maxCaseNum = 1;
|
|
343
|
391
|
caseNum = caseNum + "001";
|
|
344
|
392
|
} else {
|
|
345
|
|
- maxCaseNum=maxCaseNum+1;
|
|
|
393
|
+ maxCaseNum = maxCaseNum + 1;
|
|
346
|
394
|
caseNum = caseNum + String.format("%03d", maxCaseNum);
|
|
347
|
395
|
}
|
|
348
|
396
|
return caseNum;
|
|
349
|
397
|
|
|
350
|
398
|
}
|
|
|
399
|
+
|
|
351
|
400
|
public void inputChangeToFile(InputStream instream, File file) {
|
|
352
|
401
|
try {
|
|
353
|
402
|
OutputStream outStr = new FileOutputStream(file);
|
|
|
@@ -527,7 +576,8 @@ public class CaseZipImportImpl {
|
|
527
|
576
|
*/
|
|
528
|
577
|
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
|
|
529
|
578
|
List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
|
|
530
|
|
- Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList) {
|
|
|
579
|
+ Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
|
|
|
580
|
+ List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
|
|
531
|
581
|
// 组装内置字段
|
|
532
|
582
|
if (CollectionUtil.isEmpty(dictDataList)) {
|
|
533
|
583
|
return;
|
|
|
@@ -544,14 +594,14 @@ public class CaseZipImportImpl {
|
|
544
|
594
|
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
|
|
545
|
595
|
if (dictData.getDictLabel().contains("被申请人")) {
|
|
546
|
596
|
// 组装被申请人内置自段
|
|
547
|
|
- buildDebtorColumn(dictData, fatchMap, debtorAffiliate,caseApplication.getId());
|
|
|
597
|
+ buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId());
|
|
548
|
598
|
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|
|
549
|
599
|
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
|
|
550
|
600
|
// 组装申请人内置自段
|
|
551
|
|
- buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList,caseApplication.getId());
|
|
|
601
|
+ buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication.getId(), smsSendRecords, smsRequestList);
|
|
552
|
602
|
} else if (dictData.getDictLabel().contains("合同编号")) {
|
|
553
|
603
|
// 合同编号
|
|
554
|
|
- String contractNumber = fatchMap.get("合同编号"+ Constants.PDFSTR + caseApplication.getId());
|
|
|
604
|
+ String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
|
|
555
|
605
|
if (StrUtil.isNotEmpty(contractNumber)) {
|
|
556
|
606
|
// 提取字母和数字
|
|
557
|
607
|
String regx = "[^a-zA-Z0-9]";
|
|
|
@@ -559,11 +609,11 @@ public class CaseZipImportImpl {
|
|
559
|
609
|
caseApplication.setContractNumber(replaceAll.toUpperCase());
|
|
560
|
610
|
}
|
|
561
|
611
|
} else {
|
|
562
|
|
- ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
|
|
|
612
|
+ ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
563
|
613
|
}
|
|
564
|
614
|
|
|
565
|
615
|
} else {
|
|
566
|
|
- ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
|
|
|
616
|
+ ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
|
|
567
|
617
|
|
|
568
|
618
|
}
|
|
569
|
619
|
|
|
|
@@ -587,14 +637,15 @@ public class CaseZipImportImpl {
|
|
587
|
637
|
*/
|
|
588
|
638
|
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
|
|
589
|
639
|
Map<String, Long> deptMap, List<SysDept> sysDepts,
|
|
590
|
|
- Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,Long caseId) {
|
|
|
640
|
+ Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, Long caseId,
|
|
|
641
|
+ List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
|
|
591
|
642
|
|
|
592
|
643
|
affiliate.setIdentityType(1);
|
|
593
|
644
|
|
|
594
|
645
|
// 申请人
|
|
595
|
646
|
switch (dictData.getDictLabel()) {
|
|
596
|
647
|
case "申请人姓名":
|
|
597
|
|
- affiliate.setName((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
|
|
|
648
|
+ affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
|
|
598
|
649
|
if (StrUtil.isNotEmpty(affiliate.getName())) {
|
|
599
|
650
|
// 组装申请机构
|
|
600
|
651
|
// 将组织机构id设为申请人名称
|
|
|
@@ -622,29 +673,30 @@ public class CaseZipImportImpl {
|
|
622
|
673
|
}
|
|
623
|
674
|
break;
|
|
624
|
675
|
case "统一社会信用代码":
|
|
625
|
|
- affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
|
|
|
676
|
+ affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
|
|
626
|
677
|
break;
|
|
627
|
678
|
case "法定代表人":
|
|
628
|
|
- affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
679
|
+ affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
629
|
680
|
break;
|
|
630
|
681
|
case "法定代表人职位":
|
|
631
|
|
- affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
|
|
|
682
|
+ affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
|
|
632
|
683
|
break;
|
|
633
|
684
|
case "申请人住所":
|
|
634
|
|
- affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
|
|
|
685
|
+ affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
|
|
635
|
686
|
break;
|
|
636
|
687
|
case "申请人联系地址":
|
|
637
|
|
- affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
688
|
+ affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
638
|
689
|
break;
|
|
639
|
690
|
case "委托代理人姓名":
|
|
640
|
|
- affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
691
|
+ affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
641
|
692
|
break;
|
|
642
|
693
|
case "委托代理人联系电话":
|
|
643
|
|
- affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
694
|
+ affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
644
|
695
|
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
|
|
|
696
|
+ SysUser agentUser = null;
|
|
645
|
697
|
// 用户已存在
|
|
646
|
698
|
if (userMap.containsKey(affiliate.getContactTelphoneAgent())) {
|
|
647
|
|
- SysUser agentUser = userMap.get(affiliate.getContactTelphoneAgent());
|
|
|
699
|
+ agentUser = userMap.get(affiliate.getContactTelphoneAgent());
|
|
648
|
700
|
if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
|
|
649
|
701
|
// 同步用户表和案件关联人表的手机号和名称
|
|
650
|
702
|
affiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
|
|
|
@@ -670,7 +722,7 @@ public class CaseZipImportImpl {
|
|
670
|
722
|
}
|
|
671
|
723
|
} else {
|
|
672
|
724
|
// 用户不存在,新增
|
|
673
|
|
- SysUser agentUser = new SysUser();
|
|
|
725
|
+ agentUser = new SysUser();
|
|
674
|
726
|
agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId()));
|
|
675
|
727
|
agentUser.setIdCard(affiliate.getIdentityNumAgent());
|
|
676
|
728
|
agentUser.setNickName(affiliate.getNameAgent());
|
|
|
@@ -683,10 +735,29 @@ public class CaseZipImportImpl {
|
|
683
|
735
|
insertAgentUserRole(agentUser, roleId, userRoleList);
|
|
684
|
736
|
|
|
685
|
737
|
}
|
|
|
738
|
+ if (addUsers != null) {
|
|
|
739
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
740
|
+ request.setTemplateId("1956159");
|
|
|
741
|
+ request.setPhone(agentUser.getPhonenumber());
|
|
|
742
|
+ request.setTemplateParamSet(new String[]{agentUser.getNickName()});
|
|
|
743
|
+ SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
744
|
+ smsSendRecord.setCaseId(caseId);
|
|
|
745
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
746
|
+ caseApplication.setId(caseId);
|
|
|
747
|
+ smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
|
|
748
|
+ smsSendRecord.setPhone(request.getPhone());
|
|
|
749
|
+ smsSendRecord.setSendTime(new Date());
|
|
|
750
|
+ String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
|
|
|
751
|
+ smsSendRecord.setSendContent(content);
|
|
|
752
|
+ smsSendRecord.setCreateBy(getUsername());
|
|
|
753
|
+ smsSendRecords.add(smsSendRecord);
|
|
|
754
|
+ smsRequestList.add(request);
|
|
|
755
|
+ }
|
|
|
756
|
+
|
|
686
|
757
|
}
|
|
687
|
758
|
break;
|
|
688
|
759
|
case "委托代理人电子邮件":
|
|
689
|
|
- affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
|
|
|
760
|
+ affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
|
|
690
|
761
|
|
|
691
|
762
|
break;
|
|
692
|
763
|
default:
|
|
|
@@ -716,17 +787,17 @@ public class CaseZipImportImpl {
|
|
716
|
787
|
* @param fatchMap 抓取内容
|
|
717
|
788
|
* @param debtorAffiliate 被申请人
|
|
718
|
789
|
*/
|
|
719
|
|
- private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate,Long caseId) {
|
|
|
790
|
+ private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate, Long caseId) {
|
|
720
|
791
|
|
|
721
|
792
|
debtorAffiliate.setIdentityType(2);
|
|
722
|
793
|
// 被申请人
|
|
723
|
794
|
switch (dictData.getDictLabel()) {
|
|
724
|
795
|
case "被申请人姓名":
|
|
725
|
|
- debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
796
|
+ debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
726
|
797
|
break;
|
|
727
|
798
|
case "被申请人身份证号":
|
|
728
|
|
- String identityNum = fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId);
|
|
729
|
|
- debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
799
|
+ String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
|
|
|
800
|
+ debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
730
|
801
|
// 出生年月日,从身份证抓取
|
|
731
|
802
|
if (StrUtil.isNotEmpty(identityNum)) {
|
|
732
|
803
|
identityNum = identityNum.replace("\n", "");
|
|
|
@@ -748,13 +819,13 @@ public class CaseZipImportImpl {
|
|
748
|
819
|
|
|
749
|
820
|
break;
|
|
750
|
821
|
case "被申请人住所":
|
|
751
|
|
- debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
822
|
+ debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
752
|
823
|
break;
|
|
753
|
824
|
case "被申请人联系电话":
|
|
754
|
|
- debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
|
|
|
825
|
+ debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
|
|
755
|
826
|
break;
|
|
756
|
827
|
case "被申请人电子邮件":
|
|
757
|
|
- debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
|
|
|
828
|
+ debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
|
|
758
|
829
|
|
|
759
|
830
|
break;
|
|
760
|
831
|
default:
|
|
|
@@ -807,5 +878,4 @@ public class CaseZipImportImpl {
|
|
807
|
878
|
}
|
|
808
|
879
|
|
|
809
|
880
|
|
|
810
|
|
-
|
|
811
|
881
|
}
|