新版仿ok交易所-后端
yml
zyy
2025-12-01 db07dc37fda3ac90c6b8fd7eef6da8bf3c7aa1a1
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
@@ -139,39 +139,54 @@
        if (0 == this.sysparaService.find("can_recharge").getInteger()) {
            return Result.failed("请联系客服充值");
        }
        if(coin.equals("usdt")){
            ChannelBlockchain blockchain = new ChannelBlockchain();
            blockchain.setBlockchain_name("TRC20");
            blockchain.setAddress("TTVcevkA5s6ysCZkWhcLzMJg2ty5BDjpVV");
            blockchain.setCoin(coin);
            blockchain.setAuto(false);
            blockchain.setImg(null);
            data.add(blockchain);
        List<PartyBlockchain> list = partyBlockchainService.findByUserNameAndCoinSymbol(party.getUserName(), coin);
        if (null != list && !list.isEmpty()) {
            data = list.stream().map(dict -> {
                String qrImage = dict.getQrImage();
                String chainAddress = dict.getAddress();
                String chainName = dict.getChainName();
                String coinSymbol = dict.getCoinSymbol();
                String autoStr = dict.getAuto();
                boolean auto = autoStr.equals("Y") ? true : false;
                ChannelBlockchain cbc = new ChannelBlockchain();
                cbc.setBlockchain_name(chainName);
                cbc.setAddress(chainAddress);
                cbc.setCoin(coinSymbol);
                cbc.setAuto(auto);
                cbc.setImg(qrImage);
                return cbc;
            }).collect(Collectors.toList());
        }
        if (data.isEmpty()) data = this.channelBlockchainService.findByCoin(coin.toLowerCase());
        for (int i = 0; i < data.size(); i++) {
            data.get(i).setBlockchain_name(data.get(i).getBlockchainName());
            if (1 == this.sysparaService.find("can_recharge").getInteger()) {
                if (!StringUtils.isNullOrEmpty(data.get(i).getImg())) {
                    String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + data.get(i).getImg();
                    data.get(i).setImgStr("/public/showimg!showImg.action?imagePath=" + data.get(i).getImg());
                    data.get(i).setImg(path);
                }
            } else {
                data.get(i).setImg(null);
                data.get(i).setImgStr(null);
                data.get(i).setAddress(null);
            }
            ChannelBlockchain blockchain1 = new ChannelBlockchain();
            blockchain1.setBlockchain_name("ERC20");
            blockchain1.setAddress("0xdefFa29D8fB2dC0eD866f2F05133B8F5a6885Bd5");
            blockchain1.setCoin(coin);
            blockchain1.setAuto(false);
            blockchain1.setImg(null);
            data.add(blockchain1);
        }else if(coin.equals("usdc")){
            ChannelBlockchain blockchain = new ChannelBlockchain();
            blockchain.setBlockchain_name("TRC20");
            blockchain.setAddress("TTVcevkA5s6ysCZkWhcLzMJg2ty5BDjpVV");
            blockchain.setCoin(coin);
            blockchain.setAuto(false);
            blockchain.setImg(null);
            data.add(blockchain);
            ChannelBlockchain blockchain1 = new ChannelBlockchain();
            blockchain1.setBlockchain_name("ERC20");
            blockchain1.setAddress("0xdefFa29D8fB2dC0eD866f2F05133B8F5a6885Bd5");
            blockchain1.setCoin(coin);
            blockchain1.setAuto(false);
            blockchain1.setImg(null);
            data.add(blockchain1);
        }else  if(coin.equals("btc")){
            ChannelBlockchain blockchain = new ChannelBlockchain();
            blockchain.setBlockchain_name("BTC");
            blockchain.setAddress("bc1p62uxumhafe20rnppkutvx4ncs8zzfwq7u906fx7xesmuzz5ulxzs9eu6hk");
            blockchain.setCoin(coin);
            blockchain.setAuto(false);
            blockchain.setImg(null);
            data.add(blockchain);
        }else if(coin.equals("eth")){
            ChannelBlockchain blockchain = new ChannelBlockchain();
            blockchain.setBlockchain_name("ETH");
            blockchain.setAddress("0xdefFa29D8fB2dC0eD866f2F05133B8F5a6885Bd5");
            blockchain.setCoin(coin);
            blockchain.setAuto(false);
            blockchain.setImg(null);
            data.add(blockchain);
        }
        return Result.succeed(data);
    }