Explorar el Código

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

qtz hace 2 años
padre
commit
08a6e72cc2

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java Ver fichero

23
     private String orgnizeNamePsnAccount;
23
     private String orgnizeNamePsnAccount;
24
     /** 机构经办人名称 */
24
     /** 机构经办人名称 */
25
     private String orgnizeNamepsnName;
25
     private String orgnizeNamepsnName;
26
+
27
+    String fileDownloadUrl;
28
+
29
+    public String getFileDownloadUrl() {
30
+        return fileDownloadUrl;
31
+    }
32
+
33
+    public void setFileDownloadUrl(String fileDownloadUrl) {
34
+        this.fileDownloadUrl = fileDownloadUrl;
35
+    }
36
+
26
     /** 流程状态 */
37
     /** 流程状态 */
27
     private Integer signFlowStatus;
38
     private Integer signFlowStatus;
28
     /** 签名状态 */
39
     /** 签名状态 */

+ 33
- 66
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Ver fichero

6
 import com.ruoyi.common.constant.CaseApplicationConstants;
6
 import com.ruoyi.common.constant.CaseApplicationConstants;
7
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
7
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
8
 import com.ruoyi.common.exception.EsignDemoException;
8
 import com.ruoyi.common.exception.EsignDemoException;
9
+import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
9
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
11
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
11
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
12
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
29
         Gson gson = new Gson();
30
         Gson gson = new Gson();
30
 
31
 
31
         SealSignRecord sealSignRecordselect = new SealSignRecord();
32
         SealSignRecord sealSignRecordselect = new SealSignRecord();
32
-        sealSignRecordselect.setSignFlowStatus(1);
33
-
33
+//        sealSignRecordselect.setSignFlowStatus(1);
34
         List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
34
         List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
35
         if(sealSignRecords!=null&&sealSignRecords.size()>0){
35
         if(sealSignRecords!=null&&sealSignRecords.size()>0){
36
             for (int i = 0; i < sealSignRecords.size(); i++) {
36
             for (int i = 0; i < sealSignRecords.size(); i++) {
39
                 JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
39
                 JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
40
                 JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
40
                 JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
41
                 JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
41
                 JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
42
-
43
-                System.out.println("signFlowDetailJsonObject-----------"+signFlowDetailJsonObject.toString());
44
-
45
                 Integer psnsignStatus = null;
42
                 Integer psnsignStatus = null;
46
                 Integer orgsignStatus = null;
43
                 Integer orgsignStatus = null;
47
                 for (int j = 0; j < signersArray.size(); j++) {
44
                 for (int j = 0; j < signersArray.size(); j++) {
61
                     }
58
                     }
62
 
59
 
63
                 }
60
                 }
64
-
65
-                System.out.println("psnsignStatus-----------"+psnsignStatus);
66
-                System.out.println("orgsignStatus-----------"+orgsignStatus);
67
-
68
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
61
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
69
                     //更新立案申请状态为待用印
62
                     //更新立案申请状态为待用印
70
                     CaseApplication caseApplication = new CaseApplication();
63
                     CaseApplication caseApplication = new CaseApplication();
71
                     caseApplication.setId(sealSignRecord.getCaseAppliId());
64
                     caseApplication.setId(sealSignRecord.getCaseAppliId());
72
-                    caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
73
-                    caseApplicationMapper.submitCaseApplication(caseApplication);
74
 
65
 
75
-                    //修改"签署用印记录表"的状态为待用印
76
-                    sealSignRecord.setSignFlowStatus(2);
77
-                    sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
66
+                    CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
67
+                    if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION){
68
+                        caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
69
+                        caseApplicationMapper.submitCaseApplication(caseApplication);
70
+
71
+                        //修改"签署用印记录表"的状态为待用印
72
+                        sealSignRecord.setSignFlowStatus(2);
73
+                        sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
74
+                    }
75
+
76
+
78
                 }
77
                 }
79
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
78
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
80
                     //更新立案申请状态为待送达
79
                     //更新立案申请状态为待送达
81
                     CaseApplication caseApplication = new CaseApplication();
80
                     CaseApplication caseApplication = new CaseApplication();
82
                     caseApplication.setId(sealSignRecord.getCaseAppliId());
81
                     caseApplication.setId(sealSignRecord.getCaseAppliId());
83
-                    caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
84
-                    caseApplicationMapper.submitCaseApplication(caseApplication);
85
-
86
-                    //修改"签署用印记录表"的状态为签署完成
87
-                    sealSignRecord.setSignFlowStatus(3);
88
-                    sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
89
 
82
 
90
-                    //下载审核完成的裁决书,
91
-//                  SaaSAPIFileUtils.fileDownloadUrl();
83
+                    CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
84
+                    if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){
85
+                        caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
86
+                        caseApplicationMapper.submitCaseApplication(caseApplication);
87
+
88
+                        //下载审核完成的裁决书,
89
+                        String signFlowId = sealSignRecord.getSignFlowid();
90
+                        EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
91
+                        JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
92
+                        JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
93
+                        JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
94
+                        if(filesArray!=null&&filesArray.size()>0){
95
+                            JsonObject fileObject = (JsonObject)filesArray.get(0);
96
+                            String fileDownloadUrl = fileObject.get("downloadUrl").toString();
97
+                            //修改"签署用印记录表"的状态为签署完成
98
+                            sealSignRecord.setSignFlowStatus(3);
99
+                            sealSignRecord.setFileDownloadUrl(fileDownloadUrl);
100
+                            sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
92
 
101
 
93
-
94
-                    
102
+                        }
103
+                    }
95
                 }
104
                 }
96
             }
105
             }
97
 
106
 
98
         }
107
         }
99
 
108
 
100
-//        Gson gson = new Gson();
101
-//
102
-//        SealSignRecord sealSignRecord = new SealSignRecord();
103
-//        sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d");
104
-//        EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
105
-//        JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
106
-//        JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
107
-//        JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
108
-//        for (int i = 0; i < signersArray.size(); i++) {
109
-//            JsonObject signerObject = (JsonObject)signersArray.get(i);
110
-//            Integer psnsignStatus ;
111
-//            Integer orgsignStatus ;
112
-//            if(!(signerObject.get("psnSigner").toString()).equals("null")){
113
-//                JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
114
-//                if(psnSignerData!=null){
115
-//                    psnsignStatus = signerObject.get("signStatus").getAsInt();
116
-//                    sealSignRecord.setPsnsignStatus(psnsignStatus);
117
-//
118
-//                    if(psnsignStatus.intValue()==2){
119
-//                        //更新立案申请状态为待用印
120
-//                        CaseApplication caseApplication = new CaseApplication();
121
-//                        caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
122
-//                        caseApplicationMapper.submitCaseApplication(caseApplication);
123
-//
124
-//
125
-//
126
-//                    }
127
-//
128
-//
129
-//
130
-//                }
131
-//            }
132
-//            if(!(signerObject.get("orgSigner").toString()).equals("null")){
133
-//                JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
134
-//                if(orgSignerData!=null){
135
-//                    orgsignStatus = signerObject.get("signStatus").getAsInt();
136
-//                    sealSignRecord.setOrgsignStatus(orgsignStatus);
137
-//                }
138
-//
139
-//            }
140
-//
141
-//        }
142
 
109
 
143
 
110
 
144
     }
111
     }

+ 0
- 61
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Ver fichero

27
 
27
 
28
         SealSignRecord sealSignRecord = new SealSignRecord();
28
         SealSignRecord sealSignRecord = new SealSignRecord();
29
 
29
 
30
-        sealSignRecord.setFileid("a808f1f39a744357a2f018e4ab34c55d");
31
-        sealSignRecord.setFilename("23893bfd3f2249ffa5c82850c11c482e.pdf");
32
-        sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d");
33
-
34
-
35
-        sealSignRecord.setPensonAccount("18209231185");
36
-        sealSignRecord.setPensonName("秦桃则");
37
-        sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
38
-        sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
39
-        sealSignRecord.setOrgnizeNamepsnName("韩超勃");
40
-        sealSignRecord.setPositionPagepsn("2");
41
-
42
-        sealSignRecord.setPositionXpsn(279+20);
43
-        sealSignRecord.setPositionYpsn(216.336-20);
44
-
45
-        sealSignRecord.setPositionPageorg("2");
46
-
47
-        sealSignRecord.setPositionXorg(342+30);
48
-        sealSignRecord.setPositionYorg(185.136);
49
-
50
-
51
-
52
 
30
 
53
         /* 发起签署*/
31
         /* 发起签署*/
54
 //        EsignHttpResponse createByFile = createByFile(sealSignRecord);
32
 //        EsignHttpResponse createByFile = createByFile(sealSignRecord);
159
         double positionXorg = sealSignRecord.getPositionXorg();
137
         double positionXorg = sealSignRecord.getPositionXorg();
160
         double positionYorg = sealSignRecord.getPositionYorg();
138
         double positionYorg = sealSignRecord.getPositionYorg();
161
 
139
 
162
-
163
         String jsonParm = "{\n" +
140
         String jsonParm = "{\n" +
164
                 "    \"docs\": [\n" +
141
                 "    \"docs\": [\n" +
165
                 "        {\n" +
142
                 "        {\n" +
166
-
167
-//                "            \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
168
                 "            \"fileId\": \"" + fileId +  "\",\n" +
143
                 "            \"fileId\": \"" + fileId +  "\",\n" +
169
-
170
-//                "            \"fileName\": \"477470a7741b4536a200c792b6ddf966.pdf\"\n" +
171
                 "            \"fileName\": \"" + fileName +  "\"\n" +
144
                 "            \"fileName\": \"" + fileName +  "\"\n" +
172
 
145
 
173
                 "        }\n" +
146
                 "        }\n" +
194
                 "          {\n" +
167
                 "          {\n" +
195
 
168
 
196
                 "            \"psnSignerInfo\": {\n" +
169
                 "            \"psnSignerInfo\": {\n" +
197
-
198
-//                "                \"psnAccount\": \"18209231185\",\n" +
199
                 "                \"psnAccount\": \"" + psnAccount +  "\",\n" +
170
                 "                \"psnAccount\": \"" + psnAccount +  "\",\n" +
200
 
171
 
201
                 "                \"psnInfo\": {\n" +
172
                 "                \"psnInfo\": {\n" +
202
-
203
-//                "                            \"psnName\": \"秦桃则\"\n" +
204
                 "                            \"psnName\": \"" + psnName +  "\"\n" +
173
                 "                            \"psnName\": \"" + psnName +  "\"\n" +
205
                 "                        }\n" +
174
                 "                        }\n" +
206
 
175
 
207
-
208
                 "            },\n" +
176
                 "            },\n" +
209
-
210
-
211
                 "            \"signFields\": [\n" +
177
                 "            \"signFields\": [\n" +
212
                 "                {\n" +
178
                 "                {\n" +
213
 
179
 
214
-//                "                    \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
215
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
180
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
216
 
181
 
217
                 "                    \"normalSignFieldConfig\": {\n" +
182
                 "                    \"normalSignFieldConfig\": {\n" +
219
                 "                        \"freeMode\": false,\n" +
184
                 "                        \"freeMode\": false,\n" +
220
                 "                        \"movableSignField\": false,\n" +
185
                 "                        \"movableSignField\": false,\n" +
221
                 "                        \"signFieldPosition\": {\n" +
186
                 "                        \"signFieldPosition\": {\n" +
222
-
223
-//                "                            \"positionPage\": \"2\",\n" +
224
                 "                            \"positionPage\": \"" + positionPagepsn +  "\",\n" +
187
                 "                            \"positionPage\": \"" + positionPagepsn +  "\",\n" +
225
-
226
-//                "                            \"positionX\": 310.0,\n" +
227
                 "                            \"positionX\": " + positionXpsn +  ",\n" +
188
                 "                            \"positionX\": " + positionXpsn +  ",\n" +
228
-
229
-//                "                            \"positionY\": 247.536\n" +
230
                 "                            \"positionY\": " + positionYpsn +  "\n" +
189
                 "                            \"positionY\": " + positionYpsn +  "\n" +
231
-
232
                 "                        },\n" +
190
                 "                        },\n" +
233
                 "                        \"signFieldStyle\": 1\n" +
191
                 "                        \"signFieldStyle\": 1\n" +
234
                 "                    },\n" +
192
                 "                    },\n" +
241
 
199
 
242
                 "        {\n" +
200
                 "        {\n" +
243
                 "            \"orgSignerInfo\": {\n" +
201
                 "            \"orgSignerInfo\": {\n" +
244
-
245
-//                "                \"orgName\": \"西安云美电子科技有限公司\",\n" +
246
                 "                \"orgName\": \"" + orgName +  "\",\n" +
202
                 "                \"orgName\": \"" + orgName +  "\",\n" +
247
-
248
                 "                \"transactorInfo\": {\n" +
203
                 "                \"transactorInfo\": {\n" +
249
-
250
-
251
-//                "                \"psnAccount\": \"17691338406\",\n" +
252
                 "                \"psnAccount\": \"" + orgNamePsnAccount +  "\",\n" +
204
                 "                \"psnAccount\": \"" + orgNamePsnAccount +  "\",\n" +
253
 
205
 
254
                 "                \"psnInfo\": {\n" +
206
                 "                \"psnInfo\": {\n" +
255
 
207
 
256
-//                "                            \"psnName\": \"韩超勃\"\n" +
257
                 "                            \"psnName\": \"" + orgNamepsnName +  "\"\n" +
208
                 "                            \"psnName\": \"" + orgNamepsnName +  "\"\n" +
258
                 "                        }\n" +
209
                 "                        }\n" +
259
 
210
 
262
 
213
 
263
                 "            \"signFields\": [\n" +
214
                 "            \"signFields\": [\n" +
264
                 "                {\n" +
215
                 "                {\n" +
265
-
266
-//                "                    \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
267
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
216
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
268
 
217
 
269
                 "                    \"normalSignFieldConfig\": {\n" +
218
                 "                    \"normalSignFieldConfig\": {\n" +
272
 
221
 
273
                 "                        \"signFieldPosition\": {\n" +
222
                 "                        \"signFieldPosition\": {\n" +
274
 
223
 
275
-//                "                            \"positionPage\": \"2\",\n" +
276
                 "                            \"positionPage\": \"" + positionPageorg +  "\",\n" +
224
                 "                            \"positionPage\": \"" + positionPageorg +  "\",\n" +
277
-
278
-//                "                            \"positionX\": 340.0,\n" +
279
                 "                            \"positionX\": " + positionXorg +  ",\n" +
225
                 "                            \"positionX\": " + positionXorg +  ",\n" +
280
-
281
-//                "                            \"positionY\": 340.736\n" +
282
                 "                            \"positionY\": " + positionYorg +  "\n" +
226
                 "                            \"positionY\": " + positionYorg +  "\n" +
283
                 "                        },\n" +
227
                 "                        },\n" +
284
                 "                        \"signFieldStyle\": 1\n" +
228
                 "                        \"signFieldStyle\": 1\n" +
313
         String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
257
         String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
314
         String jsonParm = "{\n" +
258
         String jsonParm = "{\n" +
315
                 "    \"operator\": {\n" +
259
                 "    \"operator\": {\n" +
316
-//                "        \"psnAccount\":\"18209231185\"\n" +
317
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
260
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
318
                 "    }\n" +
261
                 "    }\n" +
319
                 "}";
262
                 "}";
338
         String orgName = sealSignRecord.getOrgnizeName();
281
         String orgName = sealSignRecord.getOrgnizeName();
339
 
282
 
340
         String jsonParm = "{\n" +
283
         String jsonParm = "{\n" +
341
-//                "    \"needLogin\": true,\n" +
342
                 "    \"operator\": {\n" +
284
                 "    \"operator\": {\n" +
343
 
285
 
344
-//                "        \"psnAccount\":\"17691338406\"\n" +
345
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
286
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
346
                 "    },\n" +
287
                 "    },\n" +
347
                 "    \"organization\": {\n" +
288
                 "    \"organization\": {\n" +
348
-
349
-//                "        \"orgName\": \"西安云美电子科技有限公司\"\n" +
350
                 "        \"orgName\": \"" + orgName +  "\"\n" +
289
                 "        \"orgName\": \"" + orgName +  "\"\n" +
351
 
290
 
352
                 "    }\n" +
291
                 "    }\n" +

+ 2
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml Ver fichero

39
     <update id="updataSealSignRecord" parameterType="SealSignRecord">
39
     <update id="updataSealSignRecord" parameterType="SealSignRecord">
40
         update seal_sign_record
40
         update seal_sign_record
41
         <set>
41
         <set>
42
-            <if test="signFlowStatus != null">sign_flow_status = #{signFlowStatus}</if>
42
+            <if test="signFlowStatus != null">sign_flow_status = #{signFlowStatus},</if>
43
+            <if test="fileDownloadUrl != null and fileDownloadUrl != ''">file_download_url = #{fileDownloadUrl}</if>
43
         </set>
44
         </set>
44
         where id = #{id}
45
         where id = #{id}
45
     </update>
46
     </update>