فهرست منبع

Merge remote-tracking branch 'origin/sit-three-categories' into sit-three-categories

dujian 3 ماه پیش
والد
کامیت
76d0d2a4f9
15فایلهای تغییر یافته به همراه301 افزوده شده و 94 حذف شده
  1. 2 0
      alien-entity/src/main/java/shop/alien/entity/store/dto/CategoryGroupDto.java
  2. 3 0
      alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineItemDto.java
  3. 73 0
      alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineTypeResponseDto.java
  4. 6 6
      alien-entity/src/main/java/shop/alien/entity/store/vo/SportsEquipmentFacilityVo.java
  5. 7 0
      alien-entity/src/main/java/shop/alien/entity/store/vo/StoreStaffDetailWithPerformanceVo.java
  6. 11 15
      alien-store/src/main/java/shop/alien/store/controller/BarPerformanceController.java
  7. 10 6
      alien-store/src/main/java/shop/alien/store/controller/StoreCuisineController.java
  8. 8 4
      alien-store/src/main/java/shop/alien/store/controller/StorePriceController.java
  9. 17 5
      alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java
  10. 3 2
      alien-store/src/main/java/shop/alien/store/service/StoreCuisineService.java
  11. 2 1
      alien-store/src/main/java/shop/alien/store/service/StoreStaffConfigService.java
  12. 15 8
      alien-store/src/main/java/shop/alien/store/service/impl/BarPerformanceServiceImpl.java
  13. 78 37
      alien-store/src/main/java/shop/alien/store/service/impl/StoreCuisineServiceImpl.java
  14. 13 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreImgServiceImpl.java
  15. 53 10
      alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/CategoryGroupDto.java

@@ -1,5 +1,6 @@
 package shop.alien.entity.store.dto;
 
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -18,6 +19,7 @@ import java.util.List;
 @Data
 @NoArgsConstructor
 @AllArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
 @ApiModel(value = "CategoryGroupDto", description = "套餐分类组")
 public class CategoryGroupDto {
 

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

@@ -27,5 +27,8 @@ public class CuisineItemDto {
 
     @ApiModelProperty(value = "数量")
     private Integer quantity;
+
+    @ApiModelProperty(value = "单位")
+    private String unit;
 }
 

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

@@ -0,0 +1,73 @@
+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.math.BigDecimal;
+
+/**
+ * 根据类型获取美食详情响应 DTO
+ *
+ * @author auto-generated
+ * @since 2025-01-01
+ */
+@Data
+@ApiModel(value = "CuisineTypeResponseDto", description = "根据类型获取美食详情响应")
+public class CuisineTypeResponseDto {
+
+    @ApiModelProperty(value = "名称,格式:套餐:{套餐名称}(引用上述两个单品)")
+    private String name;
+
+    @ApiModelProperty(value = "数据对象")
+    private CuisineTypeData data;
+
+    @Data
+    @ApiModel(value = "CuisineTypeData", description = "美食详情数据")
+    public static class CuisineTypeData {
+
+        @ApiModelProperty(value = "美食类型: 1-单品,2-套餐")
+        private Integer cuisineType;
+
+        @ApiModelProperty(value = "商户id")
+        private Integer storeId;
+
+        @ApiModelProperty(value = "菜名/套餐名")
+        private String name;
+
+        @ApiModelProperty(value = "总价")
+        private BigDecimal totalPrice;
+
+        @ApiModelProperty(value = "图片列表,最多 9 张 URL,逗号分隔")
+        private String images;
+
+        @ApiModelProperty(value = "菜品原料json(原料名称:name,所需重量:height,成本价:cost,推荐价格:suggest)")
+        private String rawJson;
+
+        @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 = "套餐组合JSON字符串")
+        private String groupJson;
+    }
+}
+

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

@@ -58,22 +58,22 @@ public class SportsEquipmentFacilityVo implements Serializable {
     @ApiModelProperty(value = "图片列表")
     private List<String> imageList;
 
-    @ApiModelProperty(value = "区域ID(关联sports_facility_area.id)")
+    @ApiModelProperty(value = "区域ID")
     private Integer areaId;
 
-    @ApiModelProperty(value = "设备ID列表(fitness_equipment_info表的id,用逗号分隔)")
+    @ApiModelProperty(value = "设备ID列表")
     private String fitnessEquipmentIds;
 
-    @ApiModelProperty(value = "设备名称(用于创建fitness_equipment_info记录)")
+    @ApiModelProperty(value = "设备名称")
     private String equipmentName;
 
-    @ApiModelProperty(value = "设备数量(用于创建fitness_equipment_info记录)")
+    @ApiModelProperty(value = "设备数量")
     private Integer equipmentNums;
 
-    @ApiModelProperty(value = "设备图片URL(用于创建fitness_equipment_info记录)")
+    @ApiModelProperty(value = "设备图片URL")
     private String equipmentImage;
 
-    @ApiModelProperty(value = "设备ID(fitness_equipment_info表的主键ID,用于修改时根据设备ID查询设施记录)")
+    @ApiModelProperty(value = "设备ID")
     private Integer equipmentId;
 }
 

+ 7 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/StoreStaffDetailWithPerformanceVo.java

@@ -40,5 +40,12 @@ public class StoreStaffDetailWithPerformanceVo implements Serializable {
      */
     @ApiModelProperty(value = "是否今日演出(true-今日有演出,false-今日无演出)")
     private Boolean hasPerformanceToday;
+
+    /**
+     * 是否喜欢(true-已喜欢,false-未喜欢)
+     * 根据当前登录用户的token中的userid判断
+     */
+    @ApiModelProperty(value = "是否喜欢(true-已喜欢,false-未喜欢)")
+    private Boolean isLiked;
 }
 

+ 11 - 15
alien-store/src/main/java/shop/alien/store/controller/BarPerformanceController.java

@@ -8,10 +8,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.BarPerformance;
+import shop.alien.entity.store.dto.BarPerformanceOnlineStatusDto;
 import shop.alien.store.service.BarPerformanceService;
-import shop.alien.util.myBaticsPlus.QueryBuilder;
-
-import java.util.List;
 
 /**
  * 酒吧演出Controller
@@ -133,29 +131,27 @@ public class BarPerformanceController {
     /**
      * 设置演出上线下线状态
      *
-     * @param id          演出ID
-     * @param onlineStatus 上线状态(0-下线,1-上线)
+     * @param dto 包含演出ID和上线状态的DTO对象
      * @return 操作结果
      */
     @ApiOperation("设置演出上线状态")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "演出ID", dataType = "Integer", paramType = "query", required = true),
-            @ApiImplicitParam(name = "onlineStatus", value = "上线状态(0-下线,1-上线)", dataType = "Integer", paramType = "query", required = true)
-    })
     @PostMapping("/setOnlineStatus")
-    public R<Integer> setOnlineStatus(
-            @RequestParam Integer id,
-            @RequestParam Integer onlineStatus) {
-        log.info("BarPerformanceController.setOnlineStatus?id={}, onlineStatus={}", id, onlineStatus);
+    public R<Integer> setOnlineStatus(@RequestBody BarPerformanceOnlineStatusDto dto) {
+        log.info("BarPerformanceController.setOnlineStatus?dto={}", dto);
         try {
-            Integer result = barPerformanceService.setOnlineStatus(id, onlineStatus);
+            // 参数验证
+            if (dto == null || dto.getId() == null || dto.getOnlineStatus() == null) {
+                log.warn("设置演出上线状态参数不完整:dto={}", dto);
+                return R.fail("参数不完整,演出ID和上线状态不能为空");
+            }
+            Integer result = barPerformanceService.setOnlineStatus(dto.getId(), dto.getOnlineStatus());
             if (result > 0) {
                 return R.success("设置成功");
             } else {
                 return R.fail("设置失败");
             }
         } catch (Exception e) {
-            log.error("设置演出上线状态失败", e);
+            log.error("设置演出上线状态失败,dto={}", dto, e);
             return R.fail("设置演出上线状态失败:" + e.getMessage());
         }
     }

+ 10 - 6
alien-store/src/main/java/shop/alien/store/controller/StoreCuisineController.java

@@ -13,7 +13,7 @@ import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreCuisine;
 import shop.alien.entity.store.StorePrice;
 import shop.alien.entity.store.dto.CuisineComboDto;
-import shop.alien.entity.store.dto.CuisineDetailDto;
+import shop.alien.entity.store.dto.CuisineTypeResponseDto;
 import shop.alien.entity.store.vo.PriceListVo;
 import shop.alien.store.service.StoreCuisineService;
 import shop.alien.store.service.StorePriceService;
@@ -79,8 +79,8 @@ public class StoreCuisineController {
             @ApiImplicitParam(name = "cuisineType", value = "美食类型:1-单品,2-套餐", dataType = "Integer", paramType = "query", required = true)
     })
     @GetMapping("/getByCuisineType")
-    public R<CuisineDetailDto> getByCuisineType(Integer id, Integer cuisineType) {
-        return R.data(storeCuisineService.getByCuisineType(id, cuisineType));
+    public R<CuisineTypeResponseDto> getByCuisineType(Integer id, Integer cuisineType) {
+        return R.data(storeCuisineService.getByCuisineTypeNew(id, cuisineType));
     }
 
 
@@ -114,7 +114,7 @@ public class StoreCuisineController {
             @ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query", required = true)
     })
     @PostMapping("/changeShelfStatus")
-    public R<String> changeShelfStatus(Integer id, Integer shelfStatus) {
+    public R<String> changeShelfStatus(@RequestParam("id") Integer id, @RequestParam("shelfStatus") Integer shelfStatus) {
         log.info("StoreCuisineController.changeShelfStatus?id={},shelfStatus={}", id, shelfStatus);
         if (shelfStatus == null || (shelfStatus != 1 && shelfStatus != 2)) {
             return R.fail("上下架状态不合法(只能为1或2)");
@@ -142,7 +142,9 @@ public class StoreCuisineController {
             @RequestParam(required = false) Integer storeId,
             @RequestParam(required = false) String name,
             @RequestParam(required = false) Integer status,
-            @RequestParam(required = true) Integer type) {
+            @RequestParam(required = true) Integer type,
+            @RequestParam(required = false) Integer origin)
+    {
         log.info("StoreCuisineController.getPage?pageNum={},pageSize={},storeId={},name={},status={},type={}", pageNum, pageSize, storeId, name, status, type);
         List<PriceListVo> priceListVo = new ArrayList<>();
 
@@ -150,7 +152,9 @@ public class StoreCuisineController {
             Page<StoreCuisine> page = new Page<>(pageNum, pageSize);
             LambdaQueryWrapper<StoreCuisine> queryWrapper = new LambdaQueryWrapper<>();
             // 默认只查询已上架的菜品/套餐(shelf_status = 1)
-            queryWrapper.eq(StoreCuisine::getShelfStatus, 1);
+            if(null==origin){
+                queryWrapper.eq(StoreCuisine::getShelfStatus, 1);
+            }
             if (storeId != null) {
                 queryWrapper.eq(StoreCuisine::getStoreId, storeId);
             }

+ 8 - 4
alien-store/src/main/java/shop/alien/store/controller/StorePriceController.java

@@ -139,11 +139,15 @@ public class StorePriceController {
             @RequestParam(required = false) Integer storeId,
             @RequestParam(required = false) String name,
             @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer shelfStatus) {
+            @RequestParam(required = false) Integer shelfStatus,
+            @RequestParam(required = false) Integer origin) {
         log.info("StorePriceController.getPage?pageNum={},pageSize={},storeId={},name={},status={},shelfStatus={}",
                 pageNum, pageSize, storeId, name, status, shelfStatus);
         Page<StorePrice> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
+        if(null==origin){
+            queryWrapper.eq(StorePrice::getShelfStatus, 1);
+        }
         if (storeId != null) {
             queryWrapper.eq(StorePrice::getStoreId, storeId);
         }
@@ -192,11 +196,11 @@ public class StorePriceController {
     @ApiOperation("上下架操作:1-上架,2-下架")
     @ApiOperationSupport(order = 8)
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "通用价目id", dataType = "Integer", paramType = "query", required = true),
-            @ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query", required = true)
+            @ApiImplicitParam(name = "id", value = "通用价目id", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query", required = false)
     })
     @PostMapping("/changeShelfStatus")
-    public R<String> changeShelfStatus(@RequestParam Integer id, @RequestParam Integer shelfStatus) {
+    public R<String> changeShelfStatus(@RequestParam("id") Integer id, @RequestParam("shelfStatus") Integer shelfStatus) {
         log.info("StorePriceController.changeShelfStatus?id={},shelfStatus={}", id, shelfStatus);
         if (shelfStatus == null || (shelfStatus != 1 && shelfStatus != 2)) {
             return R.fail("上下架状态不合法(只能为1或2)");

+ 17 - 5
alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java

@@ -2,12 +2,15 @@ package shop.alien.store.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.*;
+import springfox.documentation.annotations.ApiIgnore;
 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.StoreStaffConfig;
 import shop.alien.entity.store.StoreStaffTitle;
+import shop.alien.entity.store.UserLoginInfo;
+import shop.alien.util.common.TokenInfo;
 import shop.alien.entity.store.dto.StoreStaffConfigListQueryDto;
 import shop.alien.entity.store.vo.StaffTitleGroupVo;
 import shop.alien.entity.store.vo.StoreStaffDetailVo;
@@ -266,8 +269,10 @@ public class StoreStaffConfigController {
     })
     @GetMapping("/queryStaffDetail")
     public R<StoreStaffDetailWithPerformanceVo> queryStaffDetail(
-            @RequestParam(value = "id", required = true) Integer id) {
-        log.info("查询员工详情(包含演出列表),id={}", id);
+            @RequestParam(value = "id", required = true) Integer id,
+            @ApiIgnore @TokenInfo UserLoginInfo userLoginInfo) {
+        log.info("查询员工详情(包含演出列表),id={},userId={}", 
+                id, userLoginInfo != null ? userLoginInfo.getUserId() : null);
 
         try {
             // 参数校验
@@ -276,17 +281,24 @@ public class StoreStaffConfigController {
                 return R.fail("员工ID不能为空且必须大于0");
             }
 
+            // 获取用户ID(可能为null,如果用户未登录)
+            Integer userId = null;
+            if (userLoginInfo != null) {
+                userId = userLoginInfo.getUserId();
+            }
+
             // 调用服务层查询
             StoreStaffDetailWithPerformanceVo result =
-                    storeStaffConfigService.queryStaffDetailWithPerformance(id);
+                    storeStaffConfigService.queryStaffDetailWithPerformance(id, userId);
 
             if (result == null) {
                 log.warn("查询员工详情失败,员工不存在:id={}", id);
                 return R.fail("员工不存在");
             }
 
-            log.info("查询员工详情成功,id={},演出安排数量:{}",
-                    id, result.getPerformanceScheduleList() != null ? result.getPerformanceScheduleList().size() : 0);
+            log.info("查询员工详情成功,id={},演出安排数量:{},是否喜欢:{}",
+                    id, result.getPerformanceScheduleList() != null ? result.getPerformanceScheduleList().size() : 0,
+                    result.getIsLiked());
             return R.data(result);
         } catch (IllegalArgumentException e) {
             log.warn("查询员工详情参数错误,id={},错误信息:{}", id, e.getMessage());

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import shop.alien.entity.store.StoreCuisine;
 import shop.alien.entity.store.dto.CuisineComboDto;
 import shop.alien.entity.store.dto.CuisineDetailDto;
+import shop.alien.entity.store.dto.CuisineTypeResponseDto;
 
 import java.util.List;
 
@@ -31,11 +32,11 @@ public interface StoreCuisineService extends IService<StoreCuisine> {
     List<StoreCuisine> getSingleName();
 
     /**
-     * 根据 id 与类型获取详情:
+     * 根据 id 与类型获取详情(新格式)
      * - type = 1:返回单品详情
      * - type = 2:返回套餐详情(主信息 + 套餐包含的单品列表)
      */
-    CuisineDetailDto getByCuisineType(Integer id, Integer cuisineType);
+    CuisineTypeResponseDto getByCuisineTypeNew(Integer id, Integer cuisineType);
 
     /**
      * 上下架操作:1-上架,2-下架

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

@@ -132,9 +132,10 @@ public interface StoreStaffConfigService {
      * </p>
      *
      * @param id 员工主键ID,必须大于0
+     * @param userId 当前登录用户ID,可为null(未登录时)
      * @return 员工详情(包含演出列表),如果员工不存在则返回null
      */
-    shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id);
+    shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id, Integer userId);
 
     /**
      * 获取美食员工列表

+ 15 - 8
alien-store/src/main/java/shop/alien/store/service/impl/BarPerformanceServiceImpl.java

@@ -59,11 +59,6 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
         if (StringUtils.isEmpty(barPerformance.getPerformancePoster())) {
             throw new IllegalArgumentException("演出海报不能为空");
         }
-        // 检查海报是否有多张(逗号分隔)
-        String[] posterImages = barPerformance.getPerformancePoster().split(",");
-        if (posterImages.length > 1) {
-            throw new IllegalArgumentException("演出海报最多只能上传1张");
-        }
 
         // 3. 演出类型和频次的关联验证:特邀演出(0)只能选单次(0)
         if (barPerformance.getPerformanceType() != null && barPerformance.getPerformanceType() == 0) {
@@ -214,12 +209,18 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
         // 调用AI内容审核接口,如果检测到违规内容会抛出异常
         AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(moderationText, imageUrls);
         if (auditResult == null || !auditResult.isPassed()) {
+            // AI审核失败,设置审核状态为2(审核拒绝)并记录拒绝原因
             String failureReason = (auditResult != null && StringUtils.isNotEmpty(auditResult.getFailureReason()))
                     ? auditResult.getFailureReason()
                     : "内容包含违规信息";
+            barPerformance.setReviewStatus(2); // 审核拒绝
+            barPerformance.setRejectReason(failureReason);
             log.warn("酒吧演出内容审核失败:{}", failureReason);
             throw new IllegalArgumentException("内容审核未通过:" + failureReason);
         }
+        // AI审核通过,设置审核状态为1(审核通过),清除拒绝原因
+        barPerformance.setReviewStatus(1); // 审核通过
+        barPerformance.setRejectReason(null); // 清除拒绝原因
         log.info("酒吧演出内容审核通过");
 
         Integer id = barPerformance.getId();
@@ -232,15 +233,17 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
             if (barPerformance.getDeleteFlag() == null) {
                 barPerformance.setDeleteFlag(0);
             }
-            // 设置默认状态为待审核(0)
+            // 设置默认状态为禁用(0)
             if (barPerformance.getStatus() == null) {
                 barPerformance.setStatus(0);
             }
-            // 设置默认审核状态为待审核(0),对应数据库字段 review_status
+            // 审核状态已在AI审核结果后设置(1-审核通过 或 2-审核拒绝)
+            // 如果AI审核通过,reviewStatus已设置为1;如果AI审核失败,reviewStatus已设置为2
+            // 如果为null(理论上不应该出现,因为已经执行了AI审核),设置为0(待审核)
             if (barPerformance.getReviewStatus() == null) {
                 barPerformance.setReviewStatus(0);
             }
-            // 设置默认上线状态为下线(0)
+            // 设置默认上线状态为下线(0),AI审核通过后仍然保持下线状态
             if (barPerformance.getOnlineStatus() == null) {
                 barPerformance.setOnlineStatus(0);
             }
@@ -270,9 +273,13 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
                 if (barPerformance.getStatus() == null) {
                     barPerformance.setStatus(0);
                 }
+                // 审核状态已在AI审核结果后设置(1-审核通过 或 2-审核拒绝)
+                // 如果AI审核通过,reviewStatus已设置为1;如果AI审核失败,reviewStatus已设置为2
+                // 如果为null(理论上不应该出现,因为已经执行了AI审核),设置为0(待审核)
                 if (barPerformance.getReviewStatus() == null) {
                     barPerformance.setReviewStatus(0);
                 }
+                // 设置默认上线状态为下线(0),AI审核通过后仍然保持下线状态
                 if (barPerformance.getOnlineStatus() == null) {
                     barPerformance.setOnlineStatus(0);
                 }

+ 78 - 37
alien-store/src/main/java/shop/alien/store/service/impl/StoreCuisineServiceImpl.java

@@ -10,11 +10,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import shop.alien.entity.store.StoreCuisine;
 import shop.alien.entity.store.StoreCuisineCombo;
-import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.dto.CategoryGroupDto;
 import shop.alien.entity.store.dto.CuisineComboDto;
-import shop.alien.entity.store.dto.CuisineDetailDto;
 import shop.alien.entity.store.dto.CuisineItemDto;
+import shop.alien.entity.store.dto.CuisineTypeResponseDto;
 import shop.alien.mapper.StoreCuisineMapper;
 import shop.alien.mapper.StoreInfoMapper;
 import shop.alien.store.service.StoreCuisineComboService;
@@ -116,46 +115,55 @@ public class StoreCuisineServiceImpl extends ServiceImpl<StoreCuisineMapper, Sto
         return updateById(cuisine);
     }
 
+
     /**
-     * 根据 id 与类型获取详情:
+     * 根据 id 与类型获取详情(新格式)
      * - type = 1:返回单品详情
      * - type = 2:返回套餐详情(主信息 + 套餐包含的单品列表)
      */
     @Override
-    public CuisineDetailDto getByCuisineType(Integer id, Integer cuisineType) {
+    public CuisineTypeResponseDto getByCuisineTypeNew(Integer id, Integer cuisineType) {
         // 1. 先查主表记录
         StoreCuisine base = getById(id);
         if (base == null) {
             return null;
         }
 
-        CuisineDetailDto dto = new CuisineDetailDto();
-        dto.setBaseInfo(base);
-
-        //查询当前门店套餐/单品列表 详情头部使用
-        List<StoreCuisine> cuisineList = storeCuisineMapper.selectList(new LambdaQueryWrapper<StoreCuisine>().eq(StoreCuisine :: getStoreId, base.getStoreId()));
-        dto.setStoreCuisineList(cuisineList);
-
-        //查询门店手机号 门店名称
-        StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo :: getId, base.getStoreId()));
-        if(storeInfo !=null){
-            dto.setStorePhone(storeInfo.getStoreTel());
-            dto.setStoreName(storeInfo.getStoreName());
-        }
-
-        // 单品:直接返回主信息,items 为空
+        CuisineTypeResponseDto response = new CuisineTypeResponseDto();
+        CuisineTypeResponseDto.CuisineTypeData data = new CuisineTypeResponseDto.CuisineTypeData();
+        
+        // 填充基本信息
+        data.setCuisineType(base.getCuisineType());
+        data.setStoreId(base.getStoreId());
+        data.setName(base.getName());
+        data.setTotalPrice(base.getTotalPrice());
+        data.setImages(base.getImages());
+        data.setImageContent(base.getImageContent());
+        data.setDetailContent(base.getDetailContent());
+        data.setExtraNote(base.getExtraNote());
+        data.setNeedReserve(base.getNeedReserve());
+        data.setReserveRule(base.getReserveRule());
+        data.setPeopleLimit(base.getPeopleLimit());
+        data.setUsageRule(base.getUsageRule());
+        data.setRawJson(base.getRawJson());
+        // 单品:groupJson 为空,name 为单品名称
         if (cuisineType != null && cuisineType == 1) {
-            dto.setItems(Collections.emptyList());
-            return dto;
+            response.setName(base.getName());
+            data.setGroupJson("");
+            response.setData(data);
+            return response;
         }
 
-        // 套餐:通过中间表查出包含哪些单品
+        // 套餐:通过中间表查出包含哪些单品,构建 groupJson
         LambdaQueryWrapper<StoreCuisineCombo> comboWrapper = new LambdaQueryWrapper<>();
         comboWrapper.eq(StoreCuisineCombo::getCid, id);
         List<StoreCuisineCombo> combos = storeCuisineComboService.list(comboWrapper);
+        
         if (combos.isEmpty()) {
-            dto.setItems(Collections.emptyList());
-            return dto;
+            response.setName("套餐:" + base.getName());
+            data.setGroupJson("[]");
+            response.setData(data);
+            return response;
         }
 
         // 收集所有单品 sid
@@ -171,21 +179,54 @@ public class StoreCuisineServiceImpl extends ServiceImpl<StoreCuisineMapper, Sto
         Map<Integer, StoreCuisine> singleMap = singles.stream()
                 .collect(Collectors.toMap(StoreCuisine::getId, s -> s));
 
-        // 组装套餐明细
-        List<CuisineDetailDto.CuisineItemDetail> itemDetails = new ArrayList<>();
-        for (StoreCuisineCombo combo : combos) {
-            StoreCuisine single = singleMap.get(combo.getSid());
-            if (single == null) {
-                continue;
+        // 按分类分组构建 CategoryGroupDto 列表
+        Map<String, List<StoreCuisineCombo>> categoryMap = combos.stream()
+                .collect(Collectors.groupingBy(StoreCuisineCombo::getCategory));
+
+        List<CategoryGroupDto> categoryGroups = new ArrayList<>();
+        
+        for (Map.Entry<String, List<StoreCuisineCombo>> entry : categoryMap.entrySet()) {
+            String categoryName = entry.getKey();
+            List<StoreCuisineCombo> categoryCombos = entry.getValue();
+            
+            CategoryGroupDto group = new CategoryGroupDto();
+            group.setCategoryName(categoryName);
+            
+            List<CuisineItemDto> items = new ArrayList<>();
+            for (StoreCuisineCombo combo : categoryCombos) {
+                StoreCuisine single = singleMap.get(combo.getSid());
+                if (single == null) {
+                    continue;
+                }
+                
+                CuisineItemDto item = new CuisineItemDto();
+                item.setCuisineId(single.getId());
+                item.setCuisineName(single.getName());
+                item.setQuantity(combo.getSnum());
+                item.setUnit("份");
+                items.add(item);
             }
-            CuisineDetailDto.CuisineItemDetail detail = new CuisineDetailDto.CuisineItemDetail();
-            detail.setSingle(single);
-            detail.setQuantity(combo.getSnum());
-            detail.setCategory(combo.getCategory());
-            itemDetails.add(detail);
+            group.setItems(items);
+            categoryGroups.add(group);
         }
-        dto.setItems(itemDetails);
-        return dto;
+
+        // 将 CategoryGroupDto 列表转换为 JSON 字符串
+        String groupJson;
+        try {
+            groupJson = objectMapper.writeValueAsString(categoryGroups);
+        } catch (IOException e) {
+            throw new RuntimeException("构建套餐组合 JSON 失败", e);
+        }
+        data.setGroupJson(groupJson);
+
+        // 构建 name 字段:套餐:{套餐名称}(引用上述{数量}个单品)
+        // 计算不同单品的数量(去重后的 sid 数量)
+        int singleCount = sidList.size();
+        String countText = singleCount == 2 ? "两个" : (singleCount == 3 ? "三个" : singleCount + "个");
+        response.setName("套餐:" + base.getName() + "(引用上述" + countText + "单品)");
+
+        response.setData(data);
+        return response;
     }
 
     /**

+ 13 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreImgServiceImpl.java

@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.StoreImg;
@@ -159,6 +160,18 @@ public class StoreImgServiceImpl extends ServiceImpl<StoreImgMapper, StoreImg> i
      */
     @Override
     public List<StoreImg> getByBusinessId(Integer storeId, Integer imgType, Integer businessId) {
+        if (imgType==4){
+            LambdaQueryWrapper<StoreOfficialAlbum> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(StoreOfficialAlbum::getStoreId, storeId)
+                    .eq(StoreOfficialAlbum::getAlbumName, "环境");
+            List<StoreOfficialAlbum> list = storeOfficialAlbumMapper.selectList(queryWrapper);
+            if (!CollectionUtils.isEmpty(list)) {
+                StoreOfficialAlbum officialAlbum = list.get(0);
+                if (ObjectUtils.isNotEmpty(officialAlbum)) {
+                    businessId = officialAlbum.getId();
+                }
+            }
+        }
         LambdaQueryWrapper<StoreImg> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(StoreImg::getStoreId, storeId)
                 .eq(StoreImg::getImgType, imgType)

+ 53 - 10
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -27,12 +27,14 @@ import shop.alien.entity.store.vo.PerformanceScheduleVo;
 import shop.alien.entity.store.StoreComment;
 import shop.alien.entity.store.StoreStaffReview;
 import shop.alien.entity.store.StoreStaffTitle;
+import shop.alien.entity.store.LifeLikeRecord;
 import shop.alien.entity.store.vo.StaffTitleGroupVo;
 import shop.alien.entity.store.vo.StoreStaffDetailVo;
 import shop.alien.entity.store.vo.StoreStaffDetailWithPerformanceVo;
 import shop.alien.entity.store.vo.StoreStaffFitnessDetailVo;
 import shop.alien.entity.store.vo.StoreStaffPositionCountVo;
 import shop.alien.mapper.*;
+import shop.alien.mapper.LifeLikeRecordMapper;
 import shop.alien.store.service.StoreStaffConfigService;
 import shop.alien.store.service.StoreStaffFitnessBaseService;
 import shop.alien.store.service.StoreStaffFitnessCertificationService;
@@ -92,6 +94,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
 
     private final StoreStaffFitnessExperienceService storeStaffFitnessExperienceService;
 
+    private final LifeLikeRecordMapper lifeLikeRecordMapper;
+
     /**
      * 认证类型:认证
      */
@@ -243,15 +247,15 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
                             (videoAuditResult == null || videoAuditResult.isPassed());
 
         // 根据 AI 审核结果更新状态
-        // 审核通过:状态保持为"0"(审核中),等待人工审核
+        // 审核通过:状态保持为"1"(审核通过)
         // 审核失败:状态设置为"2"(审核拒绝)
         StoreStaffConfig auditUpdate = new StoreStaffConfig();
         auditUpdate.setId(staffId);
         if (allPassed) {
-            // AI审核通过,状态保持为"审核中"(0),等待人工审核
-            auditUpdate.setStatus("0");
+            // AI审核通过,状态保持为"审核中"(1)
+            auditUpdate.setStatus("1");
             auditUpdate.setRejectionReason(null);
-            log.info("人员AI审核通过,状态保持为审核中,等待人工审核:staffId={}", staffId);
+            log.info("人员AI审核通过,状态设置为审核通过:staffId={}", staffId);
         } else {
             // AI审核失败,状态设置为"审核拒绝"(2)
             // 收集所有失败原因
@@ -939,8 +943,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
      * @return 员工详情(包含演出列表),如果员工不存在则返回null
      */
     @Override
-    public StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id) {
-        log.info("查询员工详情(包含演出列表),id={}", id);
+    public StoreStaffDetailWithPerformanceVo queryStaffDetailWithPerformance(Integer id, Integer userId) {
+        log.info("查询员工详情(包含演出列表),id={},userId={}", id, userId);
 
         // 参数校验
         if (id == null || id <= 0) {
@@ -963,15 +967,19 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             // 判断今日是否有演出
             Boolean hasPerformanceToday = checkHasPerformanceToday(id);
 
+            // 判断是否喜欢(根据userId查询点赞记录)
+            Boolean isLiked = checkIsLiked(id, userId);
+
             // 构建返回对象
             StoreStaffDetailWithPerformanceVo result =
                     new StoreStaffDetailWithPerformanceVo();
             result.setStaffInfo(staffConfig);
             result.setPerformanceScheduleList(performanceScheduleList);
             result.setHasPerformanceToday(hasPerformanceToday);
+            result.setIsLiked(isLiked);
 
-            log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{}",
-                    id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday);
+            log.info("查询员工详情(包含演出列表)成功,id={},演出安排数量:{},今日是否有演出:{},是否喜欢:{}",
+                    id, performanceScheduleList != null ? performanceScheduleList.size() : 0, hasPerformanceToday, isLiked);
             return result;
         } catch (Exception e) {
             log.error("查询员工详情(包含演出列表)异常,id={},异常信息:{}", id, e.getMessage(), e);
@@ -1759,9 +1767,12 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
                 return new ArrayList<>();
             }
 
-            // 4. 过滤已删除的员工
+            // 4. 过滤已删除的员工,并根据title中的storeId过滤,只返回status为1(审核通过)的员工
             List<StoreStaffConfig> validStaffList = staffList.stream()
-                    .filter(staff -> staff != null && CommonConstant.DELETE_FLAG_UNDELETE.equals(staff.getDeleteFlag()))
+                    .filter(staff -> staff != null 
+                            && CommonConstant.DELETE_FLAG_UNDELETE.equals(staff.getDeleteFlag())
+                            && storeId.equals(staff.getStoreId())
+                            && "1".equals(staff.getStatus()))
                     .collect(Collectors.toList());
 
             if (validStaffList.isEmpty()) {
@@ -1805,4 +1816,36 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             throw new RuntimeException("根据标题ID查询员工列表失败:" + e.getMessage(), e);
         }
     }
+
+    /**
+     * 检查用户是否喜欢该员工
+     * <p>
+     * 根据userId查询life_like_record表,判断是否存在点赞记录
+     * type = "8" 表示点赞员工
+     * </p>
+     *
+     * @param staffId 员工ID
+     * @param userId 用户ID,可为null(未登录时返回false)
+     * @return true-已喜欢,false-未喜欢
+     */
+    private Boolean checkIsLiked(Integer staffId, Integer userId) {
+        // 如果用户未登录,返回false
+        if (userId == null || userId <= 0) {
+            return false;
+        }
+
+        try {
+            LambdaQueryWrapper<LifeLikeRecord> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(LifeLikeRecord::getType, "8") // 8-点赞员工
+                    .eq(LifeLikeRecord::getDianzanId, String.valueOf(userId))
+                    .eq(LifeLikeRecord::getHuifuId, String.valueOf(staffId))
+                    .eq(LifeLikeRecord::getDeleteFlag, 0);
+            long count = lifeLikeRecordMapper.selectCount(queryWrapper);
+            return count > 0;
+        } catch (Exception e) {
+            log.error("查询员工是否喜欢异常,staffId={},userId={},异常信息:{}", 
+                    staffId, userId, e.getMessage(), e);
+            return false;
+        }
+    }
 }