| | |
| | | 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())); |
| | | } |
| | | } |
| | | } |