Explorar el Código

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into bgy

gy b hace 2 años
padre
commit
05ece42912

+ 33
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/ArbitrSignatuController.java Ver fichero

1
+package com.ruoyi.web.controller.bestsign;
2
+
3
+import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
4
+import com.ruoyi.bestsign.domain.PersonRegisterVO;
5
+import com.ruoyi.bestsign.service.ArbitrSignatuService;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.validation.annotation.Validated;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.RequestBody;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+@RestController
15
+@RequestMapping("/arbitrSignatu")
16
+public class ArbitrSignatuController {
17
+    @Autowired
18
+    ArbitrSignatuService arbitrSignatuService;
19
+
20
+    /**
21
+     * 申请状态查询
22
+     *
23
+     * @param arbitrSignatuVO
24
+     * @return
25
+     */
26
+    @PostMapping("/selectApplyStatus")
27
+    public AjaxResult selectApplyStatus (@Validated @RequestBody ArbitrSignatuVO arbitrSignatuVO) {
28
+        return arbitrSignatuService.selectApplyStatus(arbitrSignatuVO);
29
+    }
30
+
31
+
32
+
33
+}

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/bestsign/domain/ArbitrSignatuVO.java Ver fichero

1
+package com.ruoyi.bestsign.domain;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+@Data
9
+@NoArgsConstructor
10
+@AllArgsConstructor
11
+@Builder
12
+public class ArbitrSignatuVO {
13
+    /**
14
+     * 用户帐号
15
+     * 任务id
16
+     */
17
+    private String account;
18
+    private String taskId;
19
+
20
+
21
+
22
+
23
+
24
+}

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/bestsign/service/ArbitrSignatuService.java Ver fichero

1
+package com.ruoyi.bestsign.service;
2
+
3
+import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+
6
+public interface ArbitrSignatuService {
7
+
8
+
9
+    AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO);
10
+
11
+
12
+}

+ 29
- 0
ruoyi-system/src/main/java/com/ruoyi/bestsign/service/impl/ArbitrSignatuServiceImpl.java Ver fichero

1
+package com.ruoyi.bestsign.service.impl;
2
+
3
+import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
4
+import com.ruoyi.bestsign.service.ArbitrSignatuService;
5
+import com.ruoyi.bestsign.utils.BestsignOpenApiClient;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+@Service
11
+public class ArbitrSignatuServiceImpl implements ArbitrSignatuService {
12
+    @Autowired
13
+    BestsignOpenApiClient bestsignOpenApiClient;
14
+
15
+
16
+    @Override
17
+    public AjaxResult selectApplyStatus(ArbitrSignatuVO arbitrSignatuVO) {
18
+        String strRespon = "";
19
+        try {
20
+            strRespon = bestsignOpenApiClient.selectApplyStatus(arbitrSignatuVO.getAccount(),
21
+                    arbitrSignatuVO.getTaskId());
22
+        } catch (Exception e) {
23
+            e.printStackTrace();
24
+            return AjaxResult.error(e.getMessage());
25
+        }
26
+        return AjaxResult.success(strRespon);
27
+
28
+    }
29
+}

+ 40
- 0
ruoyi-system/src/main/java/com/ruoyi/bestsign/utils/BestsignOpenApiClient.java Ver fichero

126
 //        }
126
 //        }
127
     }
127
     }
128
 
128
 
129
+
130
+
131
+
129
     /**
132
     /**
130
      * GET方法示例
133
      * GET方法示例
131
      * 下载合同PDF文件
134
      * 下载合同PDF文件
155
         // 返回结果解析
158
         // 返回结果解析
156
         return responseBody;
159
         return responseBody;
157
     }
160
     }
161
+
162
+    public String selectApplyStatus(String account, String taskId)  throws Exception {
163
+        String methodInvoke = "/user/async/applyCert/status/";
164
+        JSONObject requestParam = new JSONObject();
165
+
166
+        //用户账号
167
+        requestParam.put("account", account);
168
+        //任务单号
169
+        requestParam.put("taskId", taskId);
170
+        String timestamsParam = RSAUtils.getRtick();
171
+        // 计算参数签名
172
+        String paramsSign = RSAUtils.calcRsaSign(this.developerId,
173
+                this.privateKey, this.serverHost, methodInvoke, timestamsParam, null,
174
+                requestParam.toJSONString());
175
+        // 签名参数追加为url参数
176
+        String fullUrlParams = String.format(this.urlSignParams, this.developerId,
177
+                timestamsParam, paramsSign);
178
+
179
+        String responseResult = HttpClientSender.sendHttpPost(this.serverHost, methodInvoke,
180
+                fullUrlParams, requestParam.toJSONString());
181
+
182
+
183
+        JSONObject responseObj = JSON.parseObject(responseResult);
184
+        // 返回errno为0,表示成功,其他表示失败
185
+        if (responseObj.getIntValue("errno") == 0) {
186
+            JSONObject data = responseObj.getJSONObject("data");
187
+            if (data != null) {
188
+                String message = data.getString("message");
189
+                String status = data.getString("status");
190
+                return status;
191
+            }
192
+        } else {
193
+
194
+            log.error("查询申请状态异常:"+responseObj.toJSONString());
195
+        }
196
+        return responseObj.toJSONString();
197
+    }
158
 }
198
 }

+ 9
- 11
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java Ver fichero

60
     public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
60
     public IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication) {
61
         IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
61
         IdentityAuthentication identityAuthenticationselect = identityAuthenticationMapper.selectIdentityAuthentication(identityAuthentication);
62
         if(identityAuthenticationselect!=null){
62
         if(identityAuthenticationselect!=null){
63
-            identityAuthenticationselect.setCertificationStatusName("已身份注册");
63
+            identityAuthenticationselect.setCertificationStatusName("已身份认证");
64
         }else {
64
         }else {
65
             IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
65
             IdentityAuthentication identityAuthenticationselectnew = new IdentityAuthentication();
66
-            identityAuthenticationselectnew.setCertificationStatusName("未身份注册");
66
+            identityAuthenticationselectnew.setCertificationStatusName("未身份认证");
67
+            identityAuthenticationselectnew.setCertificationStatus(0);
67
             return identityAuthenticationselectnew;
68
             return identityAuthenticationselectnew;
68
         }
69
         }
69
         return identityAuthenticationselect;
70
         return identityAuthenticationselect;
119
                 GetEidResultRequest reqest = new GetEidResultRequest();
120
                 GetEidResultRequest reqest = new GetEidResultRequest();
120
                 //设置请求参数
121
                 //设置请求参数
121
                 reqest.setEidToken(eidToken);
122
                 reqest.setEidToken(eidToken);
123
+
124
+//                reqest.setInfoType("1");
125
+//                reqest.setInfoType("13");
126
+                reqest.setInfoType("2");
127
+
122
                 //获得身份认证结果
128
                 //获得身份认证结果
123
                 GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest);
129
                 GetEidResultResponse respIdenAuth = clientIdenAuth.GetEidResult(reqest);
124
                 String respJSON = GetEidResultResponse.toJsonString(respIdenAuth);
130
                 String respJSON = GetEidResultResponse.toJsonString(respIdenAuth);
125
                 JSONObject objJSON = JSON.parseObject(respJSON);
131
                 JSONObject objJSON = JSON.parseObject(respJSON);
126
-                JSONObject objText = JSON.parseObject(objJSON.getString("Text"));
127
-                String name = objText.getString("OcrName");
128
-//                IdentityAuthenticationRespon.setName(name);
129
-                String identityNo = objText.getString("OcrIdCard");
130
-//                IdentityAuthenticationRespon.setIdentityNo(identityNo);
131
                 IdentityAuthenticationRespon.setCertificationStatus(1);
132
                 IdentityAuthenticationRespon.setCertificationStatus(1);
132
                 IdentityAuthenticationRespon.setUserName(userName);
133
                 IdentityAuthenticationRespon.setUserName(userName);
133
                 IdentityAuthenticationRespon.setUserId(userId);
134
                 IdentityAuthenticationRespon.setUserId(userId);
138
                 Map<String,String> mapEidInfo =  decodeEidInfo(desKey,uerInfo);
139
                 Map<String,String> mapEidInfo =  decodeEidInfo(desKey,uerInfo);
139
                 IdentityAuthenticationRespon.setName(mapEidInfo.get("name"));
140
                 IdentityAuthenticationRespon.setName(mapEidInfo.get("name"));
140
                 IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo"));
141
                 IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo"));
142
+                IdentityAuthenticationRespon.setCertificationStatus(1);
141
 
143
 
142
                 identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
144
                 identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
143
-//                IdentityAuthenticationResult.setUserName(userName);
144
                 IdentityAuthenticationResult.setCertificationStatus(1);
145
                 IdentityAuthenticationResult.setCertificationStatus(1);
145
                 IdentityAuthenticationResult.setCertificationStatusName("认证成功");
146
                 IdentityAuthenticationResult.setCertificationStatusName("认证成功");
146
-//                IdentityAuthenticationResult.setName(name);
147
-//                IdentityAuthenticationResult.setIdentityNo(identityNo);
148
-                System.out.println(GetEidResultResponse.toJsonString(respIdenAuth));
149
             } catch (TencentCloudSDKException e) {
147
             } catch (TencentCloudSDKException e) {
150
                 log.error("认证失败:", e);
148
                 log.error("认证失败:", e);
151
                 throw new RuntimeException("认证失败");
149
                 throw new RuntimeException("认证失败");

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml Ver fichero

37
     </insert>
37
     </insert>
38
 
38
 
39
     <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
39
     <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
40
-        SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certificationStatus ,i.user_id ,i.user_name
40
+        SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name
41
         from identi_authenti i
41
         from identi_authenti i
42
         <where>
42
         <where>
43
             <if test="userName != null  and userName != '' ">
43
             <if test="userName != null  and userName != '' ">