| | |
| | | import com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity; |
| | | import com.xcong.excoin.modules.contract.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.contract.mapper.ContractHoldOrderEntityMapper; |
| | | 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 javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | private OrderProducer producer; |
| | | @Resource |
| | | private FollowTraderInfoDao followTraderInfoDao; |
| | | |
| | | @Resource |
| | | private RabbitOrderService rabbitOrderService; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | if (symbolCnt <= 0) { |
| | | // LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.OPEN_ORDER_TITLE, StrUtil.format(NoticeConstant.OPEN_ORDER_CONTENT, holdOrderEntity.getSymbol() + "开空", openPrice, followTraderInfoEntity.getNickname())); |
| | | LogRecordUtils.insertFollowerNotice(followerSetting.getMemberId(), NoticeConstant.OPEN_ORDER_FOLLOW_FAIL_TITLE, StrUtil.format(NoticeConstant.OPEN_ORDER_FOLLOW_FAIL_CONTENT, followTraderInfoEntity.getNickname())); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | relationEntity.setOrderType(FollowFollowerOrderRelationEntity.ORDER_TYPE_HOLD); |
| | | relationEntity.setTradeId(followTraderInfoEntity.getId()); |
| | | relationEntity.setTradeMemberId(followTraderInfoEntity.getMemberId()); |
| | | relationEntity.setTradeOrderId(id); |
| | | relationEntity.setTradeOrderNo(holdOrderEntity.getOrderNo()); |
| | | followFollowerOrderRelationDao.insert(relationEntity); |
| | | |
| | | // 发送爆仓消息 |
| | |
| | | } |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void closingFollowOrders(String orderNo) { |
| | | List<FollowFollowerOrderRelationEntity> orderRelations = followFollowerOrderRelationDao.selectFollowHoldOrderByTradeOrderNo(orderNo); |
| | | if (CollUtil.isNotEmpty(orderRelations)) { |
| | | for (FollowFollowerOrderRelationEntity orderRelation : orderRelations) { |
| | | List<Long> ids= new ArrayList<>(); |
| | | ids.add(orderRelation.getOrderId()); |
| | | rabbitOrderService.cancelHoldOrder(ids); |
| | | } |
| | | } |
| | | } |
| | | } |