Helius
2021-06-03 06bbe3130549b941be8c46564cf4b1e4c85edacb
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -99,8 +99,9 @@
            throw new GlobalException("剩余数量不足");
        }
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice()).setScale(2,BigDecimal.ROUND_DOWN);;
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0) {
        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) {
            throw new GlobalException("数量与金额不符");
        }
        /**
@@ -201,7 +202,8 @@
        }
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice());
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0) {
        BigDecimal usdt = orderAddDto.getCnyAmount().divide(entrustOrder.getUnitPrice(), 2, BigDecimal.ROUND_DOWN);
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0 && usdt.compareTo(orderAddDto.getUsdtAmount()) != 0) {
            throw new GlobalException("数量与金额不符");
        }