Преглед изворни кода

Merge branch 'qtz' of SH-Arbitrate/Mediation-Backend into dev

qtz пре 2 година
родитељ
комит
4339a48155

+ 7
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Прегледај датотеку

75
         return AjaxResult.success(list);
75
         return AjaxResult.success(list);
76
     }
76
     }
77
 
77
 
78
-
78
+    /**
79
+     * test
80
+     */
81
+    @PostMapping("/testSeal")
82
+    public AjaxResult testSeal(@Validated @RequestBody MsSignSealDTO dto) throws EsignDemoException {
83
+        return msSignSealService.testSeal(dto);
84
+    }
79
 
85
 
80
 
86
 
81
 
87
 

+ 14
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/SealSignRecord.java Прегледај датотеку

29
     /** 被申请人姓名 */
29
     /** 被申请人姓名 */
30
     private String pensonNameRes;
30
     private String pensonNameRes;
31
 
31
 
32
+    /** 调解员账户 */
33
+    private String pensonAccountMedi;
34
+    /** 调解员姓名 */
35
+    private String pensonNameMedi;
36
+
37
+
38
+
32
     /** 机构名称 */
39
     /** 机构名称 */
33
     private String orgnizeName;
40
     private String orgnizeName;
34
     /** 机构经办人 */
41
     /** 机构经办人 */
66
     /** 被申请人签名位置y坐标 */
73
     /** 被申请人签名位置y坐标 */
67
     private double positionYpsnRes;
74
     private double positionYpsnRes;
68
 
75
 
76
+    /** 调解员签名位置页数 */
77
+    private String positionPagepsnMedi;
78
+    /** 调解员签名位置x坐标 */
79
+    private double positionXpsnMedi;
80
+    /** 调解员签名位置y坐标 */
81
+    private double positionYpsnMedi;
82
+
69
     /** 印章位置页数 */
83
     /** 印章位置页数 */
70
     private String positionPageorg;
84
     private String positionPageorg;
71
     /** 印章位置x坐标 */
85
     /** 印章位置x坐标 */

+ 17
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java Прегледај датотеку

127
     @Column(name = "position_ypsn_res")
127
     @Column(name = "position_ypsn_res")
128
     private double positionYpsnRes;
128
     private double positionYpsnRes;
129
 
129
 
130
+    /** 调解员账户 */
131
+    @Column(name = "penson_account_medi")
132
+    private String pensonAccountMedi;
133
+    /** 调解员姓名 */
134
+    @Column(name = "penson_name_medi")
135
+    private String pensonNameMedi;
136
+
137
+    /** 调解员签名位置页数 */
138
+    @Column(name = "position_pagepsn_medi")
139
+    private String positionPagepsnMedi;
140
+    /** 调解员签名位置x坐标 */
141
+    @Column(name = "position_xpsn_medi")
142
+    private double positionXpsnMedi;
143
+    /** 调解员签名位置y坐标 */
144
+    @Column(name = "position_ypsn_medi")
145
+    private double positionYpsnMedi;
146
+
130
 
147
 
131
 
148
 
132
 }
149
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Прегледај датотеку

23
 
23
 
24
     List<MsCaseLogRecordVO> selectCaseLogRecordList(MsSignSealDTO dto);
24
     List<MsCaseLogRecordVO> selectCaseLogRecordList(MsSignSealDTO dto);
25
 
25
 
26
+    AjaxResult testSeal(MsSignSealDTO dto);
26
 }
27
 }

+ 140
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Прегледај датотеку

20
 import com.ruoyi.common.utils.StringUtils;
20
 import com.ruoyi.common.utils.StringUtils;
21
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
21
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
22
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
22
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
23
+import com.ruoyi.system.mapper.SysUserMapper;
23
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
24
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
24
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
25
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
25
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
26
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
68
     @Autowired
69
     @Autowired
69
     MsCaseFlowMapper caseFlowMapper;
70
     MsCaseFlowMapper caseFlowMapper;
70
 
71
 
72
+    @Autowired
73
+    private SysUserMapper sysUserMapper;
74
+
71
     @Autowired
75
     @Autowired
72
     private MsSealSignRecordMapper sealSignRecordMapper;
76
     private MsSealSignRecordMapper sealSignRecordMapper;
73
 
77
 
125
                                 //发起签署
129
                                 //发起签署
126
                                 sealSignRecord.setFilename(fileName);
130
                                 sealSignRecord.setFilename(fileName);
127
 
131
 
132
+                                Long arbitratorId = caseApplication.getMediatorId();
133
+                                if (arbitratorId != null) {
134
+                                    SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
135
+                                    if (sysUser == null) {
136
+                                        return AjaxResult.error();
137
+                                    }
138
+                                    sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
139
+                                    sealSignRecord.setPensonNameMedi(sysUser.getNickName());
140
+                                }
141
+
128
                                 sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
142
                                 sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
129
                                 sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
143
                                 sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
130
                                 sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
144
                                 sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
161
                                             double positionX = coordinateObj.getDoubleValue("positionX");
175
                                             double positionX = coordinateObj.getDoubleValue("positionX");
162
                                             double positionY = coordinateObj.getDoubleValue("positionY");
176
                                             double positionY = coordinateObj.getDoubleValue("positionY");
163
                                             sealSignRecord.setPositionXpsn(positionX + 90);
177
                                             sealSignRecord.setPositionXpsn(positionX + 90);
164
-                                            sealSignRecord.setPositionYpsn(positionY);
178
+                                            sealSignRecord.setPositionYpsn(positionY + 30);
165
                                         }
179
                                         }
166
                                     }else if (keyword.equals("被申请人:")) {
180
                                     }else if (keyword.equals("被申请人:")) {
167
                                         //签名
181
                                         //签名
178
                                             sealSignRecord.setPositionXpsnRes(positionX + 90);
192
                                             sealSignRecord.setPositionXpsnRes(positionX + 90);
179
                                             sealSignRecord.setPositionYpsnRes(positionY);
193
                                             sealSignRecord.setPositionYpsnRes(positionY);
180
                                         }
194
                                         }
195
+                                    }else if (keyword.equals("调解员:")) {
196
+                                        //签名
197
+                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
198
+                                        // 遍历 positionsArray 中的每个元素
199
+                                        for (int j = 0; j < positionsArray.size(); j++) {
200
+                                            JSONObject positionObj = positionsArray.getJSONObject(j);
201
+                                            int pageNum = positionObj.getIntValue("pageNum");
202
+                                            sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
203
+                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
204
+                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
205
+                                            double positionX = coordinateObj.getDoubleValue("positionX");
206
+                                            double positionY = coordinateObj.getDoubleValue("positionY");
207
+                                            sealSignRecord.setPositionXpsnMedi(positionX + 90);
208
+                                            sealSignRecord.setPositionYpsnMedi(positionY);
209
+                                        }
181
                                     }else {
210
                                     }else {
182
                                         //用印
211
                                         //用印
183
                                         JSONArray positionsArray = jsonObject3.getJSONArray("positions");
212
                                         JSONArray positionsArray = jsonObject3.getJSONArray("positions");
288
                                                 request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
317
                                                 request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
289
                                                 Boolean aBoolean1 = SmsUtils.sendSms(request1);
318
                                                 Boolean aBoolean1 = SmsUtils.sendSms(request1);
290
 
319
 
320
+                                                SealSignRecord sealSignRecordMedi = new SealSignRecord();
321
+                                                sealSignRecordMedi.setSignFlowid(signFlowId);
322
+                                                sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
323
+                                                EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
324
+                                                JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
325
+                                                JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
326
+                                                String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
327
+                                                String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
328
+
329
+                                                SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
330
+                                                requestMedi.setTemplateId("2047719");
331
+                                                requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
332
+                                                requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
333
+                                                Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
291
 
334
 
292
                                             } else {
335
                                             } else {
293
                                                 throw new ServiceException(jsonObject3.getString("message"));
336
                                                 throw new ServiceException(jsonObject3.getString("message"));
646
 
689
 
647
     }
690
     }
648
 
691
 
692
+    @Override
693
+    @Transactional
694
+    public AjaxResult testSeal(MsSignSealDTO dto) {
695
+
696
+        Gson gson = new Gson();
697
+
698
+        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat();
699
+
700
+        try {
701
+            if (sealSignRecords != null && sealSignRecords.size() > 0) {
702
+                for (int i = 0; i < sealSignRecords.size(); i++) {
703
+                    MsSealSignRecord mssealSignRecord = sealSignRecords.get(i);
704
+                    SealSignRecord sealSignRecord = new SealSignRecord();
705
+                    BeanUtil.copyProperties(mssealSignRecord, sealSignRecord);
706
+
707
+                    String signFlowId = mssealSignRecord.getSignFlowId();
708
+                    if(StringUtils.isNotEmpty(signFlowId) && "819e60824fe241e9b862bd787403fa5e".equals(signFlowId)){
709
+                        sealSignRecord.setSignFlowid(mssealSignRecord.getSignFlowId());
710
+                        EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
711
+                        JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
712
+                        JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
713
+                        JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
714
+                        List<Integer> psnsignStatusList = new ArrayList<>();
715
+                        Integer psnsignStatus = null;
716
+                        Integer orgsignStatus = null;
717
+                        for (int j = 0; j < signersArray.size(); j++) {
718
+                            JsonObject signerObject = (JsonObject) signersArray.get(j);
719
+
720
+                            if (!(signerObject.get("psnSigner").toString()).equals("null")) {
721
+                                JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
722
+                                if (psnSignerData != null) {
723
+                                    psnsignStatus = signerObject.get("signStatus").getAsInt();
724
+                                    psnsignStatusList.add(psnsignStatus);
725
+                                }
726
+                            }
727
+                            if (!(signerObject.get("orgSigner").toString()).equals("null")) {
728
+                                JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
729
+                                if (orgSignerData != null) {
730
+                                    orgsignStatus = signerObject.get("signStatus").getAsInt();
731
+                                }
732
+                            }
733
+
734
+                        }
735
+
736
+                        List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
737
+
738
+                        if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
739
+                            //更新立案申请状态为待用印
740
+                            MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
741
+                            if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
742
+                                // 根据流程id查找下一个流程节点
743
+                                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
744
+                                MsCaseApplication application = new MsCaseApplication();
745
+                                application.setId(caseApplicationselect.getId());
746
+                                application.setCaseFlowId(nextFlow.getId());
747
+                                application.setCaseStatusName(nextFlow.getCaseStatusName());
748
+                                caseApplicationMapper.updateByPrimaryKeySelective(application);
749
+
750
+                                //修改"签署用印记录表"的状态为待用印
751
+                                mssealSignRecord.setSignFlowStatus(2);
752
+                                sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
753
+                            }
754
+                        }
755
+                        if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2))  && (orgsignStatus.intValue() == 2)) {
756
+                            //更新立案申请状态为待送达
757
+                            MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
758
+
759
+                            if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
760
+                                //修改"签署用印记录表"的状态为签署完成
761
+                                mssealSignRecord.setSignFlowStatus(3);
762
+                                sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
763
+
764
+                                // 根据流程id查找下一个流程节点
765
+                                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
766
+                                MsCaseApplication application = new MsCaseApplication();
767
+                                application.setId(caseApplicationselect.getId());
768
+                                application.setCaseFlowId(nextFlow.getId());
769
+                                application.setCaseStatusName(nextFlow.getCaseStatusName());
770
+                                caseApplicationMapper.updateByPrimaryKeySelective(application);
771
+                            }
772
+                        }
773
+
774
+                    }
775
+
776
+
777
+                }
649
 
778
 
779
+            }
780
+        } catch (EsignDemoException e) {
781
+            e.printStackTrace();
782
+        }
783
+
784
+        return AjaxResult.success();
785
+
786
+
787
+
788
+    }
650
 
789
 
651
 
790
 
652
 }
791
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Прегледај датотеку

244
     /*
244
     /*
245
     定时查询签署流程详情
245
     定时查询签署流程详情
246
      */
246
      */
247
-    @Scheduled(cron = "0/10 * * * * ?")
247
+//    @Scheduled(cron = "0/10 * * * * ?")
248
     @Transactional
248
     @Transactional
249
     public void fixExecuteSelectFlowDetailUtils() {
249
     public void fixExecuteSelectFlowDetailUtils() {
250
         Gson gson = new Gson();
250
         Gson gson = new Gson();

+ 36
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Прегледај датотеку

304
         String psnAccountRes = sealSignRecord.getPensonAccountRes();
304
         String psnAccountRes = sealSignRecord.getPensonAccountRes();
305
         String psnNameRes = sealSignRecord.getPensonNameRes();
305
         String psnNameRes = sealSignRecord.getPensonNameRes();
306
 
306
 
307
+        String psnAccountMedi = sealSignRecord.getPensonAccountMedi();
308
+        String psnNameMedi = sealSignRecord.getPensonNameMedi();
309
+
307
         String orgName = sealSignRecord.getOrgnizeName();
310
         String orgName = sealSignRecord.getOrgnizeName();
308
         String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
311
         String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
309
         String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
312
         String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
316
         double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
319
         double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
317
         double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
320
         double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
318
 
321
 
322
+        String positionPagepsnMedi = sealSignRecord.getPositionPagepsnMedi();
323
+        double positionXpsnMedi = sealSignRecord.getPositionXpsnMedi();
324
+        double positionYpsnMedi = sealSignRecord.getPositionYpsnMedi();
325
+
319
         String positionPageorg = sealSignRecord.getPositionPageorg();
326
         String positionPageorg = sealSignRecord.getPositionPageorg();
320
         double positionXorg = sealSignRecord.getPositionXorg();
327
         double positionXorg = sealSignRecord.getPositionXorg();
321
         double positionYorg = sealSignRecord.getPositionYorg();
328
         double positionYorg = sealSignRecord.getPositionYorg();
406
                 "            \"signerType\": 0\n" +
413
                 "            \"signerType\": 0\n" +
407
                 "        },\n" +
414
                 "        },\n" +
408
 
415
 
416
+
417
+                "        {\n" +
418
+                "            \"psnSignerInfo\": {\n" +
419
+                "                \"psnAccount\": \"" + psnAccountMedi + "\",\n" +
420
+                "                \"psnInfo\": {\n" +
421
+                "                            \"psnName\": \"" + psnNameMedi + "\"\n" +
422
+                "                        }\n" +
423
+                "            },\n" +
424
+                "            \"signFields\": [\n" +
425
+                "                {\n" +
426
+                "                    \"fileId\": \"" + fileId + "\",\n" +
427
+                "                    \"normalSignFieldConfig\": {\n" +
428
+                "                        \"autoSign\": false,\n" +
429
+                "                        \"freeMode\": false,\n" +
430
+                "                        \"movableSignField\": false,\n" +
431
+                "                        \"signFieldPosition\": {\n" +
432
+                "                            \"positionPage\": \"" + positionPagepsnMedi + "\",\n" +
433
+                "                            \"positionX\": " + positionXpsnMedi + ",\n" +
434
+                "                            \"positionY\": " + positionYpsnMedi + "\n" +
435
+                "                        },\n" +
436
+                "                        \"signFieldStyle\": 1\n" +
437
+                "                    },\n" +
438
+                "                    \"signFieldType\": 0\n" +
439
+                "                }\n" +
440
+                "            ],\n" +
441
+                "            \"signerType\": 0\n" +
442
+                "        },\n" +
443
+
409
                 "        {\n" +
444
                 "        {\n" +
410
                 "            \"orgSignerInfo\": {\n" +
445
                 "            \"orgSignerInfo\": {\n" +
411
                 "                \"orgName\": \"" + orgName + "\",\n" +
446
                 "                \"orgName\": \"" + orgName + "\",\n" +
695
                 "    \"keywords\": [\n" +
730
                 "    \"keywords\": [\n" +
696
                 "        \"申请人:\",\n" +
731
                 "        \"申请人:\",\n" +
697
                 "        \"被申请人:\",\n" +
732
                 "        \"被申请人:\",\n" +
733
+                "        \"调解员:\",\n" +
698
                 "        \"(盖章)\"\n" +
734
                 "        \"(盖章)\"\n" +
699
                 "    ]\n" +
735
                 "    ]\n" +
700
                 "}";
736
                 "}";