wzy
2021-06-05 70ad97e3d7047adba6a1a136d4d6b7cb7d697b28
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("数量与金额不符");
        }
@@ -318,6 +320,7 @@
        this.baseMapper.updateOrderStatusByOrderNo(OtcOrder.STATUS_FINISH, null, otcOrder.getOrderNo());
        otcProducter.sendMarketBussinessMsg(otcOrder.getEntrustOrderId(), OtcOrder.STATUS_FINISH);
        otcProducter.sendOrderReturn(buyOrder.getOrderNo());
    }
    @Override