Helius
2020-10-29 49b96dc04a24b93185c09de4b61d9539a5e77990
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
@@ -77,17 +77,25 @@
    }
    private void addExecType(OrderModel model) {
    private boolean addExecType(OrderModel model) {
        List<Object> orderTypes = redisUtils.lGet(AppContants.RABBIT_TYPE + model.getOrderId(), 0 , -1);
//        if (CollUtil.isNotEmpty(orderTypes)) {
//            orderTypes.add(model.getType());
//        } else {
//            orderTypes = new ArrayList<>();
//            orderTypes.add(model.getType());
//        }
        if (CollUtil.isNotEmpty(orderTypes)) {
            orderTypes.add(model.getType());
        } else {
            orderTypes = new ArrayList<>();
            orderTypes.add(model.getType());
            log.info("存在止盈/止损/爆仓:{} -- {}",model, orderTypes);
            return false;
        }
        orderTypes = new ArrayList<>();
        orderTypes.add(model.getType());
        redisUtils.lSet(AppContants.RABBIT_TYPE + model.getOrderId(), orderTypes, 10);
        redisUtils.lSet(AppContants.MEMBER_TYPE + model.getMemberId(), orderTypes, 5);
        return true;
    }
    // 处理消息 正序的 包括
@@ -123,7 +131,10 @@
                        2、全仓: 止盈价/止损价 设置的与委托平仓价相同,需优先处理止盈/止损
                   解决: 将订单ID作为Key, 该订单执行的队列类型集合作为value, 用于在执行爆仓、委托平仓时,是否存在止盈/止损,若存在则不执行该爆仓和委托平仓
                 */
                addExecType(model);
                boolean b = addExecType(model);
                if (!b) {
                    continue;
                }
                // 止损平空
                List<OrderModel> kkzsList = new ArrayList<OrderModel>();
@@ -210,7 +221,10 @@
                        2、全仓: 止盈价/止损价 设置的与委托平仓价相同,需优先处理止盈/止损
                   解决: 将订单ID作为Key, 该订单执行的队列类型集合作为value, 用于在执行爆仓、委托平仓时,是否存在止盈/止损,若存在则不执行该爆仓和委托平仓
                 */
                addExecType(model);
                boolean b = addExecType(model);
                if (!b) {
                    continue;
                }
                // 开空止盈
                List<OrderModel> kkzyList = new ArrayList<OrderModel>();