Quellcode durchsuchen

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

qtz vor 2 Jahren
Ursprung
Commit
08a6e72cc2

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java Datei anzeigen

@@ -23,6 +23,17 @@ public class SealSignRecord extends BaseEntity {
23 23
     private String orgnizeNamePsnAccount;
24 24
     /** 机构经办人名称 */
25 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 38
     private Integer signFlowStatus;
28 39
     /** 签名状态 */

+ 33
- 66
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Datei anzeigen

@@ -6,6 +6,7 @@ import com.google.gson.JsonObject;
6 6
 import com.ruoyi.common.constant.CaseApplicationConstants;
7 7
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
8 8
 import com.ruoyi.common.exception.EsignDemoException;
9
+import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
9 10
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10 11
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
11 12
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
@@ -29,8 +30,7 @@ public class FixSelectFlowDetailUtils {
29 30
         Gson gson = new Gson();
30 31
 
31 32
         SealSignRecord sealSignRecordselect = new SealSignRecord();
32
-        sealSignRecordselect.setSignFlowStatus(1);
33
-
33
+//        sealSignRecordselect.setSignFlowStatus(1);
34 34
         List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
35 35
         if(sealSignRecords!=null&&sealSignRecords.size()>0){
36 36
             for (int i = 0; i < sealSignRecords.size(); i++) {
@@ -39,9 +39,6 @@ public class FixSelectFlowDetailUtils {
39 39
                 JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
40 40
                 JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
41 41
                 JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
42
-
43
-                System.out.println("signFlowDetailJsonObject-----------"+signFlowDetailJsonObject.toString());
44
-
45 42
                 Integer psnsignStatus = null;
46 43
                 Integer orgsignStatus = null;
47 44
                 for (int j = 0; j < signersArray.size(); j++) {
@@ -61,84 +58,54 @@ public class FixSelectFlowDetailUtils {
61 58
                     }
62 59
 
63 60
                 }
64
-
65
-                System.out.println("psnsignStatus-----------"+psnsignStatus);
66
-                System.out.println("orgsignStatus-----------"+orgsignStatus);
67
-
68 61
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
69 62
                     //更新立案申请状态为待用印
70 63
                     CaseApplication caseApplication = new CaseApplication();
71 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 78
                 if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
80 79
                     //更新立案申请状态为待送达
81 80
                     CaseApplication caseApplication = new CaseApplication();
82 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 Datei anzeigen

@@ -27,28 +27,6 @@ public class SignAward {
27 27
 
28 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 32
 //        EsignHttpResponse createByFile = createByFile(sealSignRecord);
@@ -159,15 +137,10 @@ public class SignAward {
159 137
         double positionXorg = sealSignRecord.getPositionXorg();
160 138
         double positionYorg = sealSignRecord.getPositionYorg();
161 139
 
162
-
163 140
         String jsonParm = "{\n" +
164 141
                 "    \"docs\": [\n" +
165 142
                 "        {\n" +
166
-
167
-//                "            \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
168 143
                 "            \"fileId\": \"" + fileId +  "\",\n" +
169
-
170
-//                "            \"fileName\": \"477470a7741b4536a200c792b6ddf966.pdf\"\n" +
171 144
                 "            \"fileName\": \"" + fileName +  "\"\n" +
172 145
 
173 146
                 "        }\n" +
@@ -194,24 +167,16 @@ public class SignAward {
194 167
                 "          {\n" +
195 168
 
196 169
                 "            \"psnSignerInfo\": {\n" +
197
-
198
-//                "                \"psnAccount\": \"18209231185\",\n" +
199 170
                 "                \"psnAccount\": \"" + psnAccount +  "\",\n" +
200 171
 
201 172
                 "                \"psnInfo\": {\n" +
202
-
203
-//                "                            \"psnName\": \"秦桃则\"\n" +
204 173
                 "                            \"psnName\": \"" + psnName +  "\"\n" +
205 174
                 "                        }\n" +
206 175
 
207
-
208 176
                 "            },\n" +
209
-
210
-
211 177
                 "            \"signFields\": [\n" +
212 178
                 "                {\n" +
213 179
 
214
-//                "                    \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
215 180
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
216 181
 
217 182
                 "                    \"normalSignFieldConfig\": {\n" +
@@ -219,16 +184,9 @@ public class SignAward {
219 184
                 "                        \"freeMode\": false,\n" +
220 185
                 "                        \"movableSignField\": false,\n" +
221 186
                 "                        \"signFieldPosition\": {\n" +
222
-
223
-//                "                            \"positionPage\": \"2\",\n" +
224 187
                 "                            \"positionPage\": \"" + positionPagepsn +  "\",\n" +
225
-
226
-//                "                            \"positionX\": 310.0,\n" +
227 188
                 "                            \"positionX\": " + positionXpsn +  ",\n" +
228
-
229
-//                "                            \"positionY\": 247.536\n" +
230 189
                 "                            \"positionY\": " + positionYpsn +  "\n" +
231
-
232 190
                 "                        },\n" +
233 191
                 "                        \"signFieldStyle\": 1\n" +
234 192
                 "                    },\n" +
@@ -241,19 +199,12 @@ public class SignAward {
241 199
 
242 200
                 "        {\n" +
243 201
                 "            \"orgSignerInfo\": {\n" +
244
-
245
-//                "                \"orgName\": \"西安云美电子科技有限公司\",\n" +
246 202
                 "                \"orgName\": \"" + orgName +  "\",\n" +
247
-
248 203
                 "                \"transactorInfo\": {\n" +
249
-
250
-
251
-//                "                \"psnAccount\": \"17691338406\",\n" +
252 204
                 "                \"psnAccount\": \"" + orgNamePsnAccount +  "\",\n" +
253 205
 
254 206
                 "                \"psnInfo\": {\n" +
255 207
 
256
-//                "                            \"psnName\": \"韩超勃\"\n" +
257 208
                 "                            \"psnName\": \"" + orgNamepsnName +  "\"\n" +
258 209
                 "                        }\n" +
259 210
 
@@ -262,8 +213,6 @@ public class SignAward {
262 213
 
263 214
                 "            \"signFields\": [\n" +
264 215
                 "                {\n" +
265
-
266
-//                "                    \"fileId\": \"5bd34a81e8084acaab3287c019e82fe8\",\n" +
267 216
                 "                    \"fileId\": \"" + fileId +  "\",\n" +
268 217
 
269 218
                 "                    \"normalSignFieldConfig\": {\n" +
@@ -272,13 +221,8 @@ public class SignAward {
272 221
 
273 222
                 "                        \"signFieldPosition\": {\n" +
274 223
 
275
-//                "                            \"positionPage\": \"2\",\n" +
276 224
                 "                            \"positionPage\": \"" + positionPageorg +  "\",\n" +
277
-
278
-//                "                            \"positionX\": 340.0,\n" +
279 225
                 "                            \"positionX\": " + positionXorg +  ",\n" +
280
-
281
-//                "                            \"positionY\": 340.736\n" +
282 226
                 "                            \"positionY\": " + positionYorg +  "\n" +
283 227
                 "                        },\n" +
284 228
                 "                        \"signFieldStyle\": 1\n" +
@@ -313,7 +257,6 @@ public class SignAward {
313 257
         String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
314 258
         String jsonParm = "{\n" +
315 259
                 "    \"operator\": {\n" +
316
-//                "        \"psnAccount\":\"18209231185\"\n" +
317 260
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
318 261
                 "    }\n" +
319 262
                 "}";
@@ -338,15 +281,11 @@ public class SignAward {
338 281
         String orgName = sealSignRecord.getOrgnizeName();
339 282
 
340 283
         String jsonParm = "{\n" +
341
-//                "    \"needLogin\": true,\n" +
342 284
                 "    \"operator\": {\n" +
343 285
 
344
-//                "        \"psnAccount\":\"17691338406\"\n" +
345 286
                 "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
346 287
                 "    },\n" +
347 288
                 "    \"organization\": {\n" +
348
-
349
-//                "        \"orgName\": \"西安云美电子科技有限公司\"\n" +
350 289
                 "        \"orgName\": \"" + orgName +  "\"\n" +
351 290
 
352 291
                 "    }\n" +

+ 2
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml Datei anzeigen

@@ -39,7 +39,8 @@
39 39
     <update id="updataSealSignRecord" parameterType="SealSignRecord">
40 40
         update seal_sign_record
41 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 44
         </set>
44 45
         where id = #{id}
45 46
     </update>