新版仿ok交易所-后端
1
zj
2025-09-30 d4be4cc69f18b01cc39bd3f9dc9497a828848ca8
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java
@@ -109,13 +109,14 @@
        Map<String, Object> parities = parities(symbol, symbol_to, volume_temp);
        Object getVolume = parities.get("get_volume");
        if(symbol.equals("usdt")){
            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
            Wallet userIdWallet = walletService.saveWalletByPartyId(partyId);
//            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
            if(userIdWallet.getMoney().compareTo(new BigDecimal(volume_temp)) < 0){
                throw new YamiShopBindException("not sufficient funds");
            }
            Double value = Double.valueOf(volume_temp);
            capitaltWalletService.update(userIdWallet,  -value);
//            capitaltWalletService.update(userIdWallet,  -value);
            walletService.update(userIdWallet.getUserId(),  -value);
            WalletExtend walletExtend = walletExtendService.getOne(new LambdaQueryWrapper<>(WalletExtend.class)
                    .eq(WalletExtend::getWallettype, symbol_to)
                            .eq(WalletExtend::getPartyId,partyId)
@@ -147,8 +148,10 @@
            walletExtendService.update(walletExtend,new LambdaUpdateWrapper<WalletExtend>().eq(UUIDEntity::getUuid,walletExtend.getUuid()));
            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
            capitaltWalletService.update(userIdWallet,Double.valueOf(getVolume.toString()));
//            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
//            capitaltWalletService.update(userIdWallet,Double.valueOf(getVolume.toString()));
            Wallet userIdWallet = walletService.saveWalletByPartyId(partyId);
            walletService.update(userIdWallet.getUserId(),Double.valueOf(getVolume.toString()));
        }else{
            WalletExtend walletExtend = walletExtendService.getOne(new LambdaQueryWrapper<>(WalletExtend.class)
                    .eq(WalletExtend::getWallettype, symbol)
@@ -374,12 +377,12 @@
    public Result openview() {
        Map<String, Object> data = new HashMap<String, Object>();
        String partyId = SecurityUtils.getUser().getUserId();
//        Wallet wallet = walletService.saveWalletByPartyId(partyId);
        CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
        Wallet wallet = walletService.saveWalletByPartyId(partyId);
//        CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
        // 账户剩余资金
        DecimalFormat df = new DecimalFormat("#.##");
        df.setRoundingMode(RoundingMode.FLOOR);// 向下取整
        data.put("volume", df.format(userIdWallet.getMoney()));
        data.put("volume", df.format(wallet.getMoney()));
        String session_token = sessionTokenService.savePut(partyId);
        data.put("session_token", session_token);
        data.put("fee", sysparaService.find("exchange_apply_order_buy_fee").getSvalue());