Browse Source

【功能完善】商城: 客服

puhui999 8 months ago
parent
commit
43cb8b1f21

+ 2 - 1
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/history/ProductBrowseHistoryController.java

@@ -51,7 +51,8 @@ public class ProductBrowseHistoryController {
                 convertSet(pageResult.getList(), ProductBrowseHistoryDO::getSpuId));
         return success(BeanUtils.toBean(pageResult, ProductBrowseHistoryRespVO.class,
                 vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
-                        .ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
+                        .ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
+                                .setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
     }
 
 }

+ 6 - 3
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/history/vo/ProductBrowseHistoryRespVO.java

@@ -1,12 +1,9 @@
 package cn.iocoder.yudao.module.product.controller.admin.history.vo;
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
-import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
-import java.time.LocalDateTime;
-
 import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
 
 @Schema(description = "管理后台 - 商品浏览记录 Response VO")
@@ -31,4 +28,10 @@ public class ProductBrowseHistoryRespVO {
     @Schema(description = "商品单价", example = "100")
     private Integer price;
 
+    @Schema(description = "商品销量", example = "100")
+    private Integer salesCount;
+
+    @Schema(description = "库存", example = "100")
+    private Integer stock;
+
 }

+ 2 - 1
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/history/AppProductBrowseHistoryController.java

@@ -71,7 +71,8 @@ public class AppProductBrowseHistoryController {
         Map<Long, ProductSpuDO> spuMap = convertMap(productSpuService.getSpuList(spuIds), ProductSpuDO::getId);
         return success(BeanUtils.toBean(pageResult, AppProductBrowseHistoryRespVO.class,
                 vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
-                        .ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
+                        .ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
+                                .setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
     }
 
 }

+ 7 - 0
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/history/vo/AppProductBrowseHistoryRespVO.java

@@ -26,4 +26,11 @@ public class AppProductBrowseHistoryRespVO {
     @Schema(description = "商品单价", example = "100")
     private Integer price;
 
+    @Schema(description = "商品销量", example = "100")
+    private Integer salesCount;
+
+    @Schema(description = "库存", example = "100")
+    private Integer stock;
+
+
 }

+ 2 - 2
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/kefu/KeFuMessageServiceImpl.java

@@ -112,9 +112,9 @@ public class KeFuMessageServiceImpl implements KeFuMessageService {
         // 2.3 发送消息通知会员,管理员已读 -> 会员更新发送的消息状态
         KeFuMessageDO keFuMessage = getFirst(filterList(messageList, message -> UserTypeEnum.MEMBER.getValue().equals(message.getSenderType())));
         assert keFuMessage != null; // 断言避免警告
-        getSelf().sendAsyncMessageToMember(keFuMessage.getSenderId(), KEFU_MESSAGE_ADMIN_READ, conversation);
+        getSelf().sendAsyncMessageToMember(keFuMessage.getSenderId(), KEFU_MESSAGE_ADMIN_READ, conversation.getId());
         // 2.4 通知所有管理员消息已读
-        getSelf().sendAsyncMessageToAdmin(KEFU_MESSAGE_ADMIN_READ, conversation);
+        getSelf().sendAsyncMessageToAdmin(KEFU_MESSAGE_ADMIN_READ, conversation.getId());
     }
 
     private void validateReceiverExist(Long receiverId, Integer receiverType) {