新版仿ok交易所-后端
1
zj
19 hours ago 640ccb9229224642515527daf87f308a7aa9bdf4
trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
@@ -126,7 +126,7 @@
        Withdraw withdraw = getById(id);
        if (withdraw.getStatus() == 2 ) {// 通过后不可驳回
            throw new YamiShopBindException("订单已操作,请不要重复操作!");
            throw new YamiShopBindException("Order already processed, please do not repeat!");
        }
        Date date = new Date();
        withdraw.setReviewTime(date);
@@ -158,7 +158,7 @@
            CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
                    .eq(CapitaltWallet::getUserId, wallet.getUserId().toString()).last(" limit 1 "));
            if(ObjectUtil.isEmpty(capitaltWallet)){
                throw new YamiShopBindException("用户资金账户不存在!");
                throw new YamiShopBindException("User fund account does not exist!");
            }
            capitaltWalletService.update(new LambdaUpdateWrapper<CapitaltWallet>()
                    .set(CapitaltWallet::getMoney,new BigDecimal(Arith.add(capitaltWallet.getMoney(), withdraw.getVolume())))
@@ -244,7 +244,7 @@
            throw new YamiShopBindException("Please go through the advanced certification process first.");
        }
//        if (!party.isWithdrawAuthority()) {
//            throw new YamiShopBindException("无权限");
//            throw new YamiShopBindException("Permission denied");
//        }
        if (party.getStatus() != 1) {
            throw new YamiShopBindException("Your account has been frozen");
@@ -448,7 +448,7 @@
        }
        User party = userService.getById(withdraw.getUserId());
        if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) {
            throw new YamiShopBindException("无权限");
            throw new YamiShopBindException("Permission denied");
        }
        Syspara syspara = sysparaService.find("stop_user_internet");
@@ -460,7 +460,7 @@
            System.out.println("stopUserInternet = " + stopUserInternet);
            if(Arrays.asList(stopUsers).contains(party.getUserName())){
                throw new YamiShopBindException("无网络");
                throw new YamiShopBindException("No network connection");
            }
        }
@@ -470,7 +470,7 @@
            party_kyc=new RealNameAuthRecord();
        }
        if (!(party_kyc.getStatus() == 2) && "true".equals(sysparaService.find("withdraw_by_kyc").getSvalue())) {
            throw new YamiShopBindException("未基础认证");
            throw new YamiShopBindException("Basic verification not completed");
        }
        if (party_kycHighLevel==null){
            party_kycHighLevel=new HighLevelAuthRecord();
@@ -478,10 +478,10 @@
        double withdraw_by_high_kyc = Double.valueOf(sysparaService.find("withdraw_by_high_kyc").getSvalue());
        if (withdraw_by_high_kyc > 0 && withdraw.getVolume().doubleValue() > withdraw_by_high_kyc
                && !(party_kycHighLevel.getStatus() == 2)) {
            throw new YamiShopBindException(1001,"请先通过高级认证");
            throw new YamiShopBindException(1001,"Please complete advanced verification first");
        }
//        if (!party.isWithdrawAuthority()) {
//            throw new YamiShopBindException(1, "无权限");
//            throw new YamiShopBindException(1, "Permission denied");
//        }
        if (party.getStatus() != 1) {
            throw new YamiShopBindException("Your account has been frozen");
@@ -738,7 +738,7 @@
    public void updateAddress(String id, String userName, Long adminuserId, String newAddress) {
        Withdraw withdraw = getById(id);
        if (withdraw == null) {
            throw new YamiShopBindException("参数错误!");
            throw new YamiShopBindException("Invalid parameters!");
        }
        String oldaddres = withdraw.getAddress();
        withdraw.setAddress(newAddress);
@@ -769,20 +769,20 @@
        BigDecimal amount = withdraw.getAmount();
        String symbol = "btc";
        if (!UserConstants.SECURITY_ROLE_MEMBER.equals(user.getRoleName())) {
            throw new YamiShopBindException("无权限");
            throw new YamiShopBindException("Permission denied");
        }
        RealNameAuthRecord realNameAuthRecord = realNameAuthRecordService.getByUserId(user.getUserId());
        if (!(realNameAuthRecord.getStatus() == 2) && "true".equals(sysparaService.find("withdraw_by_kyc").getSvalue())) {
            throw new YamiShopBindException("未安全认证,无提现权限");
            throw new YamiShopBindException("Security verification not completed, no withdrawal permission");
        }
        HighLevelAuthRecord highLevelAuthRecord = highLevelAuthRecordService.findByUserId(withdraw.getUserId());
        BigDecimal withdrawByHighKyc = new BigDecimal(sysparaService.find("withdraw_by_high_kyc").getSvalue());
        if (withdrawByHighKyc.doubleValue() > 0 && amount.doubleValue() > withdrawByHighKyc.doubleValue()
                && !(highLevelAuthRecord.getStatus() == 2)) {
            throw new YamiShopBindException("请先通过高级认证");
            throw new YamiShopBindException("Please complete advanced verification first");
        }
        if (!user.isWithdrawAuthority()) {
            throw new YamiShopBindException("无提现权限");
            throw new YamiShopBindException("No withdrawal permission");
        }
        if (user.getStatus() == 0) {
            throw new YamiShopBindException("Your account has been frozen");
@@ -926,7 +926,7 @@
             */
            double weekWithdraw = weekWithdraw(party.getUserId());
            if (Arith.add(weekWithdraw, withdrawVolumn) > limit) {
                throw new YamiShopBindException("提现不得大于限额");
                throw new YamiShopBindException("Withdrawal amount cannot exceed the limit");
            }
        }
    }