zainali5120
2021-03-17 cb6bf31330bd994e65879ccea31877d2e05c79ea
Merge remote-tracking branch 'origin/whole_new' into whole_new
1 files modified
6 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -302,6 +302,7 @@
            }
            log.info("profitOrLoss:{}", profitOrLoss);
            BigDecimal rewardRatio = profitOrLoss.divide(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), 4, BigDecimal.ROUND_DOWN);
            // 保证金
            BigDecimal bondAmount = CalculateUtil.getBondAmount(holdOrderEntity.getOpeningPrice(), lotNumber, closeCnt, holdOrderEntity.getLeverRatio());
@@ -323,6 +324,7 @@
            contractOrderEntity.setClosingType(closingType);
            contractOrderEntity.setSymbolCnt(closeCnt);
            contractOrderEntity.setRewardAmount(profitOrLoss);
            contractOrderEntity.setRewardRatio(rewardRatio);
            contractOrderEntity.setBondAmount(bondAmount.add(fee));
            contractOrderEntity.setClosingFeeAmount(fee);
            contractOrderEntity.setClosingTime(new Date());
@@ -445,11 +447,13 @@
        contractOrderEntity.setEntrustOpeningPrice(newPrice);
        contractOrderEntity.setEntrustTime(new Date());
        contractOrderEntity.setClosingPrice(newPrice);
        contractOrderEntity.setOrderType(orderType);
        contractOrderEntity.setTradeType(ContractOrderEntity.TRADE_TYPE_LIMIT_PRICE);
        contractOrderEntity.setOrderType(entrustOrder.getEntrustType());
        contractOrderEntity.setClosingType(closingType);
        contractOrderEntity.setSymbolCnt(closeCnt);
        contractOrderEntity.setRewardAmount(profitOrLoss);
        contractOrderEntity.setBondAmount(bondAmount);
        contractOrderEntity.setClosingTime(new Date());
        contractOrderEntity.setClosingFeeAmount(fee);
        contractOrderDao.insert(contractOrderEntity);