| | |
| | | import com.xcong.excoin.modules.member.entity.*; |
| | | import com.xcong.excoin.modules.platform.dao.TradeSettingDao; |
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.modules.symbols.parameter.vo.HomeSymbolsVo; |
| | | import com.xcong.excoin.modules.symbols.service.SymbolsService; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import com.xcong.excoin.utils.*; |
| | | import com.xcong.excoin.rabbit.pricequeue.OrderModel; |
| | |
| | | private FollowTraderInfoDao followTraderInfoDao; |
| | | @Resource |
| | | private FollowFollowerOrderRelationDao followFollowerOrderRelationDao; |
| | | @Resource |
| | | private SymbolsService symbolsService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Result submitOrder(SubmitOrderDto submitOrderDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | |
| | | log.info("订单类型:{}", submitOrderDto.getOrderType()); |
| | | log.info("订单类型:{}", memberEntity.getContractPositionType()); |
| | | // 判断当前对应的持仓/委托 |
| | | if (memberEntity.getContractPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ADD) { |
| | | List<ContractHoldOrderEntity> holdList = contractHoldOrderDao.selectMemberHoldOrderByPositionType(ContractEntrustOrderEntity.POSITION_TYPE_ALL, memberEntity.getId()); |
| | |
| | | holdOrderEntity.setOpeningPrice(openingPrice); |
| | | holdOrderEntity.setOpeningType(submitOrderDto.getOrderType()); |
| | | holdOrderEntity.setMarkPrice(newPrice); |
| | | holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_N); |
| | | holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_Y); |
| | | holdOrderEntity.setPrePaymentAmount(prePaymentAmount); |
| | | holdOrderEntity.setBondAmount(bondAmount.add(openFeePrice)); |
| | | holdOrderEntity.setOperateNo(1); |
| | |
| | | // contractMoneyInfoVo.setAvailableBalance(available); |
| | | // } |
| | | |
| | | HomeSymbolsVo symbolReturnData = symbolsService.getSymbolReturnData(symbol); |
| | | |
| | | contractMoneyInfoVo.setBeUsedBondAmount(beUsedBondAmount); |
| | | contractMoneyInfoVo.setFrozenBondAmount(frozenBondAmount); |
| | |
| | | contractMoneyInfoVo.setNewPrice(newPriceSymbol); |
| | | contractMoneyInfoVo.setSymbolSku(cacheSettingUtils.getSymbolSku(symbol)); |
| | | contractMoneyInfoVo.setLeverRate(rateEntity.getLevelRateUp()); |
| | | contractMoneyInfoVo.setUpOrDown(symbolReturnData.getUpOrDown()); |
| | | return Result.ok(contractMoneyInfoVo); |
| | | } |
| | | |