Explorar o código

Merge branch 'sit' into release_buried-point_ph

# Conflicts:
#	alien-store/src/main/java/shop/alien/store/controller/CommonCommentController.java
lutong hai 2 meses
pai
achega
9cf576aa60
Modificáronse 47 ficheiros con 1047 adicións e 2525 borrados
  1. 94 88
      alien-config/pom.xml
  2. 5 0
      alien-entity/pom.xml
  3. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/CommonComment.java
  4. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/StoreCuisine.java
  5. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/StorePrice.java
  6. 0 111
      alien-entity/src/main/java/shop/alien/entity/store/StoreProductItem.java
  7. 3 2
      alien-entity/src/main/java/shop/alien/entity/store/StoreUser.java
  8. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/TagsSynonym.java
  9. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineComboDto.java
  10. 5 0
      alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineItemDto.java
  11. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineTypeResponseDto.java
  12. 0 64
      alien-entity/src/main/java/shop/alien/entity/store/dto/StoreProductItemDto.java
  13. 5 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/CommonCommentVo.java
  14. 1 1
      alien-entity/src/main/java/shop/alien/entity/store/vo/PriceListVo.java
  15. 50 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/RatingPercentVo.java
  16. 0 146
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreProductItemDelicaciesVo.java
  17. 0 150
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreProductItemGymVo.java
  18. 10 1
      alien-entity/src/main/java/shop/alien/mapper/CommonCommentMapper.java
  19. 0 92
      alien-entity/src/main/java/shop/alien/mapper/StoreProductItemMapper.java
  20. 0 431
      alien-entity/src/main/resources/mapper/StoreProductItemMapper.xml
  21. 1 1
      alien-gateway/src/main/java/shop/alien/gateway/AlienGatewayApplication.java
  22. 4 0
      alien-store/pom.xml
  23. 1 1
      alien-store/src/main/java/shop/alien/store/controller/AiChatController.java
  24. 4 3
      alien-store/src/main/java/shop/alien/store/controller/AiSearchController.java
  25. 51 3
      alien-store/src/main/java/shop/alien/store/controller/CommonCommentController.java
  26. 24 5
      alien-store/src/main/java/shop/alien/store/controller/CommonRatingController.java
  27. 19 3
      alien-store/src/main/java/shop/alien/store/controller/StorePriceController.java
  28. 0 179
      alien-store/src/main/java/shop/alien/store/controller/StoreProductBarController.java
  29. 0 204
      alien-store/src/main/java/shop/alien/store/controller/StoreProductDelicaciesController.java
  30. 0 170
      alien-store/src/main/java/shop/alien/store/controller/StoreProductGymController.java
  31. 0 167
      alien-store/src/main/java/shop/alien/store/controller/StoreProductItemController.java
  32. 38 1
      alien-store/src/main/java/shop/alien/store/service/CommonCommentService.java
  33. 14 2
      alien-store/src/main/java/shop/alien/store/service/CommonRatingService.java
  34. 2 2
      alien-store/src/main/java/shop/alien/store/service/LifeCommentService.java
  35. 21 14
      alien-store/src/main/java/shop/alien/store/service/LifeUserDynamicsService.java
  36. 0 117
      alien-store/src/main/java/shop/alien/store/service/StoreProductItemService.java
  37. 10 3
      alien-store/src/main/java/shop/alien/store/service/impl/CommentAppealServiceImpl.java
  38. 208 3
      alien-store/src/main/java/shop/alien/store/service/impl/CommonCommentServiceImpl.java
  39. 336 85
      alien-store/src/main/java/shop/alien/store/service/impl/CommonRatingServiceImpl.java
  40. 2 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentServiceImpl.java
  41. 1 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreCuisineServiceImpl.java
  42. 0 461
      alien-store/src/main/java/shop/alien/store/service/impl/StoreProductItemServiceImpl.java
  43. 1 0
      alien-store/src/main/java/shop/alien/store/util/CommonConstant.java
  44. 20 7
      alien-util/pom.xml
  45. 39 0
      alien-util/src/main/java/shop/alien/util/common/SpringContextUtil.java
  46. 2 2
      alien-util/src/main/java/shop/alien/util/common/constant/CommentSourceTypeEnum.java
  47. 70 0
      alien-util/src/main/java/shop/alien/util/encryption/EncryptTypeHandler.java

+ 94 - 88
alien-config/pom.xml

@@ -1,88 +1,94 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>shop.alien</groupId>
-        <artifactId>alien-cloud</artifactId>
-        <version>1.0.0</version>
-    </parent>
-
-    <artifactId>alien-config</artifactId>
-    <version>1.0.0</version>
-    <name>alien-config</name>
-    <description>alien-config</description>
-
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    </properties>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-openfeign</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>io.github.openfeign</groupId>
-            <artifactId>feign-okhttp</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-core</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-extension</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>shop.alien</groupId>
-            <artifactId>alien-util</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>shop.alien</groupId>
+        <artifactId>alien-cloud</artifactId>
+        <version>1.0.0</version>
+    </parent>
+
+    <artifactId>alien-config</artifactId>
+    <version>1.0.0</version>
+    <name>alien-config</name>
+    <description>alien-config</description>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.github.openfeign</groupId>
+            <artifactId>feign-okhttp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>shop.alien</groupId>
+            <artifactId>alien-entity</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>shop.alien</groupId>
+            <artifactId>alien-util</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 5 - 0
alien-entity/pom.xml

@@ -87,6 +87,11 @@
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
+        <dependency>
+            <groupId>shop.alien</groupId>
+            <artifactId>alien-util</artifactId>
+            <version>1.0.0</version>
+        </dependency>
 
     </dependencies>
 

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/CommonComment.java

@@ -28,7 +28,7 @@ public class CommonComment implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
-    @ApiModelProperty(value = "评论来源类型:1-评价的评论 2-社区动态 3-活动留言")
+    @ApiModelProperty(value = "评论来源类型:1-评价的评论 2-动态评论")
     @TableField("source_type")
     private Integer sourceType;
 

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/StoreCuisine.java

@@ -68,7 +68,7 @@ public class StoreCuisine {
 
     @ApiModelProperty(value = "适用人数")
     @TableField("people_limit")
-    private Integer peopleLimit;
+    private String peopleLimit;
 
     @ApiModelProperty(value = "使用规则")
     @TableField("usage_rule")

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/StorePrice.java

@@ -69,7 +69,7 @@ public class StorePrice {
 
     @ApiModelProperty(value = "适用人数")
     @TableField("people_limit")
-    private Integer peopleLimit;
+    private String peopleLimit;
 
     @ApiModelProperty(value = "使用规则")
     @TableField("usage_rule")

+ 0 - 111
alien-entity/src/main/java/shop/alien/entity/store/StoreProductItem.java

@@ -1,111 +0,0 @@
-package shop.alien.entity.store;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 商品表
- *
- * @author system
- * @since 2025-01-XX
- */
-@Data
-@JsonInclude
-@TableName("store_product_item")
-@ApiModel(value = "StoreProductItem对象", description = "商品表")
-public class StoreProductItem implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "主键")
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    @ApiModelProperty(value = "门店id")
-    @TableField("store_id")
-    private Integer storeId;
-
-    @ApiModelProperty(value = "商品名称")
-    @TableField("prod_name")
-    private String prodName;
-
-    @ApiModelProperty(value = "总价")
-    @TableField("total_price")
-    private BigDecimal totalPrice;
-
-    @ApiModelProperty(value = "商品类型,整型枚举:1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次")
-    @TableField("prod_type")
-    private Integer prodType;
-
-    @ApiModelProperty(value = "图片列表,最多 9 张 URL")
-    @TableField("images")
-    private String images;
-
-    @ApiModelProperty(value = "图文详情-图片")
-    @TableField("image_content")
-    private String imageContent;
-
-    @ApiModelProperty(value = "图文详情-文字")
-    @TableField("detail_content")
-    private String detailContent;
-
-    @ApiModelProperty(value = "补充说明")
-    @TableField("extra_note")
-    private String extraNote;
-
-    @ApiModelProperty(value = "是否需要预约:0=否,1=是")
-    @TableField("need_reserve")
-    private Integer needReserve;
-
-    @ApiModelProperty(value = "预约规则")
-    @TableField("reserve_rule")
-    private String reserveRule;
-
-    @ApiModelProperty(value = "适用人数")
-    @TableField("people_limit")
-    private Integer peopleLimit;
-
-    @ApiModelProperty(value = "使用规则")
-    @TableField("usage_rule")
-    private String usageRule;
-
-    @ApiModelProperty(value = "状态:0-待审核 1-审核通过 2-审核拒绝")
-    @TableField("status")
-    private Integer status;
-
-    @ApiModelProperty(value = "拒绝原因")
-    @TableField("rejection_reason")
-    private String rejectionReason;
-
-    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
-    @TableField("delete_flag")
-    @TableLogic
-    private Integer deleteFlag;
-
-    @ApiModelProperty(value = "创建人")
-    @TableField("created_user_id")
-    private Integer createdUserId;
-
-    @ApiModelProperty(value = "更新人")
-    @TableField("updated_user_id")
-    private Integer updatedUserId;
-
-    @ApiModelProperty(value = "创建时间")
-    @TableField(value = "created_time", fill = FieldFill.INSERT)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date createdTime;
-
-    @ApiModelProperty(value = "更新时间")
-    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date updatedTime;
-}
-

+ 3 - 2
alien-entity/src/main/java/shop/alien/entity/store/StoreUser.java

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import shop.alien.util.encryption.EncryptTypeHandler;
 
 import java.util.Date;
 
@@ -18,7 +19,7 @@ import java.util.Date;
  */
 @Data
 @JsonInclude
-@TableName("store_user")
+@TableName(value = "store_user", autoResultMap = true)
 @ApiModel(value = "StoreUser对象", description = "门店用户")
 public class StoreUser extends Model<StoreUser> {
 
@@ -51,7 +52,7 @@ public class StoreUser extends Model<StoreUser> {
     private String idCard;
 
     @ApiModelProperty(value = "密码")
-    @TableField("password")
+    @TableField(value = "password", typeHandler = EncryptTypeHandler.class)
     private String password;
 
     @ApiModelProperty(value = "支付密码")

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/TagsSynonym.java

@@ -27,7 +27,7 @@ public class TagsSynonym {
     @TableField("main_tag_id")
     private Integer mainTagId;
 
-    @ApiModelProperty(value = "评论ID")
+    @ApiModelProperty(value = "评论ID(关联common_comment.id)")
     @TableField("comment_id")
     private Integer commentId;
 

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineComboDto.java

@@ -66,7 +66,7 @@ public class CuisineComboDto {
 
     @ApiModelProperty(value = "适用人数")
     @TableField("people_limit")
-    private Integer peopleLimit;
+    private String peopleLimit;
 
     @ApiModelProperty(value = "使用规则")
     @TableField("usage_rule")

+ 5 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineItemDto.java

@@ -6,6 +6,8 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import java.math.BigDecimal;
+
 /**
  * 套餐菜品项 DTO
  * 用于解析前端传入的 groupJson 中的菜品信息
@@ -30,5 +32,8 @@ public class CuisineItemDto {
 
     @ApiModelProperty(value = "单位")
     private String unit;
+
+    @ApiModelProperty(value = "价格")
+    private BigDecimal price;
 }
 

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineTypeResponseDto.java

@@ -60,7 +60,7 @@ public class CuisineTypeResponseDto {
         private String reserveRule;
 
         @ApiModelProperty(value = "适用人数")
-        private Integer peopleLimit;
+        private String peopleLimit;
 
         @ApiModelProperty(value = "使用规则")
         private String usageRule;

+ 0 - 64
alien-entity/src/main/java/shop/alien/entity/store/dto/StoreProductItemDto.java

@@ -1,64 +0,0 @@
-package shop.alien.entity.store.dto;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.List;
-
-@Data
-@ApiModel(value = "StoreProductItemDto", description = "商品表 DTO")
-public class StoreProductItemDto implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty("区分模块:1酒吧 2美食 3运动健身")
-    private Integer modelType;
-
-    @ApiModelProperty("主键")
-    private Integer id;
-
-    @ApiModelProperty("门店id")
-    private Integer storeId;
-
-    @ApiModelProperty("商品名称")
-    private String prodName;
-
-    @ApiModelProperty(value = "总价")
-    @TableField("total_price")
-    private BigDecimal totalPrice;
-
-    @ApiModelProperty("商品类型,整型枚举:1酒吧-酒水 2酒吧-餐食 3酒吧-套餐  4美食-餐食 5运动健身-单次 6运动健身-多次")
-    private Integer prodType;
-
-    @ApiModelProperty("图片列表,最多 9 张 URL")
-    private String images;
-
-    @ApiModelProperty("图文详情-图片")
-    private String imageContent;
-
-    @ApiModelProperty("图文详情-文字")
-    private String detailContent;
-
-    @ApiModelProperty("补充说明")
-    private String extraNote;
-
-    @ApiModelProperty("是否需要预约:0=否,1=是")
-    private Integer needReserve;
-
-    @ApiModelProperty("预约规则")
-    private String reserveRule;
-
-    @ApiModelProperty("适用人数")
-    private Integer peopleLimit;
-
-    @ApiModelProperty("使用规则")
-    private String usageRule;
-
-    @ApiModelProperty("子项列表(后端按类型转换)")
-    private List<?> subList;
-
-}

+ 5 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/CommonCommentVo.java

@@ -18,4 +18,9 @@ public class CommonCommentVo extends CommonComment {
     private String headName;
     @ApiModelProperty(value = "是否点赞")
     private String isLike;
+    @ApiModelProperty(value = "来源关联id")
+    private Long sourceId;
+    @ApiModelProperty(value = "数量")
+    private Integer commentCount;
+
 }

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/PriceListVo.java

@@ -60,7 +60,7 @@ public class PriceListVo {
     private String reserveRule;
 
     @ApiModelProperty(value = "适用人数")
-    private Integer peopleLimit;
+    private String peopleLimit;
 
     @ApiModelProperty(value = "使用规则")
     private String usageRule;

+ 50 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/RatingPercentVo.java

@@ -0,0 +1,50 @@
+package shop.alien.entity.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 评价回复率和评价比例VO
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Data
+@JsonInclude
+@ApiModel(value = "RatingPercentVo对象", description = "评价回复率和评价比例")
+public class RatingPercentVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "总评价数")
+    private Integer totalRatingCount;
+
+    @ApiModelProperty(value = "好评数")
+    private Integer goodCount;
+
+    @ApiModelProperty(value = "中评数")
+    private Integer midCount;
+
+    @ApiModelProperty(value = "差评数")
+    private Integer badCount;
+
+    @ApiModelProperty(value = "好评占比(%)")
+    private Double goodPercent;
+
+    @ApiModelProperty(value = "中评占比(%)")
+    private Double midPercent;
+
+    @ApiModelProperty(value = "差评占比(%)")
+    private Double badPercent;
+
+    @ApiModelProperty(value = "已回复的评价数")
+    private Integer repliedCount;
+
+    @ApiModelProperty(value = "回复率(%)")
+    private Double replyRate;
+}
+

+ 0 - 146
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreProductItemDelicaciesVo.java

@@ -1,146 +0,0 @@
-package shop.alien.entity.store.vo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-/**
- * 商品表与美食商品表关联查询VO
- *
- * @author system
- * @since 2025-01-XX
- */
-@Data
-@JsonInclude
-@ApiModel(value = "StoreProductItemDelicaciesVo对象", description = "商品表与美食商品表关联查询VO")
-public class StoreProductItemDelicaciesVo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    // ========== store_product_item 表字段 ==========
-    @ApiModelProperty(value = "商品表主键")
-    private Integer id;
-
-    @ApiModelProperty(value = "门店id")
-    private Integer storeId;
-
-    @ApiModelProperty(value = "商品名称")
-    private String prodName;
-
-    @ApiModelProperty(value = "总价")
-    private BigDecimal totalPrice;
-
-    @ApiModelProperty(value = "商品类型,整型枚举:1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次")
-    private Integer prodType;
-
-    @ApiModelProperty(value = "图片列表,最多 9 张 URL")
-    private String images;
-
-    @ApiModelProperty(value = "图文详情-图片")
-    private String imageContent;
-
-    @ApiModelProperty(value = "图文详情-文字")
-    private String detailContent;
-
-    @ApiModelProperty(value = "补充说明")
-    private String extraNote;
-
-    @ApiModelProperty(value = "是否需要预约:0=否,1=是")
-    private Integer needReserve;
-
-    @ApiModelProperty(value = "预约规则")
-    private String reserveRule;
-
-    @ApiModelProperty(value = "适用人数")
-    private Integer peopleLimit;
-
-    @ApiModelProperty(value = "使用规则")
-    private String usageRule;
-
-    @ApiModelProperty(value = "状态:0-待审核 1-审核通过 2-审核拒绝")
-    private Integer status;
-
-    @ApiModelProperty(value = "拒绝原因")
-    private String rejectionReason;
-
-    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
-    private Integer deleteFlag;
-
-    @ApiModelProperty(value = "创建人")
-    private Integer createdUserId;
-
-    @ApiModelProperty(value = "更新人")
-    private Integer updatedUserId;
-
-    @ApiModelProperty(value = "创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date createdTime;
-
-    @ApiModelProperty(value = "更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date updatedTime;
-
-    @ApiModelProperty(value = "美食商品子表列表(一对多关系)")
-    private List<StoreProductDelicaciesVo> delicaciesList;
-
-
-    // ========== store_product_delicacies 表字段 ==========
-    @ApiModelProperty(value = "美食商品表主键")
-    private Integer delicaciesId;
-
-    @ApiModelProperty(value = "商品表主键(关联字段)")
-    private Integer extId;
-
-    @ApiModelProperty(value = "名称")
-    private String name;
-
-    @ApiModelProperty(value = "价格(¥)")
-    private BigDecimal price;
-
-    @ApiModelProperty(value = "成本价(¥)")
-    private BigDecimal costPrice;
-
-    @ApiModelProperty(value = "单位,如份/瓶/杯")
-    private String unit;
-
-    @ApiModelProperty(value = "数量")
-    private Integer quantity;
-
-    @ApiModelProperty(value = "类别")
-    private String category;
-
-    @ApiModelProperty(value = "菜品分组")
-    private String extGroup;
-
-    @ApiModelProperty(value = "美食商品状态:0禁用,1启用")
-    private Integer delicaciesStatus;
-
-    @ApiModelProperty(value = "美食商品删除标记, 0:未删除, 1:已删除")
-    private Integer delicaciesDeleteFlag;
-
-    @ApiModelProperty(value = "美食商品创建人")
-    private Integer delicaciesCreatedUserId;
-
-    @ApiModelProperty(value = "美食商品更新人")
-    private Integer delicaciesUpdatedUserId;
-
-    @ApiModelProperty(value = "美食商品创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date delicaciesCreatedTime;
-
-    @ApiModelProperty(value = "美食商品更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date delicaciesUpdatedTime;
-
-    // ========== 辅助字段 ==========
-    @ApiModelProperty(value = "数据类型:1-菜品(来自store_product_delicacies),2-套餐/商品(来自store_product_item)")
-    private Integer dataType;
-}
-

+ 0 - 150
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreProductItemGymVo.java

@@ -1,150 +0,0 @@
-package shop.alien.entity.store.vo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 商品表与运动健身商品表关联查询VO
- *
- * @author system
- * @since 2025-01-XX
- */
-@Data
-@JsonInclude
-@ApiModel(value = "StoreProductItemGymVo对象", description = "商品表与运动健身商品表关联查询VO")
-public class StoreProductItemGymVo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    // ========== store_product_item 表字段 ==========
-    @ApiModelProperty(value = "商品表主键")
-    private Long id;
-
-    @ApiModelProperty(value = "父id")
-    private Long pid;
-
-    @ApiModelProperty(value = "门店id")
-    private Integer storeId;
-
-    @ApiModelProperty(value = "商品名称")
-    private String prodName;
-
-    @ApiModelProperty(value = "商品类型,整型枚举:1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次")
-    private Integer prodType;
-
-    @ApiModelProperty(value = "图片列表,最多 9 张 URL")
-    private String images;
-
-    @ApiModelProperty(value = "图文详情-图片")
-    private String imageContent;
-
-    @ApiModelProperty(value = "图文详情-文字")
-    private String detailContent;
-
-    @ApiModelProperty(value = "补充说明")
-    private String extraNote;
-
-    @ApiModelProperty(value = "是否需要预约:0=否,1=是")
-    private Integer needReserve;
-
-    @ApiModelProperty(value = "预约规则")
-    private String reserveRule;
-
-    @ApiModelProperty(value = "适用人数")
-    private Integer peopleLimit;
-
-    @ApiModelProperty(value = "使用规则")
-    private String usageRule;
-
-    @ApiModelProperty(value = "状态:0禁用,1启用")
-    private Integer status;
-
-    @ApiModelProperty(value = "拒绝原因")
-    private String rejectionReason;
-
-    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
-    private Integer deleteFlag;
-
-    @ApiModelProperty(value = "创建人")
-    private Long createdUserId;
-
-    @ApiModelProperty(value = "更新人")
-    private Long updatedUserId;
-
-    @ApiModelProperty(value = "创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date createdTime;
-
-    @ApiModelProperty(value = "更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date updatedTime;
-
-    // ========== store_product_gym 表字段 ==========
-    @ApiModelProperty(value = "运动健身商品表主键")
-    private Long gymId;
-
-    @ApiModelProperty(value = "商品表主键(关联字段)")
-    private Long extId;
-
-    @ApiModelProperty(value = "名称")
-    private String name;
-
-    @ApiModelProperty(value = "上课形式,如一对一/小班课")
-    private String classMode;
-
-    @ApiModelProperty(value = "可用周期(天)")
-    private Integer availableDays;
-
-    @ApiModelProperty(value = "总课时数(节)")
-    private Integer totalSessions;
-
-    @ApiModelProperty(value = "价格(¥)")
-    private BigDecimal price;
-
-    @ApiModelProperty(value = "课程功效")
-    private String courseEffect;
-
-    @ApiModelProperty(value = "适用人群")
-    private String suitablePeople;
-
-    @ApiModelProperty(value = "适用会员")
-    private String suitableMembership;
-
-    @ApiModelProperty(value = "淋浴设施")
-    private String showerFacility;
-
-    @ApiModelProperty(value = "额外须知")
-    private String extraNotice;
-
-    @ApiModelProperty(value = "运动健身商品状态:0禁用,1启用")
-    private Integer gymStatus;
-
-    @ApiModelProperty(value = "运动健身商品删除标记, 0:未删除, 1:已删除")
-    private Integer gymDeleteFlag;
-
-    @ApiModelProperty(value = "运动健身商品创建人")
-    private Long gymCreatedUserId;
-
-    @ApiModelProperty(value = "运动健身商品更新人")
-    private Long gymUpdatedUserId;
-
-    @ApiModelProperty(value = "运动健身商品创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date gymCreatedTime;
-
-    @ApiModelProperty(value = "运动健身商品更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date gymUpdatedTime;
-
-    // ========== store_info 表字段 ==========
-    @ApiModelProperty(value = "门店电话")
-    private String storeTel;
-}
-

+ 10 - 1
alien-entity/src/main/java/shop/alien/mapper/CommonCommentMapper.java

@@ -3,6 +3,7 @@ package shop.alien.mapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -33,8 +34,16 @@ public interface CommonCommentMapper extends BaseMapper<CommonComment> {
             "and llr.dianzan_id = #{dianzanId}\n" +
             "and llr.delete_flag = 0\n" +
             "${ew.customSqlSegment}")
-    List<CommonCommentVo> selectALlComment(@Param(Constants.WRAPPER)QueryWrapper<CommonCommentVo> wrapper,
+    List<CommonCommentVo> selectALlComment(@Param("page") Page<CommonCommentVo> page,
+                                           @Param(Constants.WRAPPER)QueryWrapper<CommonCommentVo> wrapper,
                                            @Param("type") String type,
                                            @Param("dianzanId") Long dianzanId);
+
+    @Select("select cc.source_id sourceId,count(*) commentCount\n" +
+            "from common_comment cc\n" +
+            "where \n" +
+            "cc.source_type = #{businessType}\n" +
+            "group by source_id")
+    List<CommonCommentVo> getCommentCount(Integer type);
 }
 

+ 0 - 92
alien-entity/src/main/java/shop/alien/mapper/StoreProductItemMapper.java

@@ -1,92 +0,0 @@
-package shop.alien.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import shop.alien.entity.store.StoreProductItem;
-import shop.alien.entity.store.dto.StoreProductItemDto;
-
-import java.util.ArrayList;
-import java.util.List;
-import shop.alien.entity.store.vo.StoreProductItemGymVo;
-import shop.alien.entity.store.vo.StoreProductItemDelicaciesVo;
-
-/**
- * <p>
- * 商品表 Mapper 接口
- * </p>
- *
- * @author system
- * @since 2025-01-XX
- */
-@Mapper
-public interface StoreProductItemMapper extends BaseMapper<StoreProductItem> {
-
-    ArrayList<StoreProductItemDto> getByPId(Integer id);
-    /**
-     * 分页查询商品表与运动健身商品表关联数据
-     *
-     * @param page 分页对象
-     * @param storeId 门店ID
-     * @param prodName 商品名称(模糊查询)
-     * @param prodType 商品类型
-     * @return IPage<StoreProductItemGymVo>
-     */
-    IPage<StoreProductItemGymVo> getPageWithGym(Page<StoreProductItemGymVo> page,
-                                                 @Param("storeId") Integer storeId,
-                                                 @Param("prodName") String prodName,
-                                                 @Param("prodType") Integer prodType);
-
-    /**
-     * 根据ID查询商品表与运动健身商品表关联详情
-     *
-     * @param id 商品表主键ID
-     * @return StoreProductItemGymVo
-     */
-    StoreProductItemGymVo getDetailWithGym(@Param("id") Long id);
-
-    /**
-     * 查询store_product_delicacies的所有菜品(用于合并查询)
-     *
-     * @param storeId 门店ID
-     * @param name 名称(模糊查询)
-     * @param category 类别
-     * @param extGroup 菜品分组
-     * @param status 状态(0:禁用,1:启用)
-     * @return List<StoreProductItemDelicaciesVo>
-     */
-    List<StoreProductItemDelicaciesVo> getDelicaciesList(@Param("storeId") Integer storeId,
-                                                          @Param("name") String name,
-                                                          @Param("category") String category,
-                                                          @Param("extGroup") String extGroup,
-                                                          @Param("status") Integer status);
-
-    /**
-     * 查询store_product_item的所有美食相关的套餐和商品(prodType = 3)(用于合并查询)
-     *
-     * @param storeId 门店ID
-     * @param name 名称(模糊查询)
-     * @param status 状态(0:禁用,1:启用)
-     * @param packageType 套餐类型(预留,用于根据类型查询套餐)
-     * @return List<StoreProductItemDelicaciesVo>
-     */
-    List<StoreProductItemDelicaciesVo> getFoodPackageList(@Param("storeId") Integer storeId,
-                                                            @Param("name") String name,
-                                                            @Param("status") Integer status,
-                                                            @Param("packageType") Integer packageType);
-
-
-
-
-
-    List<StoreProductItemDelicaciesVo> getAllDelicacies(@Param("storeId") Integer storeId,
-                                                          @Param("name") String name,
-                                                          @Param("category") String category,
-                                                          @Param("extGroup") String extGroup,
-                                                          @Param("status") Integer status,
-                                                        @Param("packageType") Integer packageType
-    );
-}
-

+ 0 - 431
alien-entity/src/main/resources/mapper/StoreProductItemMapper.xml

@@ -1,431 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="shop.alien.mapper.StoreProductItemMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="shop.alien.entity.store.StoreProductItem">
-        <id column="id" property="id" />
-        <result column="store_id" property="storeId" />
-        <result column="prod_name" property="prodName" />
-        <result column="prod_type" property="prodType" />
-        <result column="images" property="images" />
-        <result column="image_content" property="imageContent" />
-        <result column="detail_content" property="detailContent" />
-        <result column="extra_note" property="extraNote" />
-        <result column="need_reserve" property="needReserve" />
-        <result column="reserve_rule" property="reserveRule" />
-        <result column="people_limit" property="peopleLimit" />
-        <result column="usage_rule" property="usageRule" />
-        <result column="status" property="status" />
-        <result column="rejection_reason" property="rejectionReason" />
-        <result column="delete_flag" property="deleteFlag" />
-        <result column="created_user_id" property="createdUserId" />
-        <result column="updated_user_id" property="updatedUserId" />
-        <result column="created_time" property="createdTime" />
-        <result column="updated_time" property="updatedTime" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, store_id, prod_name, prod_type, images, image_content, detail_content,
-        extra_note, need_reserve, reserve_rule, people_limit, usage_rule, status, 
-        rejection_reason, delete_flag, created_user_id, updated_user_id, created_time, updated_time
-    </sql>
-    <!-- 酒吧商品模块 -->
-    <resultMap id="StoreProductItemDtoMap" type="shop.alien.entity.store.dto.StoreProductItemDto">
-        <id column="id" property="id"/>
-        <result column="store_id" property="storeId"/>
-        <result column="prod_name" property="prodName"/>
-        <result column="prod_type" property="prodType"/>
-        <result column="images" property="images"/>
-        <result column="image_content" property="imageContent"/>
-        <result column="detail_content" property="detailContent"/>
-        <result column="extra_note" property="extraNote"/>
-        <result column="need_reserve" property="needReserve"/>
-        <result column="reserve_rule" property="reserveRule"/>
-        <result column="people_limit" property="peopleLimit"/>
-        <result column="usage_rule" property="usageRule"/>
-
-        <collection property="subList" ofType="shop.alien.entity.store.StoreProductBar">
-            <id column="bar_id" property="id"/>
-            <result column="bar_ext_id" property="extId"/>
-            <result column="sub_type" property="sub_type"/>
-            <result column="name" property="name"/>
-            <result column="price" property="price"/>
-            <result column="cost_price" property="costPrice"/>
-            <result column="unit" property="unit"/>
-            <result column="quantity" property="quantity"/>
-            <result column="category" property="category"/>
-            <result column="alcohol_vol" property="alcoholVol"/>
-            <result column="volume_ml" property="volumeMl"/>
-            <result column="flavor" property="flavor"/>
-            <result column="bar_status" property="status"/>
-            <result column="bar_delete_flag" property="deleteFlag"/>
-            <result column="created_user_id" property="createdUserId" />
-            <result column="updated_user_id" property="updatedUserId" />
-            <result column="bar_created_time" property="createdTime"/>
-            <result column="bar_updated_time" property="updatedTime"/>
-        </collection>
-    </resultMap>
-
-    <select id="getByExtId" resultMap="StoreProductItemDtoMap">
-        SELECT
-            spi.id,
-            spi.store_id,
-            spi.prod_name,
-            spi.prod_type,
-            spi.images,
-            spi.image_content,
-            spi.detail_content,
-            spi.extra_note,
-            spi.need_reserve,
-            spi.reserve_rule,
-            spi.people_limit,
-            spi.usage_rule,
-            spb.id           AS bar_id,
-            spb.ext_id       AS bar_ext_id,
-            spb.sub_type,
-            spb.name,
-            spb.price,
-            spb.cost_price,
-            spb.unit,
-            spb.quantity,
-            spb.category,
-            spb.alcohol_vol,
-            spb.volume_ml,
-            spb.flavor,
-            spb.status       AS bar_status,
-            spb.delete_flag  AS bar_delete_flag,
-            spb.created_user_id AS bar_created_user_id,
-            spb.updated_user_id AS bar_updated_user_id,
-            spb.created_time AS bar_created_time,
-            spb.updated_time AS bar_updated_time
-        FROM store_product_item spi
-                 LEFT JOIN store_product_bar spb
-                           ON spb.ext_id = spi.id
-                               AND spb.delete_flag = 0
-        WHERE spi.delete_flag = 0
-    </select>
-
-    <!-- 商品表与运动健身商品表关联查询结果映射 -->
-    <resultMap id="StoreProductItemGymVoResultMap" type="shop.alien.entity.store.vo.StoreProductItemGymVo">
-        <!-- store_product_item 表字段 -->
-        <id column="id" property="id" />
-        <result column="pid" property="pid" />
-        <result column="store_id" property="storeId" />
-        <result column="prod_name" property="prodName" />
-        <result column="prod_type" property="prodType" />
-        <result column="images" property="images" />
-        <result column="image_content" property="imageContent" />
-        <result column="detail_content" property="detailContent" />
-        <result column="extra_note" property="extraNote" />
-        <result column="need_reserve" property="needReserve" />
-        <result column="reserve_rule" property="reserveRule" />
-        <result column="people_limit" property="peopleLimit" />
-        <result column="usage_rule" property="usageRule" />
-        <result column="status" property="status" />
-        <result column="rejection_reason" property="rejectionReason" />
-        <result column="delete_flag" property="deleteFlag" />
-        <result column="created_user_id" property="createdUserId" />
-        <result column="updated_user_id" property="updatedUserId" />
-        <result column="created_time" property="createdTime" />
-        <result column="updated_time" property="updatedTime" />
-        <!-- store_product_gym 表字段 -->
-        <result column="gym_id" property="gymId" />
-        <result column="ext_id" property="extId" />
-        <result column="gym_name" property="name" />
-        <result column="class_mode" property="classMode" />
-        <result column="available_days" property="availableDays" />
-        <result column="total_sessions" property="totalSessions" />
-        <result column="price" property="price" />
-        <result column="course_effect" property="courseEffect" />
-        <result column="suitable_people" property="suitablePeople" />
-        <result column="suitable_membership" property="suitableMembership" />
-        <result column="shower_facility" property="showerFacility" />
-        <result column="extra_notice" property="extraNotice" />
-        <result column="gym_status" property="gymStatus" />
-        <result column="gym_delete_flag" property="gymDeleteFlag" />
-        <result column="gym_created_user_id" property="gymCreatedUserId" />
-        <result column="gym_updated_user_id" property="gymUpdatedUserId" />
-        <result column="gym_created_time" property="gymCreatedTime" />
-        <result column="gym_updated_time" property="gymUpdatedTime" />
-        <!-- store_info 表字段 -->
-        <result column="store_tel" property="storeTel" />
-    </resultMap>
-
-    <!-- 分页查询商品表与运动健身商品表关联数据 -->
-    <select id="getPageWithGym" resultMap="StoreProductItemGymVoResultMap">
-        SELECT
-            -- store_product_item 表字段
-            item.id,
-            item.store_id,
-            item.prod_name,
-            item.prod_type,
-            item.images,
-            item.image_content,
-            item.detail_content,
-            item.extra_note,
-            item.need_reserve,
-            item.reserve_rule,
-            item.people_limit,
-            item.usage_rule,
-            item.status,
-            item.rejection_reason,
-            item.delete_flag,
-            item.created_user_id,
-            item.updated_user_id,
-            item.created_time,
-            item.updated_time,
-            -- store_product_gym 表字段
-            gym.id AS gym_id,
-            gym.ext_id,
-            gym.name AS gym_name,
-            gym.class_mode,
-            gym.available_days,
-            gym.total_sessions,
-            gym.price,
-            gym.course_effect,
-            gym.suitable_people,
-            gym.suitable_membership,
-            gym.shower_facility,
-            gym.extra_notice,
-            gym.status AS gym_status,
-            gym.delete_flag AS gym_delete_flag,
-            gym.created_user_id AS gym_created_user_id,
-            gym.updated_user_id AS gym_updated_user_id,
-            gym.created_time AS gym_created_time,
-            gym.updated_time AS gym_updated_time
-        FROM store_product_item item
-        LEFT JOIN store_product_gym gym ON item.id = gym.ext_id AND gym.delete_flag = 0
-        WHERE item.delete_flag = 0
-        <if test="storeId != null">
-            AND item.store_id = #{storeId}
-        </if>
-        <if test="prodName != null and prodName != ''">
-            AND item.prod_name LIKE CONCAT('%', #{prodName}, '%')
-        </if>
-        <if test="prodType != null">
-            AND item.prod_type = #{prodType}
-        </if>
-        ORDER BY item.created_time DESC
-    </select>
-
-    <!-- 根据ID查询商品表与运动健身商品表关联详情 -->
-    <select id="getDetailWithGym" resultMap="StoreProductItemGymVoResultMap">
-        SELECT
-            -- store_product_item 表字段
-            item.id,
-            item.store_id,
-            item.prod_name,
-            item.prod_type,
-            item.images,
-            item.image_content,
-            item.detail_content,
-            item.extra_note,
-            item.need_reserve,
-            item.reserve_rule,
-            item.people_limit,
-            item.usage_rule,
-            item.status,
-            item.rejection_reason,
-            item.delete_flag,
-            item.created_user_id,
-            item.updated_user_id,
-            item.created_time,
-            item.updated_time,
-            -- store_product_gym 表字段
-            gym.id AS gym_id,
-            gym.ext_id,
-            gym.name AS gym_name,
-            gym.class_mode,
-            gym.available_days,
-            gym.total_sessions,
-            gym.price,
-            gym.course_effect,
-            gym.suitable_people,
-            gym.suitable_membership,
-            gym.shower_facility,
-            gym.extra_notice,
-            gym.status AS gym_status,
-            gym.delete_flag AS gym_delete_flag,
-            gym.created_user_id AS gym_created_user_id,
-            gym.updated_user_id AS gym_updated_user_id,
-            gym.created_time AS gym_created_time,
-            gym.updated_time AS gym_updated_time,
-            -- store_info 表字段
-            store.store_tel
-        FROM store_product_item item
-        LEFT JOIN store_product_gym gym ON item.id = gym.ext_id AND gym.delete_flag = 0
-        LEFT JOIN store_info store ON item.store_id = store.id AND store.delete_flag = 0
-        WHERE item.id = #{id} AND item.delete_flag = 0
-    </select>
-
-    <!-- 商品表与美食商品表关联查询结果映射 -->
-    <resultMap id="StoreProductItemDelicaciesVoResultMap" type="shop.alien.entity.store.vo.StoreProductItemDelicaciesVo">
-        <!-- store_product_item 表字段 -->
-        <id column="id" property="id" />
-        <result column="store_id" property="storeId" />
-        <result column="prod_name" property="prodName" />
-        <result column="total_price" property="totalPrice" />
-        <result column="prod_type" property="prodType" />
-        <result column="images" property="images" />
-        <result column="image_content" property="imageContent" />
-        <result column="detail_content" property="detailContent" />
-        <result column="extra_note" property="extraNote" />
-        <result column="need_reserve" property="needReserve" />
-        <result column="reserve_rule" property="reserveRule" />
-        <result column="people_limit" property="peopleLimit" />
-        <result column="usage_rule" property="usageRule" />
-        <result column="item_status" property="status" />
-        <result column="rejection_reason" property="rejectionReason" />
-        <result column="item_delete_flag" property="deleteFlag" />
-        <result column="item_created_user_id" property="createdUserId" />
-        <result column="item_updated_user_id" property="updatedUserId" />
-        <result column="item_created_time" property="createdTime" />
-        <result column="item_updated_time" property="updatedTime" />
-        <!-- store_product_delicacies 表字段 -->
-        <result column="delicacies_id" property="delicaciesId" />
-        <result column="ext_id" property="extId" />
-        <result column="name" property="name" />
-        <result column="price" property="price" />
-        <result column="cost_price" property="costPrice" />
-        <result column="unit" property="unit" />
-        <result column="quantity" property="quantity" />
-        <result column="category" property="category" />
-        <result column="ext_group" property="extGroup" />
-        <result column="delicacies_status" property="delicaciesStatus" />
-        <result column="delicacies_delete_flag" property="delicaciesDeleteFlag" />
-        <result column="delicacies_created_user_id" property="delicaciesCreatedUserId" />
-        <result column="delicacies_updated_user_id" property="delicaciesUpdatedUserId" />
-        <result column="delicacies_created_time" property="delicaciesCreatedTime" />
-        <result column="delicacies_updated_time" property="delicaciesUpdatedTime" />
-        <!-- 辅助字段 -->
-        <result column="data_type" property="dataType" />
-    </resultMap>
-
-    <!-- 查询store_product_delicacies的所有菜品 -->
-    <select id="getDelicaciesList" resultMap="StoreProductItemDelicaciesVoResultMap">
-        SELECT
-            -- store_product_item 表字段
-            item.id,
-            item.store_id,
-            item.prod_name,
-            item.total_price,
-            item.prod_type,
-            item.images,
-            item.image_content,
-            item.detail_content,
-            item.extra_note,
-            item.need_reserve,
-            item.reserve_rule,
-            item.people_limit,
-            item.usage_rule,
-            item.status AS item_status,
-            item.rejection_reason,
-            item.delete_flag AS item_delete_flag,
-            item.created_user_id AS item_created_user_id,
-            item.updated_user_id AS item_updated_user_id,
-            item.created_time AS item_created_time,
-            item.updated_time AS item_updated_time,
-            -- store_product_delicacies 表字段
-            delicacies.id AS delicacies_id,
-            delicacies.ext_id,
-            delicacies.name,
-            delicacies.price,
-            delicacies.cost_price,
-            delicacies.unit,
-            delicacies.quantity,
-            delicacies.category,
-            delicacies.ext_group,
-            delicacies.status AS delicacies_status,
-            delicacies.delete_flag AS delicacies_delete_flag,
-            delicacies.created_user_id AS delicacies_created_user_id,
-            delicacies.updated_user_id AS delicacies_updated_user_id,
-            delicacies.created_time AS delicacies_created_time,
-            delicacies.updated_time AS delicacies_updated_time,
-            -- 数据类型:1-菜品
-            1 AS data_type
-        FROM store_product_delicacies delicacies
-        LEFT JOIN store_product_item item ON delicacies.ext_id = item.id AND item.delete_flag = 0
-        WHERE delicacies.delete_flag = 0
-        <if test="storeId != null">
-            AND (item.store_id = #{storeId} OR item.store_id IS NULL)
-        </if>
-        <if test="name != null and name != ''">
-            AND delicacies.name LIKE CONCAT('%', #{name}, '%')
-        </if>
-        <if test="category != null and category != ''">
-            AND delicacies.category = #{category}
-        </if>
-        <if test="extGroup != null and extGroup != ''">
-            AND delicacies.ext_group = #{extGroup}
-        </if>
-        <if test="status != null">
-            AND delicacies.status = #{status}
-        </if>
-        ORDER BY delicacies.created_time DESC
-    </select>
-
-    <!-- 查询store_product_item的所有美食相关的套餐和商品(prodType = 3) -->
-    <select id="getFoodPackageList" resultMap="StoreProductItemDelicaciesVoResultMap">
-        SELECT
-            -- store_product_item 表字段
-            item.id,
-            item.store_id,
-            item.prod_name,
-            item.total_price,
-            item.prod_type,
-            item.images,
-            item.image_content,
-            item.detail_content,
-            item.extra_note,
-            item.need_reserve,
-            item.reserve_rule,
-            item.people_limit,
-            item.usage_rule,
-            item.status AS item_status,
-            item.rejection_reason,
-            item.delete_flag AS item_delete_flag,
-            item.created_user_id AS item_created_user_id,
-            item.updated_user_id AS item_updated_user_id,
-            item.created_time AS item_created_time,
-            item.updated_time AS item_updated_time,
-            -- store_product_delicacies 表字段(可能为空,因为是套餐)
-            NULL AS delicacies_id,
-            NULL AS ext_id,
-            NULL AS name,
-            NULL AS price,
-            NULL AS cost_price,
-            NULL AS unit,
-            NULL AS quantity,
-            NULL AS category,
-            NULL AS ext_group,
-            NULL AS delicacies_status,
-            NULL AS delicacies_delete_flag,
-            NULL AS delicacies_created_user_id,
-            NULL AS delicacies_updated_user_id,
-            NULL AS delicacies_created_time,
-            NULL AS delicacies_updated_time,
-            -- 数据类型:2-套餐/商品
-            2 AS data_type
-        FROM store_product_item item
-        WHERE item.delete_flag = 0
-        AND item.prod_type = 3
-        <if test="storeId != null">
-            AND item.store_id = #{storeId}
-        </if>
-        <if test="name != null and name != ''">
-            AND item.prod_name LIKE CONCAT('%', #{name}, '%')
-        </if>
-        <if test="status != null">
-            AND item.status = #{status}
-        </if>
-        <if test="packageType != null">
-            -- 预留:根据类型查询套餐的口子,可以根据需要扩展
-            -- 例如:可以根据某个字段来区分不同类型的套餐
-        </if>
-        ORDER BY item.created_time DESC
-    </select>
-
-</mapper>
-

+ 1 - 1
alien-gateway/src/main/java/shop/alien/gateway/AlienGatewayApplication.java

@@ -17,7 +17,7 @@ import shop.alien.util.encryption.JasyptAutoConfiguration;
  * @date 2025/1/21 16:58
  */
 @Import({JacksonAutoConfiguration.class, JasyptAutoConfiguration.class})
-@ComponentScan({"shop.alien.gateway.*"}) // 停止扫描 shop.alien.util.* 以避免 RestTemplate 依赖冲突
+@ComponentScan({"shop.alien.gateway.*", "shop.alien.util.common", "shop.alien.util.encryption.properties"}) 
 @MapperScan(basePackages = {"shop.alien.gateway.mapper", "shop.alien.mapper"})
 @EnableFeignClients(basePackages = "shop.alien.gateway.feign")
 @SpringBootApplication

+ 4 - 0
alien-store/pom.xml

@@ -297,6 +297,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-security</artifactId>
         </dependency>
+        <dependency>
+            <groupId>jakarta.validation</groupId>
+            <artifactId>jakarta.validation-api</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 1 - 1
alien-store/src/main/java/shop/alien/store/controller/AiChatController.java

@@ -67,7 +67,7 @@ public class AiChatController {
             ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(aiChatUrl, request, String.class);
             return stringResponseEntity;
         } catch (Exception e) {
-            log.error("调用AI文本审核接口 接口异常------", e);
+            log.error("调用AI聊天接口 接口异常------", e);
         }
         return  ResponseEntity.badRequest().body(null);
     }

+ 4 - 3
alien-store/src/main/java/shop/alien/store/controller/AiSearchController.java

@@ -26,6 +26,7 @@ import shop.alien.mapper.StoreImgMapper;
 import shop.alien.mapper.StoreUserMapper;
 import shop.alien.store.annotation.TrackEvent;
 import shop.alien.store.service.CommonRatingService;
+import shop.alien.store.service.CommonRatingService;
 import shop.alien.store.service.StoreImgService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 
@@ -142,7 +143,7 @@ public class AiSearchController {
 
             // 查找图片并设置到result中(图片类型1-入口图)
             fillStoreImages(result, 1);
-            
+
             // 填充评论总数
             fillRatingCount(result);
 
@@ -251,13 +252,13 @@ public class AiSearchController {
         if (result == null || result.isEmpty()) {
             return;
         }
-        
+
         for (StoreInfoVo storeInfo : result) {
             if (storeInfo.getId() != null) {
                 try {
                     // 调用评论服务获取评论总数,businessId传id,businessType传1
                     Object ratingCountObj = commonRatingService.getRatingCount(storeInfo.getId(), 1);
-                    
+
                     // 将返回的Object转换为Map
                     if (ratingCountObj instanceof Map) {
                         Map<String, Object> ratingCountMap = (Map<String, Object>) ratingCountObj;

+ 51 - 3
alien-store/src/main/java/shop/alien/store/controller/CommonCommentController.java

@@ -1,8 +1,6 @@
 package shop.alien.store.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiSort;
+import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
@@ -78,6 +76,9 @@ public class CommonCommentController {
         if (addComment == 2) {
             return R.fail("新增评论失败,评论内容包含敏感字符");
         }
+        if (addComment == 4) {
+            return R.fail("新增评论失败,评论内容超过300字限制");
+        }
         return R.fail("新增评论失败");
     }
 
@@ -95,5 +96,52 @@ public class CommonCommentController {
         return R.fail("删除评论失败");
     }
 
+
+    /**
+     * 根据动态类型和动态id查询评论列表
+     * @param sourceType
+     * @param sourceId
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @ApiOperation(value = "动态评论")
+    @GetMapping("/getListBySourceType")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "sourceType", value = "类型", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "sourceId", value = "id", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "userId", value = "用户id", required = false, dataType = "Long")
+    })
+    public R getListBySourceType(@RequestParam Integer sourceType,
+                                 @RequestParam Integer sourceId,
+                                 @RequestParam(defaultValue = "1") Integer pageNum,
+                                 @RequestParam(defaultValue = "10") Integer pageSize,
+                                 @RequestParam(required = false) Long userId) {
+        return R.data(commonCommentService.getListBySourceType(sourceType, sourceId, pageNum, pageSize, userId));
+    }
+
+    /**
+     * 获取评论数量
+     * @param sourceId
+     * @param sourceType
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "获取评论数量")
+    @GetMapping("/getCommitCount")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "sourceId", value = "id", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "sourceType", value = "类型", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "userType", value = "用户类型,user,store", required = true, dataType = "String")
+    })
+    public R getCommitCount(@RequestParam Integer sourceId,
+                            @RequestParam Integer sourceType,
+                            @RequestParam String userId,
+                            @RequestParam String userType){
+        return R.data(commonCommentService.getCommitCount(sourceId, sourceType, userId, userType));
+    }
 }
 

+ 24 - 5
alien-store/src/main/java/shop/alien/store/controller/CommonRatingController.java

@@ -36,7 +36,10 @@ public class CommonRatingController {
             @ApiImplicitParam(name = "businessId", value = "业务关联ID", dataType = "Long", paramType = "query"),
             @ApiImplicitParam(name = "userId", value = "用户ID", dataType = "Long", paramType = "query"),
             @ApiImplicitParam(name = "auditStatus", value = "审核状态:0-待审核 1-通过 2-驳回", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "searchScore", value = "搜索评分:0-全部,1-好评 2-中评 3-差评,4-有图", dataType = "Integer", paramType = "query")
+            @ApiImplicitParam(name = "searchScore", value = "搜索评分:0-全部,1-好评 2-中评 3-差评,4-有图", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "days", value = "查询时间, 多少天前", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "replyStatus", value = "回复状态(0:全部, 1:已回复, 2:未回复)", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "tagId", value = "标签id", dataType = "Integer", paramType = "query")
     })
     @GetMapping("/getList")
     public R getList(
@@ -46,10 +49,13 @@ public class CommonRatingController {
             @RequestParam(required = false) Long businessId,
             @RequestParam(required = false) Long userId,
             @RequestParam(required = false) Integer auditStatus,
-            @RequestParam(defaultValue = "0") Integer searchScore) {
-        log.info("CommonRatingController.getList?pageNum={}&pageSize={}&businessType={}&businessId={}&userId={}&auditStatus={}&searchScore={}",
-                pageNum, pageSize, businessType, businessId, userId, auditStatus, searchScore);
-        return commonRatingService.getRatingList(pageNum, pageSize, businessType, businessId, userId, auditStatus, searchScore);
+            @RequestParam(defaultValue = "0") Integer searchScore,
+            @RequestParam(required = false) Integer days,
+            @RequestParam(required = false) Integer replyStatus,
+            @RequestParam(required = false) Integer tagId) {
+        log.info("CommonRatingController.getList?pageNum={}&pageSize={}&businessType={}&businessId={}&userId={}&auditStatus={}&searchScore={}&days={}&replyStatus={}&tagId={}",
+                pageNum, pageSize, businessType, businessId, userId, auditStatus, searchScore, days, replyStatus, tagId);
+        return commonRatingService.getRatingList(pageNum, pageSize, businessType, businessId, userId, auditStatus, searchScore, days, replyStatus, tagId);
     }
 
     @ApiOperation("获取全部评价数量(好评,中评,差评)")
@@ -62,6 +68,19 @@ public class CommonRatingController {
         return R.data(commonRatingService.getRatingCount(businessId, businessType));
     }
 
+    @ApiOperation("获取回复率和评价比例(商户端)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "businessId", value = "业务ID(店铺ID)", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "businessType", value = "业务类型:1-店铺评价", dataType = "Integer", paramType = "query", required = true)
+    })
+    @GetMapping("/getRatingPercent")
+    public R<shop.alien.entity.store.vo.RatingPercentVo> getRatingPercent(
+            @RequestParam Integer businessId,
+            @RequestParam Integer businessType) {
+        log.info("CommonRatingController.getRatingPercent?businessId={}&businessType={}", businessId, businessType);
+        return R.data(commonRatingService.getRatingPercent(businessId, businessType));
+    }
+
 //
 //    @ApiOperation("根据ID获取评价详情")
 //    @ApiImplicitParam(name = "id", value = "评价ID", dataType = "Long", paramType = "path", required = true)

+ 19 - 3
alien-store/src/main/java/shop/alien/store/controller/StorePriceController.java

@@ -17,6 +17,8 @@ import shop.alien.store.service.StorePriceService;
 import shop.alien.util.encryption.Decrypt;
 import shop.alien.util.encryption.Encrypt;
 import shop.alien.util.encryption.JasyptEncryptorUtil;
+import shop.alien.util.encryption.StandardAesUtil;
+import shop.alien.util.encryption.properties.EncryptProperties;
 
 import java.util.HashMap;
 import java.util.List;
@@ -41,15 +43,17 @@ public class StorePriceController {
 
     private final StoreInfoMapper storeInfoMapper;
 
+    private final EncryptProperties encryptProperties;
+
     @Value("${test1}")
     private String dbPassword;
 
-    @ApiOperation("测试读取配置与手动加解密")
+    @ApiOperation("读取配置自动解密与手动加解密-测试接口")
     @GetMapping("/testConfig")
     public R<Map<String, Object>> testConfig(@RequestParam String salt, @RequestParam String text) {
         Map<String, Object> result = new HashMap<>();
         
-        // 1. 测试自动解密(Jasypt 注入的结果)
+        // 1. 测试配置文件的value自动解密(Jasypt 注入的结果)
         result.put("configPassword", dbPassword);
 
         // 2. 调用 utils 里的封装进行手动加解密逻辑
@@ -68,7 +72,19 @@ public class StorePriceController {
         return R.data(result, "调试成功");
     }
 
-    @ApiOperation("加解密测试接口")
+    @ApiOperation("AES加密-测试接口")
+    @PostMapping("/aes/encrypt")
+    public R<String> aesEncrypt(@RequestParam String text) {
+        return R.data(StandardAesUtil.encrypt(text, encryptProperties.getKey(), encryptProperties.getIv()));
+    }
+
+    @ApiOperation("AES解密-测试接口")
+    @PostMapping("/aes/decrypt")
+    public R<String> aesDecrypt(@RequestParam String text) {
+        return R.data(StandardAesUtil.decrypt(text, encryptProperties.getKey(), encryptProperties.getIv()));
+    }
+
+    @ApiOperation("AES加密请求体和解密响应体-测试接口")
     @ApiOperationSupport(order = 10)
     @PostMapping("/testEncryption")
     @Decrypt

+ 0 - 179
alien-store/src/main/java/shop/alien/store/controller/StoreProductBarController.java

@@ -1,179 +0,0 @@
-package shop.alien.store.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.*;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductBar;
-import shop.alien.store.service.StoreProductBarService;
-
-import java.util.List;
-
-/**
- * 酒吧商品表 Controller
- *
- * @author system
- * @since 2025-01-XX
- */
-@Slf4j
-@Api(tags = {"酒吧商品管理"})
-@CrossOrigin
-@RestController
-@RequestMapping("/store/product/bar")
-@RequiredArgsConstructor
-public class StoreProductBarController {
-
-    private final StoreProductBarService storeProductBarService;
-
-    @ApiOperation("新增酒吧商品")
-    @ApiOperationSupport(order = 1)
-    @PostMapping
-    public R<String> saveBar(@RequestBody StoreProductBar bar) {
-        log.info("StoreProductBarController.saveBar?bar={}", bar);
-        // 参数校验
-        if (bar.getName() == null || bar.getName().trim().isEmpty()) {
-            return R.fail("名称不能为空");
-        }
-        if (bar.getPrice() == null) {
-            return R.fail("价格不能为空");
-        }
-
-        R<StoreProductBar> result = storeProductBarService.addStoreProductBar(bar);
-        if (result.getCode() == 200) {
-            return R.success("新增成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("修改酒吧商品")
-    @ApiOperationSupport(order = 2)
-    @PutMapping
-    public R<String> updateBar(@RequestBody StoreProductBar bar) {
-        log.info("StoreProductBarController.updateBar?bar={}", bar);
-        if (bar.getId() == null) {
-            return R.fail("ID不能为空");
-        }
-
-        R<StoreProductBar> result = storeProductBarService.editStoreProductBar(bar);
-        if (result.getCode() == 200) {
-            return R.success("修改成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("删除酒吧商品")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true)
-    })
-    @DeleteMapping("/{id}")
-    public R<String> deleteBar(@PathVariable("id") Integer id) {
-        log.info("StoreProductBarController.deleteBar?id={}", id);
-        R<Boolean> result = storeProductBarService.deleteStoreProductBar(id);
-        if (result.getCode() == 200) {
-            return R.success("删除成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("根据ID查询酒吧商品详情")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true)
-    })
-    @GetMapping("/{id}")
-    public R<StoreProductBar> getById(@PathVariable("id") Integer id) {
-        log.info("StoreProductBarController.getById?id={}", id);
-        R<StoreProductBar> result = storeProductBarService.getStoreProductBarById(id);
-        if (result.getCode() == 200 && result.getData() != null) {
-            return result;
-        }
-        return R.fail("未找到该酒吧商品信息");
-    }
-
-    @ApiOperation("分页查询酒吧商品列表")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "name", value = "名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "category", value = "品类", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/page")
-    public R<IPage<StoreProductBar>> getPage(
-            @RequestParam(defaultValue = "1") int pageNum,
-            @RequestParam(defaultValue = "10") int pageSize,
-            @RequestParam(required = false) String name,
-            @RequestParam(required = false) String category,
-            @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer extId) {
-        log.info("StoreProductBarController.getPage?pageNum={}, pageSize={}, name={}, category={}, status={}, extId={}",
-                pageNum, pageSize, name, category, status, extId);
-        IPage<StoreProductBar> page = storeProductBarService.getPage(pageNum, pageSize, name, category, status, extId);
-        return R.data(page);
-    }
-
-    @ApiOperation("批量删除酒吧商品")
-    @ApiOperationSupport(order = 6)
-    @PostMapping("/batchDelete")
-    public R<String> deleteBatch(@RequestBody List<Integer> ids) {
-        log.info("StoreProductBarController.deleteBatch?ids={}", ids);
-        if (ids == null || ids.isEmpty()) {
-            return R.fail("ID列表不能为空");
-        }
-        boolean result = storeProductBarService.deleteBatch(ids);
-        if (result) {
-            return R.success("批量删除成功");
-        }
-        return R.fail("批量删除失败");
-    }
-
-    @ApiOperation("更新酒吧商品状态")
-    @ApiOperationSupport(order = 7)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query", required = true)
-    })
-    @PutMapping("/{id}/status")
-    public R<String> updateStatus(
-            @PathVariable("id") Integer id,
-            @RequestParam("status") Integer status) {
-        log.info("StoreProductBarController.updateStatus?id={}, status={}", id, status);
-        if (status == null || (status != 0 && status != 1)) {
-            return R.fail("状态值无效,只能为0或1");
-        }
-        boolean result = storeProductBarService.updateStatus(id, status);
-        if (result) {
-            return R.success("状态更新成功");
-        }
-        return R.fail("状态更新失败");
-    }
-
-    @ApiOperation("根据商品表主键查询酒吧商品列表")
-    @ApiOperationSupport(order = 8)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByExtId")
-    public R<List<StoreProductBar>> getListByExtId(@RequestParam("extId") Integer extId) {
-        log.info("StoreProductBarController.getListByExtId?extId={}", extId);
-        List<StoreProductBar> list = storeProductBarService.getListByExtId(extId);
-        return R.data(list);
-    }
-
-    @ApiOperation("根据品类查询酒吧商品列表")
-    @ApiOperationSupport(order = 9)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "category", value = "品类", dataType = "String", paramType = "query", required = true)
-    })
-    @GetMapping("/listByCategory")
-    public R<List<StoreProductBar>> getListByCategory(@RequestParam("category") String category) {
-        log.info("StoreProductBarController.getListByCategory?category={}", category);
-        List<StoreProductBar> list = storeProductBarService.getListByCategory(category);
-        return R.data(list);
-    }
-}

+ 0 - 204
alien-store/src/main/java/shop/alien/store/controller/StoreProductDelicaciesController.java

@@ -1,204 +0,0 @@
-package shop.alien.store.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.*;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductDelicacies;
-import shop.alien.store.service.StoreProductDelicaciesService;
-
-import java.util.List;
-
-/**
- * 美食商品表 Controller
- *
- * @author system
- * @since 2025-01-XX
- */
-@Slf4j
-@Api(tags = {"美食商品管理"})
-@ApiSort(1)
-@CrossOrigin
-@RestController
-@RequestMapping("/store/product/delicacies")
-@RequiredArgsConstructor
-public class StoreProductDelicaciesController {
-
-    private final StoreProductDelicaciesService storeProductDelicaciesService;
-
-    @ApiOperation("分页查询美食商品列表")
-    @ApiOperationSupport(order = 1)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "name", value = "名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "category", value = "类别", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "extGroup", value = "菜品分组", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/page")
-    public R<IPage<StoreProductDelicacies>> getPage(
-            @RequestParam(defaultValue = "1") int pageNum,
-            @RequestParam(defaultValue = "10") int pageSize,
-            @RequestParam(required = false) String name,
-            @RequestParam(required = false) String category,
-            @RequestParam(required = false) String extGroup,
-            @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer extId) {
-        log.info("StoreProductDelicaciesController.getPage?pageNum={}, pageSize={}, name={}, category={}, extGroup={}, status={}, extId={}",
-                pageNum, pageSize, name, category, extGroup, status, extId);
-        IPage<StoreProductDelicacies> page = storeProductDelicaciesService.getPage(pageNum, pageSize, name, category, extGroup, status, extId);
-        return R.data(page);
-    }
-
-    @ApiOperation("根据ID查询美食商品详情")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true)
-    })
-    @GetMapping("/{id}")
-    public R<StoreProductDelicacies> getById(@PathVariable("id") Integer id) {
-        log.info("StoreProductDelicaciesController.getById?id={}", id);
-        StoreProductDelicacies delicacies = storeProductDelicaciesService.getById(id);
-        if (delicacies == null) {
-            return R.fail("未找到该美食商品信息");
-        }
-        return R.data(delicacies);
-    }
-
-    @ApiOperation("新增美食商品")
-    @ApiOperationSupport(order = 3)
-    @PostMapping
-    public R<String> saveDelicacies(@RequestBody StoreProductDelicacies delicacies) {
-        log.info("StoreProductDelicaciesController.saveDelicacies?delicacies={}", delicacies);
-        // 参数校验
-        if (delicacies.getName() == null || delicacies.getName().trim().isEmpty()) {
-            return R.fail("名称不能为空");
-        }
-        if (delicacies.getPrice() == null) {
-            return R.fail("价格不能为空");
-        }
-        if (delicacies.getCostPrice() == null) {
-            return R.fail("成本价不能为空");
-        }
-        if (delicacies.getCategory() == null || delicacies.getCategory().trim().isEmpty()) {
-            return R.fail("类别不能为空");
-        }
-        if (delicacies.getExtGroup() == null || delicacies.getExtGroup().trim().isEmpty()) {
-            return R.fail("菜品分组不能为空");
-        }
-
-        boolean result = storeProductDelicaciesService.saveDelicacies(delicacies);
-        if (result) {
-            return R.success("新增成功");
-        }
-        return R.fail("新增失败");
-    }
-
-    @ApiOperation("修改美食商品")
-    @ApiOperationSupport(order = 4)
-    @PutMapping
-    public R<String> updateDelicacies(@RequestBody StoreProductDelicacies delicacies) {
-        log.info("StoreProductDelicaciesController.updateDelicacies?delicacies={}", delicacies);
-        if (delicacies.getId() == null) {
-            return R.fail("ID不能为空");
-        }
-
-        boolean result = storeProductDelicaciesService.updateDelicacies(delicacies);
-        if (result) {
-            return R.success("修改成功");
-        }
-        return R.fail("修改失败");
-    }
-
-    @ApiOperation("删除美食商品")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Long", paramType = "path", required = true)
-    })
-    @DeleteMapping("/{id}")
-    public R<String> deleteDelicacies(@PathVariable("id") Integer id) {
-        log.info("StoreProductDelicaciesController.deleteDelicacies?id={}", id);
-        boolean result = storeProductDelicaciesService.deleteDelicacies(id);
-        if (result) {
-            return R.success("删除成功");
-        }
-        return R.fail("删除失败");
-    }
-
-    @ApiOperation("批量删除美食商品")
-    @ApiOperationSupport(order = 6)
-    @PostMapping("/batchDelete")
-    public R<String> deleteBatch(@RequestBody List<Integer> ids) {
-        log.info("StoreProductDelicaciesController.deleteBatch?ids={}", ids);
-        if (ids == null || ids.isEmpty()) {
-            return R.fail("ID列表不能为空");
-        }
-        boolean result = storeProductDelicaciesService.deleteBatch(ids);
-        if (result) {
-            return R.success("批量删除成功");
-        }
-        return R.fail("批量删除失败");
-    }
-
-    @ApiOperation("更新美食商品状态")
-    @ApiOperationSupport(order = 7)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query", required = true)
-    })
-    @PutMapping("/{id}/status")
-    public R<String> updateStatus(
-            @PathVariable("id") Integer id,
-            @RequestParam("status") Integer status) {
-        log.info("StoreProductDelicaciesController.updateStatus?id={}, status={}", id, status);
-        if (status == null || (status != 0 && status != 1)) {
-            return R.fail("状态值无效,只能为0或1");
-        }
-        boolean result = storeProductDelicaciesService.updateStatus(id, status);
-        if (result) {
-            return R.success("状态更新成功");
-        }
-        return R.fail("状态更新失败");
-    }
-
-    @ApiOperation("根据商品表主键查询美食商品列表")
-    @ApiOperationSupport(order = 8)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByExtId")
-    public R<List<StoreProductDelicacies>> getListByExtId(@RequestParam("extId") Integer extId) {
-        log.info("StoreProductDelicaciesController.getListByExtId?extId={}", extId);
-        List<StoreProductDelicacies> list = storeProductDelicaciesService.getListByExtId(extId);
-        return R.data(list);
-    }
-
-    @ApiOperation("根据类别查询美食商品列表")
-    @ApiOperationSupport(order = 9)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "category", value = "类别", dataType = "String", paramType = "query", required = true)
-    })
-    @GetMapping("/listByCategory")
-    public R<List<StoreProductDelicacies>> getListByCategory(@RequestParam("category") String category) {
-        log.info("StoreProductDelicaciesController.getListByCategory?category={}", category);
-        List<StoreProductDelicacies> list = storeProductDelicaciesService.getListByCategory(category);
-        return R.data(list);
-    }
-
-    @ApiOperation("根据菜品分组查询美食商品列表")
-    @ApiOperationSupport(order = 10)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "extGroup", value = "菜品分组", dataType = "String", paramType = "query", required = true)
-    })
-    @GetMapping("/listByExtGroup")
-    public R<List<StoreProductDelicacies>> getListByExtGroup(@RequestParam("extGroup") String extGroup) {
-        log.info("StoreProductDelicaciesController.getListByExtGroup?extGroup={}", extGroup);
-        List<StoreProductDelicacies> list = storeProductDelicaciesService.getListByExtGroup(extGroup);
-        return R.data(list);
-    }
-}
-

+ 0 - 170
alien-store/src/main/java/shop/alien/store/controller/StoreProductGymController.java

@@ -1,170 +0,0 @@
-package shop.alien.store.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.*;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductGym;
-import shop.alien.store.service.StoreProductGymService;
-
-import java.util.List;
-
-/**
- * 运动健身商品表 Controller
- *
- * @author system
- * @since 2025-01-XX
- */
-@Slf4j
-@Api(tags = {"运动健身商品管理"})
-@CrossOrigin
-@RestController
-@RequestMapping("/store/product/gym")
-@RequiredArgsConstructor
-public class StoreProductGymController {
-
-    private final StoreProductGymService storeProductGymService;
-
-    @ApiOperation("新增运动健身商品")
-    @ApiOperationSupport(order = 1)
-    @PostMapping
-    public R<String> saveGym(@RequestBody StoreProductGym gym) {
-        log.info("StoreProductGymController.saveGym?gym={}", gym);
-        // 参数校验
-        if (gym.getName() == null || gym.getName().trim().isEmpty()) {
-            return R.fail("名称不能为空");
-        }
-        if (gym.getClassMode() == null || gym.getClassMode().trim().isEmpty()) {
-            return R.fail("上课形式不能为空");
-        }
-        if (gym.getPrice() == null) {
-            return R.fail("价格不能为空");
-        }
-
-        R<StoreProductGym> result = storeProductGymService.addStoreProductGym(gym);
-        if (result.getCode() == 200) {
-            return R.success("新增成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("修改运动健身商品")
-    @ApiOperationSupport(order = 2)
-    @PutMapping
-    public R<String> updateGym(@RequestBody StoreProductGym gym) {
-        log.info("StoreProductGymController.updateGym?gym={}", gym);
-        if (gym.getId() == null) {
-            return R.fail("ID不能为空");
-        }
-
-        R<StoreProductGym> result = storeProductGymService.editStoreProductGym(gym);
-        if (result.getCode() == 200) {
-            return R.success("修改成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("删除运动健身商品")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true)
-    })
-    @DeleteMapping("/{id}")
-    public R<String> deleteGym(@PathVariable("id") Integer id) {
-        log.info("StoreProductGymController.deleteGym?id={}", id);
-        R<Boolean> result = storeProductGymService.deleteStoreProductGym(id);
-        if (result.getCode() == 200) {
-            return R.success("删除成功");
-        }
-        return R.fail(result.getMsg());
-    }
-
-    @ApiOperation("根据ID查询运动健身商品详情")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true)
-    })
-    @GetMapping("/{id}")
-    public R<StoreProductGym> getById(@PathVariable("id") Integer id) {
-        log.info("StoreProductGymController.getById?id={}", id);
-        R<StoreProductGym> result = storeProductGymService.getStoreProductGymById(id);
-        if (result.getCode() == 200 && result.getData() != null) {
-            return result;
-        }
-        return R.fail("未找到该运动健身商品信息");
-    }
-
-    @ApiOperation("分页查询运动健身商品列表")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "name", value = "名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "classMode", value = "上课形式", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/page")
-    public R<IPage<StoreProductGym>> getPage(
-            @RequestParam(defaultValue = "1") int pageNum,
-            @RequestParam(defaultValue = "10") int pageSize,
-            @RequestParam(required = false) String name,
-            @RequestParam(required = false) String classMode,
-            @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer extId) {
-        log.info("StoreProductGymController.getPage?pageNum={}, pageSize={}, name={}, classMode={}, status={}, extId={}",
-                pageNum, pageSize, name, classMode, status, extId);
-        IPage<StoreProductGym> page = storeProductGymService.getPage(pageNum, pageSize, name, classMode, status, extId);
-        return R.data(page);
-    }
-
-    @ApiOperation("批量删除运动健身商品")
-    @ApiOperationSupport(order = 6)
-    @PostMapping("/batchDelete")
-    public R<String> deleteBatch(@RequestBody List<Integer> ids) {
-        log.info("StoreProductGymController.deleteBatch?ids={}", ids);
-        if (ids == null || ids.isEmpty()) {
-            return R.fail("ID列表不能为空");
-        }
-        boolean result = storeProductGymService.deleteBatch(ids);
-        if (result) {
-            return R.success("批量删除成功");
-        }
-        return R.fail("批量删除失败");
-    }
-
-    @ApiOperation("更新运动健身商品状态")
-    @ApiOperationSupport(order = 7)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "path", required = true),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query", required = true)
-    })
-    @PutMapping("/{id}/status")
-    public R<String> updateStatus(
-            @PathVariable("id") Integer id,
-            @RequestParam("status") Integer status) {
-        log.info("StoreProductGymController.updateStatus?id={}, status={}", id, status);
-        if (status == null || (status != 0 && status != 1)) {
-            return R.fail("状态值无效,只能为0或1");
-        }
-        boolean result = storeProductGymService.updateStatus(id, status);
-        if (result) {
-            return R.success("状态更新成功");
-        }
-        return R.fail("状态更新失败");
-    }
-
-    @ApiOperation("根据商品表主键查询运动健身商品列表")
-    @ApiOperationSupport(order = 8)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "extId", value = "商品表主键", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByExtId")
-    public R<List<StoreProductGym>> getListByExtId(@RequestParam("extId") Integer extId) {
-        log.info("StoreProductGymController.getListByExtId?extId={}", extId);
-        List<StoreProductGym> list = storeProductGymService.getListByExtId(extId);
-        return R.data(list);
-    }
-}

+ 0 - 167
alien-store/src/main/java/shop/alien/store/controller/StoreProductItemController.java

@@ -1,167 +0,0 @@
-package shop.alien.store.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.*;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductItem;
-import shop.alien.entity.store.dto.StoreProductItemDto;
-import shop.alien.entity.store.vo.StoreProductItemGymVo;
-import shop.alien.entity.store.vo.StoreProductItemDelicaciesVo;
-import shop.alien.store.service.StoreProductItemService;
-
-import java.util.List;
-
-/**
- * 商品表 前端控制器
- *
- * @author system
- * @since 2025-01-XX
- */
-@Slf4j
-@Api(tags = {"商品管理"})
-@CrossOrigin
-@RestController
-@RequestMapping("/storeProductItem")
-@RequiredArgsConstructor
-public class StoreProductItemController {
-
-    private final StoreProductItemService storeProductItemService;
-
-    @ApiOperation("新增商品")
-    @ApiOperationSupport(order = 1)
-    @PostMapping("/add")
-    public R<StoreProductItem> addStoreProductItem(@RequestBody StoreProductItemDto storeProductItemDto) {
-        log.info("StoreProductItemController.addStoreProductItem?storeProductItem={}", storeProductItemDto);
-        return storeProductItemService.addStoreProductItemDto(storeProductItemDto);
-    }
-
-    @ApiOperation("编辑商品")
-    @ApiOperationSupport(order = 2)
-    @PostMapping("/edit")
-    public R<StoreProductItem> editStoreProductItem(@RequestBody StoreProductItemDto storeProductItemDto) {
-        log.info("StoreProductItemController.editStoreProductItem?storeProductItem={}", storeProductItemDto);
-        return storeProductItemService.editStoreProductItem(storeProductItemDto);
-    }
-
-    @ApiOperation("删除商品")
-    @ApiOperationSupport(order = 3)
-    @DeleteMapping("/delete")
-    public R<Boolean> deleteStoreProductItem(@RequestParam(value = "id") Integer id) {
-        log.info("StoreProductItemController.deleteStoreProductItem?id={}", id);
-        return storeProductItemService.deleteStoreProductItem(id);
-    }
-
-    @ApiOperation("根据ID查询商品")
-    @ApiOperationSupport(order = 4)
-    @GetMapping("/getById")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "modelType", value = "1酒吧2美食3运动", dataType = "int", paramType = "query"),
-    })
-    public R<List<StoreProductItemDto>> getStoreProductItemById(@RequestParam(value = "id") Integer id,@RequestParam(value = "modelType")Integer modelType) {
-        log.info("StoreProductItemController.getStoreProductItemById?id={}", id);
-        return storeProductItemService.getStoreProductItemById(id, modelType);
-    }
-
-    @ApiOperation("按商品类型查询列表")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "prodType", value = "商品类型:1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次", dataType = "Integer", paramType = "query", required = true)
-    })
-    @GetMapping("/listByProdType")
-    public R<List<StoreProductItem>> listByProdType(@RequestParam("prodType") Integer prodType) {
-        log.info("StoreProductItemController.listByProdType?prodType={}", prodType);
-        return storeProductItemService.listByProdType(prodType);
-    }
-
-    @ApiOperation("分页查询(按门店/名称/类型/状态/预约筛选)")
-    @ApiOperationSupport(order = 7)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码(默认1)", dataType = "int", paramType = "query"),
-            @ApiImplicitParam(name = "pageSize", value = "页容(默认10)", dataType = "int", paramType = "query"),
-            @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "prodName", value = "商品名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "prodType", value = "商品类型", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "needReserve", value = "是否需要预约:0-否 1-是", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/pageList")
-    public R<IPage<StoreProductItem>> pageList(@RequestParam(defaultValue = "1") int pageNum,
-                                               @RequestParam(defaultValue = "10") int pageSize,
-                                               @RequestParam(required = false) Integer storeId,
-                                               @RequestParam(required = false) String prodName,
-                                               @RequestParam(required = false) Integer prodType,
-                                               @RequestParam(required = false) Integer status,
-                                               @RequestParam(required = false) Integer needReserve) {
-        IPage<StoreProductItem> pageResult = storeProductItemService.pageStoreProductItems(
-                pageNum > 0 ? pageNum : 1,
-                pageSize > 0 ? pageSize : 10,
-                storeId, prodName, prodType, status, needReserve);
-        return R.data(pageResult);
-    }
-
-    @ApiOperation("用户端 运动健身列表查询")
-    @ApiOperationSupport(order = 8)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码(默认1)", dataType = "int", paramType = "query"),
-            @ApiImplicitParam(name = "pageSize", value = "页容(默认10)", dataType = "int", paramType = "query"),
-            @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "prodName", value = "商品名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "prodType", value = "商品类型(1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次)", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getPageWithGym")
-    public R<IPage<StoreProductItemGymVo>> getPageWithGym(
-            @RequestParam int pageNum,
-            @RequestParam int pageSize,
-            @RequestParam(required = false) Integer storeId,
-            @RequestParam(required = false) String prodName,
-            @RequestParam(required = false) Integer prodType) {
-        log.info("StoreProductItemController.getPageWithGym?pageNum={}, pageSize={}, storeId={}, prodName={}, prodType={}",
-                pageNum, pageSize, storeId, prodName, prodType);
-        IPage<StoreProductItemGymVo> pageResult = storeProductItemService.getPageWithGym(pageNum, pageSize, storeId, prodName, prodType);
-        return R.data(pageResult);
-    }
-
-    @ApiOperation("用户端 运动健身详情查询")
-    @ApiOperationSupport(order = 9)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "商品表主键ID", dataType = "Long", paramType = "query", required = true)
-    })
-    @GetMapping("/getDetailWithGym")
-    public R<StoreProductItemGymVo> getDetailWithGym(@RequestParam("id") Long id) {
-        log.info("StoreProductItemController.getDetailWithGym?id={}", id);
-        return storeProductItemService.getDetailWithGym(id);
-    }
-
-    @ApiOperation("用户端查询美食商品列表(包含菜品和套餐)")
-    @ApiOperationSupport(order = 10)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "name", value = "名称(模糊查询)", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "category", value = "类别", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "extGroup", value = "菜品分组", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态(0:禁用,1:启用)", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "packageType", value = "套餐类型(预留,用于根据类型查询套餐)", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getFoodAndPackagePage")
-    public R<IPage<StoreProductItemDelicaciesVo>> getFoodAndPackagePage(
-            @RequestParam(defaultValue = "1") int pageNum,
-            @RequestParam(defaultValue = "10") int pageSize,
-            @RequestParam(required = false) Integer storeId,
-            @RequestParam(required = false) String name,
-            @RequestParam(required = false) String category,
-            @RequestParam(required = false) String extGroup,
-            @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer packageType) {
-        log.info("StoreProductItemController.getFoodAndPackagePage?pageNum={}, pageSize={}, storeId={}, name={}, category={}, extGroup={}, status={}, packageType={}",
-                pageNum, pageSize, storeId, name, category, extGroup, status, packageType);
-        IPage<StoreProductItemDelicaciesVo> page = storeProductItemService.getPageWithDelicacies(
-                pageNum, pageSize, storeId, name, category, extGroup, status, packageType);
-        return R.data(page);
-    }
-}
-

+ 38 - 1
alien-store/src/main/java/shop/alien/store/service/CommonCommentService.java

@@ -2,6 +2,11 @@ package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import shop.alien.entity.store.CommonComment;
+import shop.alien.entity.store.vo.CommonCommentVo;
+import shop.alien.entity.store.vo.CommonRatingVo;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 评论表 服务类
@@ -10,7 +15,39 @@ import shop.alien.entity.store.CommonComment;
  * @since 2025-01-XX
  */
 public interface CommonCommentService extends IService<CommonComment> {
-
+    /**
+     * 新增评论
+     * @param commonComment
+     * @return
+     */
     Integer addComment(CommonComment commonComment);
+
+    /**
+     * 根据动态类型和动态id查询评论列表
+     * @param sourceType
+     * @param sourceId
+     * @param pageNum
+     * @param pageSize
+     * @param userId
+     * @return
+     */
+    List<CommonCommentVo> getListBySourceType(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId);
+
+
+    /**
+     *
+     * @param sourceType
+     * @param sourceId
+     * @param pageNum
+     * @param pageSize
+     * @param userId
+     * @param likeType
+     * @return
+     */
+    List<CommonCommentVo> getFirstLevelComment(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId, String likeType);
+
+    void getAllChildComment(Long userId, CommonRatingVo commonRatingVo, List<CommonCommentVo> commonComments, String likeType);
+
+    Map<String,Object> getCommitCount(Integer sourceId, Integer sourceType, String userId, String userType);
 }
 

+ 14 - 2
alien-store/src/main/java/shop/alien/store/service/CommonRatingService.java

@@ -20,7 +20,7 @@ public interface CommonRatingService extends IService<CommonRating> {
      */
     Integer saveCommonRating(CommonRating commonRating);
 
-/*        *
+    /**
      * 分页查询评价列表
      *
      * @param pageNum      页数
@@ -30,9 +30,12 @@ public interface CommonRatingService extends IService<CommonRating> {
      * @param userId       用户ID
      * @param auditStatus  审核状态:0-待审核 1-通过 2-驳回
      * @param searchScore  搜索评分:0-全部,1-好评 2-中评 3-差评,4-有图
+     * @param days         查询时间, 多少天前
+     * @param replyStatus  回复状态(0:全部, 1:已回复, 2:未回复)
+     * @param tagId        标签id
      * @return IPage<CommonRating>
      */
-    R getRatingList(Integer pageNum, Integer pageSize, Integer businessType, Long businessId, Long userId, Integer auditStatus, Integer searchScore);
+    R getRatingList(Integer pageNum, Integer pageSize, Integer businessType, Long businessId, Long userId, Integer auditStatus, Integer searchScore, Integer days, Integer replyStatus, Integer tagId);
 
      /**
      * 获取店铺评价数量(好评,中评,差评)
@@ -51,6 +54,15 @@ public interface CommonRatingService extends IService<CommonRating> {
      */
     Object getRatingDetail(Integer ratingId, Long userId);
 
+    /**
+     * 获取回复率和评价比例
+     *
+     * @param businessId   业务ID(店铺ID)
+     * @param businessType 业务类型:1-店铺评价
+     * @return 回复率和评价比例信息
+     */
+    shop.alien.entity.store.vo.RatingPercentVo getRatingPercent(Integer businessId, Integer businessType);
+
 
   /*  /**
      * 根据业务类型和业务ID获取平均评分

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/LifeCommentService.java

@@ -196,7 +196,7 @@ public class LifeCommentService {
                 return commonRatingMapper.update(null, new UpdateWrapper<CommonRating>()
                         .setSql("like_count = like_count + 1")
                         .eq("id", huifuId));
-            } else if (CommonConstant.COMMENT_LIKE.equals(type)) {
+            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type)) {
                 // 12-评论点赞:更新评论表点赞数
                 return commonCommentMapper.update(null, new UpdateWrapper<CommonComment>()
                         .setSql("like_count = like_count + 1")
@@ -364,7 +364,7 @@ public class LifeCommentService {
                 return commonRatingMapper.update(null, new UpdateWrapper<CommonRating>()
                         .setSql("like_count = like_count - 1")
                         .eq("id", huifuId));
-            } else if (CommonConstant.COMMENT_LIKE.equals(type)) {
+            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type)) {
                 // 12-评论点赞:更新评论表点赞数
                 return commonCommentMapper.update(null, new UpdateWrapper<CommonComment>()
                         .setSql("like_count = like_count - 1")

+ 21 - 14
alien-store/src/main/java/shop/alien/store/service/LifeUserDynamicsService.java

@@ -13,11 +13,9 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
 import shop.alien.entity.store.*;
-import shop.alien.entity.store.vo.LifePinglunVo;
-import shop.alien.entity.store.vo.LifeUserDynamicsVo;
-import shop.alien.entity.store.vo.StoreCommentVo;
-import shop.alien.entity.store.vo.StoreUserVo;
+import shop.alien.entity.store.vo.*;
 import shop.alien.mapper.*;
+import shop.alien.util.common.constant.CommentSourceTypeEnum;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -54,6 +52,8 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
 
     private final StoreInfoMapper storeInfoMapper;
 
+    private final CommonCommentMapper commonCommentMapper;
+
     public int addLiulanCount(String id) {
         LambdaUpdateWrapper<LifeUserDynamics> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
         lambdaUpdateWrapper.eq(LifeUserDynamics::getId, id);
@@ -199,8 +199,10 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
             lifeUserDynamicsVoList = lifeUserDynamicsVoList.stream().filter(item -> followList.contains(item.getPhoneId())).collect(Collectors.toList());
         }
 
-        List<StoreCommentVo> rootCommitCount = storeCommentMapper.getRootCommitCount(2, null);
-        List<StoreCommentVo> sonCommitCount = storeCommentMapper.getSonCommitCount(2, null);
+//        List<StoreCommentVo> rootCommitCount = storeCommentMapper.getRootCommitCount(2, null);
+//        List<StoreCommentVo> sonCommitCount = storeCommentMapper.getSonCommitCount(2, null);
+
+        List<CommonCommentVo> commonCommentVo= commonCommentMapper.getCommentCount(CommentSourceTypeEnum.DYNAMIC_COMMENT.getType());
 
         // 设置动态对象的状态信息:是否关注对方、是否被关注、是否点赞及评论数量
         // 设置.imagePath。视频为mp4+jpg格式,图片为jpg/png格式。
@@ -220,17 +222,21 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
             } else {
                 vo.setIsLike("0");
             }
-            List<StoreCommentVo> rootList = rootCommitCount.stream().filter(item -> Objects.equals(item.getBusinessId(), vo.getId())).collect(Collectors.toList());
-            if (rootList.isEmpty()) {
+            List<CommonCommentVo> collect = commonCommentVo.stream().filter(x -> x.getSourceId().equals(Long.parseLong(vo.getId().toString()))).collect(Collectors.toList());
+//            List<StoreCommentVo> rootList = rootCommitCount.stream().filter(item -> Objects.equals(item.getBusinessId(), vo.getId())).collect(Collectors.toList());
+            if (collect.isEmpty()) {
                 vo.setCommentCount(0);
             } else {
-                Integer count = rootList.size();
-                for (StoreCommentVo storeCommentVo : rootList) {
-                    List<StoreCommentVo> sonList = sonCommitCount.stream().filter(item -> Objects.equals(item.getReplyId(), storeCommentVo.getId())).collect(Collectors.toList());
-                    if (!sonList.isEmpty()) {
-                        count += sonList.get(0).getCommitCount();
-                    }
+                Integer count = collect.size();
+                for (CommonCommentVo commentVo : collect) {
+                    count += commentVo.getCommentCount();
                 }
+//                for (CommonCommentVo storeCommentVo : collect) {
+//                    List<StoreCommentVo> sonList = sonCommitCount.stream().filter(item -> Objects.equals(item.getReplyId(), storeCommentVo.getId())).collect(Collectors.toList());
+//                    if (!sonList.isEmpty()) {
+//                        count += sonList.get(0).getCommitCount();
+//                    }
+//                }
                 vo.setCommentCount(count);
             }
         }
@@ -440,6 +446,7 @@ public class LifeUserDynamicsService extends ServiceImpl<LifeUserDynamicsMapper,
             if (storeUser != null) {
                 if (storeUser.getStoreId() != null) {
                     StoreInfo storeInfo = storeInfoMapper.selectById(storeUser.getStoreId());
+                    resultMap.put("businessSection",storeInfo.getBusinessSection());
                     if (storeInfo != null && storeInfo.getStoreName() != null) {
                         // 使用店铺名称作为昵称
                         storeUser.setUserName(storeInfo.getStoreName());

+ 0 - 117
alien-store/src/main/java/shop/alien/store/service/StoreProductItemService.java

@@ -1,117 +0,0 @@
-package shop.alien.store.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductItem;
-import shop.alien.entity.store.dto.StoreProductItemDto;
-import shop.alien.entity.store.vo.StoreProductItemGymVo;
-import shop.alien.entity.store.vo.StoreProductItemDelicaciesVo;
-
-import java.util.List;
-
-/**
- * 商品表 服务类
- *
- * @author system
- * @since 2025-01-XX
- */
-public interface StoreProductItemService extends IService<StoreProductItem> {
-
-    /**
-     * 新增商品
-     * @return R<StoreProductItem>
-     */
-    R<StoreProductItem> addStoreProductItemDto(StoreProductItemDto storeProductItemDto);
-
-    /**
-     * 编辑商品
-     *
-     * @param storeProductItem 商品
-     * @return R<StoreProductItem>
-     */
-    R<StoreProductItem> editStoreProductItem(StoreProductItemDto storeProductItem);
-
-    /**
-     * 删除商品
-     *
-     * @param id 主键
-     * @return R<Boolean>
-     */
-    R<Boolean> deleteStoreProductItem(Integer id);
-
-    /**
-     * 根据ID查询商品
-     *
-     * @param id 主键
-     * @return R<StoreProductItem>
-     */
-    R<List<StoreProductItemDto>> getStoreProductItemById(Integer id,Integer modelType);
-
-
-    /**
-     * 按商品类型查询列表
-     *
-     * @param prodType 商品类型:1酒吧-酒水 2酒吧-餐食 3美食-餐食 4运动健身-单次 5运动健身-多次
-     * @return R<List<StoreProductItem>>
-     */
-    R<List<StoreProductItem>> listByProdType(Integer prodType);
-
-
-    /**
-     * 分页查询商品表与运动健身商品表关联数据
-     *
-     * @param pageNum  页码
-     * @param pageSize 页容
-     * @param storeId  门店ID
-     * @param prodName 商品名称(模糊查询)
-     * @param prodType 商品类型
-     * @return IPage<StoreProductItemGymVo>
-     */
-    IPage<StoreProductItemGymVo> getPageWithGym(int pageNum, int pageSize, Integer storeId, String prodName, Integer prodType);
-
-    /**
-     * 根据ID查询商品表与运动健身商品表关联详情
-     *
-     * @param id 商品表主键ID
-     * @return R<StoreProductItemGymVo>
-     */
-    R<StoreProductItemGymVo> getDetailWithGym(Long id);
-
-    /**
-     * 通用分页查询(支持门店、名称、类型、状态、是否预约筛选)
-     *
-     * @param pageNum     页码
-     * @param pageSize    页容
-     * @param storeId     门店ID
-     * @param prodName    商品名称(模糊)
-     * @param prodType    商品类型
-     * @param status      状态:0-待审核 1-审核通过 2-审核拒绝
-     * @param needReserve 是否需要预约:0-否 1-是
-     * @return IPage<StoreProductItem>
-     */
-    IPage<StoreProductItem> pageStoreProductItems(int pageNum, int pageSize,
-                                                  Integer storeId, String prodName, Integer prodType,
-                                                  Integer status, Integer needReserve);
-
-    /**
-     * 分页查询商品表与美食商品表关联数据
-     * 包含:1. store_product_delicacies的所有菜品
-     *      2. store_product_item的所有美食相关的套餐和商品(prodType = 3)
-     *
-     * @param pageNum     页码
-     * @param pageSize    页容
-     * @param storeId     门店ID
-     * @param name        名称(模糊查询)
-     * @param category    类别
-     * @param extGroup    菜品分组
-     * @param status      状态(0:禁用,1:启用)
-     * @param packageType 套餐类型(预留,用于根据类型查询套餐)
-     * @return IPage<StoreProductItemDelicaciesVo>
-     */
-    IPage<StoreProductItemDelicaciesVo> getPageWithDelicacies(int pageNum, int pageSize,
-                                                              Integer storeId, String name,
-                                                              String category, String extGroup,
-                                                              Integer status, Integer packageType);
-}
-

+ 10 - 3
alien-store/src/main/java/shop/alien/store/service/impl/CommentAppealServiceImpl.java

@@ -197,7 +197,7 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
             lawyerUser.eq(LawyerUser::getId, appeal.getLawyerUserId());
             LawyerUser lifeUser = lawyerUserMapper.selectOne(lawyerUser);
             if (lifeUser == null) {
-                log.warn("评价用户不存在,userId={}", lifeUser.getId());
+                log.warn("律师用户不存在,lawyerUserId={}", appeal.getLawyerUserId());
                 return;
             }
             LambdaQueryWrapper<OrderReview> orderReviewLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -547,16 +547,23 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
                 pageNum, pageSize, status, lawyerUserId);
         List<CommentAppealVo> appealList = new ArrayList<>();
         //status 3 查全部
-        if (status == 3) {
+        if (status != null && status == 3) {
             appealList = baseMapper.getAppealHistoryList(null, lawyerUserId);
         } else {
             // 查询申诉历史列表
             appealList = baseMapper.getAppealHistoryList(status, lawyerUserId);
         }
 
+        // 防止空指针异常:如果查询结果为null,初始化为空列表
+        if (appealList == null) {
+            appealList = new ArrayList<>();
+        }
+
         // 处理数据转换(图片列表等)
         for (CommentAppealVo vo : appealList) {
-            processAppealVo(vo);
+            if (vo != null) {
+                processAppealVo(vo);
+            }
         }
 
         ListToPage.setPage(appealList, pageNum, pageSize);

+ 208 - 3
alien-store/src/main/java/shop/alien/store/service/impl/CommonCommentServiceImpl.java

@@ -1,17 +1,29 @@
 package shop.alien.store.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import shop.alien.entity.store.CommonComment;
-import shop.alien.mapper.CommonCommentMapper;
+import shop.alien.entity.store.*;
+import shop.alien.entity.store.vo.CommonCommentVo;
+import shop.alien.entity.store.vo.CommonRatingVo;
+import shop.alien.mapper.*;
 import shop.alien.store.service.CommonCommentService;
+import shop.alien.store.util.CommonConstant;
+import shop.alien.util.common.constant.CommentSourceTypeEnum;
 import shop.alien.util.common.safe.TextModerationResultVO;
 import shop.alien.util.common.safe.TextModerationUtil;
 
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
 /**
  * 评论表 服务实现类
  *
@@ -27,19 +39,212 @@ public class CommonCommentServiceImpl extends ServiceImpl<CommonCommentMapper, C
     @Autowired
     private TextModerationUtil textModerationUtil;
 
+    private final CommonCommentMapper commonCommentMapper;
+    private final LifeUserDynamicsMapper lifeUserDynamicsMapper;
+    private final LifeLikeRecordMapper lifeLikeRecordMapper;
+    private final StoreUserMapper storeUserMapper;
+    private final LifeUserViolationMapper lifeUserViolationMapper;
+    private final LifeUserMapper lifeUserMapper;
+
+
+    /**
+     * 新增评论
+     *
+     * @param commonComment 评论对象
+     * @return 0:成功, 1:失败, 2:文本内容异常, 4:字数超限(超过300字)
+     */
     @Override
     public Integer addComment(CommonComment commonComment) {
+        // 校验评论内容字数限制(300字)
+        if (commonComment.getContent() != null && commonComment.getContent().length() > 300) {
+            log.warn("评论内容超过300字限制,content length={}", commonComment.getContent().length());
+            return 4; // 字数超限
+        }
+
+        // 文本内容审核
         TextModerationResultVO textCheckResult = null;
         try {
             textCheckResult = textModerationUtil.invokeFunction(commonComment.getContent(), CommonRatingServiceImpl.SERVICES_LIST);
             if ("high".equals(textCheckResult.getRiskLevel())) {
-                return 2;
+                return 2; // 文本内容异常(包含敏感词)
             }
             return this.save(commonComment) ? 0 : 1;
         } catch (Exception e) {
+            log.error("新增评论失败", e);
             return 1;
         }
     }
+
+    @Override
+    public List<CommonCommentVo> getListBySourceType(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId) {
+        String likeType = null;
+        if(sourceType == CommentSourceTypeEnum.STORE_COMMENT.getType()){
+            likeType = CommonConstant.COMMENT_LIKE;
+        } else if (sourceType == CommentSourceTypeEnum.DYNAMIC_COMMENT.getType()) {
+            likeType = CommonConstant.DYNAMIC_LIKE;
+        }
+        List<CommonCommentVo> firstLevelComment = getFirstLevelComment(sourceType, sourceId, pageNum, pageSize, userId,likeType);
+        CommonRatingVo commonRatingVo = new CommonRatingVo();
+        getAllChildComment(userId, commonRatingVo, firstLevelComment,likeType);
+        return commonRatingVo.getChildCommonComments();
+    }
+
+    @Override
+    public List<CommonCommentVo> getFirstLevelComment(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId, String likeType){
+        List<CommonCommentVo> commonComments = null;
+        QueryWrapper<CommonCommentVo> commentWrapper = new QueryWrapper<CommonCommentVo>();
+        if(sourceType == CommentSourceTypeEnum.STORE_COMMENT.getType()){
+            // 1查询店铺评价
+            commentWrapper.eq("cc.source_type", CommentSourceTypeEnum.STORE_COMMENT.getType());
+
+        } else if (sourceType == CommentSourceTypeEnum.DYNAMIC_COMMENT.getType()) {
+            // 2查询动态评论
+            commentWrapper.eq("cc.source_type", CommentSourceTypeEnum.DYNAMIC_COMMENT.getType());
+        }
+        commentWrapper.eq("cc.source_id", sourceId)
+                .eq("cc.parent_id", 0);
+        Page<CommonCommentVo> page = null;
+        if( null != pageNum && null != pageSize){
+            page = new Page<>(pageNum, pageSize);
+        }
+        commonComments = commonCommentMapper.selectALlComment(page, commentWrapper, likeType, userId);
+        return commonComments;
+    }
+
+    @Override
+    public void getAllChildComment(Long userId, CommonRatingVo commonRatingVo, List<CommonCommentVo> commonComments, String likeType) {
+        // 定义评论总数
+        AtomicReference<Long> count = new AtomicReference<>(0L);
+        count.updateAndGet(v -> v + commonComments.size());
+        List<CommonCommentVo> commonCommentVos = new ArrayList<>();
+        for (CommonCommentVo commonComment : commonComments) {
+//                CommonCommentVo commonCommentVo = new CommonCommentVo();
+//                BeanUtils.copyProperties(commonComment, commonCommentVo);
+            // 递归获取所有子评论(扁平化)
+            List<CommonCommentVo> allChildComments = getChildCommentsRecursively(commonComment.getId(), userId,likeType);
+            count.updateAndGet(v -> v + allChildComments.size());
+            // 一级评论本身的商家/用户标识和商家信息
+            // setStoreUserInfo(first);
+
+            // 按时间排序后绑定子评论列表
+            allChildComments.sort(Comparator.comparing(CommonCommentVo::getCreatedTime));
+
+            commonComment.setChildCommonComments(allChildComments);
+            commonCommentVos.add(commonComment);
+        }
+        commonRatingVo.setCommentCount(count.get());
+        commonRatingVo.setChildCommonComments(commonCommentVos);
+    }
+
+    /**
+     * 动态评论数量 目前给的是动态用的接口,可以根据sorceType返回不同数据
+     * @param sourceId
+     * @param sourceType
+     * @param userId
+     * @return
+     */
+    @Override
+    public Map<String, Object> getCommitCount(Integer sourceId, Integer sourceType, String userId, String userType) {
+        // 返回分享数,喜欢数,评论数
+        Map<String, Object> map = new HashMap<>();
+        // 计算评论数
+        QueryWrapper<CommonComment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(null != sourceId, "source_id", sourceId);
+        queryWrapper.eq(null != sourceType, "source_type", sourceType);
+        //通过当前登录人id和类型 查询举报业务id 不包含已举报的
+        List<LifeUserViolation> lifeUserViolations = new ArrayList<>();
+        if(sourceType == CommentSourceTypeEnum.DYNAMIC_COMMENT.getType() ){
+            if("user".equals(userType)){
+                LifeUser lifeUser = lifeUserMapper.selectOne(new LambdaQueryWrapper<LifeUser>().eq(LifeUser::getId,userId));
+                if(lifeUser!=null){
+                    LambdaQueryWrapper<LifeUserViolation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(LifeUserViolation::getReportingUserId,lifeUser.getId());
+                    lambdaQueryWrapper.eq(LifeUserViolation::getReportingUserType,2);
+                    lambdaQueryWrapper.ne(LifeUserViolation::getProcessingStatus,2);
+                    lifeUserViolations = lifeUserViolationMapper.selectList(lambdaQueryWrapper);
+                }
+            } else {
+                StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getId,userId));
+                if(storeUser!=null){
+                    LambdaQueryWrapper<LifeUserViolation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(LifeUserViolation::getReportingUserId,storeUser.getId());
+                    lambdaQueryWrapper.eq(LifeUserViolation::getReportingUserType,1);
+                    lambdaQueryWrapper.ne(LifeUserViolation::getProcessingStatus,2);
+                    lifeUserViolations = lifeUserViolationMapper.selectList(lambdaQueryWrapper);
+                }
+            }
+        }
+        List<Integer> businessIds = lifeUserViolations.stream()
+                .filter(Objects::nonNull)
+                .map(LifeUserViolation::getBusinessId)
+                .filter(id -> id != null && !id.toString().isEmpty())
+                .collect(Collectors.toList());
+        if(businessIds!=null && businessIds.size()>0){
+            queryWrapper.notIn("id",businessIds);
+        }
+
+        Integer i = commonCommentMapper.selectCount(queryWrapper);
+        map.put("commentCount", i);
+        getOtherDataWithSourceType(sourceId, sourceType, userId, map);
+        return map;
+    }
+
+    private void getOtherDataWithSourceType(Integer sourceId, Integer sourceType, String userId, Map<String, Object> map) {
+        if ( sourceType == CommentSourceTypeEnum.DYNAMIC_COMMENT.getType() ) {
+            // 计算分析数和喜欢数
+            LifeUserDynamics lifeUserDynamics = lifeUserDynamicsMapper.selectOne(new QueryWrapper<LifeUserDynamics>().eq("id", sourceId));
+            if(null != lifeUserDynamics){
+                map.put("likeCount",lifeUserDynamics.getDianzanCount());
+                map.put("transferCount",lifeUserDynamics.getTransferCount());
+            } else {
+                map.put("likeCount",0);
+                map.put("transferCount",0);
+            }
+            // 查询商家头像 TODO -> 动态发布的时候id不应该用Store_phone的格式,来不及重构动态的位置,后续等有缘人吧
+            StoreUser storeUser = storeUserMapper.selectOne(new QueryWrapper<StoreUser>().eq("phone", lifeUserDynamics.getPhoneId().split("_")[1]));
+            map.put("userImage",storeUser.getHeadImg()!= null?storeUser.getHeadImg():"");
+            // 查询当前用户是否喜欢
+            LifeLikeRecord lifeLikeRecord = lifeLikeRecordMapper.selectOne(new QueryWrapper<LifeLikeRecord>()
+                    .eq("type", CommonConstant.LIKE_TYPE_DYNAMICS)
+                    .eq("dianzan_id", userId)
+                    .eq("huifu_id", sourceId)
+                    .eq("delete_flag", 0));
+            if(null != lifeLikeRecord){
+                map.put("isLike",1);
+            } else {
+                map.put("isLike",0);
+            }
+        }
+    }
+
+    private List<CommonCommentVo> getChildCommentsRecursively(Long id, Long userId, String likeType) {
+        List<CommonCommentVo> allChildComments = new ArrayList<>();
+
+        // 查询直接回复当前评论的所有记录
+        QueryWrapper<CommonCommentVo> wrapper = new QueryWrapper<>();
+        wrapper.eq("cc.delete_flag", 0)
+                .eq("cc.parent_id", id)
+                .orderByAsc("cc.created_time");
+        List<CommonCommentVo> directChildren = commonCommentMapper.selectALlComment(null,wrapper,likeType, userId);
+
+        if (CollectionUtils.isEmpty(directChildren)) {
+            return allChildComments;
+        }
+        // 处理每个直接子评论
+        for (CommonCommentVo child : directChildren) {
+            // 设置商家/用户标识
+//            setStoreUserInfo(child);
+            // 递归获取该子评论的所有子评论
+            List<CommonCommentVo> grandChildren = getChildCommentsRecursively(child.getId(), userId,likeType);
+            // 将当前子评论添加到结果列表
+            allChildComments.add(child);
+            // 将该子评论的所有子评论也添加到结果列表(扁平化)
+            allChildComments.addAll(grandChildren);
+        }
+
+        return allChildComments;
+    }
+
 //
 //    @Override
 //    public IPage<CommonComment> getCommentList(Integer pageNum, Integer pageSize, Integer sourceType, Long sourceId, Long parentId, Integer commentType, Integer auditStatus) {

+ 336 - 85
alien-store/src/main/java/shop/alien/store/service/impl/CommonRatingServiceImpl.java

@@ -21,10 +21,13 @@ import shop.alien.entity.result.R;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.vo.CommonCommentVo;
 import shop.alien.entity.store.vo.CommonRatingVo;
+import shop.alien.entity.store.vo.RatingPercentVo;
 import shop.alien.entity.store.vo.StoreInfoScoreVo;
 import shop.alien.entity.store.vo.WebSocketVo;
 import shop.alien.mapper.*;
+import shop.alien.entity.store.TagsSynonym;
 import shop.alien.store.config.WebSocketProcess;
+import shop.alien.store.service.CommonCommentService;
 import shop.alien.store.service.CommonRatingService;
 import shop.alien.store.util.CommonConstant;
 import shop.alien.util.common.constant.CommentSourceTypeEnum;
@@ -32,6 +35,7 @@ import shop.alien.util.common.constant.RatingBusinessTypeEnum;
 import shop.alien.util.common.safe.TextModerationResultVO;
 import shop.alien.util.common.safe.TextModerationUtil;
 import shop.alien.util.common.safe.TextReviewServiceEnum;
+import shop.alien.util.common.DateUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -66,6 +70,9 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
     private final LifeLikeRecordMapper lifeLikeRecordMapper;
     private final LifeCollectMapper lifeCollectMapper;
     private final LifeFansMapper lifeFansMapper;
+    private final TagsSynonymMapper tagsSynonymMapper;
+    private final CommonCommentService commonCommentService;
+
 
 
     public static final List<String> SERVICES_LIST = ImmutableList.of(
@@ -152,21 +159,24 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
         }
 
     }
-
     @Override
-    public R getRatingList(Integer pageNum, Integer pageSize, Integer businessType, Long businessId, Long userId, Integer auditStatus, Integer searchScore) {
+    public R getRatingList(Integer pageNum, Integer pageSize, Integer businessType, Long businessId, Long userId, Integer auditStatus, Integer searchScore, Integer days, Integer replyStatus, Integer tagId) {
         Page<CommonRating> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<CommonRating> wrapper = new LambdaQueryWrapper<>();
         
+        // 业务类型筛选
         if (businessType != null) {
             wrapper.eq(CommonRating::getBusinessType, businessType);
         }
+        // 业务ID筛选
         if (businessId != null) {
             wrapper.eq(CommonRating::getBusinessId, businessId);
         }
+        // 审核状态筛选
         if (auditStatus != null) {
             wrapper.eq(CommonRating::getAuditStatus, auditStatus);
         }
+        // 评分等级筛选
         if (searchScore != null) {
             if(searchScore == 1){
                 // 1-好评
@@ -182,17 +192,89 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
             }else if(searchScore == 4){
                 // 4-有图
                 wrapper.isNotNull(CommonRating::getImageUrls);
-                // 2. 排除 空字符串 ""
                 wrapper.ne(CommonRating::getImageUrls, "");
-                // 3. 排除 纯空格字符串(如"   ")—— 用 TRIM 函数去掉首尾空格后判断非空
                 wrapper.apply("TRIM({0}) <> ''", "image_urls");
             }
         }
-        
+        // 时间范围筛选
+        if (days != null && days > 0) {
+            Date date = DateUtils.calcDays(new Date(), -days);
+            wrapper.ge(CommonRating::getCreatedTime, date);
+        }
+        // 回复状态筛选(使用EXISTS子查询在数据库层面筛选)
+        if (replyStatus != null && (replyStatus == 1 || replyStatus == 2)) {
+            if (replyStatus == 1) {
+                // 已回复:存在商户评论
+                wrapper.apply("EXISTS (SELECT 1 FROM common_comment cc WHERE cc.source_type = 1 " +
+                             "AND cc.source_id = common_rating.id AND cc.comment_type = 2 " +
+                             "AND cc.is_show = 1 AND cc.audit_status = 1 AND cc.delete_flag = 0)");
+            } else if (replyStatus == 2) {
+                // 未回复:不存在商户评论
+                wrapper.apply("NOT EXISTS (SELECT 1 FROM common_comment cc WHERE cc.source_type = 1 " +
+                             "AND cc.source_id = common_rating.id AND cc.comment_type = 2 " +
+                             "AND cc.is_show = 1 AND cc.audit_status = 1 AND cc.delete_flag = 0)");
+            }
+        }
+        // 标签筛选
+        if (tagId != null) {
+            // 1. 查询标签关联的评论ID列表(tags_synonym.comment_id 关联 common_comment.id)
+            LambdaQueryWrapper<TagsSynonym> tagWrapper = new LambdaQueryWrapper<>();
+            tagWrapper.eq(TagsSynonym::getMainTagId, tagId)
+                     .eq(TagsSynonym::getDeleteFlag, 0)
+                     .isNotNull(TagsSynonym::getCommentId);  // 确保comment_id不为空
+            List<TagsSynonym> tagsSynonymList = tagsSynonymMapper.selectList(tagWrapper);
+
+            if (CollectionUtils.isNotEmpty(tagsSynonymList)) {
+                // 2. 提取评论ID列表(common_comment.id)
+                List<Long> commentIdList = tagsSynonymList.stream()
+                        .filter(synonym -> synonym != null && synonym.getCommentId() != null)
+                        .map(synonym -> synonym.getCommentId().longValue())
+                        .distinct()
+                        .collect(Collectors.toList());
+
+                if (CollectionUtils.isNotEmpty(commentIdList)) {
+                    // 3. 通过评论ID查询common_comment表,获取source_id(评价ID)
+                    LambdaQueryWrapper<CommonComment> commentWrapper = new LambdaQueryWrapper<>();
+                    commentWrapper.in(CommonComment::getId, commentIdList)
+                                 .eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())  // source_type=1表示评价的评论
+                                 .eq(CommonComment::getIsShow, 1)
+                                 .eq(CommonComment::getAuditStatus, 1);
+                    List<CommonComment> comments = commonCommentMapper.selectList(commentWrapper);
+
+                    if (CollectionUtils.isNotEmpty(comments)) {
+                        // 4. 提取评价ID列表(common_comment.source_id = common_rating.id)
+                        List<Long> ratingIdList = comments.stream()
+                                .filter(comment -> comment.getSourceId() != null)
+                                .map(CommonComment::getSourceId)
+                                .distinct()
+                                .collect(Collectors.toList());
+
+                        if (CollectionUtils.isNotEmpty(ratingIdList)) {
+                            wrapper.in(CommonRating::getId, ratingIdList);
+                        } else {
+                            // 如果没有匹配的评价ID,返回空结果
+                            wrapper.eq(CommonRating::getId, -1);
+                        }
+                    } else {
+                        // 如果没有匹配的评论,返回空结果
+                        wrapper.eq(CommonRating::getId, -1);
+                    }
+                } else {
+                    // 如果没有评论ID,返回空结果
+                    wrapper.eq(CommonRating::getId, -1);
+                }
+            } else {
+                // 如果没有标签关联,返回空结果
+                wrapper.eq(CommonRating::getId, -1);
+            }
+        }
+
         wrapper.eq(CommonRating::getIsShow, 1);
         wrapper.orderByDesc(CommonRating::getId);
         IPage<CommonRating> page1 = this.page(page, wrapper);
-        return doListBusinessWithType(page1, businessType,userId);
+
+        // 处理回复状态筛选
+        return doListBusinessWithType(page1, businessType, userId, replyStatus);
     }
 
     @Override
@@ -211,6 +293,29 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
         }
         // 获取评价统计信息(总评论数、有图评论数、好评数、中评数、差评数)
         ratingCount = commonRatingMapper.getRatingCount(new QueryWrapper<CommonRating>().in("id", collect));
+
+        // 计算好评、中评、差评占比
+        // 注意:数据库返回的 count 可能是 BigDecimal、Long 或 Integer 类型,需要安全转换
+        int goodCount = getIntValue(ratingCount.get("goodCount"));
+        int midCount = getIntValue(ratingCount.get("midCount"));
+        int badCount = getIntValue(ratingCount.get("badCount"));
+        int totalCount = goodCount + midCount + badCount;
+
+        if (totalCount > 0) {
+            // 计算占比(保留2位小数)
+            Double goodPercent = Math.round((goodCount * 100.0 / totalCount) * 100.0) / 100.0;
+            Double midPercent = Math.round((midCount * 100.0 / totalCount) * 100.0) / 100.0;
+            Double badPercent = Math.round((badCount * 100.0 / totalCount) * 100.0) / 100.0;
+
+            ratingCount.put("goodPercent", goodPercent);
+            ratingCount.put("midPercent", midPercent);
+            ratingCount.put("badPercent", badPercent);
+        } else {
+            ratingCount.put("goodPercent", 0.0);
+            ratingCount.put("midPercent", 0.0);
+            ratingCount.put("badPercent", 0.0);
+        }
+
         if(RatingBusinessTypeEnum.STORE_RATING.getBusinessType() == businessType){
             // 1店铺评分
             StoreInfo storeInfo = storeInfoMapper.selectById(businessId);
@@ -236,7 +341,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
             List<Long> collect2 = commonRatings.stream().filter(i -> i.getScore() >= 4.5).map(CommonRating::getUserId).distinct().limit(6).collect(Collectors.toList());
             if(!collect2.isEmpty()) {
                 List<LifeUser> lifeUsers = lifeUserMapper.selectList(new QueryWrapper<LifeUser>().lambda().in(LifeUser::getId, collect2));
-                ratingCount.put("img", lifeUsers.stream().filter(x -> x.getUserImage() != null).map(LifeUser::getUserImage).collect(Collectors.toList()));
+                ratingCount.put("img", lifeUsers.stream().map(LifeUser::getUserImage).collect(Collectors.toList()));
             } else {
                 ratingCount.put("img", new ArrayList<>());
             }
@@ -333,62 +438,9 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                 commonRatingVo.setIsCollect(0);
             }
             // 2查询一级评价
-            QueryWrapper<CommonCommentVo> commentWrapper = new QueryWrapper<CommonCommentVo>()
-                    .eq("cc.source_type", CommentSourceTypeEnum.STORE_COMMENT.getType())
-                    .eq("cc.source_id", ratingId)
-                    .eq("cc.parent_id", 0);
-            List<CommonCommentVo> commonComments = commonCommentMapper.selectALlComment(commentWrapper,CommonConstant.COMMENT_LIKE, userId);
-
-            // 定义评论总数
-            AtomicReference<Long> count = new AtomicReference<>(0L);
-            count.updateAndGet(v -> v + commonComments.size());
-            List<CommonCommentVo> commonCommentVos = new ArrayList<>();
-            for (CommonCommentVo commonComment : commonComments) {
-//                CommonCommentVo commonCommentVo = new CommonCommentVo();
-//                BeanUtils.copyProperties(commonComment, commonCommentVo);
-                // 递归获取所有子评论(扁平化)
-                List<CommonCommentVo> allChildComments = getChildCommentsRecursively(commonComment.getId(), userId);
-                count.updateAndGet(v -> v + allChildComments.size());
-                // 一级评论本身的商家/用户标识和商家信息
-                // setStoreUserInfo(first);
-
-                // 按时间排序后绑定子评论列表
-                allChildComments.sort(Comparator.comparing(CommonCommentVo::getCreatedTime));
-
-                commonComment.setChildCommonComments(allChildComments);
-                commonCommentVos.add(commonComment);
-            }
-            commonRatingVo.setCommentCount(count.get());
-            commonRatingVo.setChildCommonComments(commonCommentVos);
-        }
-    }
-
-    private List<CommonCommentVo> getChildCommentsRecursively(Long id, Long userId) {
-        List<CommonCommentVo> allChildComments = new ArrayList<>();
-
-        // 查询直接回复当前评论的所有记录
-        QueryWrapper<CommonCommentVo> wrapper = new QueryWrapper<>();
-        wrapper.eq("cc.delete_flag", 0)
-                .eq("cc.parent_id", id)
-                .orderByAsc("cc.created_time");
-        List<CommonCommentVo> directChildren = commonCommentMapper.selectALlComment(wrapper,CommonConstant.COMMENT_LIKE, userId);
-
-        if (CollectionUtils.isEmpty(directChildren)) {
-            return allChildComments;
+            List<CommonCommentVo> commonComments = commonCommentService.getFirstLevelComment(CommentSourceTypeEnum.STORE_COMMENT.getType(), ratingId,null,null, userId,CommonConstant.COMMENT_LIKE);
+            commonCommentService.getAllChildComment(userId, commonRatingVo, commonComments,CommonConstant.COMMENT_LIKE);
         }
-        // 处理每个直接子评论
-        for (CommonCommentVo child : directChildren) {
-            // 设置商家/用户标识
-//            setStoreUserInfo(child);
-            // 递归获取该子评论的所有子评论
-            List<CommonCommentVo> grandChildren = getChildCommentsRecursively(child.getId(), userId);
-            // 将当前子评论添加到结果列表
-            allChildComments.add(child);
-            // 将该子评论的所有子评论也添加到结果列表(扁平化)
-            allChildComments.addAll(grandChildren);
-        }
-
-        return allChildComments;
     }
 
     @NotNull
@@ -403,19 +455,29 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
         }
     }
 
-    private R doListBusinessWithType(IPage<CommonRating> page1, Integer businessType, Long userId) {
+    /**
+     * 根据业务类型处理评价列表
+     *
+     * @param page1       评价分页数据
+     * @param businessType 业务类型
+     * @param userId      用户ID
+     * @param replyStatus 回复状态(0:全部, 1:已回复, 2:未回复)
+     * @return R<IPage<CommonRatingVo>>
+     */
+    private R<IPage<CommonRatingVo>> doListBusinessWithType(IPage<CommonRating> page1, Integer businessType, Long userId, Integer replyStatus) {
         if(businessType == RatingBusinessTypeEnum.STORE_RATING.getBusinessType()){
-            IPage<CommonRatingVo> result = new Page<>(page1.getPages(), page1.getSize(), page1.getTotal());
-            List resultList = new ArrayList();
+            IPage<CommonRatingVo> result = new Page<>(page1.getCurrent(), page1.getSize(), page1.getTotal());
+            List<CommonRatingVo> resultList = new ArrayList<>();
             if(page1.getRecords().isEmpty()){
                 result.setRecords(resultList);
                 return R.data(result);
             }
-            // 1查询评价用户信息
+
+            // 1. 查询评价用户信息
             Set<Long> userIdSet = page1.getRecords().stream()
                     .map(CommonRating::getUserId)
                     .collect(Collectors.toSet());
-            List<LifeUser> lifeUsers = new  ArrayList<>();
+            List<LifeUser> lifeUsers = new ArrayList<>();
             Map<Integer, LifeUser> lifeUserMap = new HashMap<>();
             if (!userIdSet.isEmpty()){
                 lifeUsers = lifeUserMapper.selectList(
@@ -424,49 +486,109 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                 lifeUserMap = lifeUsers.stream()
                         .collect(Collectors.toMap(LifeUser::getId, Function.identity()));
             }
-            // 2查询当前用户点赞列表(仅评价)
-            List<LifeLikeRecord> lifeLikeRecords = lifeLikeRecordMapper.selectList(
-                    new QueryWrapper<LifeLikeRecord>().lambda()
-                    .eq(LifeLikeRecord::getDianzanId, userId)
-                    .eq(LifeLikeRecord::getType, CommonConstant.RATING_LIKE));
-            Map<String, LifeLikeRecord> likeRecordMap = lifeLikeRecords.stream()
-                    .collect(Collectors.toMap(LifeLikeRecord::getHuifuId, Function.identity()));
 
+            // 2. 查询当前用户点赞列表(仅评价)
+            List<LifeLikeRecord> lifeLikeRecords = new ArrayList<>();
+            Map<String, LifeLikeRecord> likeRecordMap = new HashMap<>();
+            if (userId != null) {
+                lifeLikeRecords = lifeLikeRecordMapper.selectList(
+                        new QueryWrapper<LifeLikeRecord>().lambda()
+                        .eq(LifeLikeRecord::getDianzanId, userId)
+                        .eq(LifeLikeRecord::getType, CommonConstant.RATING_LIKE));
+                likeRecordMap = lifeLikeRecords.stream()
+                        .collect(Collectors.toMap(LifeLikeRecord::getHuifuId, Function.identity()));
+            }
 
-            // 1.查询评价的评论的记录个数
+            // 3. 查询评价的评论记录个数和商户回复状态
             Set<Long> ratingIdSet = page1.getRecords().stream()
                     .map(CommonRating::getId)
                     .collect(Collectors.toSet());
-            LambdaQueryWrapper<CommonComment> commentWrapper = new LambdaQueryWrapper<CommonComment>()
-                    .eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())
-                    .in(CommonComment::getSourceId, ratingIdSet);
-            // 评价id对应的所有评论 定义Map存储「评价ID -> 该评价下的总评论数」
-            Map<Long, Long> ratingCommentCountMap = commonCommentMapper.selectList(commentWrapper).stream()
+
+            // 查询所有评论(用于统计评论数)
+            LambdaQueryWrapper<CommonComment> commentWrapper = new LambdaQueryWrapper<>();
+            commentWrapper.eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())
+                         .in(CommonComment::getSourceId, ratingIdSet)
+                         .eq(CommonComment::getIsShow, 1)
+                         .eq(CommonComment::getAuditStatus, 1);
+            List<CommonComment> allComments = commonCommentMapper.selectList(commentWrapper);
+
+            // 评价ID -> 该评价下的总评论数
+            Map<Long, Long> ratingCommentCountMap = allComments.stream()
                     .collect(Collectors.groupingBy(CommonComment::getSourceId, Collectors.counting()));
 
+            // 查询每个评价的最新一条商户回复(comment_type=2, parent_id=0)
+            Map<Long, CommonCommentVo> latestMerchantReplyMap = new HashMap<>();
+            if (!ratingIdSet.isEmpty()) {
+                QueryWrapper<CommonCommentVo> merchantReplyWrapper = new QueryWrapper<>();
+                merchantReplyWrapper.eq("cc.source_type", CommentSourceTypeEnum.STORE_COMMENT.getType())
+                                   .in("cc.source_id", ratingIdSet)
+                                   .eq("cc.comment_type", 2)  // 商户评论
+                                   .eq("cc.parent_id", 0)     // 直接回复评价的根评论
+                                   .eq("cc.is_show", 1)
+                                   .eq("cc.audit_status", 1)
+                                   .eq("cc.delete_flag", 0)
+                                   .orderByDesc("cc.created_time");
+
+                // 查询所有商户回复(包含用户信息)
+                List<CommonCommentVo> merchantReplies = commonCommentMapper.selectALlComment(
+                        null,
+                    merchantReplyWrapper,
+                    CommonConstant.COMMENT_LIKE,
+                    userId != null ? userId : 0L
+                );
+
+                // 按评价ID分组,每组只取最新的一条(已按时间倒序排序)
+                if (CollectionUtils.isNotEmpty(merchantReplies)) {
+                    for (CommonCommentVo reply : merchantReplies) {
+                        Long ratingId = reply.getSourceId();
+                        // 如果该评价还没有设置回复,则设置(因为已经按时间倒序,第一条就是最新的)
+                        if (ratingId != null && !latestMerchantReplyMap.containsKey(ratingId)) {
+                            latestMerchantReplyMap.put(ratingId, reply);
+                        }
+                    }
+                }
+            }
+
+            // 4. 组装评价列表数据
             for (CommonRating record : page1.getRecords()) {
                 CommonRatingVo commonRatingVo = new CommonRatingVo();
                 BeanUtil.copyProperties(record, commonRatingVo);
-                // 判断用户信息
+
+                // 设置用户信息
                 if(lifeUserMap.containsKey(Integer.parseInt(record.getUserId().toString()))){
                     LifeUser lifeUser = lifeUserMap.get(Integer.parseInt(record.getUserId().toString()));
-                    // 设置评论用户信息
                     commonRatingVo.setUserImage(lifeUser.getUserImage());
                     commonRatingVo.setUserName(lifeUser.getUserName());
                 }
-                // 判断当前登录人是否点赞过
+
+                // 设置点赞状态
                 commonRatingVo.setIsLike(0);
                 if(likeRecordMap.containsKey(record.getId().toString())){
                     commonRatingVo.setIsLike(1);
                 }
-                // 3.1 从映射中获取该评价的总评论数(默认0)
+
+                // 设置评论数
                 commonRatingVo.setCommentCount(ratingCommentCountMap.getOrDefault(record.getId(), 0L));
+
+                // 设置商户最新回复(同一评价下,商家只显示最新的一条回复)
+                CommonCommentVo latestMerchantReply = latestMerchantReplyMap.get(record.getId());
+                if (latestMerchantReply != null) {
+                    // 只设置一条最新的商户回复
+                    commonRatingVo.setChildCommonComments(Collections.singletonList(latestMerchantReply));
+                } else {
+                    // 没有商户回复,设置为空列表
+                    commonRatingVo.setChildCommonComments(new ArrayList<>());
+                }
+
                 resultList.add(commonRatingVo);
             }
+
             result.setRecords(resultList);
             return R.data(result);
         }
-        return null;
+        // 如果不是店铺评价类型,返回空结果
+        IPage<CommonRatingVo> emptyResult = new Page<>(page1.getCurrent(), page1.getSize(), 0);
+        return R.data(emptyResult);
     }
 /*
     @Override
@@ -495,5 +617,134 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
         
         return (long) this.count(wrapper);
     }*/
+
+    /**
+     * 安全地将数据库返回的数值类型转换为 int
+     * 支持 BigDecimal、Long、Integer、Number 等类型
+     *
+     * @param value 数据库返回的数值对象
+     * @return int 值,如果为 null 或无法转换则返回 0
+     */
+    private int getIntValue(Object value) {
+        if (value == null) {
+            return 0;
+        }
+
+        if (value instanceof Number) {
+            return ((Number) value).intValue();
+        }
+
+        // 尝试字符串转换
+        try {
+            if (value instanceof String) {
+                return Integer.parseInt((String) value);
+            }
+        } catch (NumberFormatException e) {
+            log.warn("无法将值转换为 int: {}", value, e);
+        }
+
+        return 0;
+    }
+
+    /**
+     * 获取回复率和评价比例
+     *
+     * @param businessId   业务ID(店铺ID)
+     * @param businessType 业务类型:1-店铺评价
+     * @return 回复率和评价比例信息
+     */
+    @Override
+    public RatingPercentVo getRatingPercent(Integer businessId, Integer businessType) {
+        log.info("CommonRatingServiceImpl.getRatingPercent?businessId={}&businessType={}", businessId, businessType);
+
+        RatingPercentVo vo = new RatingPercentVo();
+
+        // 1. 查询全部评价记录(仅展示的、审核通过的)
+        LambdaQueryWrapper<CommonRating> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CommonRating::getBusinessId, businessId);
+        wrapper.eq(CommonRating::getBusinessType, businessType);
+        wrapper.eq(CommonRating::getIsShow, 1);
+        wrapper.eq(CommonRating::getAuditStatus, 1);  // 仅统计审核通过的
+        List<CommonRating> commonRatings = commonRatingMapper.selectList(wrapper);
+
+        // 如果为空,返回默认值
+        if (CollectionUtils.isEmpty(commonRatings)) {
+            vo.setTotalRatingCount(0);
+            vo.setGoodCount(0);
+            vo.setMidCount(0);
+            vo.setBadCount(0);
+            vo.setGoodPercent(0.0);
+            vo.setMidPercent(0.0);
+            vo.setBadPercent(0.0);
+            vo.setRepliedCount(0);
+            vo.setReplyRate(0.0);
+            return vo;
+        }
+
+        List<Long> ratingIdList = commonRatings.stream()
+                .map(CommonRating::getId)
+                .collect(Collectors.toList());
+
+        // 2. 获取评价统计信息(好评、中评、差评数量)
+        Map<String, Object> ratingCount = commonRatingMapper.getRatingCount(
+                new QueryWrapper<CommonRating>().in("id", ratingIdList));
+
+        // 3. 计算好评、中评、差评数量和占比
+        int goodCount = getIntValue(ratingCount.get("goodCount"));
+        int midCount = getIntValue(ratingCount.get("midCount"));
+        int badCount = getIntValue(ratingCount.get("badCount"));
+        int totalCount = goodCount + midCount + badCount;
+
+        vo.setTotalRatingCount(totalCount);
+        vo.setGoodCount(goodCount);
+        vo.setMidCount(midCount);
+        vo.setBadCount(badCount);
+
+        // 计算占比(保留2位小数)
+        if (totalCount > 0) {
+            Double goodPercent = Math.round((goodCount * 100.0 / totalCount) * 100.0) / 100.0;
+            Double midPercent = Math.round((midCount * 100.0 / totalCount) * 100.0) / 100.0;
+            Double badPercent = Math.round((badCount * 100.0 / totalCount) * 100.0) / 100.0;
+
+            vo.setGoodPercent(goodPercent);
+            vo.setMidPercent(midPercent);
+            vo.setBadPercent(badPercent);
+        } else {
+            vo.setGoodPercent(0.0);
+            vo.setMidPercent(0.0);
+            vo.setBadPercent(0.0);
+        }
+
+        // 4. 计算回复率
+        // 查询已回复的评价数(存在商户评论 comment_type=2, parent_id=0)
+        LambdaQueryWrapper<CommonComment> repliedWrapper = new LambdaQueryWrapper<>();
+        repliedWrapper.eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())
+                     .in(CommonComment::getSourceId, ratingIdList)
+                     .eq(CommonComment::getCommentType, 2)  // 商户评论
+                     .eq(CommonComment::getParentId, 0)     // 根评论(直接回复评价)
+                     .eq(CommonComment::getIsShow, 1)
+                     .eq(CommonComment::getAuditStatus, 1);
+
+        // 获取已回复的评价ID列表(去重)
+        Set<Long> repliedRatingIds = commonCommentMapper.selectList(repliedWrapper).stream()
+                .map(CommonComment::getSourceId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toSet());
+
+        int repliedCount = repliedRatingIds.size();
+        vo.setRepliedCount(repliedCount);
+
+        // 计算回复率(保留2位小数)
+        Double replyRate = 0.0;
+        if (totalCount > 0) {
+            replyRate = Math.round((repliedCount * 100.0 / totalCount) * 100.0) / 100.0;
+        }
+        vo.setReplyRate(replyRate);
+
+        log.info("CommonRatingServiceImpl.getRatingPercent result: totalCount={}, goodCount={}, midCount={}, badCount={}, repliedCount={}, replyRate={}%",
+                totalCount, goodCount, midCount, badCount, repliedCount, replyRate);
+
+        return vo;
+    }
 }
 

+ 2 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentServiceImpl.java

@@ -82,6 +82,8 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
 
     @Autowired
     private TextModerationUtil textModerationUtil;
+    @Autowired
+    private CommonCommentMapper commonCommentMapper;
 
     /**
      * 评论列表

+ 1 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreCuisineServiceImpl.java

@@ -223,6 +223,7 @@ public class StoreCuisineServiceImpl extends ServiceImpl<StoreCuisineMapper, Sto
                 item.setCuisineName(single.getName());
                 item.setQuantity(combo.getSnum());
                 item.setUnit("份");
+                item.setPrice(single.getTotalPrice());
                 items.add(item);
             }
             group.setItems(items);

+ 0 - 461
alien-store/src/main/java/shop/alien/store/service/impl/StoreProductItemServiceImpl.java

@@ -1,461 +0,0 @@
-package shop.alien.store.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import shop.alien.entity.result.CommonEnum;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreProductBar;
-import shop.alien.entity.store.StoreProductDelicacies;
-import shop.alien.entity.store.StoreProductGym;
-import shop.alien.entity.store.StoreProductItem;
-import shop.alien.entity.store.vo.StoreProductItemGymVo;
-import shop.alien.entity.store.vo.StoreProductItemDelicaciesVo;
-import shop.alien.entity.store.vo.StoreProductDelicaciesVo;
-import shop.alien.entity.store.dto.StoreProductItemDto;
-import shop.alien.mapper.StoreProductItemMapper;
-import shop.alien.store.service.StoreProductBarService;
-import shop.alien.store.service.StoreProductDelicaciesService;
-import shop.alien.store.service.StoreProductGymService;
-import shop.alien.store.service.StoreProductItemService;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.function.BiConsumer;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * 商品表 服务实现类
- *
- * @author system
- * @since 2025-01-XX
- */
-@Slf4j
-@Transactional(rollbackFor = Exception.class)
-@Service
-@RequiredArgsConstructor
-public class StoreProductItemServiceImpl extends ServiceImpl<StoreProductItemMapper, StoreProductItem> implements StoreProductItemService {
-
-    private final ObjectMapper objectMapper;
-
-    private final StoreProductBarService storeProductBarService;
-
-    private final StoreProductDelicaciesService storeProductDelicaciesService;
-
-    private final StoreProductGymService storeProductGymService;
-
-    @Override
-    public R<StoreProductItem> addStoreProductItemDto(StoreProductItemDto storeProductItemDto) {
-        log.info("StoreProductItemServiceImpl.addStoreProductItem?storeProductItem={}", storeProductItemDto);
-        StoreProductItem storeProductItem = new StoreProductItem();
-        BeanUtils.copyProperties(storeProductItemDto, storeProductItem);
-        // 先保存主商品,确保可以拿到自增的 id 作为子表 extId。
-        this.save(storeProductItem);
-        // 根据商品类型分发子表保存逻辑。
-        processSubItems(storeProductItemDto, storeProductItem, false);
-        return R.data(storeProductItem);
-    }
-
-    @Override
-    public R<StoreProductItem> editStoreProductItem(StoreProductItemDto storeProductItemDto) {
-        log.info("StoreProductItemServiceImpl.editStoreProductItem?storeProductItem={}", storeProductItemDto);
-        StoreProductItem storeProductItem = new StoreProductItem();
-        BeanUtils.copyProperties(storeProductItemDto, storeProductItem);
-        this.updateById(storeProductItem);
-        // 统一的子表处理:先清理旧数据,再按商品类型重建。
-        processSubItems(storeProductItemDto, storeProductItem, true);
-        return R.data(storeProductItem);
-    }
-
-    /**
-     * 新增/编辑场景下的子表处理。
-     *
-     * @param storeProductItemDto 前端传入的数据,包含主表和子表信息
-     * @param storeProductItem    已保存/更新的主表实体,需从中读取 id 作为子表 extId
-     * @param replaceExisting     是否需要先删除同 extId 的旧数据(编辑场景)
-     */
-    private void processSubItems(StoreProductItemDto storeProductItemDto,
-                                 StoreProductItem storeProductItem,
-                                 boolean replaceExisting) {
-        List<?> rawSubList = storeProductItemDto.getSubList();
-        if (rawSubList == null || rawSubList.isEmpty()) {
-            return;
-        }
-        Integer modelType = storeProductItemDto.getModelType();
-        if (modelType == null) {
-            log.warn("商品缺少 modelType,跳过子项处理");
-            return;
-        }
-        Integer extId = storeProductItem.getId();
-
-        // 编辑场景:删除当前商品 extId 对应的旧子表数据,避免脏数据。
-        if (replaceExisting) {
-            clearSubItemsByModelType(modelType, extId);
-        }
-
-        // 按商品类型把原始子项转换为目标实体并批量入库。
-        if (CommonEnum.ModelType.BAR.getCode() == modelType) {
-            convertAndSave(rawSubList, extId, StoreProductBar.class,
-                    (item, id) -> item.setExtId(id), storeProductBarService::saveBatch);
-        } else if (CommonEnum.ModelType.DELICACY.getCode() == modelType) {
-            convertAndSave(rawSubList, extId, StoreProductDelicacies.class,
-                    (item, id) -> item.setExtId(id), storeProductDelicaciesService::saveBatch);
-        } else if (CommonEnum.ModelType.GYM.getCode() == modelType) {
-            convertAndSave(rawSubList, extId, StoreProductGym.class,
-                    (item, id) -> {
-                        item.setExtId(id);
-                        if (item.getUsageCount() == null) {
-                            item.setUsageCount(0);
-                        }
-                    }, storeProductGymService::saveBatch);
-        } else {
-            log.warn("未知的商品 modelType:{},子项未处理", modelType);
-        }
-    }
-
-    /**
-     * 根据商品模块清理同一个 extId 的旧子表数据,防止编辑后出现重复/脏数据。
-     */
-    private void clearSubItemsByModelType(Integer modelType, Integer extId) {
-        if (CommonEnum.ModelType.BAR.getCode() == modelType) {
-            storeProductBarService.lambdaUpdate().eq(StoreProductBar::getExtId, extId).remove();
-        } else if (CommonEnum.ModelType.DELICACY.getCode() == modelType) {
-            storeProductDelicaciesService.lambdaUpdate().eq(StoreProductDelicacies::getExtId, extId).remove();
-        } else if (CommonEnum.ModelType.GYM.getCode() == modelType) {
-            storeProductGymService.lambdaUpdate().eq(StoreProductGym::getExtId, extId).remove();
-        }
-    }
-
-    /**
-     * 通用转换 + 批量保存,保持原有异常行为。
-     */
-    private <T> void convertAndSave(List<?> rawSubList, Integer extId, Class<T> clazz,
-                                    BiConsumer<T, Integer> extSetter,
-                                    Function<List<T>, Boolean> saveBatchFunc) {
-        List<T> subList = rawSubList.stream()
-                .map(v -> objectMapper.convertValue(v, clazz))
-                .peek(v -> extSetter.accept(v, extId))
-                .collect(Collectors.toList());
-        boolean subSaved = saveBatchFunc.apply(subList);
-        if (!subSaved) {
-            throw new RuntimeException("子项保存失败");
-        }
-    }
-
-    @Override
-    public R<Boolean> deleteStoreProductItem(Integer id) {
-        log.info("StoreProductItemServiceImpl.deleteStoreProductItem?id={}", id);
-        boolean result = this.removeById(id);
-        storeProductBarService.lambdaUpdate().eq(StoreProductBar::getExtId, id).remove();
-        storeProductDelicaciesService.lambdaUpdate().eq(StoreProductDelicacies::getExtId, id).remove();
-        storeProductGymService.lambdaUpdate().eq(StoreProductGym::getExtId, id).remove();
-        if (result) {
-            return R.success("删除成功");
-        }
-        return R.fail("删除失败");
-    }
-
-    @Override
-    public R<List<StoreProductItemDto>> getStoreProductItemById(Integer id,Integer modelType) {
-        log.info("StoreProductItemServiceImpl.getStoreProductItemById?id={}", id);
-        StoreProductItem storeProductItem = this.getById(id);
-        if (storeProductItem != null) {
-            ArrayList<StoreProductItemDto> list = new ArrayList<>();
-            StoreProductItemDto storeProductItemDto = new StoreProductItemDto();
-            list.add(storeProductItemDto);
-            BeanUtils.copyProperties(storeProductItem,storeProductItemDto);
-            List<?> sublist =null;
-            if (modelType == CommonEnum.ModelType.BAR.getCode()) {
-                sublist = storeProductBarService.getByExtId(id);
-            }else if (modelType == CommonEnum.ModelType.DELICACY.getCode()) {
-                sublist = storeProductDelicaciesService.getByExtId(id);
-            }else if (modelType == CommonEnum.ModelType.GYM.getCode()) {
-                sublist = storeProductGymService.getByExtId(id);
-            }
-            storeProductItemDto.setSubList(sublist);
-            return R.data(list);
-        }
-        return R.fail("未找到数据");
-    }
-
-    @Override
-    public R<List<StoreProductItem>> listByProdType(Integer prodType) {
-        log.info("StoreProductItemServiceImpl.listByProdType?prodType={}", prodType);
-        if (prodType == null) {
-            return R.fail("prodType不能为空");
-        }
-        List<StoreProductItem> result = lambdaQuery().eq(StoreProductItem::getProdType, prodType)
-                .orderByDesc(StoreProductItem::getCreatedTime).list();
-        return R.data(result);
-    }
-
-    @Override
-    public IPage<StoreProductItem> pageStoreProductItems(int pageNum, int pageSize,
-                                                         Integer storeId, String prodName, Integer prodType,
-                                                         Integer status, Integer needReserve) {
-        log.info("StoreProductItemServiceImpl.pageStoreProductItems?pageNum={}, pageSize={}, storeId={}, prodName={}, prodType={}, status={}, needReserve={}",
-                pageNum, pageSize, storeId, prodName, prodType, status, needReserve);
-        Page<StoreProductItem> page = new Page<>(pageNum, pageSize);
-        LambdaQueryWrapper<StoreProductItem> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(storeId != null, StoreProductItem::getStoreId, storeId)
-                .eq(prodType != null, StoreProductItem::getProdType, prodType)
-                .eq(status != null, StoreProductItem::getStatus, status)
-                .eq(needReserve != null, StoreProductItem::getNeedReserve, needReserve)
-                .like(StringUtils.hasText(prodName), StoreProductItem::getProdName, prodName)
-                .orderByDesc(StoreProductItem::getCreatedTime);
-        return this.page(page, wrapper);
-    }
-
-    @Override
-    public IPage<StoreProductItemGymVo> getPageWithGym(int pageNum, int pageSize, Integer storeId, String prodName, Integer prodType) {
-        log.info("StoreProductItemServiceImpl.getPageWithGym?pageNum={}, pageSize={}, storeId={}, prodName={}, prodType={}",
-                pageNum, pageSize, storeId, prodName, prodType);
-        Page<StoreProductItemGymVo> page = new Page<>(pageNum, pageSize);
-        if(prodType == 0){
-            return baseMapper.getPageWithGym(page, storeId, prodName, null);
-        }else{
-            return baseMapper.getPageWithGym(page, storeId, prodName, prodType);
-        }
-    }
-
-    @Override
-    public R<StoreProductItemGymVo> getDetailWithGym(Long id) {
-        log.info("StoreProductItemServiceImpl.getDetailWithGym?id={}", id);
-        if (id == null) {
-            return R.fail("ID不能为空");
-        }
-        StoreProductItemGymVo detail = baseMapper.getDetailWithGym(id);
-        if (detail != null) {
-            return R.data(detail);
-        }
-        return R.fail("查询失败,数据不存在");
-    }
-
-    @Override
-    public IPage<StoreProductItemDelicaciesVo> getPageWithDelicacies(int pageNum, int pageSize,
-                                                                      Integer storeId, String name,
-                                                                      String category, String extGroup,
-                                                                      Integer status, Integer packageType) {
-        log.info("StoreProductItemServiceImpl.getPageWithDelicacies?pageNum={}, pageSize={}, storeId={}, name={}, category={}, extGroup={}, status={}, packageType={}",
-                pageNum, pageSize, storeId, name, category, extGroup, status, packageType);
-        
-        // 1. 查询主表store_product_item中关于美食的数据(prodType = 4)
-        LambdaQueryWrapper<StoreProductItem> itemWrapper = new LambdaQueryWrapper<>();
-        itemWrapper.eq(StoreProductItem::getProdType, 4)
-                .eq(StoreProductItem::getDeleteFlag, 0);
-        
-        if (storeId != null) {
-            itemWrapper.eq(StoreProductItem::getStoreId, storeId);
-        }
-        if (StringUtils.hasText(name)) {
-            itemWrapper.like(StoreProductItem::getProdName, name);
-        }
-        if (status != null) {
-            itemWrapper.eq(StoreProductItem::getStatus, status);
-        }
-        
-        // 查询所有主表数据(不分页,用于后续合并)
-        List<StoreProductItem> allItemList = this.list(itemWrapper);
-        List<Integer> allItemIds = allItemList != null ? allItemList.stream()
-                .map(StoreProductItem::getId)
-                .collect(Collectors.toList()) : new ArrayList<>();
-        
-        // 2. 查询所有关联的子表数据
-        LambdaQueryWrapper<StoreProductDelicacies> relatedDelicaciesWrapper = new LambdaQueryWrapper<>();
-        if (!allItemIds.isEmpty()) {
-            relatedDelicaciesWrapper.in(StoreProductDelicacies::getExtId, allItemIds)
-                    .eq(StoreProductDelicacies::getDeleteFlag, 0);
-        } else {
-            // 如果没有主表数据,设置一个不可能的条件
-            relatedDelicaciesWrapper.eq(StoreProductDelicacies::getExtId, -1)
-                    .eq(StoreProductDelicacies::getDeleteFlag, 0);
-        }
-        
-        // 子表筛选条件
-        if (StringUtils.hasText(name)) {
-            relatedDelicaciesWrapper.like(StoreProductDelicacies::getName, name);
-        }
-        if (StringUtils.hasText(category)) {
-            relatedDelicaciesWrapper.eq(StoreProductDelicacies::getCategory, category);
-        }
-        if (StringUtils.hasText(extGroup)) {
-            relatedDelicaciesWrapper.eq(StoreProductDelicacies::getExtGroup, extGroup);
-        }
-        if (status != null) {
-            relatedDelicaciesWrapper.eq(StoreProductDelicacies::getStatus, status);
-        }
-        
-        List<StoreProductDelicacies> relatedDelicaciesList = storeProductDelicaciesService.list(relatedDelicaciesWrapper);
-        
-        // 3. 查询独立的子表数据(extId为null或不在主表ID列表中的)
-        LambdaQueryWrapper<StoreProductDelicacies> independentDelicaciesWrapper = new LambdaQueryWrapper<>();
-        independentDelicaciesWrapper.eq(StoreProductDelicacies::getDeleteFlag, 0);
-        
-        // 独立的子表:extId为null,或者extId不在主表ID列表中
-        if (allItemIds.isEmpty()) {
-            // 如果没有主表数据,查询所有extId为null的子表数据
-            independentDelicaciesWrapper.isNull(StoreProductDelicacies::getExtId);
-        } else {
-            // extId为null,或者extId不在主表ID列表中
-            independentDelicaciesWrapper.and(wrapper -> wrapper.isNull(StoreProductDelicacies::getExtId)
-                    .or().notIn(StoreProductDelicacies::getExtId, allItemIds));
-        }
-        
-        // 子表筛选条件
-        if (StringUtils.hasText(name)) {
-            independentDelicaciesWrapper.like(StoreProductDelicacies::getName, name);
-        }
-        if (StringUtils.hasText(category)) {
-            independentDelicaciesWrapper.eq(StoreProductDelicacies::getCategory, category);
-        }
-        if (StringUtils.hasText(extGroup)) {
-            independentDelicaciesWrapper.eq(StoreProductDelicacies::getExtGroup, extGroup);
-        }
-        if (status != null) {
-            independentDelicaciesWrapper.eq(StoreProductDelicacies::getStatus, status);
-        }
-        
-        List<StoreProductDelicacies> independentDelicaciesList = storeProductDelicaciesService.list(independentDelicaciesWrapper);
-        
-        // 4. 按extId分组,构建关联子表数据映射
-        Map<Integer, List<StoreProductDelicaciesVo>> delicaciesMap = relatedDelicaciesList.stream()
-                .collect(Collectors.groupingBy(
-                        StoreProductDelicacies::getExtId,
-                        Collectors.mapping(delicacies -> convertToDelicaciesVo(delicacies), Collectors.toList())
-                ));
-        
-        // 5. 组装结果列表
-        List<StoreProductItemDelicaciesVo> resultList = new ArrayList<>();
-        
-        // 5.1 添加主表数据及其关联的子表数据
-        if (allItemList != null) {
-            for (StoreProductItem item : allItemList) {
-                StoreProductItemDelicaciesVo vo = convertItemToVo(item);
-                // 设置子表列表(一对多关系)
-                List<StoreProductDelicaciesVo> subList = delicaciesMap.getOrDefault(item.getId(), new ArrayList<>());
-                vo.setDelicaciesList(subList);
-                resultList.add(vo);
-            }
-        }
-        
-        // 5.2 添加独立的子表数据(作为独立的记录,主表字段为空)
-        for (StoreProductDelicacies delicacies : independentDelicaciesList) {
-            StoreProductItemDelicaciesVo vo = new StoreProductItemDelicaciesVo();
-            // 主表字段为空或null
-            vo.setId(null);
-            vo.setStoreId(null);
-            // 子表字段
-            vo.setDelicaciesId(delicacies.getId());
-            vo.setExtId(delicacies.getExtId());
-            vo.setName(delicacies.getName());
-            vo.setPrice(delicacies.getPrice());
-            vo.setCostPrice(delicacies.getCostPrice());
-            vo.setUnit(delicacies.getUnit());
-            vo.setQuantity(delicacies.getQuantity());
-            vo.setCategory(delicacies.getCategory());
-            vo.setExtGroup(delicacies.getExtGroup());
-            vo.setDelicaciesStatus(delicacies.getStatus());
-            vo.setDelicaciesDeleteFlag(delicacies.getDeleteFlag());
-            vo.setDelicaciesCreatedUserId(delicacies.getCreatedUserId());
-            vo.setDelicaciesUpdatedUserId(delicacies.getUpdatedUserId());
-            vo.setDelicaciesCreatedTime(delicacies.getCreatedTime());
-            vo.setDelicaciesUpdatedTime(delicacies.getUpdatedTime());
-            // 子表列表只包含自己
-            List<StoreProductDelicaciesVo> subList = new ArrayList<>();
-            subList.add(convertToDelicaciesVo(delicacies));
-            vo.setDelicaciesList(subList);
-            resultList.add(vo);
-        }
-        
-        // 6. 按创建时间倒序排序(主表或子表的创建时间)
-        resultList.sort((a, b) -> {
-            Date dateA = a.getDelicaciesCreatedTime() != null ? a.getDelicaciesCreatedTime() : a.getCreatedTime();
-            Date dateB = b.getDelicaciesCreatedTime() != null ? b.getDelicaciesCreatedTime() : b.getCreatedTime();
-            if (dateA == null && dateB == null) return 0;
-            if (dateA == null) return 1;
-            if (dateB == null) return -1;
-            return dateB.compareTo(dateA); // 倒序
-        });
-        
-        // 7. 手动分页
-        int total = resultList.size();
-        int start = (pageNum - 1) * pageSize;
-        int end = Math.min(start + pageSize, total);
-        
-        List<StoreProductItemDelicaciesVo> pageList = start < total ? resultList.subList(start, end) : new ArrayList<>();
-        
-        // 8. 构建分页结果
-        Page<StoreProductItemDelicaciesVo> resultPage = new Page<>(pageNum, pageSize);
-        resultPage.setRecords(pageList);
-        resultPage.setTotal(total);
-        resultPage.setPages((int) Math.ceil((double) total / pageSize));
-        resultPage.setCurrent(pageNum);
-        resultPage.setSize(pageSize);
-        
-        return resultPage;
-    }
-
-    /**
-     * 将StoreProductItem转换为VO
-     */
-    private StoreProductItemDelicaciesVo convertItemToVo(StoreProductItem item) {
-        StoreProductItemDelicaciesVo vo = new StoreProductItemDelicaciesVo();
-        vo.setId(item.getId());
-        vo.setStoreId(item.getStoreId());
-        vo.setProdName(item.getProdName());
-        vo.setTotalPrice(item.getTotalPrice());
-        vo.setProdType(item.getProdType());
-        vo.setImages(item.getImages());
-        vo.setImageContent(item.getImageContent());
-        vo.setDetailContent(item.getDetailContent());
-        vo.setExtraNote(item.getExtraNote());
-        vo.setNeedReserve(item.getNeedReserve());
-        vo.setReserveRule(item.getReserveRule());
-        vo.setPeopleLimit(item.getPeopleLimit());
-        vo.setUsageRule(item.getUsageRule());
-        vo.setStatus(item.getStatus());
-        vo.setRejectionReason(item.getRejectionReason());
-        vo.setDeleteFlag(item.getDeleteFlag());
-        vo.setCreatedUserId(item.getCreatedUserId());
-        vo.setUpdatedUserId(item.getUpdatedUserId());
-        vo.setCreatedTime(item.getCreatedTime());
-        vo.setUpdatedTime(item.getUpdatedTime());
-        return vo;
-    }
-
-    /**
-     * 将StoreProductDelicacies转换为VO
-     */
-    private StoreProductDelicaciesVo convertToDelicaciesVo(StoreProductDelicacies delicacies) {
-        StoreProductDelicaciesVo vo = new StoreProductDelicaciesVo();
-        vo.setId(delicacies.getId());
-        vo.setExtId(delicacies.getExtId());
-        vo.setName(delicacies.getName());
-        vo.setPrice(delicacies.getPrice());
-        vo.setCostPrice(delicacies.getCostPrice());
-        vo.setUnit(delicacies.getUnit());
-        vo.setQuantity(delicacies.getQuantity());
-        vo.setCategory(delicacies.getCategory());
-        vo.setExtGroup(delicacies.getExtGroup());
-        vo.setStatus(delicacies.getStatus());
-        vo.setDeleteFlag(delicacies.getDeleteFlag());
-        vo.setCreatedUserId(delicacies.getCreatedUserId());
-        vo.setUpdatedUserId(delicacies.getUpdatedUserId());
-        vo.setCreatedTime(delicacies.getCreatedTime());
-        vo.setUpdatedTime(delicacies.getUpdatedTime());
-        return vo;
-    }
-
-}
-

+ 1 - 0
alien-store/src/main/java/shop/alien/store/util/CommonConstant.java

@@ -111,4 +111,5 @@ public class CommonConstant {
     public static final String LIKE_TYPE_STORE = "9";
     public static final String RATING_LIKE = "11";
     public static final String COMMENT_LIKE = "12";
+    public static final String DYNAMIC_LIKE = "13";
 }

+ 20 - 7
alien-util/pom.xml

@@ -46,6 +46,7 @@
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
+            <version>4.5.11</version>
         </dependency>
 
         <dependency>
@@ -103,8 +104,26 @@
 
         <dependency>
             <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-core</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis</artifactId>
+            <version>3.5.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-generator</artifactId>
-            <version>3.3.1.tmp</version>
+            <version>3.2.0</version>
         </dependency>
 
         <dependency>
@@ -295,12 +314,6 @@
         </dependency>
 
         <dependency>
-            <groupId>shop.alien</groupId>
-            <artifactId>alien-entity</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-java</artifactId>
             <version>3.8.1</version>

+ 39 - 0
alien-util/src/main/java/shop/alien/util/common/SpringContextUtil.java

@@ -0,0 +1,39 @@
+package shop.alien.util.common;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * Spring 上下文工具类
+ */
+@Component
+public class SpringContextUtil implements ApplicationContextAware {
+
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        SpringContextUtil.applicationContext = applicationContext;
+    }
+
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    public static Object getBean(String name) {
+        return applicationContext.getBean(name);
+    }
+
+    public static <T> T getBean(Class<T> clazz) {
+        if (applicationContext == null) {
+            return null;
+        }
+        return applicationContext.getBean(clazz);
+    }
+
+    public static <T> T getBean(String name, Class<T> clazz) {
+        return applicationContext.getBean(name, clazz);
+    }
+}

+ 2 - 2
alien-util/src/main/java/shop/alien/util/common/constant/CommentSourceTypeEnum.java

@@ -2,8 +2,8 @@ package shop.alien.util.common.constant;
 
 
 public enum CommentSourceTypeEnum {
-    STORE_COMMENT(1, "店铺评价");
-
+    STORE_COMMENT(1, "店铺评价"),
+    DYNAMIC_COMMENT(2, "动态评论");
     private final Integer type;
     private final String info;
 

+ 70 - 0
alien-util/src/main/java/shop/alien/util/encryption/EncryptTypeHandler.java

@@ -0,0 +1,70 @@
+package shop.alien.util.encryption;
+
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import shop.alien.util.common.SpringContextUtil;
+import shop.alien.util.encryption.properties.EncryptProperties;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * MyBatis 数据库字段加解密类型转换器
+ * 基于 AES/CBC/PKCS5Padding
+ * 使用方式:在实体类字段上添加 @TableField(typeHandler = EncryptTypeHandler.class)
+ */
+@MappedJdbcTypes(JdbcType.VARCHAR)
+@MappedTypes(String.class)
+public class EncryptTypeHandler extends BaseTypeHandler<String> {
+
+    private static final Logger log = LoggerFactory.getLogger(EncryptTypeHandler.class);
+
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException {
+        EncryptProperties properties = SpringContextUtil.getBean(EncryptProperties.class);
+        if (properties != null && properties.isEnabled() && parameter != null) {
+            String encrypted = StandardAesUtil.encrypt(parameter, properties.getKey(), properties.getIv());
+            ps.setString(i, encrypted);
+        } else {
+            ps.setString(i, parameter);
+        }
+    }
+
+    @Override
+    public String getNullableResult(ResultSet rs, String columnName) throws SQLException {
+        return decrypt(rs.getString(columnName));
+    }
+
+    @Override
+    public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+        return decrypt(rs.getString(columnIndex));
+    }
+
+    @Override
+    public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
+        return decrypt(cs.getString(columnIndex));
+    }
+
+    private String decrypt(String value) {
+        if (value == null || value.isEmpty()) {
+            return value;
+        }
+        EncryptProperties properties = SpringContextUtil.getBean(EncryptProperties.class);
+        if (properties != null && properties.isEnabled()) {
+            try {
+                String decrypted = StandardAesUtil.decrypt(value, properties.getKey(), properties.getIv());
+                return decrypted != null ? decrypted : value;
+            } catch (Exception e) {
+                log.error("数据库字段解密失败,返回原值: {}", e.getMessage());
+                return value;
+            }
+        }
+        return value;
+    }
+}