Browse Source

标签相关功能
装修相关功能

zhangchen 1 week ago
parent
commit
57a4114406
38 changed files with 1518 additions and 12 deletions
  1. 4 0
      alien-entity/src/main/java/shop/alien/entity/store/StoreDictionary.java
  2. 2 1
      alien-entity/src/main/java/shop/alien/entity/store/StoreImg.java
  3. 3 0
      alien-entity/src/main/java/shop/alien/entity/store/StoreInfo.java
  4. 62 0
      alien-entity/src/main/java/shop/alien/entity/store/StoreOfficialAlbum.java
  5. 64 0
      alien-entity/src/main/java/shop/alien/entity/store/TagBusinessRelation.java
  6. 90 0
      alien-entity/src/main/java/shop/alien/entity/store/TagCategory.java
  7. 126 0
      alien-entity/src/main/java/shop/alien/entity/store/TagStoreRelation.java
  8. 28 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreImgInfoVo.java
  9. 6 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMenuVo.java
  10. 17 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreOfficialAlbumVo.java
  11. 29 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/TagCategoryVo.java
  12. 24 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/TagStoreInfoVo.java
  13. 32 0
      alien-entity/src/main/java/shop/alien/mapper/StoreOfficialAlbumMapper.java
  14. 11 0
      alien-entity/src/main/java/shop/alien/mapper/TagBusinessRelationMapper.java
  15. 10 0
      alien-entity/src/main/java/shop/alien/mapper/TagCategoryMapper.java
  16. 12 0
      alien-entity/src/main/java/shop/alien/mapper/TagStoreRelationMapper.java
  17. 7 0
      alien-store/src/main/java/shop/alien/store/controller/StoreDictController.java
  18. 29 0
      alien-store/src/main/java/shop/alien/store/controller/StoreImgController.java
  19. 27 4
      alien-store/src/main/java/shop/alien/store/controller/StoreMenuController.java
  20. 63 0
      alien-store/src/main/java/shop/alien/store/controller/StoreOfficialAlbumController.java
  21. 131 0
      alien-store/src/main/java/shop/alien/store/controller/TagCategoryController.java
  22. 4 0
      alien-store/src/main/java/shop/alien/store/service/StoreDictService.java
  23. 8 0
      alien-store/src/main/java/shop/alien/store/service/StoreImgService.java
  24. 2 0
      alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java
  25. 16 0
      alien-store/src/main/java/shop/alien/store/service/StoreMenuService.java
  26. 16 0
      alien-store/src/main/java/shop/alien/store/service/StoreOfficialAlbumService.java
  27. 16 0
      alien-store/src/main/java/shop/alien/store/service/StoreTagBusinessRelationService.java
  28. 19 0
      alien-store/src/main/java/shop/alien/store/service/StoreTagService.java
  29. 16 0
      alien-store/src/main/java/shop/alien/store/service/TagStoreRelationService.java
  30. 62 2
      alien-store/src/main/java/shop/alien/store/service/impl/StoreDictServiceImpl.java
  31. 21 2
      alien-store/src/main/java/shop/alien/store/service/impl/StoreImgServiceImpl.java
  32. 18 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java
  33. 102 3
      alien-store/src/main/java/shop/alien/store/service/impl/StoreMenuServiceImpl.java
  34. 80 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreOfficialAlbumServiceImpl.java
  35. 69 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreTagBusinessRelationServiceImpl.java
  36. 167 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreTagServiceImpl.java
  37. 75 0
      alien-store/src/main/java/shop/alien/store/service/impl/TagStoreRelationServiceImpl.java
  38. 50 0
      alien-store/src/main/java/shop/alien/store/util/CommonConstant.java

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreDictionary.java

@@ -11,6 +11,7 @@ import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -75,6 +76,9 @@ public class StoreDictionary extends Model<StoreDictionary> {
     @TableField("updated_user_id")
     private Integer updatedUserId;
 
+    @ApiModelProperty(value = "子节点")
+    @TableField(exist = false)
+    private List<StoreDictionary> storeDictionaryList;
 
     @Override
     protected Serializable pkVal() {

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

@@ -1,6 +1,7 @@
 package shop.alien.entity.store;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
@@ -19,7 +20,7 @@ import java.util.Date;
 @JsonInclude
 @TableName("store_img")
 @ApiModel(value = "StoreImg对象", description = "门店图片")
-public class StoreImg {
+public class StoreImg extends Model<StoreImg> {
 
     @ApiModelProperty(value = "主键")
     @TableId(value = "id", type = IdType.AUTO)

+ 3 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreInfo.java

@@ -185,4 +185,7 @@ public class StoreInfo {
     @TableField("contract_reason")
     private String contractReason;
 
+    @ApiModelProperty(value = "图片模式")
+    @TableField("img_mode")
+    private Integer ImgMode;
 }

+ 62 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreOfficialAlbum.java

@@ -0,0 +1,62 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+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.util.Date;
+
+/**
+ * 官方相册信息
+ */
+
+@Data
+@JsonInclude
+@TableName("store_official_album")
+@ApiModel(value = "store_official_album", description = "store_official_album")
+public class StoreOfficialAlbum extends Model<StoreOfficialAlbum> {
+    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("album_name")
+    private String albumName;
+
+    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
+    @TableField("delete_flag")
+    @TableLogic
+    private Integer deleteFlag;
+
+    @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 = "创建人ID")
+    @TableField("created_user_id")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    @TableField("updated_user_id")
+    private Integer updatedUserId;
+
+    @ApiModelProperty(value = "店铺ID")
+    @TableField("img_count")
+    private Integer imgCount;
+}

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

@@ -0,0 +1,64 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+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.util.Date;
+
+/**
+ * 标签
+ */
+@Data
+@JsonInclude
+@TableName("tag_business_relation")
+@ApiModel(value = "tag_business_relation", description = "tag_business_relation")
+public class TagBusinessRelation extends Model<TagBusinessRelation> {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "标签id")
+    @TableField("tag_id")
+    private Integer tagId;
+
+    @ApiModelProperty(value = "删除标识")
+    @TableField("delete_flag")
+    private Integer  deleteFlag;
+
+    @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 = "创建人ID")
+    @TableField("created_user_id")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    @TableField("updated_user_id")
+    private Integer updatedUserId;
+
+
+    @ApiModelProperty(value = "标签类型")
+    @TableField("business_section")
+    private Integer businessSection;
+
+    @ApiModelProperty(value = "标签类型")
+    @TableField("business_section_name")
+    private Integer businessSectionName;
+
+    @ApiModelProperty(value = "标签名称")
+    @TableField("tag_name")
+    private String tagName;
+}

+ 90 - 0
alien-entity/src/main/java/shop/alien/entity/store/TagCategory.java

@@ -0,0 +1,90 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 标签
+ */
+@Data
+@JsonInclude
+@TableName("tag_category")
+@ApiModel(value = "tag_category", description = "tag_category")
+public class TagCategory extends Model<TagCategory> {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "标签名称")
+    @TableField("tag_name")
+    @JsonProperty("label")
+    private String tagName;
+
+    @ApiModelProperty(value = "标签排序")
+    @TableField("tag_sort")
+    private Integer tagSort;
+
+    @ApiModelProperty(value = "删除标识")
+    @TableLogic
+    @TableField("delete_flag")
+    private Integer  deleteFlag;
+
+    @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 = "创建人ID")
+    @TableField("created_user_id")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    @TableField("updated_user_id")
+    private Integer updatedUserId;
+
+    @ApiModelProperty(value = "标签类型")
+    @TableField("label_type")
+    private String labelType;
+
+    @ApiModelProperty(value = "标签按钮类型")
+    @TableField("label_button_type")
+    private String labelButtonType;
+
+
+    @ApiModelProperty(value = "按钮名称1")
+    @JsonProperty("labelButtonOption_1")
+    @TableField("label_button_option_one")
+    private String labelButtonOptionOne;
+
+    @ApiModelProperty(value = "按钮名称2")
+    @JsonProperty("labelButtonOption_2")
+    @TableField("label_button_option_two")
+    private String labelButtonOptionTwo;
+
+    @ApiModelProperty(value = "标签描述")
+    @TableField("label_describe")
+    private String labelDescribe;
+
+    @ApiModelProperty(value = "预留字段1")
+    @JsonProperty("field_1")
+    @TableField("field_one")
+    private String fieldOne;
+
+    @ApiModelProperty(value = "预留字段2")
+    @JsonProperty("field_2")
+    @TableField("field_two")
+    private String fieldTwo;
+}

+ 126 - 0
alien-entity/src/main/java/shop/alien/entity/store/TagStoreRelation.java

@@ -0,0 +1,126 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+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.util.Date;
+
+/**
+ * 门店标签信息表
+ */
+@Data
+@JsonInclude
+@TableName("tag_category")
+@ApiModel(value = "tag_store_relation", description = "tag_store_relation")
+public class TagStoreRelation extends Model<TagStoreRelation> {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "店铺ID")
+    @TableField("store_id")
+    private Integer storeId;
+
+    @ApiModelProperty(value = "标签信息1")
+    @TableField("tag_column1")
+    private String  tagColumn1;
+
+    @ApiModelProperty(value = "标签信息2")
+    @TableField("tag_column2")
+    private String tagColumn2;
+
+    @ApiModelProperty(value = "标签信息3")
+    @TableField("tag_column3")
+    private String  tagColumn3;
+
+    @ApiModelProperty(value = "标签信息4")
+    @TableField("tag_column4")
+    private String tagColumn4;
+
+    @ApiModelProperty(value = "标签信息5")
+    @TableField("tag_column5")
+    private String  tagColumn5;
+
+    @ApiModelProperty(value = "标签信息6")
+    @TableField("tag_column6")
+    private String tagColumn6;
+
+    @ApiModelProperty(value = "标签信息7")
+    @TableField("tag_column7")
+    private String  tagColumn7;
+
+    @ApiModelProperty(value = "标签信息8")
+    @TableField("tag_column8")
+    private String tagColumn8;
+
+    @ApiModelProperty(value = "标签信息9")
+    @TableField("tag_column9")
+    private String  tagColumn9;
+
+    @ApiModelProperty(value = "标签信息10")
+    @TableField("tag_column10")
+    private String tagColumn10;
+
+    @ApiModelProperty(value = "标签信息11")
+    @TableField("tag_column11")
+    private String  tagColumn11;
+
+    @ApiModelProperty(value = "标签信息12")
+    @TableField("tag_column12")
+    private String tagColumn12;
+
+    @ApiModelProperty(value = "标签信息13")
+    @TableField("tag_column13")
+    private String  tagColumn13;
+
+    @ApiModelProperty(value = "标签信息14")
+    @TableField("tag_column14")
+    private String tagColumn14;
+
+    @ApiModelProperty(value = "标签信息15")
+    @TableField("tag_column15")
+    private String  tagColumn15;
+
+    @ApiModelProperty(value = "标签信息16")
+    @TableField("tag_column16")
+    private String tagColumn16;
+
+    @ApiModelProperty(value = "标签信息17")
+    @TableField("tag_column17")
+    private String  tagColumn17;
+
+    @ApiModelProperty(value = "标签信息18")
+    @TableField("tag_column18")
+    private String tagColumn18;
+
+    @ApiModelProperty(value = "标签信息19")
+    @TableField("tag_column19")
+    private String  tagColumn19;
+
+    @ApiModelProperty(value = "标签信息20")
+    @TableField("tag_column20")
+    private String tagColumn20;
+
+    @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 = "创建人ID")
+    @TableField("created_user_id")
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    @TableField("updated_user_id")
+    private Integer updatedUserId;
+}

+ 28 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreImgInfoVo.java

@@ -0,0 +1,28 @@
+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 lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import shop.alien.entity.store.StoreImg;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@JsonInclude
+@NoArgsConstructor
+@ApiModel(value = "StoreImgInfoVo", description = "店铺及图片信息vo")
+public class StoreImgInfoVo{
+
+    @ApiModelProperty(value = "图片列表")
+    private List<StoreImg> storeImgList;
+    @ApiModelProperty(value = "店铺ID")
+    private Integer storeId;
+    @ApiModelProperty(value = "图片类型")
+    private Integer imgType;
+    @ApiModelProperty(value = "图片模式")
+    private Integer imgMode;
+}

+ 6 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreMenuVo.java

@@ -28,6 +28,12 @@ public class StoreMenuVo extends StoreMenu {
     @ApiModelProperty(value = "是否点赞")
     private Integer isLike;
 
+    @ApiModelProperty(value = "菜品数量")
+    private Integer menuCount;
+
+    @ApiModelProperty(value = "推荐数量")
+    private Integer suggestCount;
+
     @ApiModelProperty(value = "菜品排序")
     private List<StoreMenuVo> sortList;
 

+ 17 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreOfficialAlbumVo.java

@@ -0,0 +1,17 @@
+package shop.alien.entity.store.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import shop.alien.entity.store.StoreOfficialAlbum;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="StoreOfficialAlbumVo对象", description="官方相册vo")
+public class StoreOfficialAlbumVo extends StoreOfficialAlbum {
+    @ApiModelProperty(value = "图片链接")
+    private String imgUrl;
+}

+ 29 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/TagCategoryVo.java

@@ -0,0 +1,29 @@
+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 lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import shop.alien.entity.store.TagCategory;
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@JsonInclude
+@NoArgsConstructor
+@ApiModel(value = "TagCategoryVo", description = "标签对象")
+public class TagCategoryVo {
+
+    @ApiModelProperty(value = "新增标签列表")
+    private List<TagCategory> addTagCategoryList;
+
+    @ApiModelProperty(value = "删除标签列表")
+    private List<TagCategory> deleteTagCategoryList;
+
+    @ApiModelProperty(value = "更新标签列表")
+    private List<TagCategory> updateTagCategoryList;
+
+}

+ 24 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/TagStoreInfoVo.java

@@ -0,0 +1,24 @@
+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 lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@JsonInclude
+@NoArgsConstructor
+@ApiModel(value = "TagStoreInfoVo", description = "标签商户信息对象")
+public class TagStoreInfoVo {
+    @ApiModelProperty(value = "新增标签列表")
+    private String tagId;
+
+    @ApiModelProperty(value = "删除标签列表")
+    private String labelOption;
+
+    @ApiModelProperty(value = "更新标签列表")
+    private String isNull;
+}

+ 32 - 0
alien-entity/src/main/java/shop/alien/mapper/StoreOfficialAlbumMapper.java

@@ -0,0 +1,32 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import shop.alien.entity.store.StoreOfficialAlbum;
+import shop.alien.entity.store.vo.StoreOfficialAlbumVo;
+
+import java.util.List;
+
+/**
+ * 官方相册信息
+ */
+@Mapper
+public interface StoreOfficialAlbumMapper extends BaseMapper<StoreOfficialAlbum> {
+
+    /**
+     * 获取菜单
+     *
+     * @param storeId  门店id
+     * @return List<StoreOfficialAlbumVo>
+     */
+    //"图片类型, 0:其他, 1:入口图, 2:相册, 3:菜品, 4:环境, 5:价目表, 6:推荐菜, 7:菜单, 8:用户评论, 9:商家申诉, 10:商家头像, 11:店铺轮播图"
+    @Select("SELECT a.*, b.img_url FROM store_official_album a LEFT JOIN store_img b ON b.id = " +
+            "(SELECT b2.id FROM store_img b2 WHERE b2.business_id = a.id and b2.img_type = '2' " +
+            "order by b2.img_sort LIMIT 1) where a.delete_flag = '0' and  a.store_id = #{storeId}")
+    List<StoreOfficialAlbumVo> getStoreOfficialAlbumList(@Param("storeId") Integer storeId);
+
+    @Select("select si.business_id as id ,count(*) as img_count from store_img si where si.delete_flag = '0' and si.store_id = #{storeId} group by si.business_id ")
+    List<StoreOfficialAlbum> getStoreOfficialAlbumImgCount(@Param("storeId") Integer storeId);
+}

+ 11 - 0
alien-entity/src/main/java/shop/alien/mapper/TagBusinessRelationMapper.java

@@ -0,0 +1,11 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import shop.alien.entity.store.TagBusinessRelation;
+
+/**
+ * 标签 Mapper 接口
+ */
+public interface TagBusinessRelationMapper extends BaseMapper<TagBusinessRelation> {
+}

+ 10 - 0
alien-entity/src/main/java/shop/alien/mapper/TagCategoryMapper.java

@@ -0,0 +1,10 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import shop.alien.entity.store.TagCategory;
+
+/**
+ * 标签 Mapper 接口
+ */
+public interface TagCategoryMapper extends BaseMapper<TagCategory> {
+}

+ 12 - 0
alien-entity/src/main/java/shop/alien/mapper/TagStoreRelationMapper.java

@@ -0,0 +1,12 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import shop.alien.entity.store.TagBusinessRelation;
+import shop.alien.entity.store.TagStoreRelation;
+
+/**
+ * 标签 Mapper 接口
+ */
+public interface TagStoreRelationMapper extends BaseMapper<TagStoreRelation> {
+}

+ 7 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreDictController.java

@@ -11,6 +11,7 @@ import shop.alien.store.service.StoreDictService;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 字典Controller
@@ -92,4 +93,10 @@ public class StoreDictController {
         return R.success("删除成功");
     }
 
+    @ApiOperation("获取字典集合")
+    @ApiOperationSupport(order = 1)
+    @GetMapping("/getDictList")
+    public R<Map<String, List<StoreDictionary>>> getDictList(@RequestParam(value = "typeNameList") List<String> typeNameList) {
+        return R.data(storeDictService.getDictList(typeNameList));
+    }
 }

+ 29 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreImgController.java

@@ -6,8 +6,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.vo.StoreImgInfoVo;
 import shop.alien.entity.store.vo.StoreImgTypeVo;
 import shop.alien.store.service.StoreImgService;
+import shop.alien.store.service.StoreInfoService;
 
 import java.util.List;
 
@@ -27,6 +29,8 @@ import java.util.List;
 public class StoreImgController {
 
     private final StoreImgService storeImgService;
+    private final StoreInfoService storeInfoService;
+
 
     @ApiOperation("获取图片")
     @ApiOperationSupport(order = 1)
@@ -62,6 +66,31 @@ public class StoreImgController {
         return R.fail("失败");
     }
 
+    @ApiOperation("新增/修改/删除图片")
+    @ApiOperationSupport(order = 3)
+    @PostMapping("/saveOrUpdateImg")
+    public R<String> saveOrUpdateImg(@RequestBody StoreImgInfoVo storeImgInfoVo) {
+        log.info("StoreImgController.saveOrUpdateImg?storeImgInfoVo={}", storeImgInfoVo);
+        List<StoreImg> storeImgList = storeImgInfoVo.getStoreImgList();
+        if (storeImgInfoVo.getStoreId()==null || storeImgInfoVo.getImgType()==null) {
+            return R.fail("失败");
+        }
+        // 清空storeid,imgType下图片
+        int deleteCount = storeImgService.saveOrUpdateImg(storeImgInfoVo.getStoreId(),storeImgInfoVo.getImgType());
+        log.info("StoreImgController.updateStoreImgModeInfo?deleteCount={}", deleteCount);
+        int result = storeInfoService.updateStoreImgModeInfo(storeImgInfoVo);
+        log.info("StoreImgController.updateStoreImgModeInfo?result={}", result);
+        Integer id = storeImgList.get(0).getId();
+        if (storeImgService.saveOrUpdateBatch(storeImgList)) {
+            if (null != id) {
+                return R.success("修改成功");
+            }
+            return R.success("新增成功");
+        }
+        return R.fail("失败");
+    }
+
+
     @ApiOperation(value = "删除图片")
     @ApiOperationSupport(order = 4)
     @PostMapping("/delete")

+ 27 - 4
alien-store/src/main/java/shop/alien/store/controller/StoreMenuController.java

@@ -33,7 +33,7 @@ public class StoreMenuController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true),
             @ApiImplicitParam(name = "dishType", value = "菜品类型, 0:菜单, 1:推荐", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "phoneId", value = "消息标识", dataType = "Integer", paramType = "query", required = true)
+            @ApiImplicitParam(name = "phoneId", value = "消息标识", dataType = "Integer", paramType = "query")
     })
     @GetMapping("/getMenuByStoreId")
     public R<List<StoreMenuVo>> getMenuByStoreId(Integer storeId, Integer dishType, String phoneId) {
@@ -44,9 +44,9 @@ public class StoreMenuController {
     @ApiOperation("新增或修改门店菜单")
     @ApiOperationSupport(order = 2)
     @PostMapping("/saveOrUpdate")
-    public R<String> saveOrUpdate(@RequestBody StoreMenu storeMenu) {
-        log.info("StoreRecommendController.saveOrUpdate?storeMenu={}", storeMenu);
-        return storeMenuService.saveOrUpdateMenu(storeMenu);
+    public R<String> saveOrUpdate(@RequestBody StoreMenuVo storeMenuVo) {
+        log.info("StoreRecommendController.saveOrUpdateMenu?storeMenu={}", storeMenuVo);
+        return storeMenuService.saveOrUpdateMenus(storeMenuVo);
     }
 
     @ApiOperation(value = "删除门店菜单")
@@ -86,5 +86,28 @@ public class StoreMenuController {
         }
     }
 
+    @ApiOperation("保存菜品排序")
+    @ApiOperationSupport(order = 6)
+    @PostMapping("/saveMenuSort")
+    public R<Boolean> saveMenuSort(@RequestBody List<StoreMenu> storeMenuList) {
+        log.info("StoreRecommendController.saveMenuSort?storeMenuList={}", storeMenuList);
+        Boolean flag = false;
+        flag = storeMenuService.saveMenuSort(storeMenuList);
+        if(flag){
+            return R.success("已更新排序");
+        }else{
+            return R.fail("排序失败");
+        }
+    }
 
+    @ApiOperation("获取门店菜品推荐数量")
+    @ApiOperationSupport(order = 1)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true)
+    })
+    @GetMapping("/getMenuCountByStoreId")
+    public R<StoreMenuVo> getMenuCountByStoreId(Integer storeId) {
+        log.info("StoreRecommendController.getMenuCountByStoreId?id={}", storeId);
+        return R.data(storeMenuService.getMenuCountByStoreId(storeId));
+    }
 }

+ 63 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreOfficialAlbumController.java

@@ -0,0 +1,63 @@
+package shop.alien.store.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiOperationSupport;
+import io.swagger.annotations.ApiSort;
+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.StoreOfficialAlbum;
+import shop.alien.entity.store.vo.StoreOfficialAlbumVo;
+import shop.alien.store.service.StoreOfficialAlbumService;
+
+import java.util.List;
+
+/**
+ * 标签前端控制器
+ *
+ * @author zhangchen
+ * @since 2025-07-16
+ */
+@Slf4j
+@Api(tags = {"二期-官方相册"})
+@ApiSort(1)
+@CrossOrigin
+@RestController
+@RequestMapping("/store/official")
+@RequiredArgsConstructor
+public class StoreOfficialAlbumController {
+    private final StoreOfficialAlbumService storeOfficialAlbumService;
+
+
+    @ApiOperation("创建/更新官方相册")
+    @ApiOperationSupport(order = 1)
+    @PostMapping("/createOrUpdateOfficialAlbum")
+    public R<StoreOfficialAlbum> createOrUpdateOfficialAlbum(@RequestBody StoreOfficialAlbum storeOfficialAlbum) {
+        log.info("StoreOfficialAlbumController.createOfficialAlbum?storeOfficialAlbum={}", storeOfficialAlbum);
+        StoreOfficialAlbum storeOfficial = storeOfficialAlbumService.createOrUpdateOfficialAlbum(storeOfficialAlbum);
+        return R.data(storeOfficial);
+    }
+
+    @ApiOperation("获取官方相册列表")
+    @ApiOperationSupport(order = 2)
+    @GetMapping("/getOfficialAlbumList")
+    public R<List<StoreOfficialAlbumVo>> getOfficialAlbumList(String storeId) {
+        log.info("StoreOfficialAlbumController.getOfficialAlbumList");
+        List<StoreOfficialAlbumVo> storeOfficialAlbumList = storeOfficialAlbumService.getOfficialAlbumList(storeId);
+        return R.data(storeOfficialAlbumList);
+    }
+
+    @ApiOperation("删除官方相册")
+    @ApiOperationSupport(order = 3)
+    @PostMapping("/deleteOfficialAlbum")
+    public  R<Boolean> deleteOfficialAlbum(@RequestBody List<StoreOfficialAlbum> storeOfficialAlbumList) {
+        log.info("StoreOfficialAlbumController.deleteOfficialAlbum");
+        int result = storeOfficialAlbumService.deleteOfficialAlbum(storeOfficialAlbumList);
+        if (result > 0) {
+            return R.data(true);
+        }
+        return R.fail("失败");
+    }
+}

+ 131 - 0
alien-store/src/main/java/shop/alien/store/controller/TagCategoryController.java

@@ -0,0 +1,131 @@
+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.*;
+import shop.alien.store.service.StoreTagBusinessRelationService;
+import shop.alien.store.service.StoreTagService;
+import shop.alien.store.service.TagStoreRelationService;
+
+/**
+ * 标签前端控制器
+ *
+ * @author zhangchen
+ * @since 2025-07-16
+ */
+@Slf4j
+@Api(tags = {"二期-标签信息"})
+@ApiSort(1)
+@CrossOrigin
+@RestController
+@RequestMapping("/store/tag")
+@RequiredArgsConstructor
+public class TagCategoryController {
+    private final StoreTagService tagCategoryService;
+    private final StoreTagBusinessRelationService storeTagBusinessRelationService;
+    private final TagStoreRelationService tagStoreRelationService;
+
+    @ApiOperation("创建标签")
+    @ApiOperationSupport(order = 1)
+    @PostMapping("/createTag")
+    public R<TagCategory> createTag(@RequestBody TagCategory tagCategory) {
+        log.info("TagCategoryController.createTag?tagCategoryVO={}", tagCategory);
+        TagCategory tag = tagCategoryService.createTag(tagCategory);
+        return R.data(tag);
+    }
+
+    @ApiOperation("获取标签列表")
+    @ApiOperationSupport(order = 2)
+    @GetMapping("/getTagList")
+    public R<IPage<TagCategory>> getTagList(@RequestParam(defaultValue = "1") int pageNum,
+                                            @RequestParam(defaultValue = "10") int pageSize,
+                                            @RequestParam(required = false) String label,
+                                            @RequestParam(required = false) String labelType,
+                                            @RequestParam(required = false) String labelButtonType
+
+    ) {
+        log.info("TagCategoryController.getTagList");
+        IPage<TagCategory> storeCouponList = tagCategoryService.getTagList(pageNum, pageSize,label,labelType,labelButtonType);
+        return R.data(storeCouponList);
+    }
+
+    @ApiOperation("删除标签")
+    @ApiOperationSupport(order = 3)
+    @PostMapping("/deleteTagCategory")
+    public  R<Boolean> deleteTagCategory(@RequestBody TagCategory tagCategory) {
+        log.info("TagCategoryController.deleteTagCategory");
+        int result = tagCategoryService.deleteTag(tagCategory);
+        if (result > 0) {
+            return R.data(true);
+        }
+        return R.fail("失败");
+    }
+
+    @ApiOperation("修改标签")
+    @ApiOperationSupport(order = 4)
+    @PostMapping("/updateTagCategory")
+    public R<Boolean> updateTagCategory(@RequestBody TagCategory tagCategory) {
+        log.info("TagCategoryController.updateTagCategory?tagCategory={}", tagCategory);
+        int num = tagCategoryService.updateTagCategory(tagCategory);
+        if (num > 0) {
+            return R.data(true);
+        }
+        return R.fail("失败");
+    }
+
+    @ApiOperation("创建标签经营类型关系")
+    @ApiOperationSupport(order = 5)
+    @PostMapping("/createTagBusinessRelation")
+    public R<TagBusinessRelation> createTagBusinessRelation(@RequestBody TagBusinessRelation tagBusinessRelation) {
+        log.info("TagCategoryController.createTagBusinessRelation?tagBusinessRelation={}", tagBusinessRelation);
+        TagBusinessRelation tag = storeTagBusinessRelationService.createTagBusinessRelation(tagBusinessRelation);
+        return R.data(tag);
+    }
+
+
+    @ApiOperation("获取标签经营类型关系")
+    @ApiOperationSupport(order = 6)
+    @GetMapping("/getTagBusinessRelationList")
+    public R<IPage<TagBusinessRelation>> getTagBusinessRelationList(@RequestParam(defaultValue = "1") int page,
+                                            @RequestParam(defaultValue = "10") int size, @RequestParam(required = false) int businessSection,
+                                            @RequestParam(required = false) String businessSectionName
+    ) {
+        log.info("TagCategoryController.getTagBusinessRelationList");
+        IPage<TagBusinessRelation> tagBusinessRelationList = storeTagBusinessRelationService.getTagBusinessRelationList(page, size, businessSection, businessSectionName);
+        return R.data(tagBusinessRelationList);
+    }
+
+    @ApiOperation("删除标签经营类型关系")
+    @ApiOperationSupport(order = 7)
+    @PostMapping("/deleteTagBusinessRelation")
+    public  R<Boolean> deleteTagBusinessRelation(@RequestBody TagBusinessRelation tagBusinessRelation) {
+        log.info("TagCategoryController.deleteTagBusinessRelation");
+        int result = storeTagBusinessRelationService.deleteTagBusinessRelation(tagBusinessRelation);
+        if (result > 0) {
+            return R.data(true);
+        }
+        return R.fail("失败");
+    }
+
+    @ApiOperation("创建/更新店铺标签关系")
+    @ApiOperationSupport(order = 8)
+    @PostMapping("/createOrUpdateTagStoreRelation")
+    public R<TagStoreRelation> createOrUpdateTagStoreRelation(@RequestBody TagStoreRelation tagStoreRelation) {
+        log.info("TagCategoryController.createOrUpdateTagStoreRelation?tagStoreRelation={}", tagStoreRelation);
+        TagStoreRelation tag = tagStoreRelationService.createOrUpdateTagStoreRelation(tagStoreRelation);
+        return R.data(tag);
+    }
+
+    @ApiOperation("获取标签经营类型关系")
+    @ApiOperationSupport(order = 9)
+    @GetMapping("/getTagStoreRelationByStoreId")
+    public R<TagStoreRelation> getTagStoreRelationByStoreId(int storeId) {
+        log.info("TagCategoryController.getTagStoreRelationByStoreId={}", storeId);
+        TagStoreRelation tagStoreRelation = tagStoreRelationService.getTagStoreRelationByStoreId(storeId);
+        return R.data(tagStoreRelation);
+    }
+}

+ 4 - 0
alien-store/src/main/java/shop/alien/store/service/StoreDictService.java

@@ -2,8 +2,10 @@ package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import shop.alien.entity.store.StoreDictionary;
+import shop.alien.entity.store.vo.StoreDictionaryVo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 字典Service
@@ -38,4 +40,6 @@ public interface StoreDictService extends IService<StoreDictionary> {
      */
     boolean deleteDict(Integer id);
 
+    Map<String, List<StoreDictionary>> getDictList(List<String> typeNameList);
+
 }

+ 8 - 0
alien-store/src/main/java/shop/alien/store/service/StoreImgService.java

@@ -62,4 +62,12 @@ public interface StoreImgService extends IService<StoreImg> {
      * @return list
      */
     List<StoreImg> getByBusinessId(Integer storeId, Integer imgType, Integer businessId);
+
+    /**
+     * 删除图片
+     *
+     * @param storeId 门店id
+     * @param imgType 图片类型, 0:其他, 1:入口图, 2:相册, 3:菜品, 4:环境, 5:价目表, 6:推荐菜, 7:菜单, 8:用户评论, 9:商家申诉, 10:商家头像, 11:店铺轮播图
+     */
+    int saveOrUpdateImg(Integer storeId, Integer imgType);
 }

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

@@ -253,4 +253,6 @@ public interface StoreInfoService extends IService<StoreInfo> {
      *
      */
     Map<String,Object> getStoreContractStatus(int id);
+    int updateStoreImgModeInfo(StoreImgInfoVo storeImgInfoVo);
+
 }

+ 16 - 0
alien-store/src/main/java/shop/alien/store/service/StoreMenuService.java

@@ -41,6 +41,12 @@ public interface StoreMenuService extends IService<StoreMenu> {
     R<String> saveOrUpdateMenu(StoreMenu storeMenu);
 
     /**
+     * 新增或修改门店菜单
+     *
+     */
+    R<String> saveOrUpdateMenus(StoreMenuVo storeMenuVo);
+
+    /**
      *
      * 菜品排序
      */
@@ -48,8 +54,18 @@ public interface StoreMenuService extends IService<StoreMenu> {
 
     /**
      *
+     * 保存菜品排序
+     */
+    Boolean saveMenuSort(List<StoreMenu> storeMenuList);
+
+    /**
+     *
      * 删除门店菜单
      */
     Boolean deleteMenu(List<Integer> ids, int dishType);
+
+
+
+    StoreMenuVo getMenuCountByStoreId(int storeId);
 }
 

+ 16 - 0
alien-store/src/main/java/shop/alien/store/service/StoreOfficialAlbumService.java

@@ -0,0 +1,16 @@
+package shop.alien.store.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.store.StoreOfficialAlbum;
+import shop.alien.entity.store.vo.StoreOfficialAlbumVo;
+
+import java.util.List;
+
+/**
+ * 官方相册服务
+ */
+public interface StoreOfficialAlbumService extends IService<StoreOfficialAlbum> {
+    StoreOfficialAlbum createOrUpdateOfficialAlbum(StoreOfficialAlbum storeOfficialAlbum);
+    List<StoreOfficialAlbumVo> getOfficialAlbumList(String storeId);
+    int deleteOfficialAlbum(List<StoreOfficialAlbum> storeOfficialAlbumList);
+}

+ 16 - 0
alien-store/src/main/java/shop/alien/store/service/StoreTagBusinessRelationService.java

@@ -0,0 +1,16 @@
+package shop.alien.store.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.store.TagBusinessRelation;
+
+/**
+ * 标签服务
+ */
+
+public interface StoreTagBusinessRelationService extends IService<TagBusinessRelation> {
+    TagBusinessRelation createTagBusinessRelation(TagBusinessRelation tagBusinessRelation);
+    IPage<TagBusinessRelation> getTagBusinessRelationList(int page, int size, int businessSection, String businessSectionName);
+    int deleteTagBusinessRelation(TagBusinessRelation tagBusinessRelation);
+}

+ 19 - 0
alien-store/src/main/java/shop/alien/store/service/StoreTagService.java

@@ -0,0 +1,19 @@
+package shop.alien.store.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.store.StoreGroupPackage;
+import shop.alien.entity.store.TagCategory;
+
+/**
+ * 标签服务
+ */
+
+public interface StoreTagService extends IService<TagCategory> {
+
+    TagCategory createTag(TagCategory tagCategory);
+    IPage<TagCategory> getTagList(int page, int size,String label,String labelType, String labelButtonType);
+    int deleteTag(TagCategory tagCategory);
+    int updateTagCategory(TagCategory tagCategory);
+}

+ 16 - 0
alien-store/src/main/java/shop/alien/store/service/TagStoreRelationService.java

@@ -0,0 +1,16 @@
+package shop.alien.store.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import shop.alien.entity.store.TagBusinessRelation;
+import shop.alien.entity.store.TagStoreRelation;
+
+/**
+ * 店铺标签服务接口
+ */
+
+public interface TagStoreRelationService {
+
+    TagStoreRelation createOrUpdateTagStoreRelation(TagStoreRelation tagStoreRelation);
+    TagStoreRelation getTagStoreRelationByStoreId(int storeId);
+}

+ 62 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreDictServiceImpl.java

@@ -1,15 +1,20 @@
 package shop.alien.store.service.impl;
 
+import com.alibaba.excel.util.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.StoreDictionary;
+import shop.alien.entity.store.StoreMenu;
+import shop.alien.entity.store.vo.StoreDictionaryVo;
 import shop.alien.mapper.StoreDictionaryMapper;
 import shop.alien.store.service.StoreDictService;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 字典ServiceImpl
@@ -62,4 +67,59 @@ public class StoreDictServiceImpl extends ServiceImpl<StoreDictionaryMapper, Sto
     public boolean deleteDict(Integer id) {
         return this.removeById(id);
     }
+
+    @Override
+    public Map<String, List<StoreDictionary>> getDictList(List<String> typeNameList) {
+        if (CollectionUtils.isEmpty(typeNameList)){
+            // 为空,给与默认值
+            String typeName = "storeArea,businessStatus,week,specialDate,business_section,fine_food";
+            typeNameList = Arrays.stream(typeName.split(","))
+                    .map(String::trim)  // 去除每个元素前后的空格
+                    .filter(s -> !s.isEmpty())  // 过滤掉空字符串
+                    .collect(Collectors.toList());
+        }
+
+        List<StoreDictionary> storeDictionaryList =  storeDictionaryMapper.selectList(
+                new LambdaQueryWrapper<StoreDictionary>().in(StoreDictionary::getTypeName, typeNameList).eq(StoreDictionary::getDeleteFlag,0));
+
+        List<StoreDictionary> storeDictionaries = buildTreeOptimized(storeDictionaryList);
+        return storeDictionaries.stream()
+                .collect(Collectors.groupingBy(StoreDictionary::getTypeName));
+    }
+
+    public List<StoreDictionary> buildTreeOptimized(List<StoreDictionary> flatList) {
+        // 创建三个存储结构
+        Map<Integer, StoreDictionary> nodeMap = new HashMap<>();  // ID到节点的映射
+        Map<Integer, List<StoreDictionary>> parentChildMap = new HashMap<>();  // 父ID到子节点列表的映射
+        List<StoreDictionary> result = new ArrayList<>();  // 结果列表
+
+        // 第一次遍历:填充nodeMap和parentChildMap
+        for (StoreDictionary entity : flatList) {
+            Integer id = entity.getId();
+            Integer parentId = entity.getParentId();
+
+            // 存入节点映射
+            nodeMap.put(id, entity);
+
+            // 初始化子节点列表
+            entity.setStoreDictionaryList(new ArrayList<>());
+
+            // 如果是根节点,直接添加到结果
+            if (parentId == null || parentId==0 || !nodeMap.containsKey(parentId)) {
+                result.add(entity);
+            } else {
+                // 否则,记录父子关系
+                parentChildMap.computeIfAbsent(parentId, k -> new ArrayList<>()).add(entity);
+            }
+        }
+
+        // 第二次遍历:建立父子关系
+        for (StoreDictionary entity : flatList) {
+            Integer id = entity.getId();
+            if (parentChildMap.containsKey(id)) {
+                entity.getStoreDictionaryList().addAll(parentChildMap.get(id));
+            }
+        }
+        return result;
+    }
 }

+ 21 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreImgServiceImpl.java

@@ -2,17 +2,21 @@ 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.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.LifeClassManage;
 import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.StoreOfficialAlbum;
 import shop.alien.entity.store.vo.StoreImgTypeVo;
 import shop.alien.mapper.LifeUserMapper;
 import shop.alien.mapper.StoreImgMapper;
+import shop.alien.mapper.StoreOfficialAlbumMapper;
 import shop.alien.store.service.StoreImgService;
 
 import java.util.Comparator;
@@ -32,6 +36,7 @@ import java.util.stream.Collectors;
 public class StoreImgServiceImpl extends ServiceImpl<StoreImgMapper, StoreImg> implements StoreImgService {
 
     private final StoreImgMapper storeImgMapper;
+    private final StoreOfficialAlbumMapper storeOfficialAlbumMapper;
     private final LifeUserMapper lifeUserMapper;
 
     /**
@@ -44,7 +49,7 @@ public class StoreImgServiceImpl extends ServiceImpl<StoreImgMapper, StoreImg> i
     @Override
     public List<StoreImg> getStoreImg(Integer storeId, Integer imgType) {
         LambdaQueryWrapper<StoreImg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, imgType);
+        lambdaQueryWrapper.eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, imgType).orderByAsc(StoreImg::getImgSort);
         return this.list(lambdaQueryWrapper);
     }
 
@@ -152,7 +157,21 @@ public class StoreImgServiceImpl extends ServiceImpl<StoreImgMapper, StoreImg> i
         LambdaQueryWrapper<StoreImg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(StoreImg::getStoreId, storeId)
                 .eq(StoreImg::getImgType, imgType)
-                .eq(StoreImg::getBusinessId, businessId);
+                .eq(StoreImg::getBusinessId, businessId).orderByAsc(StoreImg::getImgSort);
+        List<StoreImg> storeImgList = this.list(lambdaQueryWrapper);
+        int imgCount = storeImgList.size();
+        LambdaUpdateWrapper<StoreOfficialAlbum> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.eq(StoreOfficialAlbum::getId, businessId).set(StoreOfficialAlbum::getImgCount, imgCount);
+        storeOfficialAlbumMapper.update(null, updateWrapper);
         return this.list(lambdaQueryWrapper);
     }
+
+    @Override
+    public int saveOrUpdateImg(Integer storeId, Integer imgType) {
+        int result = 0;
+        if(storeId !=null && storeId > 0 && imgType != null){
+            result = storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, imgType));
+        }
+        return result;
+    }
 }

+ 18 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -1704,4 +1704,22 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             }
         }
     }
+
+    public int updateStoreImgModeInfo(StoreImgInfoVo storeImgInfoVo) {
+        int result = 0;
+        if (storeImgInfoVo !=null) {
+            // 校验必要参数是否为null
+            if (storeImgInfoVo.getStoreId() == null || storeImgInfoVo.getImgMode() == null) {
+                return result;
+            }
+            int imgType = storeImgInfoVo.getImgType();
+            if (imgType == 21 || imgType == 22) {
+                LambdaUpdateWrapper<StoreInfo> wrapper = new LambdaUpdateWrapper<>();
+                wrapper.eq(StoreInfo::getId, storeImgInfoVo.getStoreId());
+                wrapper.set(StoreInfo::getImgMode, storeImgInfoVo.getImgMode());
+                result =  storeInfoMapper.update(null, wrapper);
+            }
+        }
+        return result;
+    }
 }

+ 102 - 3
alien-store/src/main/java/shop/alien/store/service/impl/StoreMenuServiceImpl.java

@@ -1,22 +1,28 @@
 package shop.alien.store.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.LifeClassManage;
 import shop.alien.entity.store.LifeLikeRecord;
+import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreMenu;
 import shop.alien.entity.store.vo.StoreMenuVo;
 import shop.alien.mapper.LifeLikeRecordMapper;
 import shop.alien.mapper.StoreMenuMapper;
+import shop.alien.store.service.StoreImgService;
 import shop.alien.store.service.StoreMenuService;
 
-import java.util.Comparator;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -33,6 +39,9 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
 
     private final LifeLikeRecordMapper lifeLikeRecordMapper;
 
+    private final StoreImgService storeImgService;
+
+
     /**
      * 获取门店菜单
      *
@@ -43,6 +52,7 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
      */
     @Override
     public List<StoreMenuVo> getStoreMenu(Integer storeId, Integer dishType, String phoneId) {
+
         if(dishType == 0){
             List<StoreMenuVo> collect = storeMenuMapper.getStoreMenuList(storeId, null);
             return collect.stream().sorted(Comparator.comparing(StoreMenuVo::getSort)).collect(Collectors.toList());
@@ -60,7 +70,7 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
                     }
                 }
             });
-            return collect.stream().sorted(Comparator.comparing(StoreMenuVo::getImgSort)).collect(Collectors.toList());
+            return collect.stream().sorted(Comparator.comparing(StoreMenuVo::getSort)).collect(Collectors.toList());
         }
     }
 
@@ -114,6 +124,66 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
     }
 
     /**
+     * 新增或修改门店菜品new
+     * @param storeMenuVo
+     * @return
+     */
+    @Override
+    public R<String> saveOrUpdateMenus(StoreMenuVo storeMenuVo) {
+        boolean flag = false;
+        LambdaQueryWrapper<StoreMenu> storeMenuLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        int imgId = 0;
+        if (storeMenuVo.getImgId() == null ||storeMenuVo.getImgId() == 0) {
+            StoreImg storeImg = new StoreImg();
+            storeImg.setStoreId(storeMenuVo.getStoreId());
+            storeImg.setImgType(7);
+            storeImg.setImgUrl(storeMenuVo.getImgUrl());
+            storeImg.setImgDescription(storeMenuVo.getDishName());
+            storeImgService.saveOrUpdate(storeImg);
+            imgId = storeImg.getId();
+        } else {
+            imgId = storeMenuVo.getImgId();
+        }
+
+        // 封装storeMenu参数
+        StoreMenu storeMenu = new StoreMenu();
+        BeanUtils.copyProperties(storeMenuVo,storeMenu);
+        storeMenu.setImgId(imgId);
+
+        //修改菜品
+        if(storeMenu.getId()!=null){
+            flag = this.updateById(storeMenu);
+            if(!flag){
+                log.error("菜单修改失败");
+                return R.fail("菜单修改失败");
+            }
+            return R.success("菜单修改成功");
+        } else {
+            //新增菜品
+            // 校验菜品参数
+            if(StringUtils.isEmpty(storeMenu.getDishName())){
+                return R.fail("请输入菜品名称");
+            }
+
+            storeMenuLambdaQueryWrapper.eq(StoreMenu::getStoreId,storeMenu.getStoreId());
+            List<StoreMenu> menuList = this.list(storeMenuLambdaQueryWrapper);
+            if(CollectionUtil.isNotEmpty(menuList)){
+                int maxSort = menuList.stream().map(StoreMenu::getSort).reduce(Integer::max).get();
+                storeMenu.setSort(maxSort+1);
+            }else{
+                storeMenu.setSort(1);
+            }
+            //保存菜品
+            flag = this.save(storeMenu);
+            if(!flag){
+                return R.fail("菜品新增失败");
+            }
+        }
+        return R.success("新增菜品成功");
+    }
+
+
+    /**
      * 菜品排序信息
      * @param storeMenuVo
      * @return
@@ -133,6 +203,11 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
         return flag;
     }
 
+    @Override
+    public Boolean saveMenuSort(List<StoreMenu> storeMenuList) {
+        return this.updateBatchById(storeMenuList);
+    }
+
     /**
      * 删除菜品或推荐菜 根据类型区分
      * @param ids
@@ -156,4 +231,28 @@ public class StoreMenuServiceImpl extends ServiceImpl<StoreMenuMapper, StoreMenu
         }
         return flag;
     }
+
+    @Override
+    public StoreMenuVo getMenuCountByStoreId(int storeId) {
+        StoreMenuVo storeMenuVo = new StoreMenuVo();
+        LambdaUpdateWrapper<StoreMenu> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.eq(StoreMenu::getStoreId, storeId);
+        updateWrapper.eq(StoreMenu::getDeleteFlag, 0);
+        List<StoreMenu> storeMenuList = storeMenuMapper.selectList(updateWrapper);
+        if(CollectionUtils.isNotEmpty(storeMenuList)) {
+            storeMenuVo.setMenuCount(storeMenuList.size());
+            Map<Integer, List<StoreMenu>> groupByDishType = storeMenuList.stream()
+                    .collect(Collectors.groupingBy(StoreMenu::getDishType));
+            List<StoreMenu> suggestList = groupByDishType.get(1);
+            if(CollectionUtils.isNotEmpty(suggestList)) {
+                storeMenuVo.setSuggestCount(suggestList.size());
+            } else {
+                storeMenuVo.setSuggestCount(0);
+            }
+        } else {
+            storeMenuVo.setMenuCount(0);
+            storeMenuVo.setSuggestCount(0);
+        }
+        return storeMenuVo;
+    }
 }

+ 80 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreOfficialAlbumServiceImpl.java

@@ -0,0 +1,80 @@
+package shop.alien.store.service.impl;
+
+import com.alibaba.excel.util.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.StoreOfficialAlbum;
+import shop.alien.entity.store.vo.StoreOfficialAlbumVo;
+import shop.alien.mapper.StoreImgMapper;
+import shop.alien.mapper.StoreOfficialAlbumMapper;
+import shop.alien.store.service.StoreOfficialAlbumService;
+import shop.alien.store.util.CommonConstant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Transactional
+@Service
+@RequiredArgsConstructor
+public class StoreOfficialAlbumServiceImpl extends ServiceImpl<StoreOfficialAlbumMapper, StoreOfficialAlbum> implements StoreOfficialAlbumService {
+
+    private final StoreOfficialAlbumMapper storeOfficialAlbumMapper;
+    private final StoreImgMapper storeImgMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public StoreOfficialAlbum createOrUpdateOfficialAlbum(StoreOfficialAlbum storeOfficialAlbum) {
+
+        Integer id= storeOfficialAlbum.getId();
+        if (id!=null && id > 0) {
+            boolean updateSuccess = storeOfficialAlbumMapper.updateById(storeOfficialAlbum) > 0;
+            if (!updateSuccess) {
+                throw new RuntimeException("更新官方相册失败");
+            }
+        } else {
+            boolean insertSuccess = storeOfficialAlbumMapper.insert(storeOfficialAlbum) > 0;
+            if (!insertSuccess) {
+                throw new RuntimeException("插入官方相册失败");
+            }
+        }
+        return storeOfficialAlbum;
+    }
+
+    @Override
+    public List<StoreOfficialAlbumVo> getOfficialAlbumList(String storeId) {
+        if(StringUtils.isNotBlank(storeId)) {
+            //查询出店铺官方相册img数量并更新
+            List<StoreOfficialAlbum> storeOfficialAlbumList = storeOfficialAlbumMapper.getStoreOfficialAlbumImgCount(Integer.parseInt(storeId));
+            this.updateBatchById(storeOfficialAlbumList);
+            return storeOfficialAlbumMapper.getStoreOfficialAlbumList(Integer.parseInt(storeId));
+        }
+        return Collections.emptyList();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteOfficialAlbum(List<StoreOfficialAlbum> storeOfficialAlbumList) {
+        if (storeOfficialAlbumList == null || storeOfficialAlbumList.isEmpty()) {
+            return 0;
+        }
+        List<Integer> albumIds =storeOfficialAlbumList.stream().map(StoreOfficialAlbum::getId).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(albumIds)) {
+            return 0;
+        }
+
+        // 删除相册
+        storeOfficialAlbumMapper.deleteBatchIds(albumIds);
+        // 删除图片(批量删除)
+        LambdaUpdateWrapper<StoreImg> wrapper = new LambdaUpdateWrapper<StoreImg>()
+                .in(StoreImg::getBusinessId, albumIds)
+                .eq(StoreImg::getImgType, CommonConstant.STORE_IMG_ALBUM);
+        storeImgMapper.delete(wrapper);
+        return 1;
+    }
+}

+ 69 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreTagBusinessRelationServiceImpl.java

@@ -0,0 +1,69 @@
+package shop.alien.store.service.impl;
+
+import com.alibaba.nacos.common.utils.CollectionUtils;
+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 com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+import shop.alien.entity.store.TagBusinessRelation;
+import shop.alien.entity.store.TagCategory;
+import shop.alien.mapper.TagBusinessRelationMapper;
+import shop.alien.mapper.TagCategoryMapper;
+import shop.alien.store.config.BaseRedisService;
+import shop.alien.store.service.StoreTagBusinessRelationService;
+import shop.alien.store.service.StoreTagService;
+import shop.alien.store.util.CommonConstant;
+
+import java.util.List;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class StoreTagBusinessRelationServiceImpl extends ServiceImpl<TagBusinessRelationMapper, TagBusinessRelation> implements StoreTagBusinessRelationService {
+    public final TagBusinessRelationMapper tagBusinessRelationMapper;
+
+    @Override
+    public TagBusinessRelation createTagBusinessRelation(TagBusinessRelation tagBusinessRelation) {
+
+        // 校验同一层级是否存在相同的标签
+        List<TagBusinessRelation> tagCategoryList = tagBusinessRelationMapper.selectList(new LambdaQueryWrapper<TagBusinessRelation>().eq(TagBusinessRelation::getTagId, tagBusinessRelation.getTagId()).eq(TagBusinessRelation::getBusinessSection, tagBusinessRelation.getBusinessSection()));
+        if(CollectionUtils.isNotEmpty(tagCategoryList)){
+            throw new IllegalArgumentException("标签已经存在");
+        }
+
+        // 将数据存储到数据库中
+        log.info("标签创建, 请求参数: {}", tagBusinessRelation);
+        int result = tagBusinessRelationMapper.insert(tagBusinessRelation);
+        log.info("标签创建, 结果: {}", result);
+        // 清除相关缓存
+//        baseRedisService.delete(TAG_TREE_CACHE_KEY);
+        return tagBusinessRelation;
+    }
+
+    @Override
+    public IPage<TagBusinessRelation> getTagBusinessRelationList(int page, int size, int businessSection, String businessSectionName) {
+        IPage<TagBusinessRelation> iPage = new Page<>(page, size);
+        LambdaQueryWrapper<TagBusinessRelation> tagCategoryLambdaQueryWrapper = new LambdaQueryWrapper<TagBusinessRelation>();
+        tagCategoryLambdaQueryWrapper.eq(TagBusinessRelation::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
+        if(businessSection > 0) {
+            tagCategoryLambdaQueryWrapper.eq(TagBusinessRelation::getTagId, businessSection);
+        }
+        if(StringUtils.isNotBlank(businessSectionName)) {
+            tagCategoryLambdaQueryWrapper.like(TagBusinessRelation::getBusinessSectionName,businessSectionName);
+        }
+        tagCategoryLambdaQueryWrapper.orderByDesc(TagBusinessRelation::getCreatedTime);
+        return tagBusinessRelationMapper.selectPage(iPage,tagCategoryLambdaQueryWrapper);
+    }
+    @Override
+    public int deleteTagBusinessRelation(TagBusinessRelation tagBusinessRelation) {
+        if(tagBusinessRelation == null ||tagBusinessRelation.getId() == null){
+            return 0;
+        }
+        return tagBusinessRelationMapper.deleteById(tagBusinessRelation.getId());
+    }
+}

+ 167 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreTagServiceImpl.java

@@ -0,0 +1,167 @@
+package shop.alien.store.service.impl;
+
+import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import shop.alien.entity.store.LifeDiscountCoupon;
+import shop.alien.entity.store.StoreClockIn;
+import shop.alien.entity.store.TagCategory;
+import shop.alien.entity.store.vo.LifeDiscountCouponStoreFriendVo;
+import shop.alien.entity.store.vo.LifeDiscountCouponVo;
+import shop.alien.mapper.StoreClockInMapper;
+import shop.alien.mapper.TagCategoryMapper;
+import shop.alien.store.config.BaseRedisService;
+import shop.alien.store.service.StoreTagService;
+import shop.alien.store.util.CommonConstant;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+@Transactional
+public class StoreTagServiceImpl extends ServiceImpl<TagCategoryMapper, TagCategory> implements StoreTagService {
+
+    public final TagCategoryMapper tagCategoryMapper;
+    private final BaseRedisService baseRedisService;
+    private static final String TAG_TREE_CACHE_KEY = "tag:tree";
+
+    @Override
+    public TagCategory createTag(TagCategory tagCategory) {
+
+        // 校验同一层级是否存在相同的标签
+//        List<TagCategory> tagCategoryList = tagCategoryMapper.selectList(new LambdaQueryWrapper<TagCategory>().eq(TagCategory::getLabelType, tagCategory.getLabelType()).eq(TagCategory::getTagName, tagCategory.getTagName()));
+//        if(CollectionUtils.isNotEmpty(tagCategoryList)){
+//            throw new IllegalArgumentException("标签已经存在");
+//        }
+
+        // 将数据存储到数据库中
+        log.info("标签创建, 请求参数: {}", tagCategory);
+        int result = tagCategoryMapper.insert(tagCategory);
+        log.info("标签创建, 结果: {}", result);
+        // 清除相关缓存
+//        baseRedisService.delete(TAG_TREE_CACHE_KEY);
+        return tagCategory;
+    }
+
+    @Override
+    public IPage<TagCategory> getTagList(int page, int size,String label,String labelType, String labelButtonType) {
+        IPage<TagCategory> iPage = new Page<>(page, size);
+        LambdaQueryWrapper<TagCategory> tagCategoryLambdaQueryWrapper = new LambdaQueryWrapper<TagCategory>();
+        tagCategoryLambdaQueryWrapper.eq(TagCategory::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
+        if(StringUtils.isNotBlank(label)){
+            tagCategoryLambdaQueryWrapper.like(TagCategory::getTagName,label);
+        }
+        if(StringUtils.isNotBlank(labelType)){
+            tagCategoryLambdaQueryWrapper.eq(TagCategory::getLabelType, labelType);
+        }
+        if(StringUtils.isNotBlank(labelButtonType)){
+            tagCategoryLambdaQueryWrapper.eq(TagCategory::getLabelButtonType, labelButtonType);
+        }
+        tagCategoryLambdaQueryWrapper.orderByDesc(TagCategory::getCreatedTime);
+        return tagCategoryMapper.selectPage(iPage,tagCategoryLambdaQueryWrapper);
+    }
+
+//    @Override
+//    public List<TagCategory> getTagTree() {
+//        // 缓存获取
+//
+//        List<TagCategory> tagCategoryTree = new ArrayList<>();
+//        try {
+//            tagCategoryTree = baseRedisService.getList(TAG_TREE_CACHE_KEY, TagCategory.class);
+//        } catch (JsonProcessingException e) {
+//            log.error("StoreTagServiceImpl-getTagTree获取缓存异常: ", e);
+//            throw new RuntimeException(e);
+//        }
+//        if (CollectionUtils.isNotEmpty(tagCategoryTree)) {
+//            return tagCategoryTree;
+//        }
+//
+//        // 从数据库获取未删除的所有标签
+//        LambdaQueryWrapper<TagCategory> queryWrapper = new LambdaQueryWrapper<>();
+//        queryWrapper.like(TagCategory::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
+//        List<TagCategory> allTags = tagCategoryMapper.selectList(queryWrapper);
+//
+//        // 构建树形结构
+//        tagCategoryTree = buildTagTree(allTags);
+//
+//        // 缓存结果
+//        if (CollectionUtils.isNotEmpty(tagCategoryTree)) {
+//            try {
+//                baseRedisService.storeList(TAG_TREE_CACHE_KEY, tagCategoryTree);
+//            } catch (JsonProcessingException e) {
+//                log.error("StoreTagServiceImpl-getTagTree存储缓存异常: ", e);
+//                throw new RuntimeException(e);
+//            }
+//        }
+//
+//        return tagCategoryTree;
+//    }
+
+    @Override
+    public int deleteTag(TagCategory tagCategory) {
+        if(tagCategory == null ||tagCategory.getId() == null){
+            return 0;
+        }
+
+        int deleteTagResult = tagCategoryMapper.deleteById(tagCategory.getId());
+        if (deleteTagResult > 0) {
+            baseRedisService.delete(TAG_TREE_CACHE_KEY);
+        }
+        return deleteTagResult;
+    }
+
+    @Override
+    public int updateTagCategory(TagCategory tagCategory) {
+        if(tagCategory == null){
+            return 0;
+        }
+        int updateResult = tagCategoryMapper.updateById(tagCategory);
+        if (updateResult > 0){
+            baseRedisService.delete(TAG_TREE_CACHE_KEY);
+        }
+        return updateResult;
+    }
+
+    /**
+     * 构造树形结构方法
+     *
+     * @param allTags 所有标签列表
+     * @return 构造完成后的标签列表
+     */
+//    private List<TagCategory> buildTagTree(List<TagCategory> allTags) {
+//        Map<Integer, List<TagCategory>> tagMap = allTags.stream()
+//                .collect(Collectors.groupingBy(TagCategory::getParentTagId));
+//        List<TagCategory> rootTags = tagMap.getOrDefault(0, Collections.emptyList());
+//        rootTags.forEach(tag -> buildChildren(tag, tagMap));
+//        return rootTags;
+//    }
+
+    /**
+     * 构造树形结构方法
+     *
+     * @param parentTagCategory 父标签
+     * @param tagMap 父标签ID分组MAP
+     */
+//    private void buildChildren(TagCategory parentTagCategory, Map<Integer, List<TagCategory>> tagMap) {
+//        List<TagCategory> children = tagMap.getOrDefault(parentTagCategory.getId(), Collections.emptyList());
+//        parentTagCategory.setChildrenTag(children);
+//        children.forEach(child -> buildChildren(child, tagMap));
+//    }
+
+
+}

+ 75 - 0
alien-store/src/main/java/shop/alien/store/service/impl/TagStoreRelationServiceImpl.java

@@ -0,0 +1,75 @@
+package shop.alien.store.service.impl;
+import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import shop.alien.entity.store.TagStoreRelation;
+import shop.alien.mapper.TagStoreRelationMapper;
+import shop.alien.store.config.BaseRedisService;
+import shop.alien.store.service.TagStoreRelationService;
+import java.util.List;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class TagStoreRelationServiceImpl implements TagStoreRelationService {
+    public final TagStoreRelationMapper tagStoreRelationMapper;
+    private final BaseRedisService baseRedisService;
+    private static final String TAG_STORE_CACHE_KEY = "tag_store";
+    @Override
+    public TagStoreRelation createOrUpdateTagStoreRelation(TagStoreRelation tagStoreRelation) {
+        // 校验同一层级是否存在相同的店铺标签信息
+        List<TagStoreRelation> tagStoreRelationList = tagStoreRelationMapper.selectList(new LambdaQueryWrapper<TagStoreRelation>().eq(TagStoreRelation::getStoreId, tagStoreRelation.getStoreId()));
+        if(CollectionUtils.isNotEmpty(tagStoreRelationList)){
+            // 店铺标签信息已经存在,进行更新操作
+            tagStoreRelationMapper.updateById(tagStoreRelation);
+        } else {
+            // 将数据存储到数据库中
+            tagStoreRelationMapper.insert(tagStoreRelation);
+        }
+        String cacheKey = buildTagStoreCacheKey(tagStoreRelation.getStoreId());
+//        try {
+//            baseRedisService.storeObject(cacheKey, tagStoreRelation);
+//        } catch (JsonProcessingException e) {
+//            throw new RuntimeException(e);
+//        }
+        return tagStoreRelation;
+    }
+
+    @Override
+    public TagStoreRelation getTagStoreRelationByStoreId(int storeId) {
+//        TagStoreRelation tagStoreRelation = null;
+//        String cacheKey = buildTagStoreCacheKey(storeId);
+//        try {
+//            tagStoreRelation = baseRedisService.getObject(cacheKey, TagStoreRelation.class);
+//        } catch (JsonProcessingException e) {
+//            log.error("Failed to deserialize TagStoreRelation from Redis", e);
+//            throw new RuntimeException(e);
+//        }
+//        if (tagStoreRelation != null) {
+//            return tagStoreRelation;
+//        }
+//        LambdaQueryWrapper<TagStoreRelation> wrapper = new LambdaQueryWrapper<>();
+//        wrapper.eq(TagStoreRelation::getStoreId, storeId);
+//        List<TagStoreRelation> tagStoreRelationList = tagStoreRelationMapper.selectList(wrapper);
+//        if (CollectionUtils.isNotEmpty(tagStoreRelationList)) {
+//            tagStoreRelation = tagStoreRelationList.get(0);
+//            try {
+//                baseRedisService.storeObject(cacheKey, tagStoreRelation);
+//            } catch (JsonProcessingException e) {
+//                log.error("Failed to serialize TagStoreRelation to Redis", e);
+//                throw new RuntimeException(e);
+//            }
+//        }
+        return null;
+    }
+
+    /**
+     * 构建 Redis 缓存 Key
+     */
+    private String buildTagStoreCacheKey(int storeId) {
+        return TAG_STORE_CACHE_KEY + ":" + storeId;
+    }
+}

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

@@ -0,0 +1,50 @@
+package shop.alien.store.util;
+
+/**
+ * 通用常量配置
+ * @author zhangchen
+ * @since 2025/7/1
+ */
+public class CommonConstant {
+
+    /**
+     * 是否删除,0:未删除,2:已删除
+     */
+    public static final Integer DELETE_FLAG_UNDELETE = 0;
+    public static final Integer DELETE_FLAG_DELETED = 1;
+
+    /**
+     * 优惠券类型,1-代金券  2-团购(套餐)
+     */
+    public static final Integer LIFE_COUPON_TYPE = 1;
+    public static final Integer LIFE_GROUP_TYPE = 2;
+
+    /**
+     * 优惠券状态,-1:待审核,-2:审核不通过,0:未使用,1:使用中,2:暂停,3:已结束
+     */
+    public static final Integer LIFE_COUPON_STATUS_PENDING_APPROVAL = -1;
+    public static final Integer LIFE_COUPON_STATUS_REJECTED = -2;
+    public static final Integer LIFE_COUPON_STATUS_UNUSED = 0;
+    public static final Integer LIFE_COUPON_STATUS_USING = 1;
+    public static final Integer LIFE_COUPON_STATUS_PAUSE = 2;
+    public static final Integer LIFE_COUPON_STATUS_END = 3;
+
+    /**
+     * 新建/更新返回值,0:失败,1:成功
+     */
+    public static final Integer ERROR_CODE_VALID_PARAMS = 1;
+    public static final Integer ERROR_CODE_INVALID_PARAMS = 0;
+
+    /**
+     * 标签类型 1:套餐, 2:门店
+     */
+    public static final String LABEL_TYPE_MENU = "1";
+    public static final String LABEL_TYPE_SHOP = "2";
+
+    /**
+     * 图片类型,0:其他, 1:入口图, 2:相册, 3:菜品, 4:环境, 5:价目表, 6:推荐菜, 7:菜单, 8:用户评论, 9:商家申诉,10:商家头像,11:店铺轮播图,12:联名卡图片,13:动态折扣,14:营业执照,15:合同照片,17:打卡广场小人图片 18: 二手商品发布图片, 19:二手商品与用户举报图片
+     */
+    public static final Integer STORE_IMG_OTHER = 1;
+    public static final Integer STORE_IMG_ALBUM = 2;
+
+}