Helius
2021-06-10 e13b1f9d6817a29f528f70493685371ae4004eb7
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -103,6 +103,7 @@
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice()).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal usdt = orderAddDto.getCnyAmount().divide(entrustOrder.getUnitPrice(), 2, BigDecimal.ROUND_DOWN);
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0 && usdt.compareTo(orderAddDto.getUsdtAmount()) != 0) {
            log.info("BUY = CNY:{}, CNY_{}, USDT:{}, USDT_{}", cny, orderAddDto.getCnyAmount(), usdt, orderAddDto.getUsdtAmount());
            throw new GlobalException("数量与金额不符");
        }
        /**
@@ -206,6 +207,7 @@
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice());
        BigDecimal usdt = orderAddDto.getCnyAmount().divide(entrustOrder.getUnitPrice(), 2, BigDecimal.ROUND_DOWN);
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0 && usdt.compareTo(orderAddDto.getUsdtAmount()) != 0) {
            log.info("SALE = CNY:{}, CNY_{}, USDT:{}, USDT_{}", cny, orderAddDto.getCnyAmount(), usdt, orderAddDto.getUsdtAmount());
            throw new GlobalException("数量与金额不符");
        }