| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private MemberDao memberDao;
|
| | |
|
| | | @Resource
|
| | | private OrderSubmitProducer orderSubmitProducer;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | // 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"));
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @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();
|