魏超 hace 5 años
padre
commit
7da205f1af

+ 21
- 7
src/main/java/com/huiju/estateagents/eContract/controller/TaCompanyController.java Ver fichero

@@ -69,6 +69,7 @@ public class TaCompanyController extends BaseController {
69 69
 
70 70
     public ITaContractUserService iTaContractUserService;
71 71
 
72
+
72 73
     /**
73 74
      * 条件查询企业列表
74 75
      *
@@ -464,6 +465,7 @@ public class TaCompanyController extends BaseController {
464 465
         taContract.setContractId(contractId);
465 466
         taContract.setContractDownloadUrl(downloadUrl);
466 467
         taContract.setContractViewUrl(viewpdfUrl);
468
+        taContract.setStatus(CommConstant.STATUS_NORMAL);
467 469
         iTaContractService.updateById(taContract);
468 470
 
469 471
         TaCompany taCompany = new TaCompany();
@@ -475,13 +477,6 @@ public class TaCompanyController extends BaseController {
475 477
         taCompany.setAuthorizeViewUrl(viewpdfUrl);
476 478
         taCompany.setAuthorizeDescription(resultDesc);
477 479
         taCompany.setAuthorizeType(CommConstant.ONLINEAUTH);
478
-//        QueryWrapper<TaCompany> taCompanyQueryWrapper = new QueryWrapper<>();
479
-//        taCompanyQueryWrapper.eq("authorize_status", resultCode.equals("3000") ? "1" : "0");
480
-//        taCompanyQueryWrapper.eq("authorize_transaction_id", transactionId);
481
-//        taCompanyQueryWrapper.eq("authorize_contract_id", contractId);
482
-//        taCompanyQueryWrapper.eq("authorize_download_url", downloadUrl);
483
-//        taCompanyQueryWrapper.eq("authorize_view_url", viewpdfUrl);
484
-//        taCompanyQueryWrapper.eq("authorize_description", resultDesc);
485 480
         iTaCompanyService.updateById(taCompany);
486 481
 
487 482
     }
@@ -522,4 +517,23 @@ public class TaCompanyController extends BaseController {
522 517
         taContract.setContractViewUrl(viewpdf_url);
523 518
         iTaContractService.updateById(taContract);
524 519
     }
520
+
521
+    /**
522
+     * 查询授权状态接口
523
+     * @param id
524
+     * @return
525
+     */
526
+    @RequestMapping(value = "/channel/company/getAuthStatus/{id}", method = RequestMethod.GET)
527
+    public ResponseBean getAuthStatus(@PathVariable Integer id){
528
+        ResponseBean responseBean = new ResponseBean();
529
+        String res = iTaCompanyService.getAuthStatus(id);
530
+        JSONObject result = JSONObject.parseObject(res);
531
+
532
+        if ((Integer) result.get("code") != 1){
533
+            responseBean.addError(result.getString("msg"));
534
+            return responseBean;
535
+        }
536
+        responseBean.addSuccess(result.get("data"));
537
+        return responseBean;
538
+    }
525 539
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/eContract/service/ITaCompanyService.java Ver fichero

@@ -37,4 +37,6 @@ public interface ITaCompanyService extends IService<TaCompany> {
37 37
     String autoAuthCompanySeal(Integer companyId, Integer orgId) throws Exception;
38 38
 
39 39
     TaCompany getCompanyAndContractInfo(Integer companyId);
40
+
41
+    String getAuthStatus(Integer companyId);
40 42
 }

+ 20
- 0
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanySealUtil.java Ver fichero

@@ -86,4 +86,24 @@ public class TaCompanySealUtil {
86 86
 
87 87
         return stringBuilder.toString();
88 88
     }
89
+
90
+    public String getAuthStatus(String customerId){
91
+        ArrayList params = new ArrayList();
92
+
93
+        try {
94
+            String timeStamp = HttpsUtil.getTimeStamp();
95
+            String sha1 = FddEncryptTool.sha1(fadadaProperties.getAppId() + FddEncryptTool.md5Digest(timeStamp) + FddEncryptTool.sha1(fadadaProperties.getAppSecret() + customerId));
96
+            String msgDigest = new String(FddEncryptTool.Base64Encode(sha1.getBytes()));
97
+            params.add(new BasicNameValuePair("customer_id", customerId));
98
+            params.add(new BasicNameValuePair("app_id", fadadaProperties.getAppId()));
99
+            params.add(new BasicNameValuePair("timestamp", timeStamp));
100
+            params.add(new BasicNameValuePair("v", fadadaProperties.getVersion()));
101
+            params.add(new BasicNameValuePair("msg_digest", msgDigest));
102
+        } catch (Exception var7) {
103
+            var7.printStackTrace();
104
+            throw new RuntimeException(var7);
105
+        }
106
+
107
+        return HttpsUtil.doPost(fadadaProperties.getServeHost() + "get_auth_status.api", params);
108
+    }
89 109
 }

+ 7
- 1
src/main/java/com/huiju/estateagents/eContract/service/impl/TaCompanyServiceImpl.java Ver fichero

@@ -206,7 +206,7 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
206 206
         taContract.setOrgId(orgId);
207 207
         taContract.setCreateDate(LocalDateTime.now());
208 208
         taContract.setTargetType(CommConstant.AUTH);
209
-        taContract.setStatus(CommConstant.STATUS_NORMAL);
209
+        taContract.setStatus(CommConstant.STATUS_UNACCALIMED);
210 210
         taContract.setOrgId(orgId);
211 211
         taContractMapper.insert(taContract);
212 212
 
@@ -221,6 +221,12 @@ public class TaCompanyServiceImpl extends ServiceImpl<TaCompanyMapper, TaCompany
221 221
         return taCompanyMapper.getCompanyAndContractInfo(companyId);
222 222
     }
223 223
 
224
+    @Override
225
+    public String getAuthStatus(Integer companyId) {
226
+        TaCompany taCompany = taCompanyMapper.selectById(companyId);
227
+        return taCompanySealUtil.getAuthStatus(taCompany.getFadadaCode());
228
+    }
229
+
224 230
     /**
225 231
      * url解码
226 232
      * @param bizContent

+ 1
- 1
src/main/resources/mapper/eContract/TaCompanyMapper.xml Ver fichero

@@ -4,7 +4,7 @@
4 4
 
5 5
     <select id="getCompanyAndContractInfo" resultType="com.huiju.estateagents.eContract.entity.TaCompany">
6 6
         select *,a.contract_id From ta_company t
7
-        left join ta_contract a on t.company_id = a.company_id and a.target_type = 'auth'
7
+        left join ta_contract a on t.company_id = a.company_id and a.target_type = 'auth' and a.status = 1
8 8
         where t.company_id = #{companyId}
9 9
     </select>
10 10