| | |
| | | public Result submitOrder(SubmitOrderDto submitOrderDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | |
| | | 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); |
| | |
| | | // canAddMaxBond = BigDecimal.ZERO; |
| | | // } |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()); |
| | | |
| | | if (rewardRatio.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = canReduceMaxBond.add(rewardRatio); |
| | | } |
| | | |
| | | if (canReduceMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = BigDecimal.ZERO; |
| | | } |