Helius
2021-03-17 2bc7169b568195cfc5160bf88df6525e50afdc7c
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -215,7 +215,7 @@
                    followOrderOperationService.closingFollowOrders(holdOrderEntity.getOrderNo());
                } else {
                    followFollowerProfitDao.updateFollowerProfitByTradeMemberId(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), profitOrLoss, traderInfoEntity.getMemberId(), memberEntity.getId());
                    LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CLOSE_ORDER_TITLE, StrUtil.format(NoticeConstant.CLOSE_ORDER_CONTENT, contractOrderEntity.getSymbol(), contractOrderEntity.getClosingPrice(), profitOrLoss.setScale(8, BigDecimal.ROUND_DOWN), traderInfoEntity.getNickname()));
                    LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CLOSE_ORDER_TITLE, StrUtil.format(NoticeConstant.CLOSE_ORDER_CONTENT, contractOrderEntity.getSymbol(), contractOrderEntity.getClosingPrice(), profitOrLoss.setScale(8, BigDecimal.ROUND_DOWN).toString(), traderInfoEntity.getNickname()));
                }
            }
        }
@@ -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,7 +447,7 @@
        contractOrderEntity.setEntrustOpeningPrice(newPrice);
        contractOrderEntity.setEntrustTime(new Date());
        contractOrderEntity.setClosingPrice(newPrice);
        contractOrderEntity.setOrderType(orderType);
        contractOrderEntity.setOrderType(entrustOrder.getEntrustType());
        contractOrderEntity.setClosingType(closingType);
        contractOrderEntity.setSymbolCnt(closeCnt);
        contractOrderEntity.setRewardAmount(profitOrLoss);