Helius
2021-06-01 25aec7899b8ab3d483bbfd6d7580c6966318ee7f
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -32,6 +32,7 @@
import com.xcong.excoin.modules.otc.vo.BuyOrderDetailVo;
import com.xcong.excoin.modules.otc.vo.OrderListVo;
import com.xcong.excoin.modules.otc.vo.SaleOrderDetailVo;
import com.xcong.excoin.rabbit.producer.OtcProducter;
import com.xcong.excoin.utils.RedisUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -57,6 +58,7 @@
    private final OtcBlackListDao otcBlackListDao;
    private final OtcSettingDao otcSettingDao;
    private final RedisUtils redisUtils;
    private final OtcProducter otcProducter;
    @Override
@@ -97,7 +99,7 @@
            throw new GlobalException("剩余数量不足");
        }
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice());
        BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice()).setScale(2,BigDecimal.ROUND_DOWN);;
        if (cny.compareTo(orderAddDto.getCnyAmount()) != 0) {
            throw new GlobalException("数量与金额不符");
        }
@@ -315,6 +317,7 @@
        memberWalletCoinDao.reduceFrozenBalance(saleWallet.getId(), buyOrder.getCoinAmount());
        this.baseMapper.updateOrderStatusByOrderNo(OtcOrder.STATUS_FINISH, null, otcOrder.getOrderNo());
        otcProducter.sendMarketBussinessMsg(otcOrder.getEntrustOrderId(), OtcOrder.STATUS_FINISH);
    }
    @Override
@@ -464,6 +467,8 @@
        otcEntrustOrderDao.updateRemainAmount(otcOrder.getEntrustOrderId(), otcOrder.getCoinAmount());
        this.baseMapper.updateOrderStatusByOrderNo(OtcOrder.STATUS_CANCEL, null, otcOrder.getOrderNo());
        otcProducter.sendMarketBussinessMsg(otcOrder.getEntrustOrderId(), OtcOrder.STATUS_CANCEL);
    }
    @Override