| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.druid.sql.visitor.functions.If; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.LoginUserUtils; |
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum; |
| | |
| | | import com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity; |
| | | import com.xcong.excoin.modules.contract.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.contract.mapper.ContractHoldOrderEntityMapper; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.ChangeBondDto; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.ProfitOrLessDto; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.SubmitOrderDto; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.SymbolDto; |
| | | import com.xcong.excoin.modules.contract.parameter.vo.ContractMoneyInfoVo; |
| | | import com.xcong.excoin.modules.contract.parameter.vo.HoldOrderListVo; |
| | | import com.xcong.excoin.modules.contract.mapper.ContractOrderEntityMapper; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.*; |
| | | import com.xcong.excoin.modules.contract.parameter.vo.*; |
| | | import com.xcong.excoin.modules.contract.service.ContractHoldOrderService; |
| | | import com.xcong.excoin.modules.member.dao.MemberDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberLevelRateDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberWalletContractDao; |
| | | import com.xcong.excoin.modules.member.entity.AgentReturnEntity; |
| | |
| | | @Resource |
| | | private OrderProducer producer; |
| | | |
| | | @Resource |
| | | private MemberDao memberDao; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Result submitOrder(SubmitOrderDto submitOrderDto) { |
| | |
| | | MemberWalletContractEntity walletContract = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberEntity.getId(), CoinTypeEnum.USDT.name()); |
| | | |
| | | PlatformTradeSettingEntity tradeSettingEntity = cacheSettingUtils.getTradeSetting(); |
| | | |
| | | |
| | | Long id = memberEntity.getId(); |
| | | MemberEntity selectById = memberDao.selectById(id); |
| | | BigDecimal spread = selectById.getSpread(); |
| | | // 规格 |
| | | BigDecimal lotNumber = cacheSettingUtils.getSymbolSku(submitOrderDto.getSymbol()); |
| | | |
| | |
| | | // 开多 |
| | | if (submitOrderDto.getOrderType() == ContractHoldOrderEntity.OPENING_TYPE_MORE) { |
| | | // 市场价*(1 + (点差/10000)) |
| | | openingPrice = newPrice.multiply(BigDecimal.ONE.add(tradeSettingEntity.getSpread().divide(new BigDecimal(10000)))).setScale(8, BigDecimal.ROUND_DOWN); |
| | | openingPrice = newPrice.multiply(BigDecimal.ONE.add(spread.divide(new BigDecimal(10000)))).setScale(8, BigDecimal.ROUND_DOWN); |
| | | |
| | | // 开空 |
| | | } else if (submitOrderDto.getOrderType() == ContractHoldOrderEntity.OPENING_TYPE_LESS) { |
| | | // 市场价*(1 - (点差/10000)) |
| | | openingPrice = newPrice.multiply(BigDecimal.ONE.subtract(tradeSettingEntity.getSpread().divide(new BigDecimal(10000)))).setScale(8, BigDecimal.ROUND_DOWN); |
| | | openingPrice = newPrice.multiply(BigDecimal.ONE.subtract(spread.divide(new BigDecimal(10000)))).setScale(8, BigDecimal.ROUND_DOWN); |
| | | } else { |
| | | return Result.fail("未知类型"); |
| | | } |
| | |
| | | holdOrderEntity.setMarkPrice(newPrice); |
| | | holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_Y); |
| | | holdOrderEntity.setPrePaymentAmount(prePaymentAmount); |
| | | holdOrderEntity.setOpeningTime(new Date()); |
| | | holdOrderEntity.setBondAmount(bondAmount.add(openFeePrice)); |
| | | |
| | | ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(holdOrderEntity); |
| | | |
| | | contractOrderEntity.setOpeningTime(new Date()); |
| | | contractHoldOrderDao.insert(holdOrderEntity); |
| | | int i = contractOrderDao.insert(contractOrderEntity); |
| | | memberWalletContractDao.increaseWalletContractBalanceById(prePaymentAmount.negate(), null, bondAmount.add(openFeePrice), walletContract.getId()); |
| | | |
| | | // 计算佣金 |
| | | ThreadPoolUtils.calReturnMoney(memberEntity.getId(), contractOrderEntity.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_OPEN); |
| | | if (i > 0) { |
| | | return Result.ok("success"); |
| | | memberWalletContractDao.increaseWalletContractBalanceById(prePaymentAmount.negate(), openFeePrice.negate(), null, walletContract.getId()); |
| | | // 计算佣金 |
| | | ThreadPoolUtils.calReturnMoney(memberEntity.getId(), contractOrderEntity.getOpeningFeeAmount(), contractOrderEntity, AgentReturnEntity.ORDER_TYPE_OPEN); |
| | | return Result.ok("提交成功"); |
| | | } |
| | | return Result.fail("fail"); |
| | | return Result.fail("提交失败"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | |
| | | List<ContractHoldOrderEntity> list = contractHoldOrderDao.selectHoldOrderListByMemberIdAndSymbol(memberEntity.getId(), symbol); |
| | | MemberWalletContractEntity walletContractEntity = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberEntity.getId(), CoinTypeEnum.USDT.name()); |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | BigDecimal totalProfitOrLoss = BigDecimal.ZERO; |
| | | List<HoldOrderListVo> resultList = new ArrayList<>(); |
| | |
| | | .divide(new BigDecimal(holdOrderEntity.getLeverRatio()), 8, BigDecimal.ROUND_DOWN); |
| | | |
| | | // 可增加最大保证金 |
| | | BigDecimal canAddMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()).subtract(costPrice); |
| | | if (canAddMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canAddMaxBond = BigDecimal.ZERO; |
| | | // BigDecimal canAddMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()).subtract(costPrice); |
| | | // if (canAddMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | // canAddMaxBond = BigDecimal.ZERO; |
| | | // } |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()); |
| | | if (canReduceMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = BigDecimal.ZERO; |
| | | } |
| | | |
| | | holdOrderListVo.setCanAddMaxBond(canAddMaxBond); |
| | | holdOrderListVo.setCanReduceMaxBond(canReduceMaxBond); |
| | | holdOrderListVo.setCanAddMaxBond(walletContractEntity.getAvailableBalance()); |
| | | holdOrderListVo.setReturnRate(returnRate); |
| | | holdOrderListVo.setProfitOrLoss(rewardRatio); |
| | | resultList.add(holdOrderListVo); |
| | |
| | | // 开仓价 |
| | | BigDecimal openPrice = holdOrderEntity.getOpeningPrice(); |
| | | // 设置的止盈止损价 |
| | | BigDecimal price = profitOrLessDto.getPrice(); |
| | | BigDecimal stopProfitPrice = profitOrLessDto.getStopProfitPrice(); |
| | | |
| | | BigDecimal stopLessPrice = profitOrLessDto.getStopLessPrice(); |
| | | |
| | | // 开多 |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) { |
| | | if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) { |
| | | if (stopProfitPrice != null) { |
| | | // 当前价大于开仓价 |
| | | if (newPrice.compareTo(openPrice) > 0) { |
| | | // 如果止盈价小于当前价 |
| | | if (price.compareTo(newPrice) < 0) { |
| | | if (stopProfitPrice.compareTo(newPrice) < 0) { |
| | | return Result.fail("止盈价必须高于当前价"); |
| | | } |
| | | } else { |
| | | if (price.compareTo(openPrice) < 0) { |
| | | if (stopProfitPrice.compareTo(openPrice) < 0) { |
| | | return Result.fail("止盈价必须高于开仓价"); |
| | | } |
| | | } |
| | | } else { |
| | | } |
| | | |
| | | if (stopLessPrice != null) { |
| | | if (newPrice.compareTo(openPrice) > 0) { |
| | | if (price.compareTo(openPrice) > 0) { |
| | | if (stopLessPrice.compareTo(openPrice) > 0) { |
| | | return Result.fail("止损价必须低于开仓价"); |
| | | } |
| | | } else { |
| | | if (price.compareTo(newPrice) > 0) { |
| | | if (stopLessPrice.compareTo(newPrice) > 0) { |
| | | return Result.fail("止损价必须低于当前价"); |
| | | } |
| | | } |
| | | } |
| | | // 开空 |
| | | } else { |
| | | if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) { |
| | | if (stopProfitPrice != null) { |
| | | if (newPrice.compareTo(openPrice) > 0) { |
| | | if (price.compareTo(openPrice) > 0) { |
| | | return Result.fail("止损价必须低于开仓价"); |
| | | if (stopProfitPrice.compareTo(openPrice) > 0) { |
| | | return Result.fail("止盈价必须低于开仓价"); |
| | | } |
| | | } else { |
| | | if (price.compareTo(newPrice) > 0) { |
| | | return Result.fail("止损价必须低于当前价"); |
| | | if (stopProfitPrice.compareTo(newPrice) > 0) { |
| | | return Result.fail("止盈价必须低于当前价"); |
| | | } |
| | | } |
| | | } else { |
| | | } |
| | | if (stopLessPrice != null) { |
| | | if (newPrice.compareTo(openPrice) > 0) { |
| | | if (price.compareTo(newPrice) < 0) { |
| | | if (stopLessPrice.compareTo(newPrice) < 0) { |
| | | return Result.fail("止损价必须高于当前价"); |
| | | } |
| | | } else { |
| | | if (price.compareTo(openPrice) < 0) { |
| | | if (stopLessPrice.compareTo(openPrice) < 0) { |
| | | return Result.fail("止损价必须高于开仓价"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) { |
| | | holdOrderEntity.setStopProfitPrice(price); |
| | | } else { |
| | | holdOrderEntity.setStopLossPrice(price); |
| | | } |
| | | holdOrderEntity.setStopProfitPrice(stopProfitPrice); |
| | | holdOrderEntity.setStopLossPrice(stopLessPrice); |
| | | |
| | | int i = contractHoldOrderDao.updateById(holdOrderEntity); |
| | | if (i > 0) { |
| | | OrderModel model = null; |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) { |
| | | // 开多止盈 |
| | | if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_PROFIT.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | // 开多止损 |
| | | } else { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_LESS.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | if (stopProfitPrice != null) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_PROFIT.getValue(), stopProfitPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | } |
| | | // 开多止损 |
| | | if (stopLessPrice != null) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_LESS.getValue(), stopLessPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | } |
| | | } else { |
| | | // 开空止盈 |
| | | if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_PROFIT.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | // 开空止损 |
| | | } else { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_LESS.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | if (stopProfitPrice != null) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_PROFIT.getValue(), stopProfitPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | } |
| | | // 开空止损 |
| | | if (stopLessPrice != null) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_STOP_LESS.getValue(), stopLessPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | } |
| | | } |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | return Result.ok("设置成功"); |
| | | } |
| | | |
| | | return Result.fail("设置失败"); |
| | | } |
| | | |
| | |
| | | BigDecimal profitOrLess = BigDecimal.ZERO; |
| | | // 开多 |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) { |
| | | profitOrLess = newPrice.subtract(holdOrderEntity.getOpeningPrice()).multiply(new BigDecimal(holdOrderEntity.getSymbolCnt())).multiply(lotNumber).multiply(holdOrderEntity.getSymbolSku()); |
| | | profitOrLess = newPrice.subtract(holdOrderEntity.getOpeningPrice()).multiply(new BigDecimal(holdOrderEntity.getSymbolCnt())).multiply(lotNumber); |
| | | // 开空 |
| | | } else { |
| | | profitOrLess = holdOrderEntity.getOpeningPrice().subtract(newPrice).multiply(new BigDecimal(holdOrderEntity.getSymbolCnt())).multiply(lotNumber).multiply(holdOrderEntity.getSymbolSku()); |
| | | profitOrLess = holdOrderEntity.getOpeningPrice().subtract(newPrice).multiply(new BigDecimal(holdOrderEntity.getSymbolCnt())).multiply(lotNumber); |
| | | } |
| | | |
| | | if (MemberEntity.IS_PROFIT_Y == memberEntity.getIsProfit()) { |
| | |
| | | contractMoneyInfoVo.setLeverRate(rateEntity.getLevelRateUp()); |
| | | return Result.ok(contractMoneyInfoVo); |
| | | } |
| | | |
| | | @Override |
| | | public Result changeLeverRate(ChangeLeverRateDto changeLeverRateDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | MemberLevelRateEntity levelRateEntity = memberLevelRateDao.selectLeverRateByMemberIdAndSymbol(memberEntity.getId(), changeLeverRateDto.getSymbol()); |
| | | levelRateEntity.setLevelRateUp(changeLeverRateDto.getLeverRate()); |
| | | levelRateEntity.setLevelRateDown(changeLeverRateDto.getLeverRate()); |
| | | int i = memberLevelRateDao.updateById(levelRateEntity); |
| | | if (i > 0) { |
| | | return Result.ok("调整成功"); |
| | | } |
| | | return Result.fail("调整失败"); |
| | | } |
| | | |
| | | @Override |
| | | public Result findHoldOrderDetailById(Long id) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | ContractHoldOrderEntity holdOrderEntity = contractHoldOrderDao.selectHoldOrderByMemberIdAndId(memberEntity.getId(), id); |
| | | if (holdOrderEntity == null) { |
| | | return Result.fail("订单不存在"); |
| | | } |
| | | |
| | | HoldOrderDetailVo holdOrderDetailVo = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrderDetailVo(holdOrderEntity); |
| | | BigDecimal feeSpread = cacheSettingUtils.getTradeSetting().getFeeSpreadRatio(); |
| | | holdOrderDetailVo.setOpeningFeeAmount(holdOrderDetailVo.getOpeningFeeAmount().multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN)); |
| | | return Result.ok(holdOrderDetailVo); |
| | | } |
| | | |
| | | @Override |
| | | public Result findOrderList(OrderListDto orderListDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | Page<ContractOrderEntity> page = new Page<>(orderListDto.getPageNum(), orderListDto.getPageSize()); |
| | | ContractOrderEntity contractOrderEntity = new ContractOrderEntity(); |
| | | contractOrderEntity.setMemberId(memberEntity.getId()); |
| | | contractOrderEntity.setSymbol(orderListDto.getSymbol()); |
| | | IPage<ContractOrderEntity> list = contractOrderDao.selectContractOrderInPage(page, contractOrderEntity); |
| | | Page<OrderListVo> result = ContractOrderEntityMapper.INSTANCE.pageEntityToPageVo(list); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @Override |
| | | public Result findOrderDetailById(Long id) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | ContractOrderEntity contractOrderEntity = contractOrderDao.selectOrderDetailByIdAndMemberId(id, memberEntity.getId()); |
| | | if (contractOrderEntity == null) { |
| | | return Result.fail("订单不存在"); |
| | | } |
| | | |
| | | OrderDetailVo orderDetailVo = ContractOrderEntityMapper.INSTANCE.entityToDetailVo(contractOrderEntity); |
| | | BigDecimal feeSpread = cacheSettingUtils.getTradeSetting().getFeeSpreadRatio(); |
| | | orderDetailVo.setClosingFeeAmount(orderDetailVo.getClosingFeeAmount() == null ? orderDetailVo.getClosingFeeAmount() : orderDetailVo.getClosingFeeAmount().multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN)); |
| | | orderDetailVo.setOpeningFeeAmount(orderDetailVo.getOpeningFeeAmount().multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN)); |
| | | return Result.ok(orderDetailVo); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void calHoldOrderHoldFeeAmount() { |
| | | List<ContractHoldOrderEntity> list = contractHoldOrderDao.selectAllHoldOrder(); |
| | | PlatformTradeSettingEntity tradeSettingEntity = cacheSettingUtils.getTradeSetting(); |
| | | |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | for (ContractHoldOrderEntity holdOrderEntity : list) { |
| | | BigDecimal holdAmount = holdOrderEntity.getHoldAmount(); |
| | | if (holdAmount == null) { |
| | | holdAmount = BigDecimal.ZERO; |
| | | } |
| | | |
| | | BigDecimal thisTimeHold = holdOrderEntity.getBondAmount().multiply(tradeSettingEntity.getDoingRatio()); |
| | | log.info("订单编号:{}, 持仓费:{}", holdOrderEntity.getOrderNo(), thisTimeHold); |
| | | MemberWalletContractEntity walletContractEntity = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(holdOrderEntity.getMemberId(), CoinTypeEnum.USDT.name()); |
| | | |
| | | // 判断当前可用余额是否大于目前持仓费,若大于则扣可用余额,若小于则扣保证金中的金额 |
| | | if (thisTimeHold.compareTo(walletContractEntity.getAvailableBalance()) < 0) { |
| | | memberWalletContractDao.increaseWalletContractBalanceById(thisTimeHold.negate(), thisTimeHold.negate(), null, walletContractEntity.getId()); |
| | | |
| | | holdOrderEntity.setHoldAmount(holdAmount.add(thisTimeHold)); |
| | | contractHoldOrderDao.updateById(holdOrderEntity); |
| | | } else { |
| | | BigDecimal available = walletContractEntity.getAvailableBalance(); |
| | | BigDecimal lessAmount = thisTimeHold.subtract(available); |
| | | MemberEntity memberEntity = memberDao.selectById(holdOrderEntity.getId()); |
| | | memberWalletContractDao.increaseWalletContractBalanceById(available.negate(), available.negate(), null, walletContractEntity.getId()); |
| | | |
| | | BigDecimal newBondAmount = holdOrderEntity.getBondAmount().subtract(lessAmount); |
| | | |
| | | BigDecimal newForcePrice = CalculateUtil.getForceSetPrice(newBondAmount.subtract(holdOrderEntity.getOpeningFeeAmount()), holdOrderEntity.getOpeningPrice(), holdOrderEntity.getSymbolCnt(), holdOrderEntity.getSymbolSku(), holdOrderEntity.getOpeningType(), memberEntity); |
| | | |
| | | holdOrderEntity.setHoldAmount(holdAmount.add(thisTimeHold)); |
| | | holdOrderEntity.setBondAmount(newBondAmount); |
| | | holdOrderEntity.setForceClosingPrice(newForcePrice); |
| | | holdOrderEntity.setOperateNo(holdOrderEntity.getOperateNo() + 1); |
| | | contractHoldOrderDao.updateById(holdOrderEntity); |
| | | |
| | | OrderModel model = null; |
| | | // 开多 |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), newForcePrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | // 开空 |
| | | } else { |
| | | model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), newForcePrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol()); |
| | | } |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |