From b2ab426275d80c0c1a4972906f1b37b051aec2b1 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期五, 21 六月 2024 11:07:27 +0800
Subject: [PATCH] 用户端商品

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
index f8f2d8e..d617961 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
+++ b/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);
 
     }
 

--
Gitblit v1.7.1