hejinbo 2 лет назад
Родитель
Сommit
4cf4fa6f5c

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

1
 package com.ruoyi.web.controller.wisdomarbitrate;
1
 package com.ruoyi.web.controller.wisdomarbitrate;
2
 
2
 
3
+import com.alibaba.fastjson.JSONObject;
3
 import com.ruoyi.common.annotation.Log;
4
 import com.ruoyi.common.annotation.Log;
4
 import com.ruoyi.common.core.controller.BaseController;
5
 import com.ruoyi.common.core.controller.BaseController;
5
 import com.ruoyi.common.core.domain.AjaxResult;
6
 import com.ruoyi.common.core.domain.AjaxResult;
9
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
11
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
11
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
12
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
13
+import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
14
+import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
12
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
15
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
13
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.validation.annotation.Validated;
17
 import org.springframework.validation.annotation.Validated;
19
 
22
 
20
 @RestController
23
 @RestController
21
 @RequestMapping("/deptIdentify")
24
 @RequestMapping("/deptIdentify")
22
-public class DeptIdentifyController  extends BaseController {
25
+public class DeptIdentifyController extends BaseController {
23
     @Autowired
26
     @Autowired
24
     private IDeptIdentifyService deptIdentifyService;
27
     private IDeptIdentifyService deptIdentifyService;
25
 
28
 
52
 
55
 
53
     /**
56
     /**
54
      * 上传自定义公章
57
      * 上传自定义公章
58
+     *
55
      * @param deptIdentify
59
      * @param deptIdentify
56
      * @param file
60
      * @param file
57
      * @return
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 Просмотреть файл

82
         //生成签名鉴权方式的的header
82
         //生成签名鉴权方式的的header
83
         Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
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 Просмотреть файл

42
      * 用户账户
42
      * 用户账户
43
      */
43
      */
44
     private String userName;
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 Просмотреть файл

53
      * 附件id
53
      * 附件id
54
      */
54
      */
55
     private Integer annexId;
55
     private Integer annexId;
56
+    /**
57
+     * 印章状态  0禁用,1启用
58
+     */
59
+    private Integer sealStatus;
56
 
60
 
57
     public Integer getAnnexId() {
61
     public Integer getAnnexId() {
58
         return annexId;
62
         return annexId;
168
     public void setIsUse(Integer isUse) {
172
     public void setIsUse(Integer isUse) {
169
         this.isUse = isUse;
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 Просмотреть файл

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 Просмотреть файл

23
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
23
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24
 
24
 
25
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
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 Просмотреть файл

19
     int updateDeptIdentify(DeptIdentify deptIdentify);
19
     int updateDeptIdentify(DeptIdentify deptIdentify);
20
 
20
 
21
     List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
21
     List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
22
+
22
 }
23
 }

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

3
 import com.ruoyi.common.core.domain.AjaxResult;
3
 import com.ruoyi.common.core.domain.AjaxResult;
4
 import com.ruoyi.common.exception.EsignDemoException;
4
 import com.ruoyi.common.exception.EsignDemoException;
5
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
5
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
6
+import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
6
 import org.springframework.web.multipart.MultipartFile;
7
 import org.springframework.web.multipart.MultipartFile;
7
 
8
 
8
 import java.util.List;
9
 import java.util.List;
20
     AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file);
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 Просмотреть файл

106
     private DeptIdentifyMapper deptIdentifyMapper;
106
     private DeptIdentifyMapper deptIdentifyMapper;
107
     @Autowired
107
     @Autowired
108
     private ReservedConferenceMapper reservedConferenceMapper;
108
     private ReservedConferenceMapper reservedConferenceMapper;
109
+    @Autowired
110
+    private SysDeptMapper deptMapper;
109
     // 手机号正则
111
     // 手机号正则
110
     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}$");
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
                                                 }
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
                                         JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1770
                                         JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1751
                                         if (jsonObject3.getIntValue("code") == 0) {
1771
                                         if (jsonObject3.getIntValue("code") == 0) {
1752
                                             //获取签署流程ID
1772
                                             //获取签署流程ID
1881
         request.setTemplateId("1952136");
1901
         request.setTemplateId("1952136");
1882
         for (CaseAffiliate caseAffiliate : caseAffiliates) {
1902
         for (CaseAffiliate caseAffiliate : caseAffiliates) {
1883
             request.setPhone(caseAffiliate.getContactTelphone());
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
             // 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
1905
             // 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
1886
             Boolean aBoolean = SmsUtils.sendSms(request);
1906
             Boolean aBoolean = SmsUtils.sendSms(request);
1887
             //保存短信发送记录
1907
             //保存短信发送记录
1890
             smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
1910
             smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
1891
             smsSendRecord.setPhone(request.getPhone());
1911
             smsSendRecord.setPhone(request.getPhone());
1892
             smsSendRecord.setSendTime(new Date());
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
             smsSendRecord.setSendContent(content);
1914
             smsSendRecord.setSendContent(content);
1895
 
1915
 
1896
             String userName;
1916
             String userName;
1909
         }
1929
         }
1910
         return returnResult;
1930
         return returnResult;
1911
     }
1931
     }
1932
+
1912
     @Override
1933
     @Override
1913
     public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException {
1934
     public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException {
1914
         SealSignRecord sealSignRecord = new SealSignRecord();
1935
         SealSignRecord sealSignRecord = new SealSignRecord();
2452
 
2473
 
2453
     /**
2474
     /**
2454
      * 获取userSign,默认过期时间10小时
2475
      * 获取userSign,默认过期时间10小时
2476
+     *
2455
      * @param userId
2477
      * @param userId
2456
      * @return
2478
      * @return
2457
      */
2479
      */
2458
-    public String generateUserSign(String userId){
2480
+    public String generateUserSign(String userId) {
2459
         TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey);
2481
         TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey);
2460
         return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
2482
         return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
2461
     }
2483
     }
2463
 
2485
 
2464
     /**
2486
     /**
2465
      * 预约会议
2487
      * 预约会议
2488
+     *
2466
      * @param reservedConferenceVO
2489
      * @param reservedConferenceVO
2467
      * @return
2490
      * @return
2468
      * @throws Exception
2491
      * @throws Exception
2480
         Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
2503
         Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
2481
         Random rand = new Random();
2504
         Random rand = new Random();
2482
         int random = rand.nextInt(214748365);
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
         HttpPost post = new HttpPost(url);
2507
         HttpPost post = new HttpPost(url);
2485
         String result = "";
2508
         String result = "";
2486
         //添加参数
2509
         //添加参数
2489
         bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
2512
         bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
2490
         bodyParams.put("roomId", reservedConferenceVO.getRoomId());
2513
         bodyParams.put("roomId", reservedConferenceVO.getRoomId());
2491
         bodyParams.put("scheduleStartTime", scheduleStartTime);
2514
         bodyParams.put("scheduleStartTime", scheduleStartTime);
2492
-        bodyParams.put("scheduleEndTime",scheduleEndTime);
2515
+        bodyParams.put("scheduleEndTime", scheduleEndTime);
2493
         roomParams.put("roomType", 1);
2516
         roomParams.put("roomType", 1);
2494
         bodyParams.put("roomInfo", roomParams);
2517
         bodyParams.put("roomInfo", roomParams);
2495
         StringEntity postingString = new StringEntity(bodyParams.toString());
2518
         StringEntity postingString = new StringEntity(bodyParams.toString());
2536
 
2559
 
2537
     /**
2560
     /**
2538
      * 销毁房间回调
2561
      * 销毁房间回调
2562
+     *
2539
      * @param body
2563
      * @param body
2540
      * @param request
2564
      * @param request
2541
      */
2565
      */

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

4
 import com.google.gson.Gson;
4
 import com.google.gson.Gson;
5
 import com.google.gson.JsonObject;
5
 import com.google.gson.JsonObject;
6
 import com.ruoyi.common.config.RuoYiConfig;
6
 import com.ruoyi.common.config.RuoYiConfig;
7
+import com.ruoyi.common.constant.FileTransformation;
7
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
9
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
9
 import com.ruoyi.common.exception.EsignDemoException;
10
 import com.ruoyi.common.exception.EsignDemoException;
11
 import com.ruoyi.common.utils.file.FileUploadUtils;
12
 import com.ruoyi.common.utils.file.FileUploadUtils;
12
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
13
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
13
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
14
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
15
+import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
14
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
16
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
15
 import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
17
 import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
16
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
18
 import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
20
 import org.springframework.transaction.annotation.Transactional;
22
 import org.springframework.transaction.annotation.Transactional;
21
 import org.springframework.web.multipart.MultipartFile;
23
 import org.springframework.web.multipart.MultipartFile;
22
 
24
 
25
+import java.io.File;
23
 import java.io.IOException;
26
 import java.io.IOException;
27
+import java.time.LocalDate;
28
+import java.util.ArrayList;
24
 import java.util.Date;
29
 import java.util.Date;
25
 import java.util.List;
30
 import java.util.List;
31
+import java.util.UUID;
26
 
32
 
27
 @Service
33
 @Service
28
 public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
34
 public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
123
                     EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
129
                     EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
124
                     JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
130
                     JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
125
                     int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus");
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
                         String prefix = "/profile";
133
                         String prefix = "/profile";
128
                         int startIndex = fileName.indexOf(prefix);
134
                         int startIndex = fileName.indexOf(prefix);
129
                         startIndex += prefix.length();
135
                         startIndex += prefix.length();
138
                             identify.setIsUse(0);  //设置印章使用状态为未启用
144
                             identify.setIsUse(0);  //设置印章使用状态为未启用
139
                             //保存到表里
145
                             //保存到表里
140
                             int i = deptIdentifyMapper.updateDeptIdentify(identify);
146
                             int i = deptIdentifyMapper.updateDeptIdentify(identify);
141
-                            if (i>0){
147
+                            if (i > 0) {
142
                                 return AjaxResult.success("上传成功");
148
                                 return AjaxResult.success("上传成功");
143
                             }
149
                             }
144
                         }
150
                         }
151
         } catch (EsignDemoException e) {
157
         } catch (EsignDemoException e) {
152
             e.printStackTrace();
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 Просмотреть файл

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

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

16
 
16
 
17
 import java.io.File;
17
 import java.io.File;
18
 import java.util.Date;
18
 import java.util.Date;
19
+import java.util.List;
19
 import java.util.Map;
20
 import java.util.Map;
20
 
21
 
21
 public class SignAward {
22
 public class SignAward {
134
         //请求方法
135
         //请求方法
135
         EsignRequestType requestType = EsignRequestType.GET;
136
         EsignRequestType requestType = EsignRequestType.GET;
136
         //生成签名鉴权方式的的header
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
      * @return
147
      * @return
147
      * @throws EsignDemoException
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
         String apiaddr = "/v3/sign-flow/create-by-file";
151
         String apiaddr = "/v3/sign-flow/create-by-file";
151
 
152
 
152
         String fileId = sealSignRecord.getFileid();
153
         String fileId = sealSignRecord.getFileid();
167
         double positionXorg = sealSignRecord.getPositionXorg();
168
         double positionXorg = sealSignRecord.getPositionXorg();
168
         double positionYorg = sealSignRecord.getPositionYorg();
169
         double positionYorg = sealSignRecord.getPositionYorg();
169
 
170
 
170
-        String availableSealId = "209af82b-5f87-4e0a-b0d8-cc4923b6e652";
171
 
171
 
172
         String jsonParm = "{\n" +
172
         String jsonParm = "{\n" +
173
                 "    \"docs\": [\n" +
173
                 "    \"docs\": [\n" +
245
                 "                        \"freeMode\": false,\n" +
245
                 "                        \"freeMode\": false,\n" +
246
 
246
 
247
                 "                        \"availableSealIds\": [\n" +
247
                 "                        \"availableSealIds\": [\n" +
248
-                "                               \"" + availableSealId + "\"\n" +
248
+                "                               \"" + sealIds + "\"\n" +
249
                 "                           ],\n" +
249
                 "                           ],\n" +
250
 
250
 
251
 
251
 
268
         //请求方法
268
         //请求方法
269
         EsignRequestType requestType = EsignRequestType.POST;
269
         EsignRequestType requestType = EsignRequestType.POST;
270
         //生成请求签名鉴权方式的Header
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
         //请求方法
296
         //请求方法
297
         EsignRequestType requestType = EsignRequestType.POST;
297
         EsignRequestType requestType = EsignRequestType.POST;
298
         //生成请求签名鉴权方式的Header
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
         //请求方法
327
         //请求方法
328
         EsignRequestType requestType = EsignRequestType.POST;
328
         EsignRequestType requestType = EsignRequestType.POST;
329
         //生成请求签名鉴权方式的Header
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
         //请求方法
368
         //请求方法
369
         EsignRequestType requestType = EsignRequestType.POST;
369
         EsignRequestType requestType = EsignRequestType.POST;
370
         //生成请求签名鉴权方式的Header
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
         //请求方法
383
         //请求方法
384
         EsignRequestType requestType = EsignRequestType.GET;
384
         EsignRequestType requestType = EsignRequestType.GET;
385
         //生成签名鉴权方式的的header
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
         //请求方法
399
         //请求方法
400
         EsignRequestType requestType = EsignRequestType.GET;
400
         EsignRequestType requestType = EsignRequestType.GET;
401
         //生成签名鉴权方式的的header
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
         //请求方法
423
         //请求方法
424
         EsignRequestType requestType = EsignRequestType.POST;
424
         EsignRequestType requestType = EsignRequestType.POST;
425
         //生成请求签名鉴权方式的Header
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
                     //请求方法
470
                     //请求方法
471
                     EsignRequestType requestType = EsignRequestType.POST;
471
                     EsignRequestType requestType = EsignRequestType.POST;
472
                     //生成签名鉴权方式的的header
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
         //请求方法
495
         //请求方法
496
         EsignRequestType requestType= EsignRequestType.GET;
496
         EsignRequestType requestType= EsignRequestType.GET;
497
         //生成签名鉴权方式的的header
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 Просмотреть файл

63
             </if>
63
             </if>
64
         </where>
64
         </where>
65
     </select>
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
     <update id="updateCaseAttach" parameterType="CaseAttach">
76
     <update id="updateCaseAttach" parameterType="CaseAttach">
68
         update case_attach
77
         update case_attach

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

17
         <result property="orgId"     column="org_id"     />
17
         <result property="orgId"     column="org_id"     />
18
         <result property="authFlowId"     column="auth_flow_id"     />
18
         <result property="authFlowId"     column="auth_flow_id"     />
19
         <result property="sealId"     column="seal_id"     />
19
         <result property="sealId"     column="seal_id"     />
20
+        <result property="sealStatus"     column="seal_status"     />
20
 
21
 
21
     </resultMap>
22
     </resultMap>
22
 
23
 
74
     </select>
75
     </select>
75
 
76
 
76
     <select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
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
         from dept_identify d
79
         from dept_identify d
79
         <where>
80
         <where>
80
             <if test="identifyStatus != null">
81
             <if test="identifyStatus != null">
81
                 AND d.identify_status = #{identifyStatus}
82
                 AND d.identify_status = #{identifyStatus}
82
             </if>
83
             </if>
83
             <if test="id != null">
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
             </if>
92
             </if>
86
         </where>
93
         </where>
87
     </select>
94
     </select>
88
 
95
 
96
+
89
     <update id="updateDeptIdentify" parameterType="DeptIdentify">
97
     <update id="updateDeptIdentify" parameterType="DeptIdentify">
90
         update dept_identify
98
         update dept_identify
91
         <set>
99
         <set>
94
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
102
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
95
             <if test="sealName != null  and sealName != ''">seal_name = #{sealName},</if>
103
             <if test="sealName != null  and sealName != ''">seal_name = #{sealName},</if>
96
             <if test="sealId != null  and sealId != ''">seal_id = #{sealId},</if>
104
             <if test="sealId != null  and sealId != ''">seal_id = #{sealId},</if>
105
+            <if test="sealStatus != null ">seal_status = #{sealStatus},</if>
97
         </set>
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
     </update>
115
     </update>
100
 
116
 
101
 
117