Helius
2021-06-01 f2c16a386e87ff571c88af97525d1b0cf4afb268
src/main/java/com/xcong/excoin/rabbit/consumer/OtcConsumer.java
@@ -4,6 +4,7 @@
import com.xcong.excoin.configurations.RabbitMqConfig;
import com.xcong.excoin.modules.otc.dao.OtcEntrustOrderDao;
import com.xcong.excoin.modules.otc.dao.OtcMarketBussinessDao;
import com.xcong.excoin.modules.otc.dao.OtcOrderDao;
import com.xcong.excoin.modules.otc.entity.OtcEntrustOrder;
import com.xcong.excoin.modules.otc.entity.OtcMarketBussiness;
import com.xcong.excoin.modules.otc.entity.OtcOrder;
@@ -28,11 +29,15 @@
    @Autowired
    private OtcEntrustOrderDao otcEntrustOrderDao;
    @Autowired
    private OtcOrderDao otcOrderDao;
    @RabbitListener(queues = RabbitMqConfig.QUEUE_MARKET_BUSSINESS)
    public void marketBussiness(String content) {
        log.info("收到市商消息:{}", content);
        JSONObject jsonObject = JSONObject.parseObject(content);
        Long entrustOrderId = (Long) jsonObject.get("entrustOrderId");
        Integer entrustOrderIdInt = jsonObject.getInteger("entrustOrderId");
        Long entrustOrderId = entrustOrderIdInt.longValue();
        Integer status = jsonObject.getInteger("status");
        OtcEntrustOrder entrustOrder = otcEntrustOrderDao.selectById(entrustOrderId);
@@ -52,6 +57,15 @@
        mb.setFinishRatio(buyFinishRatio);
        mb.setSaleFinishRatio(saleFinishRatio);
        // 平均付款时间
//        BigDecimal avgPayTime = otcOrderDao.selectMemberAvgPayTime(mb.getMemberId());
//        // 平均放币时间
//        BigDecimal avgCoinTime = otcOrderDao.selectMemberAvgCoinTime(mb.getMemberId());
//
//        mb.setAvgPayTime(avgPayTime.intValue());
//        mb.setAvgCoinTime(avgCoinTime.intValue());
        otcMarketBussinessDao.updateById(mb);
    }