| | |
| | | fee = holdOrderEntity.getOpeningFeeAmount(); |
| | | } |
| | | |
| | | BigDecimal rewardRatio = profitOrLoss.divide(bondAmount, 4, BigDecimal.ROUND_DOWN); |
| | | |
| | | log.info("fee:{}", fee); |
| | | ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(holdOrderEntity); |
| | | contractOrderEntity.setId(null); |
| | | contractOrderEntity.setEntrustOpeningPrice(newPrice); |
| | | contractOrderEntity.setEntrustTime(new Date()); |
| | | contractOrderEntity.setClosingPrice(newPrice); |
| | | contractOrderEntity.setTradeType(ContractOrderEntity.TRADE_TYPE_LIMIT_PRICE); |
| | | contractOrderEntity.setOrderType(entrustOrder.getEntrustType()); |
| | | contractOrderEntity.setClosingType(closingType); |
| | | contractOrderEntity.setSymbolCnt(closeCnt); |
| | | contractOrderEntity.setRewardAmount(profitOrLoss); |
| | | contractOrderEntity.setRewardRatio(rewardRatio); |
| | | contractOrderEntity.setBondAmount(bondAmount); |
| | | contractOrderEntity.setClosingTime(new Date()); |
| | | contractOrderEntity.setClosingFeeAmount(fee); |
| | | contractOrderDao.insert(contractOrderEntity); |
| | | |