Browse Source

企业认证开户放开

cuixq 3 years ago
parent
commit
25f0537082

+ 31 - 31
tianhu-system/src/main/java/com/tianhu/system/companyAuth/controller/OwnAuthController.java

@@ -991,37 +991,37 @@ public class OwnAuthController extends BaseController {
         sysCompany.setScyId(scyId);
         //正常状态
         sysCompany.setScyStatus("00");
-//        JSONObject companyAccount =null;
-//        //jks路径
-//        String jksPath = configService.selectConfigByKey("jks_path");
-//        //密码
-//        String keyStorePassword = configService.selectConfigByKey("cfca_key_store_password");
-//        //渠道
-//        String channel = configService.selectConfigByKey("cfca_channel");
-//        //platId
-//        String platId = configService.selectConfigByKey("cfca_platId");
-//        if(CommonUtil.isNotEmpty(handler)) {
-//            try {
-//                companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, handler, TYPECODE, handlerCard,new HttpConnector(jksPath,keyStorePassword,channel,platId));
-//                }catch (Exception e) {
-//                throw new Exception("开户失败!");
-//                }
-//        }else{
-//            try {
-//                companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, scyLegal, TYPECODE, scyLegalId,new HttpConnector(jksPath,keyStorePassword,channel,platId));
-//            }catch (Exception e) {
-//                throw new Exception("开户失败!");
-//            }
-//            }
-//        System.out.print("开户结果==========>" + companyAccount);
-//        //返回cfca用户id
-//        if(CommonUtil.isNotEmpty(companyAccount.getJSONObject("enterprise").getString("userId"))){
-//            String userId = companyAccount.getJSONObject("enterprise").getString("userId");
-//            sysCompany.setScyCfcaUserId(userId);
-//            sysCompanyService.updateSysCompany(sysCompany);
-//        }else{
-//            throw new Exception("开户失败!");
-//        }
+        JSONObject companyAccount =null;
+        //jks路径
+        String jksPath = configService.selectConfigByKey("jks_path");
+        //密码
+        String keyStorePassword = configService.selectConfigByKey("cfca_key_store_password");
+        //渠道
+        String channel = configService.selectConfigByKey("cfca_channel");
+        //platId
+        String platId = configService.selectConfigByKey("cfca_platId");
+        if(CommonUtil.isNotEmpty(handler)) {
+            try {
+                companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, handler, TYPECODE, handlerCard,new HttpConnector(jksPath,keyStorePassword,channel,platId));
+                }catch (Exception e) {
+                throw new Exception("开户失败!");
+                }
+        }else{
+            try {
+                companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, scyLegal, TYPECODE, scyLegalId,new HttpConnector(jksPath,keyStorePassword,channel,platId));
+            }catch (Exception e) {
+                throw new Exception("开户失败!");
+            }
+            }
+        System.out.print("开户结果==========>" + companyAccount);
+        //返回cfca用户id
+        if(CommonUtil.isNotEmpty(companyAccount.getJSONObject("enterprise").getString("userId"))){
+            String userId = companyAccount.getJSONObject("enterprise").getString("userId");
+            sysCompany.setScyCfcaUserId(userId);
+            sysCompanyService.updateSysCompany(sysCompany);
+        }else{
+            throw new Exception("开户失败!");
+        }
         //查询企业
         LambdaQueryWrapper<SysCompany> company = new LambdaQueryWrapper<>();
         //企业id