Просмотр исходного кода

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

qtz 2 лет назад
Родитель
Сommit
d453471fca

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

@@ -257,7 +257,7 @@ public class CaseApplicationController extends BaseController {
257 257
     @PostMapping("/checkArbitrateRecord")
258 258
     public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
259 259
 
260
-        return toAjax(caseApplicationService.checkArbitrateRecord(caseApplication));
260
+        return caseApplicationService.checkArbitrateRecord(caseApplication);
261 261
     }
262 262
 
263 263
 

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

@@ -0,0 +1,56 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate;
2
+
3
+import com.ruoyi.common.annotation.Log;
4
+import com.ruoyi.common.core.controller.BaseController;
5
+import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.page.TableDataInfo;
7
+import com.ruoyi.common.enums.BusinessType;
8
+import com.ruoyi.common.exception.EsignDemoException;
9
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
11
+import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
12
+import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.validation.annotation.Validated;
15
+import org.springframework.web.bind.annotation.*;
16
+
17
+import java.util.List;
18
+
19
+@RestController
20
+@RequestMapping("/deptIdentify")
21
+public class DeptIdentifyController  extends BaseController {
22
+    @Autowired
23
+    private IDeptIdentifyService deptIdentifyService;
24
+
25
+    /**
26
+     * 查询部门认证数据
27
+     */
28
+    @GetMapping("/list")
29
+    public TableDataInfo list(DeptIdentify deptIdentify) {
30
+        startPage();
31
+        List<DeptIdentify> list = deptIdentifyService.selectDeptIdentify(deptIdentify);
32
+        return getDataTable(list);
33
+    }
34
+
35
+    /**
36
+     * 查询机构认证链接
37
+     */
38
+    @PostMapping("/selectDeptIndefiUrl")
39
+    public AjaxResult selectDeptIndefiUrl(@Validated @RequestBody DeptIdentify deptIdentify) throws EsignDemoException {
40
+        DeptIdentify deptIdentifyselect = deptIdentifyService.selectDeptIndefiUrl(deptIdentify);
41
+        return success(deptIdentifyselect);
42
+    }
43
+
44
+    /**
45
+     * 启用
46
+     */
47
+    @PostMapping("/enableDept")
48
+    public AjaxResult enableDept(@Validated @RequestBody DeptIdentify deptIdentify) {
49
+        return deptIdentifyService.enableDept(deptIdentify);
50
+    }
51
+
52
+
53
+
54
+
55
+
56
+}

+ 12
- 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java Просмотреть файл

@@ -31,6 +31,9 @@ public class SysDept extends BaseEntity
31 31
     /** 部门名称 */
32 32
     private String deptName;
33 33
 
34
+    /** 部门类型 */
35
+    private Integer deptType;
36
+
34 37
     /** 显示顺序 */
35 38
     private Integer orderNum;
36 39
 
@@ -51,7 +54,15 @@ public class SysDept extends BaseEntity
51 54
 
52 55
     /** 父部门名称 */
53 56
     private String parentName;
54
-    
57
+
58
+    public Integer getDeptType() {
59
+        return deptType;
60
+    }
61
+
62
+    public void setDeptType(Integer deptType) {
63
+        this.deptType = deptType;
64
+    }
65
+
55 66
     /** 子部门 */
56 67
     private List<SysDept> children = new ArrayList<SysDept>();
57 68
 

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

@@ -0,0 +1,126 @@
1
+package com.ruoyi.wisdomarbitrate.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import com.ruoyi.common.core.domain.BaseEntity;
5
+
6
+import java.util.Date;
7
+
8
+public class DeptIdentify   extends BaseEntity {
9
+    private static final long serialVersionUID = 1L;
10
+
11
+    /** ID */
12
+    private Long id;
13
+    /** 部门ID */
14
+    private Long deptId;
15
+    /** 用户ID */
16
+    private Long userId;
17
+
18
+    /** 认证状态 */
19
+    private Integer identifyStatus;
20
+
21
+    /** 认证时间 */
22
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
23
+    private Date identifyDate;
24
+    /** 是否启用 */
25
+    private Integer isUse;
26
+
27
+    /** 用户名称 */
28
+    private String nickName;
29
+    /** 手机号码 */
30
+    private String phonenumber;
31
+    /** 部门名称 */
32
+    private String deptName;
33
+    /** 印章名称 */
34
+    private String sealName;
35
+
36
+    public String getSealName() {
37
+        return sealName;
38
+    }
39
+
40
+    public void setSealName(String sealName) {
41
+        this.sealName = sealName;
42
+    }
43
+
44
+    /** 部门认证链接 */
45
+    private String identifyUrl;
46
+
47
+    public String getIdentifyUrl() {
48
+        return identifyUrl;
49
+    }
50
+
51
+    public void setIdentifyUrl(String identifyUrl) {
52
+        this.identifyUrl = identifyUrl;
53
+    }
54
+
55
+    public String getNickName() {
56
+        return nickName;
57
+    }
58
+
59
+    public void setNickName(String nickName) {
60
+        this.nickName = nickName;
61
+    }
62
+
63
+    public String getPhonenumber() {
64
+        return phonenumber;
65
+    }
66
+
67
+    public void setPhonenumber(String phonenumber) {
68
+        this.phonenumber = phonenumber;
69
+    }
70
+
71
+    public String getDeptName() {
72
+        return deptName;
73
+    }
74
+
75
+    public void setDeptName(String deptName) {
76
+        this.deptName = deptName;
77
+    }
78
+
79
+    public Long getId() {
80
+        return id;
81
+    }
82
+
83
+    public void setId(Long id) {
84
+        this.id = id;
85
+    }
86
+
87
+    public Long getDeptId() {
88
+        return deptId;
89
+    }
90
+
91
+    public void setDeptId(Long deptId) {
92
+        this.deptId = deptId;
93
+    }
94
+
95
+    public Long getUserId() {
96
+        return userId;
97
+    }
98
+
99
+    public void setUserId(Long userId) {
100
+        this.userId = userId;
101
+    }
102
+
103
+    public Integer getIdentifyStatus() {
104
+        return identifyStatus;
105
+    }
106
+
107
+    public void setIdentifyStatus(Integer identifyStatus) {
108
+        this.identifyStatus = identifyStatus;
109
+    }
110
+
111
+    public Date getIdentifyDate() {
112
+        return identifyDate;
113
+    }
114
+
115
+    public void setIdentifyDate(Date identifyDate) {
116
+        this.identifyDate = identifyDate;
117
+    }
118
+
119
+    public Integer getIsUse() {
120
+        return isUse;
121
+    }
122
+
123
+    public void setIsUse(Integer isUse) {
124
+        this.isUse = isUse;
125
+    }
126
+}

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

@@ -0,0 +1,22 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
5
+
6
+import java.util.List;
7
+
8
+public interface DeptIdentifyMapper {
9
+
10
+
11
+    List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify);
12
+
13
+    List<DeptIdentify> selectDeptIdentifyBydeptid(DeptIdentify deptIdentify);
14
+
15
+    int insertDeptIdentify(DeptIdentify deptIdentify);
16
+
17
+    List<DeptIdentify> selectDeptIdentifylist(DeptIdentify deptIdentify);
18
+
19
+    int updateDeptIdentify(DeptIdentify deptIdentify);
20
+
21
+    List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
22
+}

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

@@ -38,7 +38,7 @@ public interface ICaseApplicationService {
38 38
 
39 39
     int verificationArbitrateRecord(CaseApplication caseApplication);
40 40
 
41
-    int checkArbitrateRecord(CaseApplication caseApplication);
41
+    AjaxResult checkArbitrateRecord(CaseApplication caseApplication);
42 42
 
43 43
     int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck);
44 44
 

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

@@ -0,0 +1,18 @@
1
+package com.ruoyi.wisdomarbitrate.service;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.common.exception.EsignDemoException;
5
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
6
+
7
+import java.util.List;
8
+
9
+public interface IDeptIdentifyService {
10
+
11
+
12
+    List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify);
13
+
14
+
15
+    DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException;
16
+
17
+    AjaxResult enableDept(DeptIdentify deptIdentify);
18
+}

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

@@ -89,6 +89,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
89 89
     private   CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
90 90
     @Autowired
91 91
     private SmsRecordMapper smsRecordMapper;
92
+    @Autowired
93
+    private DeptIdentifyMapper deptIdentifyMapper;
92 94
     // 手机号正则
93 95
     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}$");
94 96
 
@@ -1543,7 +1545,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1543 1545
 
1544 1546
     @Override
1545 1547
     @Transactional
1546
-    public int checkArbitrateRecord(CaseApplication caseApplication) {
1548
+    public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) {
1547 1549
         int rows = 0;
1548 1550
         ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
1549 1551
         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
@@ -1593,14 +1595,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1593 1595
                                         if (arbitratorId!=null){
1594 1596
                                             SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
1595 1597
                                             if (sysUser == null){
1596
-                                                return rows;
1598
+                                                return AjaxResult.error();
1597 1599
                                             }
1598 1600
                                             sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
1599 1601
                                             sealSignRecord.setPensonName(sysUser.getNickName());
1600 1602
                                         }
1601
-                                        sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
1602
-                                        sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
1603
-                                        sealSignRecord.setOrgnizeNamepsnName("韩超勃");
1603
+
1604
+                                        DeptIdentify deptIdentify = new DeptIdentify();
1605
+                                        deptIdentify.setIsUse(1);
1606
+                                        DeptIdentify deptIdentifyselect =  new DeptIdentify();
1607
+                                        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
1608
+                                        if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){
1609
+                                            deptIdentifyselect = deptIdentifysnew.get(0);
1610
+                                            sealSignRecord.setOrgnizeName(deptIdentifyselect.getDeptName());
1611
+                                            sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getPhonenumber());
1612
+                                            sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getNickName());
1613
+                                        }else {
1614
+                                            return AjaxResult.error("没有用印时的机构名称及经办人信息");
1615
+                                        }
1616
+
1604 1617
                                         //解析文件签名印章位置
1605 1618
                                         JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
1606 1619
                                         for (int i = 0; i < jsonArray.size(); i++) {
@@ -1677,7 +1690,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1677 1690
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1678 1691
         }
1679 1692
 
1680
-        return rows;
1693
+        return AjaxResult.success();
1681 1694
     }
1682 1695
 
1683 1696
     @Override

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

@@ -0,0 +1,97 @@
1
+package com.ruoyi.wisdomarbitrate.service.impl;
2
+
3
+import com.google.gson.Gson;
4
+import com.google.gson.JsonObject;
5
+import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
7
+import com.ruoyi.common.exception.EsignDemoException;
8
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
9
+import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
10
+import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
11
+import com.ruoyi.wisdomarbitrate.utils.SignAward;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+import org.springframework.transaction.annotation.Transactional;
15
+
16
+import java.util.Date;
17
+import java.util.List;
18
+
19
+@Service
20
+public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
21
+
22
+    @Autowired
23
+    private DeptIdentifyMapper deptIdentifyMapper;
24
+
25
+
26
+    @Override
27
+    @Transactional
28
+    public List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify) {
29
+        List<DeptIdentify> deptIdentifys = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
30
+        if(deptIdentifys!=null&&deptIdentifys.size()>0){
31
+            for (int i = 0; i < deptIdentifys.size(); i++) {
32
+                DeptIdentify deptIdentifyselect = deptIdentifys.get(i);
33
+                List<DeptIdentify> deptIdentifylist = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentifyselect);
34
+                if(deptIdentifylist!=null&&deptIdentifylist.size()>0){
35
+                    continue;
36
+                }else {
37
+                    deptIdentifyselect.setIdentifyStatus(0);
38
+                    deptIdentifyMapper.insertDeptIdentify(deptIdentifyselect);
39
+                }
40
+            }
41
+        }
42
+
43
+        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
44
+        return deptIdentifysnew;
45
+    }
46
+
47
+    @Override
48
+    @Transactional
49
+    public DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException {
50
+        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
51
+        DeptIdentify deptIdentifynew = new DeptIdentify();
52
+        if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){
53
+            Gson gson = new Gson();
54
+            DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
55
+            EsignHttpResponse identifyUrl = SignAward.deptIdentifyUrl(deptIdentifyselect);
56
+            JsonObject signUrlJsonObject = gson.fromJson(identifyUrl.getBody(), JsonObject.class);
57
+            JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
58
+            String url = signUrlData.get("authUrl").getAsString();
59
+            deptIdentifynew.setIdentifyUrl(url);
60
+        }
61
+
62
+        deptIdentify.setIdentifyDate(new Date());
63
+        int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
64
+        return deptIdentifynew;
65
+    }
66
+
67
+    @Override
68
+    @Transactional
69
+    public AjaxResult enableDept(DeptIdentify deptIdentify) {
70
+        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
71
+        DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
72
+        Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
73
+        if(identifyStatus.intValue()==0){
74
+            return AjaxResult.error("这个认证数据未进行认证,不能启用");
75
+        }else if(identifyStatus.intValue()==1){
76
+            deptIdentifyselect.setIsUse(1);
77
+            deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
78
+
79
+            DeptIdentify deptIdentifySel = new DeptIdentify();
80
+            deptIdentifySel.setId(deptIdentify.getId());
81
+            deptIdentifySel.setIdentifyStatus(1);
82
+            List<DeptIdentify> deptIdentifysother = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentifySel);
83
+            if(deptIdentifysother!=null&&deptIdentifysother.size()>0){
84
+                for (int i = 0; i < deptIdentifysother.size(); i++) {
85
+                    DeptIdentify deptIdentifyother = deptIdentifysother.get(i);
86
+                    deptIdentifyother.setIsUse(0);
87
+                    deptIdentifyMapper.updateDeptIdentify(deptIdentifyother);
88
+                }
89
+            }
90
+
91
+        }
92
+        return AjaxResult.success();
93
+
94
+    }
95
+
96
+
97
+}

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

@@ -10,9 +10,11 @@ import com.ruoyi.common.exception.EsignDemoException;
10 10
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
11 11
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
12 12
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
13
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
13 14
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
14 15
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
15 16
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
17
+import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
16 18
 import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
17 19
 import org.springframework.beans.factory.annotation.Autowired;
18 20
 import org.springframework.scheduling.annotation.Scheduled;
@@ -32,6 +34,8 @@ public class FixSelectFlowDetailUtils {
32 34
     private SealSignRecordMapper sealSignRecordMapper;
33 35
     @Autowired
34 36
     private CaseAttachMapper caseAttachMapper;
37
+    @Autowired
38
+    private DeptIdentifyMapper deptIdentifyMapper;
35 39
 
36 40
     @Scheduled(cron = "0/3 * * * * ?")
37 41
     @Transactional
@@ -121,6 +125,48 @@ public class FixSelectFlowDetailUtils {
121 125
     }
122 126
 
123 127
 
128
+    @Scheduled(cron = "0/10 * * * * ?")
129
+    @Transactional
130
+    public void fixExecuteSelectDeptIndentifyUtils() throws EsignDemoException {
131
+        Gson gson = new Gson();
132
+        DeptIdentify deptIdentify = new DeptIdentify();
133
+        deptIdentify.setIdentifyStatus(0);
134
+        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
135
+        if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){
136
+            for (int i = 0; i < deptIdentifysnew.size(); i++) {
137
+                EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
138
+                JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
139
+                JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
140
+                int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
141
+                String orgId = identifyInfoData.get("orgId").getAsString();
142
+                if(realnameStatus==1){
143
+                    EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
144
+                    JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
145
+                    JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
146
+                    JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
147
+                    String sealNames = "";
148
+                    if(sealArray.size()>0){
149
+                        for (int j = 0; j < sealArray.size(); j++) {
150
+                            JsonObject sealObject = (JsonObject)sealArray.get(j);
151
+                            String sealName = sealObject.get("sealName").toString();
152
+                            String sealNamenew = sealName.substring(1,sealName.length()-1);
153
+                            sealNames += sealNamenew +",";
154
+                        }
155
+                    }
156
+                    String sealName = sealNames.substring(0,sealNames.length()-1);
157
+                    DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
158
+                    deptIdentifynew.setIdentifyStatus(1);
159
+                    deptIdentifynew.setSealName(sealName);
160
+                    int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
161
+                }
162
+
163
+            }
164
+
165
+        }
166
+
167
+    }
168
+
169
+
124 170
 
125 171
 
126 172
 

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

@@ -9,6 +9,7 @@ import com.ruoyi.common.exception.EsignDemoException;
9 9
 import com.ruoyi.common.utils.DateUtils;
10 10
 import com.ruoyi.common.utils.EsignApplicaConfig;
11 11
 import com.ruoyi.common.utils.EsignHttpHelper;
12
+import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
12 13
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
13 14
 
14 15
 import java.util.Date;
@@ -19,8 +20,6 @@ public class SignAward {
19 20
     private static String eSignHost= EsignApplicaConfig.EsignHost;
20 21
     private static String eSignAppId= EsignApplicaConfig.EsignAppId;
21 22
     private static String eSignAppSecret= EsignApplicaConfig.EsignAppSecret;
22
-//    public static String fileId = "95d0c307d91e4985bdb8874f6f84daa5";
23
-    public static String fileId = "a0c2ad21065f48ff8b872412c39d5d3a";
24 23
 
25 24
 
26 25
 
@@ -63,6 +62,35 @@ public class SignAward {
63 62
 //        System.out.println("签署长链接:" +shortusesealUrl);
64 63
 //        System.out.println("签署短链接:"+sealUrl);
65 64
 
65
+        //查询机构认证信息
66
+//        DeptIdentify deptIdentify = new DeptIdentify();
67
+//        deptIdentify.setDeptName("西安云美电子科技有限公司");
68
+//        EsignHttpResponse identifyInfo = getDeptIdentifyInfo(deptIdentify);
69
+//        JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
70
+//        JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
71
+//        int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
72
+//        String orgId = identifyInfoData.get("orgId").getAsString();
73
+//        System.out.println("机构认证状态:" +realnameStatus);
74
+//        System.out.println("机构id:" +orgId);
75
+
76
+//        EsignHttpResponse identifyInfo = deptIdentifySealList(orgId);
77
+//        JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
78
+//        JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
79
+//        JsonArray sealArray = identifyInfoData.get("seals").getAsJsonArray();
80
+//        String sealNames = "";
81
+//        if(sealArray.size()>0){
82
+//            for (int i = 0; i < sealArray.size(); i++) {
83
+//                JsonObject sealObject = (JsonObject)sealArray.get(i);
84
+//                String sealName = sealObject.get("sealName").toString();
85
+//                String sealNamenew = sealName.substring(1,sealName.length()-1);
86
+//                sealNames += sealNamenew +",";
87
+//            }
88
+//        }
89
+//        System.out.println("机构印章名称:" +sealNames.substring(0,sealNames.length()-1));
90
+
91
+
92
+
93
+
66 94
         //查询签署流程详情
67 95
 //        EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord);
68 96
 //        JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
@@ -91,12 +119,7 @@ public class SignAward {
91 119
 
92 120
 //        System.out.println(signFlowDetailJsonObject);
93 121
 
94
-        String annexName = "/profile/upload/2023/10/26/1f6fe04f5f984e8ab5bbaf70dd47100a.docx";
95
-        String prefix = "/profile/upload/";
96
-        int startIndex = prefix.length();
97
-        String annexPath = "/home/ruoyi/uploadPath/upload/";
98
-        String annexPathnew = annexPath + annexName.substring(startIndex);
99
-        System.out.println(annexPathnew);
122
+
100 123
 
101 124
 
102 125
     }
@@ -317,6 +340,69 @@ public class SignAward {
317 340
         return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
318 341
     }
319 342
 
343
+    /**
344
+     * 获取机构认证链接
345
+     * @return
346
+     * @throws EsignDemoException
347
+     */
348
+    public static EsignHttpResponse deptIdentifyUrl(DeptIdentify deptIdentify) throws EsignDemoException {
349
+        String apiaddr = "/v3/org-auth-url";
350
+        String nickName = deptIdentify.getNickName();
351
+        String phonenumber = deptIdentify.getPhonenumber();
352
+        String deptName = deptIdentify.getDeptName();
353
+        String jsonParm = "{\n" +
354
+                "            \"orgAuthConfig\": {\n" +
355
+                "                \"orgName\": \"" + deptName +  "\",\n" +
356
+                "                \"transactorInfo\": {\n" +
357
+                "                   \"psnAccount\": \"" + phonenumber +  "\",\n" +
358
+                "                   \"psnInfo\": {\n" +
359
+                "                              \"psnName\": \"" + nickName +  "\",\n" +
360
+                "                              \"psnMobile\": \"" + phonenumber +  "\"\n" +
361
+                "                         }\n" +
362
+
363
+                "                   }\n" +
364
+                "            }\n" +
365
+                "}";
366
+        //请求方法
367
+        EsignRequestType requestType = EsignRequestType.POST;
368
+        //生成请求签名鉴权方式的Header
369
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true);
370
+        //发起接口请求
371
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
372
+    }
373
+
374
+    /**
375
+     * 查询企业认证状态
376
+     */
377
+    public static EsignHttpResponse getDeptIdentifyInfo(DeptIdentify deptIdentify) throws EsignDemoException {
378
+        String apiaddr="/v3/organizations/identity-info?orgName="+deptIdentify.getDeptName();
379
+
380
+        String jsonParm="{}";
381
+        //请求方法
382
+        EsignRequestType requestType= EsignRequestType.GET;
383
+        //生成签名鉴权方式的的header
384
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
385
+        //发起接口请求
386
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
387
+    }
388
+    /**
389
+     * 查询企业认证印章信息
390
+     */
391
+    public static EsignHttpResponse deptIdentifySealList(String orgId) throws EsignDemoException {
392
+        int pageNum=1;
393
+        int pageSize=10;
394
+        String apiaddr="/v3/seals/org-own-seal-list?orgId="+orgId+"&pageNum="+pageNum+"&pageSize="+pageSize;
395
+        String jsonParm=null;
396
+        //请求方法
397
+        EsignRequestType requestType= EsignRequestType.GET;
398
+        //生成签名鉴权方式的的header
399
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
400
+        //发起接口请求
401
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
402
+    }
403
+
404
+
405
+
320 406
     /**
321 407
      * 获取文件签名印章位置
322 408
      * @return

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

@@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
96 96
  			<if test="deptId != null and deptId != 0">dept_id,</if>
97 97
  			<if test="parentId != null and parentId != 0">parent_id,</if>
98 98
  			<if test="deptName != null and deptName != ''">dept_name,</if>
99
+			<if test="deptType != null">dept_type,</if>
99 100
  			<if test="ancestors != null and ancestors != ''">ancestors,</if>
100 101
  			<if test="orderNum != null">order_num,</if>
101 102
  			<if test="leader != null and leader != ''">leader,</if>
@@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
108 109
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
109 110
  			<if test="parentId != null and parentId != 0">#{parentId},</if>
110 111
  			<if test="deptName != null and deptName != ''">#{deptName},</if>
112
+			<if test="deptType != null">#{deptType},</if>
111 113
  			<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
112 114
  			<if test="orderNum != null">#{orderNum},</if>
113 115
  			<if test="leader != null and leader != ''">#{leader},</if>
@@ -124,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
124 126
  		<set>
125 127
  			<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
126 128
  			<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
129
+			<if test="deptType != null">dept_type = #{deptType},</if>
127 130
  			<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
128 131
  			<if test="orderNum != null">order_num = #{orderNum},</if>
129 132
  			<if test="leader != null">leader = #{leader},</if>

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

@@ -0,0 +1,100 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper">
6
+    <resultMap type="DeptIdentify" id="DeptIdentifyResult">
7
+        <id     property="id"       column="id"      />
8
+        <result property="deptId"       column="dept_id"      />
9
+        <result property="userId"     column="user_id"    />
10
+        <result property="identifyStatus"     column="identify_status"    />
11
+        <result property="identifyDate"        column="identify_date"        />
12
+        <result property="isUse"  column="is_use"  />
13
+        <result property="nickName"          column="nick_name"          />
14
+        <result property="phonenumber"       column="phonenumber"       />
15
+        <result property="deptName"     column="dept_name"     />
16
+        <result property="sealName"     column="seal_name"     />
17
+
18
+    </resultMap>
19
+
20
+
21
+    <select id="selectDeptIdentify" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
22
+        SELECT  ud.user_id , ud.nick_name ,ud.phonenumber ,ud.dept_id ,d.dept_name
23
+        FROM  (SELECT u.user_id , u.nick_name ,u.phonenumber ,u.dept_id
24
+        FROM sys_user_post up left join sys_user  u on u.user_id  = up.user_id
25
+            left join  sys_post  sp on up.post_id  = sp.post_id
26
+        where sp.post_code = 'jbr') ud left join sys_dept d on ud.dept_id = d.dept_id
27
+        WHERE d.dept_type  = 1
28
+    </select>
29
+
30
+    <select id="selectDeptIdentifyBydeptid" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
31
+        SELECT d.id ,d.dept_id ,d.user_id
32
+        from dept_identify d
33
+        <where>
34
+            <if test="deptId != null">
35
+                AND d.dept_id = #{deptId}
36
+            </if>
37
+        </where>
38
+    </select>
39
+
40
+    <insert id="insertDeptIdentify" parameterType="DeptIdentify" useGeneratedKeys="true" keyProperty="id">
41
+        insert into dept_identify(
42
+        <if test="deptId != null">dept_id,</if>
43
+        <if test="userId != null">user_id,</if>
44
+        <if test="identifyStatus != null">identify_status</if>
45
+        )values(
46
+        <if test="deptId != null">#{deptId},</if>
47
+        <if test="userId != null">#{userId},</if>
48
+        <if test="identifyStatus != null">#{identifyStatus}</if>
49
+        )
50
+    </insert>
51
+
52
+    <select id="selectDeptIdentifylist" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
53
+        SELECT  d.id ,d.dept_id ,d.user_id, d.identify_status ,d.identify_date ,d.is_use , d.seal_name,  sd.dept_name ,
54
+            u.nick_name ,u.phonenumber
55
+        from dept_identify d left join sys_dept sd on d.dept_id  = sd.dept_id
56
+        left join sys_user u on u.user_id  = d.user_id
57
+        <where>
58
+            <if test="identifyStatus != null">
59
+                AND d.identify_status = #{identifyStatus}
60
+            </if>
61
+            <if test="isUse != null">
62
+                AND d.is_use = #{isUse}
63
+            </if>
64
+            <if test="id != null">
65
+                AND d.id = #{id}
66
+            </if>
67
+        </where>
68
+    </select>
69
+
70
+    <select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
71
+        SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use
72
+        from dept_identify d
73
+        <where>
74
+            <if test="identifyStatus != null">
75
+                AND d.identify_status = #{identifyStatus}
76
+            </if>
77
+            <if test="id != null">
78
+                AND d.id != #{id}
79
+            </if>
80
+        </where>
81
+    </select>
82
+
83
+    <update id="updateDeptIdentify" parameterType="DeptIdentify">
84
+        update dept_identify
85
+        <set>
86
+            <if test="identifyDate != null">identify_date = #{identifyDate},</if>
87
+            <if test="isUse != null">is_use = #{isUse},</if>
88
+            <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
89
+            <if test="sealName != null  and sealName != ''">seal_name = #{sealName},</if>
90
+        </set>
91
+        where id = #{id}
92
+    </update>
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+</mapper>