hejinbo 2 лет назад
Родитель
Сommit
94d3f1cb1e

+ 12
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java Просмотреть файл

@@ -13,6 +13,7 @@ import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
13 13
 import org.springframework.beans.factory.annotation.Autowired;
14 14
 import org.springframework.validation.annotation.Validated;
15 15
 import org.springframework.web.bind.annotation.*;
16
+import org.springframework.web.multipart.MultipartFile;
16 17
 
17 18
 import java.util.List;
18 19
 
@@ -49,6 +50,17 @@ public class DeptIdentifyController  extends BaseController {
49 50
         return deptIdentifyService.enableDept(deptIdentify);
50 51
     }
51 52
 
53
+    /**
54
+     * 上传自定义公章
55
+     * @param deptIdentify
56
+     * @param file
57
+     * @return
58
+     */
59
+    @PostMapping("sealUpload")
60
+    public AjaxResult  sealUpload(@Validated @RequestBody DeptIdentify deptIdentify
61
+            ,@RequestParam("file") MultipartFile file){
62
+        return deptIdentifyService.sealUpload(deptIdentify,file);
63
+    }
52 64
 
53 65
 
54 66
 

+ 1
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/SealUtil.java Просмотреть файл

@@ -80,9 +80,8 @@ public class SealUtil {
80 80
      *
81 81
      * @return
82 82
      */
83
-    public static EsignHttpResponse getFileUploadUrl() throws EsignDemoException {
83
+    public static EsignHttpResponse getFileUploadUrl(String filePath) throws EsignDemoException {
84 84
         //自定义的文件封装类,传入文件地址可以获取文件的名称大小,文件流等数据
85
-        String filePath = "D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg";
86 85
         EsignFileBean esignFileBean = new EsignFileBean(filePath);
87 86
         String apiaddr="/v3/files/file-key";
88 87
         //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java Просмотреть файл

@@ -42,5 +42,9 @@ public class  CaseAttach {
42 42
      * 用户账户
43 43
      */
44 44
     private String userName;
45
+    /**
46
+     * 印章状态(0未启用,1已启用)
47
+     */
48
+    private Integer sealStatus;
45 49
 
46 50
 }

+ 24
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java Просмотреть файл

@@ -2,7 +2,6 @@ package com.ruoyi.wisdomarbitrate.domain;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4 4
 import com.ruoyi.common.core.domain.BaseEntity;
5
-
6 5
 import java.util.Date;
7 6
 
8 7
 public class DeptIdentify   extends BaseEntity {
@@ -39,6 +38,30 @@ public class DeptIdentify   extends BaseEntity {
39 38
     /** 认证授权流程ID */
40 39
     private String authFlowId;
41 40
 
41
+    public String getSealId() {
42
+        return sealId;
43
+    }
44
+
45
+    public void setSealId(String sealId) {
46
+        this.sealId = sealId;
47
+    }
48
+
49
+    /** 印章id */
50
+    private String sealId;
51
+
52
+    /**
53
+     * 附件id
54
+     */
55
+    private Integer annexId;
56
+
57
+    public Integer getAnnexId() {
58
+        return annexId;
59
+    }
60
+
61
+    public void setAnnexId(Integer annexId) {
62
+        this.annexId = annexId;
63
+    }
64
+
42 65
     public String getAuthFlowId() {
43 66
         return authFlowId;
44 67
     }

+ 5
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service;
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4 4
 import com.ruoyi.common.exception.EsignDemoException;
5 5
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
6
+import org.springframework.web.multipart.MultipartFile;
6 7
 
7 8
 import java.util.List;
8 9
 
@@ -15,4 +16,8 @@ public interface IDeptIdentifyService {
15 16
     DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException;
16 17
 
17 18
     AjaxResult enableDept(DeptIdentify deptIdentify);
19
+
20
+    AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file);
21
+
22
+
18 23
 }

+ 68
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Просмотреть файл

@@ -1,18 +1,26 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.google.gson.Gson;
4 5
 import com.google.gson.JsonObject;
6
+import com.ruoyi.common.config.RuoYiConfig;
5 7
 import com.ruoyi.common.core.domain.AjaxResult;
6 8
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
7 9
 import com.ruoyi.common.exception.EsignDemoException;
10
+import com.ruoyi.common.utils.SealUtil;
11
+import com.ruoyi.common.utils.file.FileUploadUtils;
12
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
8 13
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
14
+import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
9 15
 import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
10 16
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
11 17
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
12 18
 import org.springframework.beans.factory.annotation.Autowired;
13 19
 import org.springframework.stereotype.Service;
14 20
 import org.springframework.transaction.annotation.Transactional;
21
+import org.springframework.web.multipart.MultipartFile;
15 22
 
23
+import java.io.IOException;
16 24
 import java.util.Date;
17 25
 import java.util.List;
18 26
 
@@ -21,19 +29,21 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
21 29
 
22 30
     @Autowired
23 31
     private DeptIdentifyMapper deptIdentifyMapper;
32
+    @Autowired
33
+    private CaseAttachMapper caseAttachMapper;
24 34
 
25 35
 
26 36
     @Override
27 37
     @Transactional
28 38
     public List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify) {
29 39
         List<DeptIdentify> deptIdentifys = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
30
-        if(deptIdentifys!=null&&deptIdentifys.size()>0){
40
+        if (deptIdentifys != null && deptIdentifys.size() > 0) {
31 41
             for (int i = 0; i < deptIdentifys.size(); i++) {
32 42
                 DeptIdentify deptIdentifyselect = deptIdentifys.get(i);
33 43
                 List<DeptIdentify> deptIdentifylist = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentifyselect);
34
-                if(deptIdentifylist!=null&&deptIdentifylist.size()>0){
44
+                if (deptIdentifylist != null && deptIdentifylist.size() > 0) {
35 45
                     continue;
36
-                }else {
46
+                } else {
37 47
                     deptIdentifyselect.setIdentifyStatus(0);
38 48
                     deptIdentifyMapper.insertDeptIdentify(deptIdentifyselect);
39 49
                 }
@@ -49,21 +59,21 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
49 59
     public DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException {
50 60
         List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
51 61
         DeptIdentify deptIdentifynew = new DeptIdentify();
52
-        if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){
62
+        if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
53 63
             Gson gson = new Gson();
54 64
             DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
55 65
             EsignHttpResponse identifyUrl = SignAward.deptIdentifyUrl(deptIdentifyselect);
56 66
             JsonObject signUrlJsonObject = gson.fromJson(identifyUrl.getBody(), JsonObject.class);
67
+            int code = signUrlJsonObject.get("code").getAsInt();
57 68
             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
58 69
             String url = signUrlData.get("authUrl").getAsString();
59 70
             //获取本次认证授权流程ID
60 71
             String authFlowId = signUrlData.get("authFlowId").getAsString();
61 72
             deptIdentify.setAuthFlowId(authFlowId);
62 73
             deptIdentifynew.setIdentifyUrl(url);
74
+            deptIdentify.setIdentifyDate(new Date());
75
+            int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
63 76
         }
64
-
65
-        deptIdentify.setIdentifyDate(new Date());
66
-        int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
67 77
         return deptIdentifynew;
68 78
     }
69 79
 
@@ -73,9 +83,9 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
73 83
         List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
74 84
         DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
75 85
         Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
76
-        if(identifyStatus.intValue()==0){
86
+        if (identifyStatus.intValue() == 0) {
77 87
             return AjaxResult.error("这个认证数据未进行认证,不能启用");
78
-        }else if(identifyStatus.intValue()==1){
88
+        } else if (identifyStatus.intValue() == 1) {
79 89
             deptIdentifyselect.setIsUse(1);
80 90
             deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
81 91
 
@@ -83,7 +93,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
83 93
             deptIdentifySel.setId(deptIdentify.getId());
84 94
             deptIdentifySel.setIdentifyStatus(1);
85 95
             List<DeptIdentify> deptIdentifysother = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentifySel);
86
-            if(deptIdentifysother!=null&&deptIdentifysother.size()>0){
96
+            if (deptIdentifysother != null && deptIdentifysother.size() > 0) {
87 97
                 for (int i = 0; i < deptIdentifysother.size(); i++) {
88 98
                     DeptIdentify deptIdentifyother = deptIdentifysother.get(i);
89 99
                     deptIdentifyother.setIsUse(0);
@@ -96,5 +106,53 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
96 106
 
97 107
     }
98 108
 
109
+    @Override
110
+    public AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file) {
111
+        try {
112
+            if (file.isEmpty()) {
113
+                return AjaxResult.error("请选择要上传的文件");
114
+            }
115
+            String filePath = RuoYiConfig.getUploadPath();
116
+            // 上传
117
+            String fileName = FileUploadUtils.upload(filePath, file);
118
+            List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentify);
119
+            if (deptIdentifies != null && deptIdentifies.size() > 0) {
120
+                for (DeptIdentify identify : deptIdentifies) {
121
+                    //先判断企业用户是否授予资源管理权限
122
+                    String authFlowId = identify.getAuthFlowId();
123
+                    EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
124
+                    JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
125
+                    int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus");
126
+                    if (authorizedStatus == 1){//授权流程状态 0流程过期失效  1已授权 2授权中  3审批未通过
127
+                        String prefix = "/profile";
128
+                        int startIndex = fileName.indexOf(prefix);
129
+                        startIndex += prefix.length();
130
+                        String annexPath = "/uploadPath" + fileName.substring(startIndex);
131
+                        //创建机构图片印章
132
+                        EsignHttpResponse response = SignAward.createOrgByImage(identify, annexPath);
133
+                        JSONObject jsonObject = JSONObject.parseObject(response.getBody());
134
+                        int code = jsonObject.getIntValue("code");
135
+                        if (code == 0) {  //业务码,0表示成功,非0表示异常。
136
+                            String sealId = jsonObject.getJSONObject("data").getString("sealId");
137
+                            identify.setSealId(sealId);
138
+                            identify.setIsUse(0);  //设置印章使用状态为未启用
139
+                            //保存到表里
140
+                            int i = deptIdentifyMapper.updateDeptIdentify(identify);
141
+                            if (i>0){
142
+                                return AjaxResult.success("上传成功");
143
+                            }
144
+                        }
145
+                    }
146
+                    return AjaxResult.error("企业用户未授予资源管理权限");
147
+                }
148
+            }
149
+        } catch (IOException e) {
150
+            e.printStackTrace();
151
+        } catch (EsignDemoException e) {
152
+            e.printStackTrace();
153
+        }
154
+            return AjaxResult.error();
155
+    }
156
+
99 157
 
100 158
 }

+ 116
- 39
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Просмотреть файл

@@ -1,5 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.utils;
2 2
 
3
+import com.alibaba.fastjson.JSONArray;
4
+import com.alibaba.fastjson.JSONObject;
3 5
 import com.google.gson.Gson;
4 6
 import com.google.gson.JsonArray;
5 7
 import com.google.gson.JsonObject;
@@ -42,7 +44,7 @@ public class FixSelectFlowDetailUtils {
42 44
 
43 45
     @Scheduled(cron = "0/10 * * * * ?")
44 46
     @Transactional
45
-    public void fixExecuteSelectFlowDetailUtils(){
47
+    public void fixExecuteSelectFlowDetailUtils() {
46 48
         Gson gson = new Gson();
47 49
 
48 50
         SealSignRecord sealSignRecordselect = new SealSignRecord();
@@ -50,40 +52,40 @@ public class FixSelectFlowDetailUtils {
50 52
         List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
51 53
 
52 54
         try {
53
-            if(sealSignRecords!=null&&sealSignRecords.size()>0){
55
+            if (sealSignRecords != null && sealSignRecords.size() > 0) {
54 56
                 for (int i = 0; i < sealSignRecords.size(); i++) {
55 57
                     SealSignRecord sealSignRecord = sealSignRecords.get(i);
56 58
                     EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
57
-                    JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
59
+                    JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
58 60
                     JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
59 61
                     JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
60 62
                     Integer psnsignStatus = null;
61 63
                     Integer orgsignStatus = null;
62 64
                     for (int j = 0; j < signersArray.size(); j++) {
63
-                        JsonObject signerObject = (JsonObject)signersArray.get(j);
65
+                        JsonObject signerObject = (JsonObject) signersArray.get(j);
64 66
 
65
-                        if(!(signerObject.get("psnSigner").toString()).equals("null")){
67
+                        if (!(signerObject.get("psnSigner").toString()).equals("null")) {
66 68
                             JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
67
-                            if(psnSignerData!=null){
69
+                            if (psnSignerData != null) {
68 70
                                 psnsignStatus = signerObject.get("signStatus").getAsInt();
69 71
                             }
70 72
                         }
71
-                        if(!(signerObject.get("orgSigner").toString()).equals("null")){
73
+                        if (!(signerObject.get("orgSigner").toString()).equals("null")) {
72 74
                             JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
73
-                            if(orgSignerData!=null){
75
+                            if (orgSignerData != null) {
74 76
                                 orgsignStatus = signerObject.get("signStatus").getAsInt();
75 77
                             }
76 78
                         }
77 79
 
78 80
                     }
79
-                    if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
81
+                    if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 1)) {
80 82
                         //更新立案申请状态为待用印
81 83
                         CaseApplication caseApplication = new CaseApplication();
82 84
                         caseApplication.setId(sealSignRecord.getCaseAppliId());
83 85
 
84 86
                         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
85
-                        if(caseApplicationselect!=null){
86
-                            if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION)){
87
+                        if (caseApplicationselect != null) {
88
+                            if ((caseApplicationselect.getCaseStatus() != null) && (caseApplicationselect.getCaseStatus().intValue() == CaseApplicationConstants.SIGN_ARBITRATION)) {
87 89
                                 caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
88 90
                                 caseApplicationMapper.submitCaseApplication(caseApplication);
89 91
 
@@ -94,30 +96,30 @@ public class FixSelectFlowDetailUtils {
94 96
                         }
95 97
 
96 98
                     }
97
-                    if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
99
+                    if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 2)) {
98 100
                         //更新立案申请状态为待送达
99 101
                         CaseApplication caseApplication = new CaseApplication();
100 102
                         caseApplication.setId(sealSignRecord.getCaseAppliId());
101 103
 
102 104
                         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
103
-                        if(caseApplicationselect!=null){
104
-                            if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL)){
105
+                        if (caseApplicationselect != null) {
106
+                            if ((caseApplicationselect.getCaseStatus() != null) && (caseApplicationselect.getCaseStatus().intValue() == CaseApplicationConstants.ARBITRATED_SEAL)) {
105 107
                                 caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
106 108
                                 //下载审核完成的裁决书,
107 109
                                 String signFlowId = sealSignRecord.getSignFlowid();
108 110
                                 EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
109
-                                JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
111
+                                JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
110 112
                                 JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
111 113
                                 JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
112
-                                if(filesArray!=null&&filesArray.size()>0){
113
-                                    JsonObject fileObject = (JsonObject)filesArray.get(0);
114
+                                if (filesArray != null && filesArray.size() > 0) {
115
+                                    JsonObject fileObject = (JsonObject) filesArray.get(0);
114 116
                                     String fileDownloadUrl = fileObject.get("downloadUrl").toString();
115 117
                                     //修改"签署用印记录表"的状态为签署完成
116 118
                                     sealSignRecord.setSignFlowStatus(3);
117
-                                    sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1));
119
+                                    sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1));
118 120
                                     sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
119 121
 
120
-                                    String filearbitraUrl  = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
122
+                                    String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
121 123
                                     caseApplication.setFilearbitraUrl(filearbitraUrl);
122 124
                                     caseApplicationMapper.submitCaseApplication(caseApplication);
123 125
 
@@ -136,22 +138,22 @@ public class FixSelectFlowDetailUtils {
136 138
                                         saveFolder.mkdirs();
137 139
                                     }
138 140
                                     String resultFilePath = saveFolderPath + "/" + fileName;
139
-                                    File resultFilePathFile  = new File(resultFilePath);
141
+                                    File resultFilePathFile = new File(resultFilePath);
140 142
                                     if (!resultFilePathFile.exists()) {
141 143
                                         resultFilePathFile.createNewFile();
142 144
                                     }
143 145
 
144
-                                   String fileDownloadUrlnew  = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
145
-                                   boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
146
-                                   if(downLoadFile) {
147
-                                       Long caseAppliId = sealSignRecord.getCaseAppliId();
148
-                                       CaseAttach caseAttach = new CaseAttach();
149
-                                       caseAttach.setCaseAppliId(caseAppliId);
150
-                                       caseAttach.setAnnexType(3);
151
-                                       caseAttach.setAnnexPath(savePath);
152
-                                       caseAttach.setAnnexName(saveName);
153
-                                       caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
154
-                                   }
146
+                                    String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
147
+                                    boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
148
+                                    if (downLoadFile) {
149
+                                        Long caseAppliId = sealSignRecord.getCaseAppliId();
150
+                                        CaseAttach caseAttach = new CaseAttach();
151
+                                        caseAttach.setCaseAppliId(caseAppliId);
152
+                                        caseAttach.setAnnexType(3);
153
+                                        caseAttach.setAnnexPath(savePath);
154
+                                        caseAttach.setAnnexName(saveName);
155
+                                        caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
156
+                                    }
155 157
 
156 158
                                 }
157 159
                             }
@@ -163,7 +165,7 @@ public class FixSelectFlowDetailUtils {
163 165
             }
164 166
         } catch (EsignDemoException e) {
165 167
             e.printStackTrace();
166
-        }catch (IOException e) {
168
+        } catch (IOException e) {
167 169
             e.printStackTrace();
168 170
         }
169 171
 
@@ -176,13 +178,13 @@ public class FixSelectFlowDetailUtils {
176 178
         DeptIdentify deptIdentify = new DeptIdentify();
177 179
         deptIdentify.setIdentifyStatus(0);
178 180
         List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
179
-        if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){
181
+        if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
180 182
             for (int i = 0; i < deptIdentifysnew.size(); i++) {
181 183
                 EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
182 184
                 JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
183 185
                 JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
184 186
                 int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
185
-                if(realnameStatus==1){
187
+                if (realnameStatus == 1) {
186 188
                     String orgId = identifyInfoData.get("orgId").getAsString();
187 189
                     EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
188 190
                     //将orgId保存到数据库里
@@ -192,15 +194,15 @@ public class FixSelectFlowDetailUtils {
192 194
                     JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
193 195
                     JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
194 196
                     String sealNames = "";
195
-                    if(sealArray.size()>0){
197
+                    if (sealArray.size() > 0) {
196 198
                         for (int j = 0; j < sealArray.size(); j++) {
197
-                            JsonObject sealObject = (JsonObject)sealArray.get(j);
199
+                            JsonObject sealObject = (JsonObject) sealArray.get(j);
198 200
                             String sealName = sealObject.get("sealName").toString();
199
-                            String sealNamenew = sealName.substring(1,sealName.length()-1);
200
-                            sealNames += sealNamenew +",";
201
+                            String sealNamenew = sealName.substring(1, sealName.length() - 1);
202
+                            sealNames += sealNamenew + ",";
201 203
                         }
202 204
                     }
203
-                    String sealName = sealNames.substring(0,sealNames.length()-1);
205
+                    String sealName = sealNames.substring(0, sealNames.length() - 1);
204 206
                     deptIdentifynew.setIdentifyStatus(1);
205 207
                     deptIdentifynew.setSealName(sealName);
206 208
                     int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
@@ -208,4 +210,79 @@ public class FixSelectFlowDetailUtils {
208 210
             }
209 211
         }
210 212
     }
213
+
214
+    /**
215
+     * 定时查询企业内部印章审核状态
216
+     *
217
+     * @throws EsignDemoException
218
+     */
219
+    @Scheduled(cron = "0/30 * * * * ?")
220
+    @Transactional
221
+    public void searchForInstitutionalSeal()  {
222
+        try {
223
+            DeptIdentify deptIdentify = new DeptIdentify();
224
+            deptIdentify.setIsUse(0);
225
+            List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
226
+            if (deptIdentifies != null && deptIdentifies.size() > 0) {
227
+                for (DeptIdentify identify : deptIdentifies) {
228
+                    //查询企业内部印章
229
+                    Integer annexId = identify.getAnnexId();
230
+                    if (annexId == null){
231
+                        //说明之前没有下载过
232
+                        EsignHttpResponse response = SignAward.orgOwnSealList(identify);
233
+                        JSONObject jsonObject = JSONObject.parseObject(response.getBody());
234
+                        JSONObject data = jsonObject.getJSONObject("data");
235
+                        JSONArray seals = data.getJSONArray("seals");
236
+                        for (int i = 0; i < seals.size(); i++){
237
+                            JSONObject seal = seals.getJSONObject(i);
238
+                            int statusDescription = seal.getIntValue("statusDescription");
239
+                            if (statusDescription==1){//印章状态 1已启用,2待审核,3审核不通过,4 挂起
240
+                                //已启用证明审核通过,下载到数据库
241
+                                String sealImageDownloadUrl = seal.getString("sealImageDownloadUrl");
242
+                                LocalDate now = LocalDate.now();
243
+                                String year = Integer.toString(now.getYear());
244
+                                String month = String.format("%02d", now.getMonthValue());
245
+                                String day = String.format("%02d", now.getDayOfMonth());
246
+                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
247
+                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
248
+                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
249
+                                String savePath = "/home/ruoyi/uploadPath/upload/";
250
+                                // 创建日期目录
251
+                                File saveFolder = new File(saveFolderPath);
252
+                                if (!saveFolder.exists()) {
253
+                                    saveFolder.mkdirs();
254
+                                }
255
+                                String resultFilePath = saveFolderPath + "/" + fileName;
256
+                                File resultFilePathFile = new File(resultFilePath);
257
+                                if (!resultFilePathFile.exists()) {
258
+                                    resultFilePathFile.createNewFile();
259
+                                }
260
+                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
261
+                                if (downLoadFile) {
262
+                                    CaseAttach caseAttach = new CaseAttach();
263
+                                    caseAttach.setAnnexType(10);  //10代表印章图片
264
+                                    caseAttach.setAnnexPath(savePath);
265
+                                    caseAttach.setAnnexName(saveName);
266
+                                    caseAttach.setSealStatus(1);  //1代表印章启用
267
+                                    int i1 = caseAttachMapper.save(caseAttach);
268
+                                    if (i1>0){
269
+                                        //将附件id保存到公章管理表里
270
+                                        Integer annexId1 = caseAttach.getAnnexId();
271
+                                        identify.setAnnexId(annexId1);
272
+                                        deptIdentifyMapper.updateDeptIdentify(identify);
273
+                                    }
274
+                                }
275
+                            }
276
+                        }
277
+                    }
278
+                }
279
+            }
280
+        } catch (EsignDemoException e) {
281
+            e.printStackTrace();
282
+        } catch (IOException e) {
283
+            e.printStackTrace();
284
+        }
285
+    }
211 286
 }
287
+
288
+

+ 109
- 65
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Просмотреть файл

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.utils;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.google.gson.Gson;
4 5
 import com.google.gson.JsonArray;
5 6
 import com.google.gson.JsonObject;
@@ -9,6 +10,7 @@ import com.ruoyi.common.exception.EsignDemoException;
9 10
 import com.ruoyi.common.utils.DateUtils;
10 11
 import com.ruoyi.common.utils.EsignApplicaConfig;
11 12
 import com.ruoyi.common.utils.EsignHttpHelper;
13
+import com.ruoyi.common.utils.SealUtil;
12 14
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
13 15
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
14 16
 
@@ -18,10 +20,9 @@ import java.util.Map;
18 20
 
19 21
 public class SignAward {
20 22
 
21
-    private static String eSignHost= EsignApplicaConfig.EsignHost;
22
-    private static String eSignAppId= EsignApplicaConfig.EsignAppId;
23
-    private static String eSignAppSecret= EsignApplicaConfig.EsignAppSecret;
24
-
23
+    private static String eSignHost = EsignApplicaConfig.EsignHost;
24
+    private static String eSignAppId = EsignApplicaConfig.EsignAppId;
25
+    private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
25 26
 
26 27
 
27 28
     public static void main(String[] args) throws EsignDemoException {
@@ -89,8 +90,6 @@ public class SignAward {
89 90
 //        System.out.println("机构印章名称:" +sealNames.substring(0,sealNames.length()-1));
90 91
 
91 92
 
92
-
93
-
94 93
         //查询签署流程详情
95 94
 //        EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord);
96 95
 //        JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
@@ -120,31 +119,30 @@ public class SignAward {
120 119
 //        System.out.println(signFlowDetailJsonObject);
121 120
 
122 121
 
123
-
124
-
125 122
     }
126 123
 
127 124
 
128
-
129 125
     /**
130 126
      * 查询签署流程详情
127
+     *
131 128
      * @return
132 129
      */
133 130
     public static EsignHttpResponse signFlowDetail(SealSignRecord sealSignRecord) throws EsignDemoException {
134 131
         String signFlowId = sealSignRecord.getSignFlowid();
135
-        String apiaddr= "/v3/sign-flow/"+ signFlowId + "/detail";
132
+        String apiaddr = "/v3/sign-flow/" + signFlowId + "/detail";
136 133
         String jsonParm = null;
137 134
         //请求方法
138 135
         EsignRequestType requestType = EsignRequestType.GET;
139 136
         //生成签名鉴权方式的的header
140
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
137
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
141 138
         //发起接口请求
142
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
139
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
143 140
     }
144 141
 
145 142
 
146 143
     /**
147 144
      * 发起签署
145
+     *
148 146
      * @return
149 147
      * @throws EsignDemoException
150 148
      */
@@ -174,8 +172,8 @@ public class SignAward {
174 172
         String jsonParm = "{\n" +
175 173
                 "    \"docs\": [\n" +
176 174
                 "        {\n" +
177
-                "            \"fileId\": \"" + fileId +  "\",\n" +
178
-                "            \"fileName\": \"" + fileName +  "\"\n" +
175
+                "            \"fileId\": \"" + fileId + "\",\n" +
176
+                "            \"fileName\": \"" + fileName + "\"\n" +
179 177
                 "        }\n" +
180 178
                 "    ],\n" +
181 179
                 "    \"signFlowConfig\": {\n" +
@@ -203,22 +201,22 @@ public class SignAward {
203 201
                 "    \"signers\": [\n" +
204 202
                 "          {\n" +
205 203
                 "            \"psnSignerInfo\": {\n" +
206
-                "                \"psnAccount\": \"" + psnAccount +  "\",\n" +
204
+                "                \"psnAccount\": \"" + psnAccount + "\",\n" +
207 205
                 "                \"psnInfo\": {\n" +
208
-                "                            \"psnName\": \"" + psnName +  "\"\n" +
206
+                "                            \"psnName\": \"" + psnName + "\"\n" +
209 207
                 "                        }\n" +
210 208
                 "            },\n" +
211 209
                 "            \"signFields\": [\n" +
212 210
                 "                {\n" +
213
-                "                    \"fileId\": \"" + fileId +  "\",\n" +
211
+                "                    \"fileId\": \"" + fileId + "\",\n" +
214 212
                 "                    \"normalSignFieldConfig\": {\n" +
215 213
                 "                        \"autoSign\": false,\n" +
216 214
                 "                        \"freeMode\": false,\n" +
217 215
                 "                        \"movableSignField\": false,\n" +
218 216
                 "                        \"signFieldPosition\": {\n" +
219
-                "                            \"positionPage\": \"" + positionPagepsn +  "\",\n" +
220
-                "                            \"positionX\": " + positionXpsn +  ",\n" +
221
-                "                            \"positionY\": " + positionYpsn +  "\n" +
217
+                "                            \"positionPage\": \"" + positionPagepsn + "\",\n" +
218
+                "                            \"positionX\": " + positionXpsn + ",\n" +
219
+                "                            \"positionY\": " + positionYpsn + "\n" +
222 220
                 "                        },\n" +
223 221
                 "                        \"signFieldStyle\": 1\n" +
224 222
                 "                    },\n" +
@@ -230,31 +228,31 @@ public class SignAward {
230 228
 
231 229
                 "        {\n" +
232 230
                 "            \"orgSignerInfo\": {\n" +
233
-                "                \"orgName\": \"" + orgName +  "\",\n" +
231
+                "                \"orgName\": \"" + orgName + "\",\n" +
234 232
                 "                \"transactorInfo\": {\n" +
235
-                "                \"psnAccount\": \"" + orgNamePsnAccount +  "\",\n" +
233
+                "                \"psnAccount\": \"" + orgNamePsnAccount + "\",\n" +
236 234
                 "                \"psnInfo\": {\n" +
237
-                "                            \"psnName\": \"" + orgNamepsnName +  "\"\n" +
235
+                "                            \"psnName\": \"" + orgNamepsnName + "\"\n" +
238 236
                 "                        }\n" +
239 237
                 "                }\n" +
240 238
                 "            },\n" +
241 239
 
242 240
                 "            \"signFields\": [\n" +
243 241
                 "                {\n" +
244
-                "                    \"fileId\": \"" + fileId +  "\",\n" +
242
+                "                    \"fileId\": \"" + fileId + "\",\n" +
245 243
                 "                    \"normalSignFieldConfig\": {\n" +
246 244
                 "                        \"autoSign\": false,\n" +
247 245
                 "                        \"freeMode\": false,\n" +
248 246
 
249 247
                 "                        \"availableSealIds\": [\n" +
250
-                "                               \"" + availableSealId +  "\"\n" +
248
+                "                               \"" + availableSealId + "\"\n" +
251 249
                 "                           ],\n" +
252 250
 
253 251
 
254 252
                 "                        \"signFieldPosition\": {\n" +
255
-                "                            \"positionPage\": \"" + positionPageorg +  "\",\n" +
256
-                "                            \"positionX\": " + positionXorg +  ",\n" +
257
-                "                            \"positionY\": " + positionYorg +  "\n" +
253
+                "                            \"positionPage\": \"" + positionPageorg + "\",\n" +
254
+                "                            \"positionX\": " + positionXorg + ",\n" +
255
+                "                            \"positionY\": " + positionYorg + "\n" +
258 256
                 "                        },\n" +
259 257
                 "                        \"signFieldStyle\": 1\n" +
260 258
                 "                    },\n" +
@@ -277,6 +275,7 @@ public class SignAward {
277 275
 
278 276
     /**
279 277
      * 获取合同文件签名链接
278
+     *
280 279
      * @return
281 280
      * @throws EsignDemoException
282 281
      */
@@ -291,7 +290,7 @@ public class SignAward {
291 290
                 "    \"clientType\": \"PC\",\n" +
292 291
 
293 292
                 "    \"operator\": {\n" +
294
-                "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
293
+                "        \"psnAccount\": \"" + psnAccount + "\"\n" +
295 294
                 "    }\n" +
296 295
                 "}";
297 296
         //请求方法
@@ -304,6 +303,7 @@ public class SignAward {
304 303
 
305 304
     /**
306 305
      * 获取合同文件用印链接
306
+     *
307 307
      * @return
308 308
      * @throws EsignDemoException
309 309
      */
@@ -317,10 +317,10 @@ public class SignAward {
317 317
         String jsonParm = "{\n" +
318 318
                 "    \"operator\": {\n" +
319 319
 
320
-                "        \"psnAccount\": \"" + psnAccount +  "\"\n" +
320
+                "        \"psnAccount\": \"" + psnAccount + "\"\n" +
321 321
                 "    },\n" +
322 322
                 "    \"organization\": {\n" +
323
-                "        \"orgName\": \"" + orgName +  "\"\n" +
323
+                "        \"orgName\": \"" + orgName + "\"\n" +
324 324
 
325 325
                 "    }\n" +
326 326
                 "}";
@@ -346,10 +346,10 @@ public class SignAward {
346 346
                 "    \"orgAuthConfig\": {\n" +
347 347
                 "        \"orgName\": \"" + deptName + " \",\n" +
348 348
                 "        \"transactorInfo\": {\n" +
349
-                "            \"psnAccount\": \"" + phonenumber +  "\",\n" +
349
+                "            \"psnAccount\": \"" + phonenumber + "\",\n" +
350 350
                 "            \"psnInfo\": {\n" +
351
-                "                \"psnName\": \"" + nickName +  "\",\n" +
352
-                "                 \"psnMobile\": \"" + phonenumber +  "\"\n" +
351
+                "                \"psnName\": \"" + nickName + "\",\n" +
352
+                "                 \"psnMobile\": \"" + phonenumber + "\"\n" +
353 353
                 "            }\n" +
354 354
                 "        }\n" +
355 355
                 "    },\n" +
@@ -377,36 +377,37 @@ public class SignAward {
377 377
      * 查询企业认证状态
378 378
      */
379 379
     public static EsignHttpResponse getDeptIdentifyInfo(DeptIdentify deptIdentify) throws EsignDemoException {
380
-        String apiaddr="/v3/organizations/identity-info?orgName="+deptIdentify.getDeptName();
380
+        String apiaddr = "/v3/organizations/identity-info?orgName=" + deptIdentify.getDeptName();
381 381
 
382
-        String jsonParm="{}";
382
+        String jsonParm = "{}";
383 383
         //请求方法
384
-        EsignRequestType requestType= EsignRequestType.GET;
384
+        EsignRequestType requestType = EsignRequestType.GET;
385 385
         //生成签名鉴权方式的的header
386
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
386
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
387 387
         //发起接口请求
388
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
388
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
389 389
     }
390
+
390 391
     /**
391 392
      * 查询企业认证印章信息
392 393
      */
393 394
     public static EsignHttpResponse deptIdentifySealList(String orgId) throws EsignDemoException {
394
-        int pageNum=1;
395
-        int pageSize=10;
396
-        String apiaddr="/v3/seals/org-own-seal-list?orgId="+orgId+"&pageNum="+pageNum+"&pageSize="+pageSize;
397
-        String jsonParm=null;
395
+        int pageNum = 1;
396
+        int pageSize = 10;
397
+        String apiaddr = "/v3/seals/org-own-seal-list?orgId=" + orgId + "&pageNum=" + pageNum + "&pageSize=" + pageSize;
398
+        String jsonParm = null;
398 399
         //请求方法
399
-        EsignRequestType requestType= EsignRequestType.GET;
400
+        EsignRequestType requestType = EsignRequestType.GET;
400 401
         //生成签名鉴权方式的的header
401
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
402
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
402 403
         //发起接口请求
403
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
404
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
404 405
     }
405 406
 
406 407
 
407
-
408 408
     /**
409 409
      * 获取文件签名印章位置
410
+     *
410 411
      * @return
411 412
      * @throws EsignDemoException
412 413
      */
@@ -432,27 +433,70 @@ public class SignAward {
432 433
      *
433 434
      * @return
434 435
      */
435
-    public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify) throws EsignDemoException {
436
-        String apiaddr = "/v3/seals/org-seals/create-by-image";
437
-        String orgId = deptIdentify.getOrgId();
438
-        String sealImageFileKey = "";
436
+    public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify, String filePath) throws EsignDemoException {
437
+        //获取认证授权流程ID
438
+        String authFlowId = deptIdentify.getAuthFlowId();
439
+        //查询认证授权流程详情
440
+        EsignHttpResponse response = SealUtil.queryAuthProcess(authFlowId);
441
+        String body = response.getBody();
442
+        if (body != null) {
443
+            JSONObject jsonObject = JSONObject.parseObject(body);
444
+            //查询授权流程状态
445
+            int authorizedStatus = jsonObject.getJSONObject("data").getIntValue("authorizedStatus");
446
+            if (authorizedStatus == 1) {//0 -流程过期失效  1 - 已授权  2 - 授权中  3 - 审批未通过
447
+                String apiaddr = "/v3/seals/org-seals/create-by-image";
448
+                String orgId = deptIdentify.getOrgId();
449
+                //上传印章图片
450
+                //步骤一:获取印章图片上传地址fileUploadUrl
451
+                EsignHttpResponse response1 = SealUtil.getFileUploadUrl(filePath);
452
+                JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
453
+                String fileUploadUrl = jsonObject1.getJSONObject("data").getString("fileUploadUrl");
454
+                //步骤二:将印章图片文件流上传到fileUploadUrl
455
+                EsignHttpResponse response2 = SealUtil.fileStreamUpload(fileUploadUrl, filePath);
456
+                JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
457
+                int errCode = jsonObject2.getIntValue("errCode");
458
+                if (errCode == 0){  //业务码,0表示成功,非0表示异常。
459
+                    //获取步骤一里面的fileKey
460
+                    String sealImageFileKey = jsonObject1.getJSONObject("data").getString("fileKey");
461
+                    String sealName = deptIdentify.getSealName();
462
+                    //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
463
+                    String jsonParm = "{\n" +
464
+                            "  \"orgId\": \"" + orgId + "\",\n" +
465
+                            "  \"sealImageFileKey\": \"" + sealImageFileKey + "\",\n" +
466
+                            "  \"sealName\": \"   " + sealName + "  \",\n" +
467
+                            "  \"sealWidth\": 50,\n" +
468
+                            "  \"sealHeight\": 50,\n" +
469
+                            "}";
470
+                    //请求方法
471
+                    EsignRequestType requestType = EsignRequestType.POST;
472
+                    //生成签名鉴权方式的的header
473
+                    Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
474
+                    //发起接口请求
475
+                    return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
476
+                }
477
+            }
478
+        }
479
+        return null;
480
+    }
481
+
482
+    /**
483
+     * 查询企业内部印章
484
+     */
485
+
486
+    public static EsignHttpResponse orgOwnSealList(DeptIdentify deptIdentify) throws EsignDemoException {
487
+        String orgId=deptIdentify.getOrgId();
488
+        int pageNum=1;
489
+        int pageSize=20;
490
+
491
+        String apiaddr="/v3/seals/org-own-seal-list?orgId="+orgId+"&pageNum="+pageNum+"&pageSize="+pageSize;
492
+
439 493
         //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
440
-        String jsonParm = "{\n" +
441
-                "  \"orgId\": \"" + orgId + "\",\n" +
442
-                "  \"sealImageFileKey\": \"" + sealImageFileKey + "\",\n" +
443
-                "  \"sealName\": \"企业公章1\",\n" +
444
-                "  \"sealWidth\": 50,\n" +
445
-                "  \"sealHeight\": 50,\n" +
446
-                "}";
494
+        String jsonParm=null;
447 495
         //请求方法
448
-        EsignRequestType requestType = EsignRequestType.POST;
496
+        EsignRequestType requestType= EsignRequestType.GET;
449 497
         //生成签名鉴权方式的的header
450
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
498
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
451 499
         //发起接口请求
452
-        EsignHttpResponse response = EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
453
-        System.out.println(response);
454
-        return response;
500
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
455 501
     }
456
-
457
-
458 502
 }

+ 3
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Просмотреть файл

@@ -12,10 +12,11 @@
12 12
         <result property="note"     column="note"    />
13 13
         <result property="userId"     column="use_id"    />
14 14
         <result property="userName"     column="use_account"    />
15
+        <result property="sealStatus"     column="seal_status"    />
15 16
     </resultMap>
16 17
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
17
-        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
18
-        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
18
+        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
19
+        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
19 20
     </insert>
20 21
     <delete id="deleteByFileIds">
21 22
         delete from case_attach

+ 7
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml Просмотреть файл

@@ -14,6 +14,9 @@
14 14
         <result property="phonenumber"       column="phonenumber"       />
15 15
         <result property="deptName"     column="dept_name"     />
16 16
         <result property="sealName"     column="seal_name"     />
17
+        <result property="orgId"     column="org_id"     />
18
+        <result property="authFlowId"     column="auth_flow_id"     />
19
+        <result property="sealId"     column="seal_id"     />
17 20
 
18 21
     </resultMap>
19 22
 
@@ -28,7 +31,7 @@
28 31
     </select>
29 32
 
30 33
     <select id="selectDeptIdentifyBydeptid" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
31
-        SELECT d.id ,d.dept_id ,d.user_id
34
+        SELECT d.id ,d.dept_id ,d.user_id ,d.org_id ,d.auth_flow_id
32 35
         from dept_identify d
33 36
         <where>
34 37
             <if test="deptId != null">
@@ -53,8 +56,8 @@
53 56
     </insert>
54 57
 
55 58
     <select id="selectDeptIdentifylist" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
56
-        SELECT  d.id ,d.dept_id ,d.user_id, d.identify_status ,d.identify_date ,d.is_use , d.seal_name,  sd.dept_name ,
57
-            u.nick_name ,u.phonenumber
59
+        SELECT  d.id ,d.dept_id ,d.user_id, d.identify_status ,d.identify_date ,d.is_use , d.seal_name,
60
+               d.org_id , d.seal_id ,sd.dept_name , u.nick_name ,u.phonenumber
58 61
         from dept_identify d left join sys_dept sd on d.dept_id  = sd.dept_id
59 62
         left join sys_user u on u.user_id  = d.user_id
60 63
         <where>
@@ -90,6 +93,7 @@
90 93
             <if test="isUse != null">is_use = #{isUse},</if>
91 94
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
92 95
             <if test="sealName != null  and sealName != ''">seal_name = #{sealName},</if>
96
+            <if test="sealId != null  and sealId != ''">seal_id = #{sealId},</if>
93 97
         </set>
94 98
         where id = #{id}
95 99
     </update>