rentaiming
2024-06-21 b2ab426275d80c0c1a4972906f1b37b051aec2b1
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
@@ -310,20 +310,25 @@
        wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
        wrapper2.last("limit 1");
        AuctionSalesroomGoods auctionSalesroomGoods = this.getOne(wrapper2);
        auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS);
        auctionSalesroomGoods.setStartTime(LocalDateTime.now());
        this.updateById(auctionSalesroomGoods);
        if(auctionSalesroomGoods!=null){
            auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS);
            auctionSalesroomGoods.setStartTime(LocalDateTime.now());
            this.updateById(auctionSalesroomGoods);
        }
        Map<String, Object> map = new ConcurrentHashMap<>();
        map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM);
        map.put("auctionSalesroomId", auctionSalesroom.getId());
        map.put("AuctionTypeEnum",auctionSalesroom.getStatus());
        map.put("message_type", "start");
        map.put("type", "1");
        String msg = null;
        try {
            msg = objectMapper.writeValueAsString(map);
        } catch (JsonProcessingException e) {
        }
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg);
    }
@@ -378,14 +383,16 @@
        Map<String, Object> map = new ConcurrentHashMap<>();
        map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM);
        map.put("AuctionTypeEnum",auctionSalesroom.getStatus());
        map.put("auctionSalesroomId", auctionSalesroom.getId());
        map.put("message_type", "end");
        map.put("type", "1");
        String msg = null;
        try {
            msg = objectMapper.writeValueAsString(map);
        } catch (JsonProcessingException e) {
        }
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg);
    }
@@ -418,18 +425,20 @@
        auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS);
        this.updateById(auctionSalesroomGoods);
     /*   Map<String, Object> map = new ConcurrentHashMap<>();
       Map<String, Object> map = new ConcurrentHashMap<>();
        map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS);
        map.put("notification_time", LocalDateTime.now());
        map.put("goodsSkuId", auctionSalesroomGoods.getId());
        map.put("message_type", "start");
        map.put("type",2);
        map.put("AuctionGoodsStatusEnum",auctionSalesroomGoods.getStatus());
        String msg = null;
        try {
            msg = objectMapper.writeValueAsString(map);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);*/
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg);
    }
@@ -486,18 +495,20 @@
        auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED);
        this.updateById(auctionSalesroomGoods);
      /*  Map<String, Object> map = new ConcurrentHashMap<>();
       Map<String, Object> map = new ConcurrentHashMap<>();
        map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS);
        map.put("notification_time", LocalDateTime.now());
        map.put("goodsSkuId", auctionSalesroomGoods.getId());
        map.put("message_type", "end");
        map.put("type",2);
        map.put("AuctionGoodsStatusEnum",auctionSalesroomGoods.getStatus());
        String msg = null;
        try {
            msg = objectMapper.writeValueAsString(map);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.AUCTIONEER.getCode(), msg);*/
        WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), msg);
    }