hejinbo 2 gadus atpakaļ
vecāks
revīzija
4cf4fa6f5c

+ 41
- 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java Parādīt failu

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.ruoyi.common.annotation.Log;
4 5
 import com.ruoyi.common.core.controller.BaseController;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -9,6 +10,8 @@ import com.ruoyi.common.exception.EsignDemoException;
9 10
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10 11
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
11 12
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
13
+import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
14
+import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
12 15
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
13 16
 import org.springframework.beans.factory.annotation.Autowired;
14 17
 import org.springframework.validation.annotation.Validated;
@@ -19,7 +22,7 @@ import java.util.List;
19 22
 
20 23
 @RestController
21 24
 @RequestMapping("/deptIdentify")
22
-public class DeptIdentifyController  extends BaseController {
25
+public class DeptIdentifyController extends BaseController {
23 26
     @Autowired
24 27
     private IDeptIdentifyService deptIdentifyService;
25 28
 
@@ -52,17 +55,49 @@ public class DeptIdentifyController  extends BaseController {
52 55
 
53 56
     /**
54 57
      * 上传自定义公章
58
+     *
55 59
      * @param deptIdentify
56 60
      * @param file
57 61
      * @return
58 62
      */
59
-    @PostMapping("sealUpload")
60
-    public AjaxResult  sealUpload(@Validated @RequestBody DeptIdentify deptIdentify
61
-            ,@RequestParam("file") MultipartFile file){
62
-        return deptIdentifyService.sealUpload(deptIdentify,file);
63
+    @PostMapping("/sealUpload")
64
+    public AjaxResult sealUpload(@Validated @RequestBody DeptIdentify deptIdentify
65
+            , @RequestParam("file") MultipartFile file) {
66
+        return deptIdentifyService.sealUpload(deptIdentify, file);
63 67
     }
64 68
 
69
+    /**
70
+     * 接收E签宝回调通知
71
+     * @param body
72
+     * @return
73
+     */
74
+    @GetMapping("/notify")
75
+    public AjaxResult receiveNotify(String body) {
76
+        return deptIdentifyService.receiveNotify(body);
77
+    }
65 78
 
79
+    /**
80
+     * 签章图片列表查询
81
+     * @param deptIdentify
82
+     * @return
83
+     */
84
+    @GetMapping("/sealList")
85
+    public TableDataInfo getSealList(DeptIdentify deptIdentify){
86
+        startPage();
87
+        List<SealListVO> list = deptIdentifyService.getSealList(deptIdentify);
88
+        return getDataTable(list);
89
+    }
66 90
 
67
-
91
+    /**
92
+     * 印章启用或者禁用
93
+     * @param deptIdentify
94
+     * @return
95
+     */
96
+    @PostMapping("/updateSealLockStatus")
97
+    public AjaxResult updateSealLockStatus(@Validated @RequestBody DeptIdentify deptIdentify){
98
+        if(deptIdentify.getSealId()==null ||deptIdentify.getSealStatus()==null){
99
+            return error("参数校验失败");
100
+        }
101
+        return deptIdentifyService.updateSealLockStatus(deptIdentify);
102
+    }
68 103
 }

+ 1
- 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java Parādīt failu

@@ -82,7 +82,7 @@ public class SaaSAPIFileUtils {
82 82
         //生成签名鉴权方式的的header
83 83
         Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
84 84
         //发起接口请求
85
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
85
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
86 86
     }
87 87
 
88 88
 

+ 1
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java Parādīt failu

@@ -42,9 +42,6 @@ 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 47
 }

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java Parādīt failu

@@ -53,6 +53,10 @@ public class DeptIdentify   extends BaseEntity {
53 53
      * 附件id
54 54
      */
55 55
     private Integer annexId;
56
+    /**
57
+     * 印章状态  0禁用,1启用
58
+     */
59
+    private Integer sealStatus;
56 60
 
57 61
     public Integer getAnnexId() {
58 62
         return annexId;
@@ -168,4 +172,12 @@ public class DeptIdentify   extends BaseEntity {
168 172
     public void setIsUse(Integer isUse) {
169 173
         this.isUse = isUse;
170 174
     }
175
+
176
+    public Integer getSealStatus() {
177
+        return sealStatus;
178
+    }
179
+
180
+    public void setSealStatus(Integer sealStatus) {
181
+        this.sealStatus = sealStatus;
182
+    }
171 183
 }

+ 27
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SealListVO.java Parādīt failu

@@ -0,0 +1,27 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.Data;
4
+
5
+@Data
6
+public class SealListVO {
7
+    /** 印章id */
8
+    private String sealId;
9
+    /** 印章名称 */
10
+    private String sealName;
11
+    /**
12
+     * 印章状态  0禁用,1启用
13
+     */
14
+    private Integer sealStatus;
15
+    /**
16
+     * 附件id
17
+     */
18
+    private Integer annexId;
19
+    /**
20
+     * 附件路径
21
+     */
22
+    private String annexPath;
23
+    /**
24
+     * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)'
25
+     */
26
+    private Integer annexType;
27
+}

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java Parādīt failu

@@ -23,4 +23,6 @@ public interface CaseAttachMapper {
23 23
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24 24
 
25 25
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
+
27
+    CaseAttach queryAnnexById(Integer annexId);
26 28
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/DeptIdentifyMapper.java Parādīt failu

@@ -19,4 +19,5 @@ public interface DeptIdentifyMapper {
19 19
     int updateDeptIdentify(DeptIdentify deptIdentify);
20 20
 
21 21
     List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
22
+
22 23
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java Parādīt failu

@@ -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 com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
6 7
 import org.springframework.web.multipart.MultipartFile;
7 8
 
8 9
 import java.util.List;
@@ -20,4 +21,11 @@ public interface IDeptIdentifyService {
20 21
     AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file);
21 22
 
22 23
 
24
+    AjaxResult receiveNotify(String body);
25
+
26
+    List<SealListVO> getSealList(DeptIdentify deptIdentify);
27
+
28
+    AjaxResult updateSealLockStatus(DeptIdentify deptIdentify);
29
+
30
+
23 31
 }

+ 30
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Parādīt failu

@@ -106,6 +106,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
106 106
     private DeptIdentifyMapper deptIdentifyMapper;
107 107
     @Autowired
108 108
     private ReservedConferenceMapper reservedConferenceMapper;
109
+    @Autowired
110
+    private SysDeptMapper deptMapper;
109 111
     // 手机号正则
110 112
     private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
111 113
 
@@ -1746,7 +1748,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1746 1748
                                                 }
1747 1749
                                             }
1748 1750
                                         }
1749
-                                        EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord);
1751
+                                        DeptIdentify deptIdentify1 = new DeptIdentify();
1752
+                                        deptIdentify1.setSealStatus(1); // 印章状态为启用
1753
+                                        //根据机构名称查询部门id
1754
+                                        SysDept sysDept = new SysDept();
1755
+                                        sysDept.setDeptName(sealSignRecord.getOrgnizeName());
1756
+                                        List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
1757
+                                        if (sysDepts != null && sysDepts.size() > 0) {
1758
+                                            Long deptId = sysDepts.get(0).getDeptId();
1759
+                                            deptIdentify1.setDeptId(deptId);
1760
+                                        }
1761
+                                        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
1762
+                                        List<String> sealIds = new ArrayList<>();
1763
+                                        if (deptIdentifies != null && deptIdentifies.size() > 0) {
1764
+                                            for (DeptIdentify identify : deptIdentifies) {
1765
+                                                String sealId = identify.getSealId();
1766
+                                                sealIds.add(sealId);
1767
+                                            }
1768
+                                        }
1769
+                                        EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord,sealIds);
1750 1770
                                         JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1751 1771
                                         if (jsonObject3.getIntValue("code") == 0) {
1752 1772
                                             //获取签署流程ID
@@ -1881,7 +1901,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1881 1901
         request.setTemplateId("1952136");
1882 1902
         for (CaseAffiliate caseAffiliate : caseAffiliates) {
1883 1903
             request.setPhone(caseAffiliate.getContactTelphone());
1884
-            request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()+caseAffiliate.getUserId()});
1904
+            request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + caseAffiliate.getUserId()});
1885 1905
             // 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
1886 1906
             Boolean aBoolean = SmsUtils.sendSms(request);
1887 1907
             //保存短信发送记录
@@ -1890,7 +1910,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1890 1910
             smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
1891 1911
             smsSendRecord.setPhone(request.getPhone());
1892 1912
             smsSendRecord.setSendTime(new Date());
1893
-            String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo()+caseAffiliate.getUserId() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
1913
+            String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + caseAffiliate.getUserId() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
1894 1914
             smsSendRecord.setSendContent(content);
1895 1915
 
1896 1916
             String userName;
@@ -1909,6 +1929,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1909 1929
         }
1910 1930
         return returnResult;
1911 1931
     }
1932
+
1912 1933
     @Override
1913 1934
     public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException {
1914 1935
         SealSignRecord sealSignRecord = new SealSignRecord();
@@ -2452,10 +2473,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2452 2473
 
2453 2474
     /**
2454 2475
      * 获取userSign,默认过期时间10小时
2476
+     *
2455 2477
      * @param userId
2456 2478
      * @return
2457 2479
      */
2458
-    public String generateUserSign(String userId){
2480
+    public String generateUserSign(String userId) {
2459 2481
         TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey);
2460 2482
         return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
2461 2483
     }
@@ -2463,6 +2485,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2463 2485
 
2464 2486
     /**
2465 2487
      * 预约会议
2488
+     *
2466 2489
      * @param reservedConferenceVO
2467 2490
      * @return
2468 2491
      * @throws Exception
@@ -2480,7 +2503,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2480 2503
         Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
2481 2504
         Random rand = new Random();
2482 2505
         int random = rand.nextInt(214748365);
2483
-        String url="https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" +random + "&contenttype=json";
2506
+        String url = "https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" + random + "&contenttype=json";
2484 2507
         HttpPost post = new HttpPost(url);
2485 2508
         String result = "";
2486 2509
         //添加参数
@@ -2489,7 +2512,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2489 2512
         bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
2490 2513
         bodyParams.put("roomId", reservedConferenceVO.getRoomId());
2491 2514
         bodyParams.put("scheduleStartTime", scheduleStartTime);
2492
-        bodyParams.put("scheduleEndTime",scheduleEndTime);
2515
+        bodyParams.put("scheduleEndTime", scheduleEndTime);
2493 2516
         roomParams.put("roomType", 1);
2494 2517
         bodyParams.put("roomInfo", roomParams);
2495 2518
         StringEntity postingString = new StringEntity(bodyParams.toString());
@@ -2536,6 +2559,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2536 2559
 
2537 2560
     /**
2538 2561
      * 销毁房间回调
2562
+     *
2539 2563
      * @param body
2540 2564
      * @param request
2541 2565
      */

+ 120
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Parādīt failu

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
4 4
 import com.google.gson.Gson;
5 5
 import com.google.gson.JsonObject;
6 6
 import com.ruoyi.common.config.RuoYiConfig;
7
+import com.ruoyi.common.constant.FileTransformation;
7 8
 import com.ruoyi.common.core.domain.AjaxResult;
8 9
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
9 10
 import com.ruoyi.common.exception.EsignDemoException;
@@ -11,6 +12,7 @@ import com.ruoyi.common.utils.SealUtil;
11 12
 import com.ruoyi.common.utils.file.FileUploadUtils;
12 13
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
13 14
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
15
+import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
14 16
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
15 17
 import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
16 18
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
@@ -20,9 +22,13 @@ import org.springframework.stereotype.Service;
20 22
 import org.springframework.transaction.annotation.Transactional;
21 23
 import org.springframework.web.multipart.MultipartFile;
22 24
 
25
+import java.io.File;
23 26
 import java.io.IOException;
27
+import java.time.LocalDate;
28
+import java.util.ArrayList;
24 29
 import java.util.Date;
25 30
 import java.util.List;
31
+import java.util.UUID;
26 32
 
27 33
 @Service
28 34
 public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
@@ -123,7 +129,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
123 129
                     EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
124 130
                     JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
125 131
                     int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus");
126
-                    if (authorizedStatus == 1){//授权流程状态 0流程过期失效  1已授权 2授权中  3审批未通过
132
+                    if (authorizedStatus == 1) {//授权流程状态 0流程过期失效  1已授权 2授权中  3审批未通过
127 133
                         String prefix = "/profile";
128 134
                         int startIndex = fileName.indexOf(prefix);
129 135
                         startIndex += prefix.length();
@@ -138,7 +144,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
138 144
                             identify.setIsUse(0);  //设置印章使用状态为未启用
139 145
                             //保存到表里
140 146
                             int i = deptIdentifyMapper.updateDeptIdentify(identify);
141
-                            if (i>0){
147
+                            if (i > 0) {
142 148
                                 return AjaxResult.success("上传成功");
143 149
                             }
144 150
                         }
@@ -151,8 +157,119 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
151 157
         } catch (EsignDemoException e) {
152 158
             e.printStackTrace();
153 159
         }
154
-            return AjaxResult.error();
160
+        return AjaxResult.error();
155 161
     }
156 162
 
163
+    @Override
164
+    public AjaxResult receiveNotify(String body) {
165
+      /* 请求Body数据格式如下:
166
+        {
167
+                "action":"SEAL_AUDIT",
168
+                "auditStatus":1,
169
+                "psnId":"c7e00294**41e7",
170
+                "rejectReason":"",
171
+                "sealBizType":"COMMON",
172
+                "sealId":"af80ba0f-xx-xx-xx-a2da292d7f7f",
173
+                "sealName":"赵四的图片印章",
174
+                "statusDescription":"通过"
175
+        }*/
176
+        //解析body数据
177
+        try {
178
+            JSONObject jsonObject = JSONObject.parseObject(body);
179
+            String action = jsonObject.getString("action");
180
+            if (action.equals("SEAL_AUDIT")) {  //SEAL_AUDIT表示图片印章审核结果通知
181
+                String auditStatus = jsonObject.getString("auditStatus");
182
+                if (auditStatus.equals("1")) {   //图片印章审核结果   1通过 ,0驳回
183
+                    //审核通过,拿到印章id和机构账号ID
184
+                    String orgId = jsonObject.getString("orgId");
185
+                    String sealId = jsonObject.getString("sealId");
186
+                    //查询指定印章详情(机构)
187
+                    EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
188
+                    JSONObject jsonObject1 = JSONObject.parseObject(response.getBody());
189
+                    if (jsonObject1.getIntValue("code") == 0) {  //业务码,0表示成功,非0表示异常。
190
+                        int sealStatus = jsonObject1.getJSONObject("data").getIntValue("sealStatus");
191
+                        if (sealStatus == 1) {         //印章状态 1已启用,2待审核,3审核不通过,4 挂起
192
+                            String sealImageDownloadUrl = jsonObject1.getString("sealImageDownloadUrl");
193
+                            LocalDate now = LocalDate.now();
194
+                            String year = Integer.toString(now.getYear());
195
+                            String month = String.format("%02d", now.getMonthValue());
196
+                            String day = String.format("%02d", now.getDayOfMonth());
197
+                            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
198
+                            String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
199
+                            String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
200
+                            String savePath = "/home/ruoyi/uploadPath/upload/";
201
+                            // 创建日期目录
202
+                            File saveFolder = new File(saveFolderPath);
203
+                            if (!saveFolder.exists()) {
204
+                                saveFolder.mkdirs();
205
+                            }
206
+                            String resultFilePath = saveFolderPath + "/" + fileName;
207
+                            File resultFilePathFile = new File(resultFilePath);
208
+                            if (!resultFilePathFile.exists()) {
209
+                                resultFilePathFile.createNewFile();
210
+                            }
211
+                            boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
212
+                            if (downLoadFile) {
213
+                                CaseAttach caseAttach = new CaseAttach();
214
+                                caseAttach.setAnnexType(10);  //10代表印章图片
215
+                                caseAttach.setAnnexPath(savePath);
216
+                                caseAttach.setAnnexName(saveName);
217
+                                int i1 = caseAttachMapper.save(caseAttach);
218
+                                if (i1 > 0) {
219
+                                    //将附件id保存到公章管理表里
220
+                                    Integer annexId1 = caseAttach.getAnnexId();
221
+                                    DeptIdentify identify = new DeptIdentify();
222
+                                    identify.setSealId(sealId);
223
+                                    List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(identify);
224
+                                    if (deptIdentifies != null && deptIdentifies.size() > 0) {
225
+                                        DeptIdentify identify1 = deptIdentifies.get(0);
226
+                                        identify1.setAnnexId(annexId1);
227
+                                        identify1.setSealStatus(1);  //启用
228
+                                        deptIdentifyMapper.updateDeptIdentify(identify1);
229
+                                    }
230
+                                }
231
+                            }
232
+                        }
233
+                    }
234
+                }
235
+            }
236
+        } catch (EsignDemoException e) {
237
+            e.printStackTrace();
238
+        } catch (IOException e) {
239
+            e.printStackTrace();
240
+        }
241
+        return new AjaxResult(200, "success");
242
+    }
157 243
 
244
+    @Override
245
+    public List<SealListVO> getSealList(DeptIdentify deptIdentify) {
246
+        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify);
247
+        List<SealListVO> sealListVOS = new ArrayList<>();
248
+        if (deptIdentifies != null && deptIdentifies.size() > 0) {
249
+            for (DeptIdentify identify : deptIdentifies) {
250
+                SealListVO sealListVO = new SealListVO();
251
+                sealListVO.setSealId(identify.getSealId());
252
+                sealListVO.setSealName(identify.getSealName());
253
+                sealListVO.setSealStatus(identify.getSealStatus());
254
+                Integer annexId = identify.getAnnexId();
255
+                //根据附件id查询路径
256
+                CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId);
257
+                String annexName = caseAttach.getAnnexName();
258
+                String prefix = "/profile";
259
+                int startIndex = annexName.indexOf(prefix);
260
+                startIndex += prefix.length();
261
+                String annexPath = "/uploadPath" + annexName.substring(startIndex);
262
+                sealListVO.setAnnexPath(annexPath);
263
+                sealListVO.setAnnexType(caseAttach.getAnnexType());
264
+                sealListVOS.add(sealListVO);
265
+            }
266
+        }
267
+        return sealListVOS;
268
+    }
269
+
270
+    @Override
271
+    public AjaxResult updateSealLockStatus(DeptIdentify deptIdentify) {
272
+        deptIdentifyMapper.updateDeptIdentify(deptIdentify);
273
+        return AjaxResult.success();
274
+    }
158 275
 }

+ 1
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Parādīt failu

@@ -216,7 +216,7 @@ public class FixSelectFlowDetailUtils {
216 216
      *
217 217
      * @throws EsignDemoException
218 218
      */
219
-    @Scheduled(cron = "0/30 * * * * ?")
219
+   // @Scheduled(cron = "0/30 * * * * ?")
220 220
     @Transactional
221 221
     public void searchForInstitutionalSeal()  {
222 222
         try {
@@ -263,7 +263,6 @@ public class FixSelectFlowDetailUtils {
263 263
                                     caseAttach.setAnnexType(10);  //10代表印章图片
264 264
                                     caseAttach.setAnnexPath(savePath);
265 265
                                     caseAttach.setAnnexName(saveName);
266
-                                    caseAttach.setSealStatus(1);  //1代表印章启用
267 266
                                     int i1 = caseAttachMapper.save(caseAttach);
268 267
                                     if (i1>0){
269 268
                                         //将附件id保存到公章管理表里

+ 39
- 23
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Parādīt failu

@@ -16,6 +16,7 @@ import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
16 16
 
17 17
 import java.io.File;
18 18
 import java.util.Date;
19
+import java.util.List;
19 20
 import java.util.Map;
20 21
 
21 22
 public class SignAward {
@@ -134,9 +135,9 @@ public class SignAward {
134 135
         //请求方法
135 136
         EsignRequestType requestType = EsignRequestType.GET;
136 137
         //生成签名鉴权方式的的header
137
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
138
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
138 139
         //发起接口请求
139
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
140
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
140 141
     }
141 142
 
142 143
 
@@ -146,7 +147,7 @@ public class SignAward {
146 147
      * @return
147 148
      * @throws EsignDemoException
148 149
      */
149
-    public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException {
150
+    public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord, List<String> sealIds) throws EsignDemoException {
150 151
         String apiaddr = "/v3/sign-flow/create-by-file";
151 152
 
152 153
         String fileId = sealSignRecord.getFileid();
@@ -167,7 +168,6 @@ public class SignAward {
167 168
         double positionXorg = sealSignRecord.getPositionXorg();
168 169
         double positionYorg = sealSignRecord.getPositionYorg();
169 170
 
170
-        String availableSealId = "209af82b-5f87-4e0a-b0d8-cc4923b6e652";
171 171
 
172 172
         String jsonParm = "{\n" +
173 173
                 "    \"docs\": [\n" +
@@ -245,7 +245,7 @@ public class SignAward {
245 245
                 "                        \"freeMode\": false,\n" +
246 246
 
247 247
                 "                        \"availableSealIds\": [\n" +
248
-                "                               \"" + availableSealId + "\"\n" +
248
+                "                               \"" + sealIds + "\"\n" +
249 249
                 "                           ],\n" +
250 250
 
251 251
 
@@ -268,9 +268,9 @@ public class SignAward {
268 268
         //请求方法
269 269
         EsignRequestType requestType = EsignRequestType.POST;
270 270
         //生成请求签名鉴权方式的Header
271
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
271
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
272 272
         //发起接口请求
273
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
273
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
274 274
     }
275 275
 
276 276
     /**
@@ -296,9 +296,9 @@ public class SignAward {
296 296
         //请求方法
297 297
         EsignRequestType requestType = EsignRequestType.POST;
298 298
         //生成请求签名鉴权方式的Header
299
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
299
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
300 300
         //发起接口请求
301
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
301
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
302 302
     }
303 303
 
304 304
     /**
@@ -327,9 +327,9 @@ public class SignAward {
327 327
         //请求方法
328 328
         EsignRequestType requestType = EsignRequestType.POST;
329 329
         //生成请求签名鉴权方式的Header
330
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
330
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
331 331
         //发起接口请求
332
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
332
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
333 333
     }
334 334
 
335 335
     /**
@@ -368,9 +368,9 @@ public class SignAward {
368 368
         //请求方法
369 369
         EsignRequestType requestType = EsignRequestType.POST;
370 370
         //生成请求签名鉴权方式的Header
371
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
371
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
372 372
         //发起接口请求
373
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
373
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
374 374
     }
375 375
 
376 376
     /**
@@ -383,9 +383,9 @@ public class SignAward {
383 383
         //请求方法
384 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, false);
387 387
         //发起接口请求
388
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
388
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
389 389
     }
390 390
 
391 391
     /**
@@ -399,9 +399,9 @@ public class SignAward {
399 399
         //请求方法
400 400
         EsignRequestType requestType = EsignRequestType.GET;
401 401
         //生成签名鉴权方式的的header
402
-        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, false);
403 403
         //发起接口请求
404
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
404
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
405 405
     }
406 406
 
407 407
 
@@ -423,9 +423,9 @@ public class SignAward {
423 423
         //请求方法
424 424
         EsignRequestType requestType = EsignRequestType.POST;
425 425
         //生成请求签名鉴权方式的Header
426
-        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
426
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
427 427
         //发起接口请求
428
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
428
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
429 429
     }
430 430
 
431 431
     /**
@@ -470,9 +470,9 @@ public class SignAward {
470 470
                     //请求方法
471 471
                     EsignRequestType requestType = EsignRequestType.POST;
472 472
                     //生成签名鉴权方式的的header
473
-                    Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
473
+                    Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
474 474
                     //发起接口请求
475
-                    return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
475
+                    return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
476 476
                 }
477 477
             }
478 478
         }
@@ -495,8 +495,24 @@ public class SignAward {
495 495
         //请求方法
496 496
         EsignRequestType requestType= EsignRequestType.GET;
497 497
         //生成签名鉴权方式的的header
498
-        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,false);
499 499
         //发起接口请求
500
-        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
500
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
501
+    }
502
+    /**
503
+     * 查询指定印章详情(机构)
504
+     */
505
+
506
+    public static EsignHttpResponse getOrgSeal(String orgId,String sealId) throws EsignDemoException {
507
+        String apiaddr="/v3/seals/org-seal-info?orgId="+orgId+"&sealId="+sealId;
508
+
509
+        //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
510
+        String jsonParm=null;
511
+        //请求方法
512
+        EsignRequestType requestType= EsignRequestType.GET;
513
+        //生成签名鉴权方式的的header
514
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,false);
515
+        //发起接口请求
516
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
501 517
     }
502 518
 }

+ 9
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Parādīt failu

@@ -63,6 +63,15 @@
63 63
             </if>
64 64
         </where>
65 65
     </select>
66
+    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach">
67
+        select annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
68
+        from case_attach
69
+        <where>
70
+            <if test="annexId != null ">
71
+                AND annex_id = #{annexId}
72
+            </if>
73
+        </where>
74
+    </select>
66 75
 
67 76
     <update id="updateCaseAttach" parameterType="CaseAttach">
68 77
         update case_attach

+ 19
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml Parādīt failu

@@ -17,6 +17,7 @@
17 17
         <result property="orgId"     column="org_id"     />
18 18
         <result property="authFlowId"     column="auth_flow_id"     />
19 19
         <result property="sealId"     column="seal_id"     />
20
+        <result property="sealStatus"     column="seal_status"     />
20 21
 
21 22
     </resultMap>
22 23
 
@@ -74,18 +75,25 @@
74 75
     </select>
75 76
 
76 77
     <select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
77
-        SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use
78
+        SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use ,d.sealName ,d.sealId ,d.annexId
78 79
         from dept_identify d
79 80
         <where>
80 81
             <if test="identifyStatus != null">
81 82
                 AND d.identify_status = #{identifyStatus}
82 83
             </if>
83 84
             <if test="id != null">
84
-                AND d.id != #{id}
85
+                AND d.id = #{id}
86
+            </if>
87
+            <if test="sealStatus != null">
88
+                AND d.seal_status = #{sealStatus}
89
+            </if>
90
+            <if test="deptId != null">
91
+                AND d.dept_id = #{deptId}
85 92
             </if>
86 93
         </where>
87 94
     </select>
88 95
 
96
+
89 97
     <update id="updateDeptIdentify" parameterType="DeptIdentify">
90 98
         update dept_identify
91 99
         <set>
@@ -94,8 +102,16 @@
94 102
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
95 103
             <if test="sealName != null  and sealName != ''">seal_name = #{sealName},</if>
96 104
             <if test="sealId != null  and sealId != ''">seal_id = #{sealId},</if>
105
+            <if test="sealStatus != null ">seal_status = #{sealStatus},</if>
97 106
         </set>
98
-        where id = #{id}
107
+        <where>
108
+            <if test="id != null">
109
+                AND d.id = #{id}
110
+            </if>
111
+            <if test="sealId != null">
112
+                AND seal_id = #{sealId}
113
+            </if>
114
+        </where>
99 115
     </update>
100 116
 
101 117