src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -143,6 +143,9 @@ } } // 盈亏比例(回报率) BigDecimal rewardRatio = profitOrLoss.divide(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), 8, BigDecimal.ROUND_DOWN); FollowTraderInfoEntity traderInfoEntity = null; // 判断当前订单是否为跟单 if (ContractOrderEntity.CONTRACTTYPE_DOCUMENTARY == holdOrderEntity.getContractType()) { @@ -151,7 +154,7 @@ traderInfoEntity = followTraderInfoDao.selectTraderInfoByOrderId(holdOrderEntity.getId()); if (profitOrLoss.compareTo(BigDecimal.ZERO) > 0) { // 计算需返利给交易员的金额 BigDecimal returnMoney = profitOrLoss.subtract(traderInfoEntity.getProfitRatio()); BigDecimal returnMoney = profitOrLoss.multiply(traderInfoEntity.getProfitRatio()); profitOrLoss = profitOrLoss.subtract(returnMoney); MemberWalletContractEntity traderWallet = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(traderInfoEntity.getMemberId(), CoinTypeEnum.USDT.name()); memberWalletContractDao.increaseWalletContractBalanceById(returnMoney, returnMoney, null, traderWallet.getId()); @@ -159,9 +162,6 @@ } } } // 盈亏比例(回报率) BigDecimal rewardRatio = profitOrLoss.divide(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), 8, BigDecimal.ROUND_DOWN); ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(holdOrderEntity); contractOrderEntity.setId(null); src/main/java/com/xcong/excoin/modules/documentary/common/NoticeConstant.java
@@ -18,4 +18,8 @@ public static final String CLOSE_ORDER_CONTENT = "{}平仓成功,平仓价{},收益{}, 交易员{}"; public static final String STOP_FOLLOW_TITLE = "跟单-停止跟随"; public static final String STOP_FOLLOW_CONTENT = "您已被交易员{}移除,已停止跟随此交易员下单"; } src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -10,6 +10,8 @@ import javax.annotation.Resource; import javax.validation.Valid; import com.xcong.excoin.modules.documentary.common.NoticeConstant; import com.xcong.excoin.utils.*; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -68,10 +70,6 @@ import com.xcong.excoin.modules.member.entity.MemberLevelRateEntity; import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity; import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; import com.xcong.excoin.utils.CacheSettingUtils; import com.xcong.excoin.utils.CoinTypeConvert; import com.xcong.excoin.utils.MessageSourceUtils; import com.xcong.excoin.utils.RedisUtils; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; @@ -904,7 +902,12 @@ FollowFollowerProfitEntity followFollowerProfitEntity = followFollowerProfitDao.selectById(id); followFollowerProfitEntity.setIsFollow(FollowFollowerProfitEntity.IS_FOLLOW_N); followFollowerProfitDao.updateById(followFollowerProfitEntity); FollowTraderInfoEntity traderInfoEntity = followTraderInfoDao.selectTraderInfoByMemberId(memberId); if (traderInfoEntity != null) { LogRecordUtils.insertFollowerNotice(memberId, NoticeConstant.STOP_FOLLOW_TITLE, StrUtil.format(NoticeConstant.STOP_FOLLOW_CONTENT, traderInfoEntity.getNickname())); } return Result.ok(MessageSourceUtils.getString("member_service_0026")); }