Procházet zdrojové kódy

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

qtz před 2 roky
rodič
revize
fdf48d2f14

+ 24
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Zobrazit soubor

@@ -39,6 +39,18 @@ public class AdjudicationController extends BaseController {
39 39
         return success(sealSignRecordselect);
40 40
     }
41 41
 
42
+    /**
43
+     * 根据批号查询批量签名链接
44
+     */
45
+    @PostMapping("/selectBatchSignUrl")
46
+    public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) {
47
+        if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
48
+            return error("参数校验失败");
49
+        }
50
+        SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq);
51
+        return success(sealSignRecordselect);
52
+    }
53
+
42 54
     /**
43 55
      * 根据签署流程id查询批量用印链接
44 56
      */
@@ -62,6 +74,18 @@ public class AdjudicationController extends BaseController {
62 74
         return getDataTable(list);
63 75
     }
64 76
 
77
+    /**
78
+     * 根据批号查询批量用印链接
79
+     */
80
+    @PostMapping("/getSealUrlBatch")
81
+    public AjaxResult getSealUrlBatch(@RequestBody StringIdsReq idsReq) {
82
+        if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
83
+            return error("参数校验失败");
84
+        }
85
+        SealSignRecord sealSignRecordselect = adjudicationService.getSealUrlBatch(idsReq);
86
+        return success(sealSignRecordselect);
87
+    }
88
+
65 89
 
66 90
     /**
67 91
      * 生成裁决书

+ 10
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java Zobrazit soubor

@@ -54,4 +54,14 @@ public class CaseArbitrateController extends BaseController {
54 54
         return  caseArbitrateService.writtenHear(caseIds);
55 55
 
56 56
     }
57
+    /**
58
+     * 批量书面审理
59
+     * @param
60
+     * @return
61
+     */
62
+    @PostMapping("/writtenHearBatch")
63
+    public AjaxResult writtenHearBatch(@Validated @RequestBody CaseApplication caseApplication){
64
+        return  caseArbitrateService.writtenHearBatch(caseApplication);
65
+
66
+    }
57 67
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java Zobrazit soubor

@@ -19,4 +19,8 @@ public class StringIdsReq {
19 19
      * 机构账户
20 20
      */
21 21
     private String orgId ;
22
+    /**
23
+     * 批号
24
+     */
25
+    private Integer batchNumber;
22 26
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Zobrazit soubor

@@ -417,5 +417,5 @@ public class CaseApplication  extends BaseEntity {
417 417
      */
418 418
     private Integer pendingStatus;
419 419
    /** e签宝流程id */
420
-    private String signFlowId;;
420
+    private String signFlowId;
421 421
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java Zobrazit soubor

@@ -29,4 +29,6 @@ public interface SealSignRecordMapper {
29 29
 
30 30
 
31 31
     void insertSealSignRecord(SealSignRecord sealSignRecord);
32
+
33
+    List<CaseApplication> selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus")  Integer caseStatus);
32 34
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java Zobrazit soubor

@@ -57,4 +57,8 @@ public interface IAdjudicationService {
57 57
     List<CaseApplication> selectSealSigning(String personAccount,Integer caseStatus);
58 58
 
59 59
     SealSignRecord selectBatchSealUrl(StringIdsReq idsReq);
60
+
61
+    SealSignRecord getSignUrlBatch(StringIdsReq idsReq);
62
+
63
+    SealSignRecord getSealUrlBatch(StringIdsReq idsReq);
60 64
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java Zobrazit soubor

@@ -16,4 +16,6 @@ public interface ICaseArbitrateService {
16 16
     AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod);
17 17
 
18 18
     AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication);
19
+
20
+    AjaxResult writtenHearBatch(CaseApplication caseApplication);
19 21
 }

+ 100
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Zobrazit soubor

@@ -1429,6 +1429,106 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1429 1429
         return signRecord;
1430 1430
     }
1431 1431
 
1432
+    @Override
1433
+    public SealSignRecord getSignUrlBatch(StringIdsReq idsReq) {
1434
+        SealSignRecord signRecord = new SealSignRecord();
1435
+        try {
1436
+            EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
1437
+
1438
+            Gson gson = new Gson();
1439
+            if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1440
+                JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1441
+                if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
1442
+                    JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1443
+                    if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
1444
+                        idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1445
+                    }
1446
+                }
1447
+            }
1448
+            if (StrUtil.isEmpty(idsReq.getPsnId())) {
1449
+                throw new ServiceException("该用户未认证");
1450
+            }
1451
+            Integer batchNumber = idsReq.getBatchNumber();
1452
+            Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION;
1453
+            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
1454
+            if (caseApplications != null && caseApplications.size() > 0) {
1455
+                List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1456
+                idsReq.setIds(signFlowIds);
1457
+
1458
+                EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
1459
+                if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
1460
+                    JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1461
+                    if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1462
+                        JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1463
+                        if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1464
+                            // 免登录批量签链接(链接有效期2小时)
1465
+                            String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1466
+                            // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1467
+                            signRecord.setSignUrl(url);
1468
+                        }
1469
+                    }
1470
+                }
1471
+
1472
+            }else{
1473
+                throw new ServiceException("这个批号没有批量签名的案件");
1474
+            }
1475
+
1476
+        } catch (EsignDemoException e) {
1477
+            e.printStackTrace();
1478
+        }
1479
+
1480
+        return signRecord;
1481
+    }
1482
+
1483
+    @Override
1484
+    public SealSignRecord getSealUrlBatch(StringIdsReq idsReq) {
1485
+        SealSignRecord signRecord = new SealSignRecord();
1486
+        try {
1487
+            EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
1488
+
1489
+            Gson gson = new Gson();
1490
+            if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1491
+                JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1492
+                if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
1493
+                    JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1494
+                    if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
1495
+                        idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1496
+                    }
1497
+                }
1498
+            }
1499
+            if (StrUtil.isEmpty(idsReq.getPsnId())) {
1500
+                throw new ServiceException("该用户未认证");
1501
+            }
1502
+            Integer batchNumber = idsReq.getBatchNumber();
1503
+            Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL;
1504
+            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
1505
+            if (caseApplications != null && caseApplications.size() > 0) {
1506
+                List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1507
+                idsReq.setIds(signFlowIds);
1508
+
1509
+                EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
1510
+                if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
1511
+                    JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1512
+                    if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1513
+                        JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1514
+                        if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1515
+                            // 免登录批量签链接(链接有效期2小时)
1516
+                            String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1517
+                            // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1518
+                            signRecord.setSignUrl(url);
1519
+                        }
1520
+                    }
1521
+                }
1522
+
1523
+            }else{
1524
+                throw new ServiceException("这个批号没有批量用印的案件");
1525
+            }
1526
+        } catch (EsignDemoException e) {
1527
+            e.printStackTrace();
1528
+        }
1529
+        return signRecord;
1530
+    }
1531
+
1432 1532
     /**
1433 1533
      * 根据仲裁员手机号分页查询等待签署,签署中的裁决书
1434 1534
      *

+ 40
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Zobrazit soubor

@@ -239,6 +239,46 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
239 239
         return AjaxResult.success();
240 240
     }
241 241
 
242
+    @Override
243
+    @Transactional
244
+    public AjaxResult writtenHearBatch(CaseApplication caseApplicationparam) {
245
+        CaseApplication caseApplicationsel = new CaseApplication();
246
+        caseApplicationsel.setBatchNumber(caseApplicationparam.getBatchNumber());
247
+        caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
248
+        List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
249
+        if (caseApplications1 != null && caseApplications1.size() > 0) {
250
+            List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
251
+            for (Long caseId : ids) {
252
+                //查询案件详情
253
+                CaseApplication caseApplication = new CaseApplication();
254
+                caseApplication.setId(caseId);
255
+                CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
256
+                //案件日志表里添加数据
257
+                CaseLogRecord caseLogRecord = new CaseLogRecord();
258
+                caseLogRecord.setCaseAppliId(caseApplication1.getId());
259
+                caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
260
+                caseLogRecord.setCreateBy(getUsername());
261
+                caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
262
+                // 新增日志
263
+                CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
264
+
265
+                // 生成裁决书
266
+                CaseApplication application = new CaseApplication();
267
+                application.setId(caseId);
268
+                adjudicationService.createDocument(application);
269
+                //修改案件状态
270
+                caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
271
+                int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
272
+
273
+            }
274
+
275
+        }else{
276
+            throw new ServiceException("这个批号没有批量书面审理的案件");
277
+        }
278
+        return AjaxResult.success();
279
+
280
+    }
281
+
242 282
     @Override
243 283
     @Transactional
244 284
     public AjaxResult writtenHear(CaseIds caseIds) {

+ 15
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml Zobrazit soubor

@@ -81,6 +81,21 @@
81 81
         order by c.case_num desc
82 82
     </select>
83 83
 
84
+    <select id="selectsignFlow" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
85
+        SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
86
+        c.arbitrator_id arbitratorId,
87
+        c.arbitrator_name arbitratorName
88
+        from seal_sign_record s
89
+        join case_application c on s.case_appli_id=c.id
90
+        WHERE c.lock_status = 0
91
+        <if test="batchNumber != null">
92
+            AND c.batch_number  = #{batchNumber}
93
+        </if>
94
+        <if test="caseStatus != null">
95
+            AND c.case_status  = #{caseStatus}
96
+        </if>
97
+    </select>
98
+
84 99
 
85 100
     <update id="updataSealSignRecord" parameterType="SealSignRecord">
86 101
         update seal_sign_record