zainali5120
2020-10-10 f8a0008705fd8067959151ce83c5dce19e72fb85
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.common.enumerates.CoinTypeEnum;
import com.xcong.excoin.modules.blackchain.service.RocService;
import com.xcong.excoin.modules.coin.mapper.OrderCoinsDealMapper;
import com.xcong.excoin.modules.member.dao.MemberDao;
@@ -16,6 +17,7 @@
import com.xcong.excoin.modules.platform.entity.PlatformSymbolsCoinEntity;
import com.xcong.excoin.modules.symbols.constants.SymbolsConstats;
import com.xcong.excoin.rabbit.producer.OrderSubmitProducer;
import com.xcong.excoin.trade.CoinTrader;
import com.xcong.excoin.trade.CoinTraderFactory;
import com.xcong.excoin.trade.ExchangeTrade;
@@ -90,6 +92,9 @@
    @Resource
    private MemberDao memberDao;
    @Resource
    private OrderSubmitProducer orderSubmitProducer;
    @Override
@@ -464,9 +469,11 @@
//            memberWalletCoinDao.updateById(walletCoin);
            memberWalletCoinDao.updateWalletBalance(walletCoin.getId(),amount.negate(),amount.negate(),amount);
        }
        // 加入到撮合
        CoinTrader trader = factory.getTrader(symbol);
        trader.trade(order);
        // 加入到撮合 TODO  通过消息队列发送到交易撮合
        //CoinTrader trader = factory.getTrader(symbol);
        //trader.trade(order);
        order.setSymbol(symbol);
        orderSubmitProducer.sendMsg(JSONObject.toJSONString(order));
        return Result.ok(MessageSourceUtils.getString("order_service_0011"));
    }
@@ -713,6 +720,12 @@
    }
    @Override
    public Result findAllWalletCoinOrder() {
        List<OrderCoinsDealEntity> orderCoinsDealEntities = orderCoinDealDao.selectAllCoinDealsOrderBySymbol(CoinTypeEnum.ROC.toString());
        return Result.ok(orderCoinsDealEntities);
    }
    @Override
    public Result findWalletCoinOrder(Long orderId) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();