Helius
2020-08-10 bc60c2e83e277421336c0583c6105d9da9308c4b
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -13,6 +13,7 @@
import com.xcong.excoin.modules.contract.service.RabbitOrderService;
import com.xcong.excoin.modules.documentary.common.NoticeConstant;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerOrderRelationDao;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitDetailDao;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity;
@@ -76,6 +77,8 @@
    private FollowTraderInfoDao followTraderInfoDao;
    @Resource
    private FollowTraderProfitDetailDao followTraderProfitDetailDao;
    @Resource
    private FollowFollowerProfitDao followFollowerProfitDao;
    @Transactional(rollbackFor = Exception.class)
    @Override
@@ -192,7 +195,8 @@
                if (MemberEntity.IS_TRADER_Y.equals(memberEntity.getIsTrader())) {
                    followOrderOperationService.closingFollowOrders(holdOrderEntity.getOrderNo());
                } else {
                    LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CLOSE_ORDER_TITLE, StrUtil.format(NoticeConstant.CLOSE_ORDER_CONTENT, contractOrderEntity.getSymbol(), contractOrderEntity.getClosingPrice(), profitOrLoss));
                    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, traderInfoEntity.getNickname()));
                }
            }
        }
@@ -230,4 +234,11 @@
        profitDetailEntity.setOrderNo(orderNo);
        followTraderProfitDetailDao.insert(profitDetailEntity);
    }
    /**
     * 全仓模式平仓逻辑
     */
    public void closingWholeOrder(ContractHoldOrderEntity contractHoldOrderEntity) {
    }
}