From 1048f01c81cf90b8ceb4d8ad070a76d32ea00380 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 22 Jul 2025 12:05:02 +0800
Subject: [PATCH] fix:修复衣服社交 Mapper 中的点赞和收藏数量统计错误- 修改了 likeCntReal 和 collectCntReal 字段的查询方式- 使用 COUNT(DISTINCT(member_id)) 替代 COUNT(id)并去除 group by 语句- 这样可以正确统计每个衣服的点赞和收藏数量,而不是按用户分组计数

---
 src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java b/src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java
index 392ec52..47699fd 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java
@@ -2,18 +2,19 @@
 
 import cc.mrbird.febs.common.controller.BaseController;
 import cc.mrbird.febs.common.entity.FebsConstant;
+import cc.mrbird.febs.common.entity.FebsResponse;
 import cc.mrbird.febs.common.enumerates.SocialPatternLocationTypeEnum;
+import cc.mrbird.febs.common.utils.AppContants;
 import cc.mrbird.febs.common.utils.FebsUtil;
+import cc.mrbird.febs.common.utils.RedisUtils;
+import cc.mrbird.febs.mall.dto.clothes.AdminClothesPrintOrderDto;
 import cc.mrbird.febs.mall.entity.*;
 import cc.mrbird.febs.mall.mapper.*;
 import cc.mrbird.febs.mall.service.ClothesTypeService;
 import cc.mrbird.febs.mall.service.IAdminBannerService;
 import cc.mrbird.febs.mall.vo.AdminLabelSetVo;
 import cc.mrbird.febs.mall.vo.AdminMallOrderVo;
-import cc.mrbird.febs.mall.vo.clothes.AdminClothesDeliverGoodsVo;
-import cc.mrbird.febs.mall.vo.clothes.AdminClothesLocationRemarkVo;
-import cc.mrbird.febs.mall.vo.clothes.AdminClothesPatternRemarkVo;
-import cc.mrbird.febs.mall.vo.clothes.AdminClothesTypeInfoVo;
+import cc.mrbird.febs.mall.vo.clothes.*;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
@@ -59,6 +60,7 @@
     private final MallExpressInfoMapper mallExpressInfoMapper;
     private final ClothesPatternRemarkMapper clothesPatternRemarkMapper;
     private final ClothesLocationRemarkMapper clothesLocationRemarkMapper;
+    private final RedisUtils redisUtils;
 
     /**
      * 社区分类列表
@@ -106,6 +108,27 @@
         return FebsUtil.view("modules/clothesType/socialList");
     }
 
+
+
+    /**
+     * 社区列表-查看评论
+     * @return
+     */
+    @GetMapping("/socialComment/{id}")
+    @RequiresPermissions("socialComment:view")
+    public String socialComment(@PathVariable Long id, Model model) {
+
+        String existToken = redisUtils.getString(AppContants.SOCIAL_COMMENT);
+        if (StrUtil.isNotBlank(existToken)) {
+            Object o = redisUtils.get(existToken);
+            if (ObjectUtil.isNotEmpty(o)) {
+                redisUtils.del(existToken);
+            }
+        }
+        redisUtils.set(AppContants.SOCIAL_COMMENT, id, -1);
+        return FebsUtil.view("modules/clothesType/socialComment");
+    }
+
     /**
      * 社区-新增
      */
@@ -114,6 +137,8 @@
     public String socialAdd() {
         return FebsUtil.view("modules/clothesType/socialAdd");
     }
+
+
 
     /**
      * 社区-修改
@@ -210,6 +235,25 @@
         return FebsUtil.view("modules/clothesType/orderList");
     }
 
+
+
+
+
+    /**
+     * 社区列表-查看评论
+     * @return
+     */
+    @GetMapping("/orderPrint/{id}")
+    @RequiresPermissions("orderPrint:view")
+    public String orderPrint(@PathVariable Long id, Model model) {
+
+        AdminClothesPrintOrderDto dto = new AdminClothesPrintOrderDto();
+        dto.setId(id);
+        AdminClothesPrintOrderVo adminClothesPrintOrderVo = clothesTypeService.printOrderEvent(dto);
+        model.addAttribute("orderPrint", adminClothesPrintOrderVo);
+        return FebsUtil.view("modules/clothesType/orderPrint");
+    }
+
     /**
      * 订单-发货
      * @param id
@@ -218,9 +262,13 @@
      */
     @GetMapping("deliverGoods/{id}")
     @RequiresPermissions("deliverGoods:update")
-    public String deliverGoods(@PathVariable long id, Model model) {
+    public String deliverGoods(@PathVariable Long id, Model model) {
         AdminClothesDeliverGoodsVo data = new AdminClothesDeliverGoodsVo();
         ClothesOrder clothesOrder = clothesOrderMapper.selectById(id);
+        data.setId(clothesOrder.getId());
+        data.setName(clothesOrder.getName());
+        data.setPhone(clothesOrder.getPhone());
+        data.setAddress(clothesOrder.getAddress());
         data.setExpressCom("极兔快递");
         MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                 Wrappers.lambdaQuery(MallExpressInfo.class)

--
Gitblit v1.9.1