Helius
2021-03-31 e07fe3c785963d50bf1d84ecca4f9ae329f871cd
modify
1 files modified
3 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java
@@ -183,13 +183,14 @@
    private void closingFollowerOrders(MemberEntity memberEntity, ContractHoldOrderEntity holdOrderEntity, ContractOrderEntity contractOrderEntity) {
        // 判断当前持仓是否为跟单订单
        if (ContractOrderEntity.CONTRACTTYPE_DOCUMENTARY == holdOrderEntity.getContractType()) {
            FollowTraderInfoEntity traderInfoEntity = followTraderInfoDao.selectTraderInfoByOrderId(holdOrderEntity.getId());
            updateFollowOrderRelation(holdOrderEntity.getId(), contractOrderEntity.getId());
            // 若为交易员,则平仓跟随者订单
            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().setScale(2, BigDecimal.ROUND_HALF_UP).toString(), profitOrLoss.setScale(2, BigDecimal.ROUND_HALF_UP).toString(), traderInfoEntity.getNickname()));
                LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CLOSE_ORDER_TITLE, StrUtil.format(NoticeConstant.CLOSE_ORDER_CONTENT, contractOrderEntity.getSymbol(), contractOrderEntity.getClosingPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString(), contractOrderEntity.getRewardAmount().setScale(2, BigDecimal.ROUND_HALF_UP).toString(), traderInfoEntity.getNickname()));
            }
        }
    }