puzhibing
2024-03-08 ab32ff27ca091ce2ec1cb6ea666de0ed6e6c1cbf
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
@@ -223,8 +223,26 @@
        TOperator data = operatorService.getById(id);
        User byId = userService.getById(data.getUserId());
        model.addAttribute("user",byId);
        OperatorUser operatorId = operatorUserService.getOne(new QueryWrapper<OperatorUser>()
                .eq("operatorId", data.getId()));
        model.addAttribute("data",data);
        String state="";
        switch (operatorId.getAlipayAudit()){
            case 0:
                state="未认证";
                break;
            case 1:
                state="待审核";
                break;
            case 2:
                state="已通过";
                break;
            case 3:
                state="已拒绝";
                break;
        }
        model.addAttribute("state",state);
        OperatorAuthAlipay info = operatorAuthService.getOne(new QueryWrapper<OperatorAuthAlipay>()
                .eq("operatorId", id));
        model.addAttribute("item",info);
@@ -244,9 +262,6 @@
            List<TCity> list5 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 1));
            model.addAttribute("list5",list5);
        }
        model.addAttribute("bodyType",info.getBodyType());
        model.addAttribute("accountType",info.getAccountType());
        model.addAttribute("useType",info.getUseType());
@@ -290,20 +305,20 @@
            return ERROR;
        }
    }
    public static void main(String[] args) {
        // 调用支付宝接口 通过银行卡号获取银行信息
        String url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&" +
                "cardNo=6217003800041315031&cardBinCheck=true";
        HashMap<String, String> hashMap = new HashMap<>();
        String result = HttpRequestUtil.postRequest(url,hashMap);
        System.err.println(result);
        JSONObject json = JSONObject.parseObject(result);
        String bank = json.getString("bank");
        String cardType = json.getString("cardType");
        System.err.println(bank);
        System.err.println(cardType);
    }
//    public static void main(String[] args) {
//        // 调用支付宝接口 通过银行卡号获取银行信息
//        String url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&" +
//                "cardNo=6217003800041315031&cardBinCheck=true";
//        HashMap<String, String> hashMap = new HashMap<>();
//        String result = HttpRequestUtil.postRequest(url,hashMap);
//        System.err.println(result);
//        JSONObject json = JSONObject.parseObject(result);
//        String bank = json.getString("bank");
//        String cardType = json.getString("cardType");
//        System.err.println(bank);
//        System.err.println(cardType);
//
//    }
    /**
@@ -324,12 +339,18 @@
        Integer userId1 = byId.getUserId();
        OperatorUser userId2 = operatorUserService.getOne(new QueryWrapper<OperatorUser>()
                .eq("userId", userId1));
        userId2.setAlipayAudit(1);
        // 01是企业
        if (bodyType.equals("01")){
            userId2.setAlipayType(2);
        }else{
            userId2.setAlipayType(1);
        }
        operatorUserService.saveOrUpdate(userId2);
        OperatorAuthAlipay data = operatorAuthService.getOne(new QueryWrapper<OperatorAuthAlipay>().eq("operatorId", operatorId));
    // 调用支付宝接口 通过银行卡号获取银行信息
        // 调用支付宝接口 通过银行卡号获取银行信息
        String url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&" +
                "cardNo="+bankCard+"&cardBinCheck=true";
        HashMap<String, String> hashMap = new HashMap<>();
        String result = HttpRequestUtil.postRequest(url,hashMap);
        System.err.println(result);
@@ -533,6 +554,7 @@
            System.err.println("订单号"+order_no);
            operatorAuth.setOrderNo(order_no);
            operatorAuth.setRefuseReason("");
            operatorAuthService.saveOrUpdate(operatorAuth);
            Integer userId = operatorService.getById(operatorId).getUserId();
            OperatorUser user = operatorUserService.getOne(new QueryWrapper<OperatorUser>().eq("userId", userId));
@@ -545,6 +567,11 @@
            }
            operatorUserService.saveOrUpdate(user);
        } else {
            Integer userId = operatorService.getById(operatorId).getUserId();
            OperatorUser user = operatorUserService.getOne(new QueryWrapper<OperatorUser>().eq("userId", userId));
            user.setAlipayAudit(3);
            operatorUserService.saveOrUpdate(user);
            operatorAuth.setRefuseReason(response.getSubMsg());
            if (response.getCode().equals("40004")){
                String subMsg = response.getSubMsg();
                return ResultUtil.error(subMsg);
@@ -829,4 +856,15 @@
        }
        return ResultUtil.success("添加成功");
    }
    /**
     * 获取所有运营商
     * @return
     */
    @ResponseBody
    @PostMapping("/getOperatorListAll")
    public Object getOperatorListAll(){
        return operatorService.list(new QueryWrapper<TOperator>().eq("state", 1));
    }
}