新版仿ok交易所-后端
zyy
2026-03-02 175d7da90c49383334d285939dcc00caee030c80
u盾
3 files modified
25 ■■■■■ changed files
trading-order-admin/src/main/java/com/yami/trading/api/UD/UdunClient.java 8 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java 12 ●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/contract/ContractOrderService.java 5 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/UD/UdunClient.java
@@ -26,12 +26,12 @@
    /**
     * UDUN Merchant Key
     */
    private final String merchantKey =  "2ea108221e1abasd2129a614ca4f1e899ef";
    private final String merchantKey =  "ced10252df2ffad4e9d3059924ece9b0";
    /**
     * UDUN Merchant Number
     */
    private final String merchantId =  "3221d38";
    private final String merchantId =  "322571";
    /**
     * Callback 充值
@@ -139,9 +139,9 @@
    public static void main(String[] args) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantId", 322138);
        params.put("merchantId", 322571);
        params.put("showBalance", false);
        ResultMsg result = JSONUtil.toBean(UdunUtils.post("https://sig10.udun.io", "2ea108221e1ab2129a614ca4f1e899ef", ApiPath.SUPPORT_COIN, JSONUtil.toJsonStr(params)), ResultMsg.class);
        ResultMsg result = JSONUtil.toBean(UdunUtils.post("https://sig10.udun.io", "ced10252df2ffad4e9d3059924ece9b0", ApiPath.SUPPORT_COIN, JSONUtil.toJsonStr(params)), ResultMsg.class);
        if (result.getCode() != HttpStatus.HTTP_OK) {
            Console.error(JSONUtil.toJsonStr(result));
        }
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
@@ -124,7 +124,7 @@
        return Result.succeed(data);
    }
    @GetMapping(action + "getBlockchainName.action")
    /*@GetMapping(action + "getBlockchainName.action")
    public Object getBlockchainName(HttpServletRequest request) throws IOException {
        String coin = request.getParameter("coin");
        List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>();
@@ -170,12 +170,12 @@
            }
        }
        return Result.succeed(data);
    }
    }*/
    /**
     * 根据币种获取链地址
     */
    /*@GetMapping(action + "getBlockchainName.action")
    @GetMapping(action + "getBlockchainName.action")
    public Object getBlockchainName(HttpServletRequest request) throws Exception {
        String coin = request.getParameter("coin");
        coin = coin.toLowerCase();
@@ -186,7 +186,7 @@
        try {
            String partyId = SecurityUtils.getUser().getUserId();
            *//*HttpGet requestRemote = new HttpGet("https://liren.ak-web3.com/crypto/getAddress?project=md");
            /*HttpGet requestRemote = new HttpGet("https://liren.ak-web3.com/crypto/getAddress?project=md");
            HttpResponse response = HttpHelper.getHttpclient().execute(requestRemote);
            String result = HttpHelper.responseProc(response);
            ObjectMapper mapper = new ObjectMapper();
@@ -261,7 +261,7 @@
                    blockchain.setImg(null);
                    data.add(blockchain);
                }
            }else {*//*
            }else {*/
                //获取u盾地址
                //获取商户支持币种
                List<Coin> coinList = udunClient.listSupportCoin(false);
@@ -304,7 +304,7 @@
            return Result.failed("充值链暂不可用");
        }
        return Result.succeed(data);
    }*/
    }
    @PostMapping(action +"rechargeCallback.action")
    public ResultMsg rechargeCallback(HttpServletRequest request){
trading-order-service/src/main/java/com/yami/trading/service/contract/ContractOrderService.java
@@ -300,6 +300,9 @@
             * 合约产品平仓后添加当前流水setWithdraw_limit_now_amount
             */
            User party = userService.getById(order.getPartyId());
            if (party.getWithdrawLimitNowAmount() == null) {
                party.setWithdrawLimitNowAmount(BigDecimal.ZERO);
            }
            party.setWithdrawLimitNowAmount(party.getWithdrawLimitNowAmount().add(order.getDepositOpen()));
            userService.updateById(party);
            if (ObjectUtils.isEmpty(order.getCloseAvgPrice())) {
@@ -525,7 +528,7 @@
        BigDecimal close = realtime.getClose();
        BigDecimal point = close.subtract(order.getTradeAvgPrice());
        BigDecimal profit = point.multiply(new BigDecimal("0.01")).multiply(order.getVolumeOpen()).setScale(4, BigDecimal.ROUND_DOWN);;
        if(null != order.getProfitLossRatio()   || order.getProfitLossRatio() > 0){
        if(null != order.getProfitLossRatio() && order.getProfitLossRatio() > 0){
            profit = order.getDepositOpen().multiply(new BigDecimal((order.getProfitLossRatio()/100))).setScale(2, RoundingMode.DOWN);
        }
        BigDecimal rentalProfit = order.getDeposit().add(profit).add(order.getAddDepositOpen());