cuixq 3 роки тому
батько
коміт
e3a1ef1fc6

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

@@ -1,18 +1,16 @@
 package com.tianhu.system.companyAuth.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.tianhu.common.core.cfca.AxqCommonUtil;
 import com.tianhu.common.core.cfca.CfcaUtil;
 import com.tianhu.common.core.cfca.QccCommonUtil;
+import com.tianhu.common.core.cfca.connector.HttpConnector;
 import com.tianhu.common.core.constant.CacheConstants;
 import com.tianhu.common.core.constant.Constants;
 import com.tianhu.common.core.domain.R;
 import com.tianhu.common.core.exception.BaseException;
 import com.tianhu.common.core.utils.*;
-import com.tianhu.common.core.utils.file.ExcelFileUtils;
 import com.tianhu.common.core.web.controller.BaseController;
-import com.tianhu.common.core.web.domain.AjaxResult;
 import com.tianhu.common.redis.service.RedisService;
 import com.tianhu.common.security.service.TokenService;
 import com.tianhu.system.api.RemoteFileService;
@@ -27,30 +25,16 @@ import com.tianhu.system.mapper.SysRoleMapper;
 import com.tianhu.system.service.*;
 import com.tianhu.system.utils.FlowableService;
 import com.tianhu.system.utils.SysConstant;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.swing.*;
-import java.io.*;
-import java.sql.ResultSet;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -152,6 +136,22 @@ public class OwnAuthController extends BaseController {
      */
     private String TYPECODE = "0";
     /**
+     * CFCA安心签jks路径
+     */
+    private String JSK = "0";
+    /**
+     * CFCA安心签jsk密码
+     */
+    private String TSKPOSSWORD = "0";
+    /**
+     * CFCA安心签渠道(默认Test,生产环境:Prod)
+     */
+    private String CHANNEL = "Test";
+    /**
+     * CFCA安心签(账号注册成功时生成的)
+     */
+    private String PLATID = "CA4572A39DCB55ABE05311016B0A04B3";
+    /**
      * 企查查标识 招采云链默认使用
      */
     private String KEY = "2eb3e260ce1c4439aa0aa039fb494036";
@@ -637,12 +637,12 @@ public class OwnAuthController extends BaseController {
         String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
         //查询银行行号
         LambdaQueryWrapper<ZcCfcaBankInf> queryWrapper = new LambdaQueryWrapper<>();
-        //所属银行
-        queryWrapper.eq(ZcCfcaBankInf::getZcbiBankName,pbaiBankName);
-        List<ZcCfcaBankInf> list = zcCfcaBankInfService.findZcCfcaBankInfs(queryWrapper);
-        if(list.size()==0){
-            return R.fail("银行名称错误,请输入正确的银行名");
-        }
+//        //所属银行
+//        queryWrapper.eq(ZcCfcaBankInf::getZcbiBankName,pbaiBankName);
+//        List<ZcCfcaBankInf> list = zcCfcaBankInfService.findZcCfcaBankInfs(queryWrapper);
+//        if(list.size()==0){
+//            return R.fail("银行名称错误,请输入正确的银行名");
+//        }
         //查询账户
         LambdaQueryWrapper<PayBankAccInf> bank = new LambdaQueryWrapper<>();
         //所属银行
@@ -662,7 +662,7 @@ public class OwnAuthController extends BaseController {
             }
             }else{
             //企业打款申请
-            JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,list.get(0).getZcbiBankNo(),zbiRemark);
+            JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,pbaiBankName,zbiRemark);
             /*JSONObject operatorAuth = new JSONObject();
             operatorAuth.put("Message", "SUCCESS");
             operatorAuth.put("Status", "20");
@@ -831,9 +831,9 @@ public class OwnAuthController extends BaseController {
         sysCompany.setScyStatus("00");
         JSONObject companyAccount =null;
         if(CommonUtil.isNotEmpty(handler)) {
-             companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, handler, TYPECODE, handlerCard);
+             companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, handler, TYPECODE, handlerCard,new HttpConnector(JSK,TSKPOSSWORD,CHANNEL,PLATID));
         }else{
-            companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, scyLegal, TYPECODE, scyLegalId);
+            companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, scyLegal, TYPECODE, scyLegalId,new HttpConnector(JSK,TSKPOSSWORD,CHANNEL,PLATID));
         }
         System.out.print("开户结果==========>" + companyAccount);
         //返回cfca用户id
@@ -915,6 +915,24 @@ public class OwnAuthController extends BaseController {
         }
     }
 
+    /**
+     * 查询银行
+     *
+     * @return
+     */
+    @PostMapping("/queryBank")
+    public R queryBank(String zcbiId,String pbaiBankName) throws Exception {
+        startPage();
+        //查询账户
+        LambdaQueryWrapper<ZcCfcaBankInf> bank = new LambdaQueryWrapper<>();
+        //所属银行
+        if(CommonUtil.isNotEmpty(pbaiBankName)){
+            bank.eq(ZcCfcaBankInf::getZcbiBankName,pbaiBankName);
+        }
+        List<ZcCfcaBankInf> bankAcc = zcCfcaBankInfService.findZcCfcaBankInfs(bank);
+        return R.ok(bankAcc);
+    }
+
     private Set<String> getPermissions(SysUser user){
         Set<String> permissions = new HashSet<String>();
         //平台走原流程