Pārlūkot izejas kodu

1.修复健身设备接口逻辑
2.人员表接口修改

zhangchen 2 dienas atpakaļ
vecāks
revīzija
aba4f6e6fe

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

@@ -32,10 +32,14 @@ public class SportsEquipmentFacility implements Serializable {
     @TableField("store_id")
     private Integer storeId;
 
-    @ApiModelProperty(value = "设施分类(1:有氧区, 2:力量区, 3:单功能机械区)")
+    @ApiModelProperty(value = "设施分类(1:有氧区, 2:力量区, 3:单功能机械区) - 已废弃,请使用facilityCategoryName")
     @TableField("facility_category")
     private Integer facilityCategory;
 
+    @ApiModelProperty(value = "设施分类名称(商户自定义)")
+    @TableField("facility_category_name")
+    private String facilityCategoryName;
+
     @ApiModelProperty(value = "设施名称")
     @TableField("facility_name")
     private String facilityName;

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

@@ -33,7 +33,7 @@ public class StoreStaffConfig extends Model<StoreStaffConfig> {
     @TableField("staff_position")
     private String staffPosition;
 
-    @ApiModelProperty(value = "员工名称/昵称")
+    @ApiModelProperty(value = "姓名/昵称")
     @TableField("name")
     private String name;
 
@@ -41,6 +41,14 @@ public class StoreStaffConfig extends Model<StoreStaffConfig> {
     @TableField("staff_image")
     private String staffImage;
 
+    @ApiModelProperty(value = "背景图片/视频(存储URL逗号分隔)")
+    @TableField("background_url")
+    private String backgroundUrl;
+
+    @ApiModelProperty(value = "擅长标签id(字典表proficient_tag逗号分隔)")
+    @TableField("proficient_id")
+    private String proficientId;
+
     @ApiModelProperty(value = "擅长项目")
     @TableField("proficient_projects")
     private String proficientProjects;
@@ -53,6 +61,10 @@ public class StoreStaffConfig extends Model<StoreStaffConfig> {
     @TableField("personal_introduction")
     private String personalIntroduction;
 
+    @ApiModelProperty(value = "电话")
+    @TableField("phone")
+    private String phone;
+
     @ApiModelProperty(value = "人员状态0-待审核 1-审核通过 2-审核拒绝")
     @TableField("status")
     private String status;
@@ -100,4 +112,12 @@ public class StoreStaffConfig extends Model<StoreStaffConfig> {
     @TableField("top_time")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date topTime;
+
+    @ApiModelProperty(value = "上线状态(0-上线 1-下线)")
+    @TableField("online_status")
+    private Integer onlineStatus;
+
+    @ApiModelProperty(value = "业务类型(0-酒吧 1-美食 2-运动健身)")
+    @TableField("business_type")
+    private Integer businessType;
 }

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

@@ -31,6 +31,9 @@ public class FitnessEquipmentCategoryDetailVo implements Serializable {
     @ApiModelProperty(value = "设施分类名称")
     private String facilityCategoryName;
 
+    @ApiModelProperty(value = "该分类下的设备数量")
+    private Integer facilityCount;
+
     @ApiModelProperty(value = "该分类下的图片列表(轮播图)")
     private List<String> imageList;
 

+ 10 - 26
alien-store/src/main/java/shop/alien/store/controller/SportsEquipmentFacilityController.java

@@ -233,34 +233,24 @@ public class SportsEquipmentFacilityController {
     private static final String INVALID_STORE_ID_MSG = "门店ID不能为空且必须大于0";
     
     /**
-     * 设施分类无效消息
-     */
-    private static final String INVALID_FACILITY_CATEGORY_MSG = "设施分类无效,必须为1(有氧区)、2(力量区)或3(单功能机械区)";
-    
-    /**
      * 最小有效值
      */
     private static final int MIN_VALID_VALUE = 1;
     
-    /**
-     * 最大设施分类编号
-     */
-    private static final int MAX_FACILITY_CATEGORY = 3;
-    
-    @ApiOperation("查询分类的设备详情(用户端)- 包含图片列表、各子分类的设备数量汇总、设备列表。facilityCategory为空时返回所有分类,equipmentType为空时返回所有类型")
+    @ApiOperation("查询分类的设备详情(用户端)- 包含图片列表、各子分类的设备数量汇总、设备列表。facilityCategoryName为空时返回所有分类,equipmentType为空时返回所有类型")
     @ApiOperationSupport(order = 11)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "Integer", paramType = "query", required = true),
-            @ApiImplicitParam(name = "facilityCategory", value = "设施分类(1:有氧区, 2:力量区, 3:单功能机械区),可选,为空时返回所有分类", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "facilityCategoryName", value = "设施分类名称(商户自定义),可选,为空时返回所有分类", dataType = "String", paramType = "query", required = false),
             @ApiImplicitParam(name = "equipmentType", value = "设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选,为空时返回所有类型", dataType = "Integer", paramType = "query", required = false)
     })
     @GetMapping("/categoryDetail")
     public R<List<FitnessEquipmentCategoryDetailVo>> getCategoryDetail(
             @RequestParam("storeId") Integer storeId,
-            @RequestParam(required = false) Integer facilityCategory,
+            @RequestParam(required = false) String facilityCategoryName,
             @RequestParam(required = false) Integer equipmentType) {
-        log.info("查询分类的设备详情(用户端),storeId={},facilityCategory={},equipmentType={}", 
-                storeId, facilityCategory, equipmentType);
+        log.info("查询分类的设备详情(用户端),storeId={},facilityCategoryName={},equipmentType={}", 
+                storeId, facilityCategoryName, equipmentType);
         try {
             // 参数验证
             if (storeId == null || storeId < MIN_VALID_VALUE) {
@@ -268,13 +258,7 @@ public class SportsEquipmentFacilityController {
                 return R.fail(INVALID_STORE_ID_MSG);
             }
             
-            // 如果facilityCategory不为空,验证其有效性
-            if (facilityCategory != null && (facilityCategory < MIN_VALID_VALUE || facilityCategory > MAX_FACILITY_CATEGORY)) {
-                log.warn("查询分类详情失败,设施分类无效:{}", facilityCategory);
-                return R.fail(INVALID_FACILITY_CATEGORY_MSG);
-            }
-            
-            List<FitnessEquipmentCategoryDetailVo> resultList = facilityService.getCategoryDetail(storeId, facilityCategory, equipmentType);
+            List<FitnessEquipmentCategoryDetailVo> resultList = facilityService.getCategoryDetail(storeId, facilityCategoryName, equipmentType);
             
             // 统计总设备数量(从equipmentTypeList中统计)
             int totalEquipmentCount = 0;
@@ -287,12 +271,12 @@ public class SportsEquipmentFacilityController {
                     }
                 }
             }
-            log.info("查询分类详情成功,storeId={},facilityCategory={},equipmentType={},返回分类数量:{},总设备数量:{}", 
-                    storeId, facilityCategory, equipmentType, resultList != null ? resultList.size() : 0, totalEquipmentCount);
+            log.info("查询分类详情成功,storeId={},facilityCategoryName={},equipmentType={},返回分类数量:{},总设备数量:{}", 
+                    storeId, facilityCategoryName, equipmentType, resultList != null ? resultList.size() : 0, totalEquipmentCount);
             return R.data(resultList);
         } catch (Exception e) {
-            log.error("查询分类详情异常,storeId={},facilityCategory={},equipmentType={},异常信息:{}", 
-                    storeId, facilityCategory, equipmentType, e.getMessage(), e);
+            log.error("查询分类详情异常,storeId={},facilityCategoryName={},equipmentType={},异常信息:{}", 
+                    storeId, facilityCategoryName, equipmentType, e.getMessage(), e);
             return R.fail(QUERY_FAIL_MSG + ":" + e.getMessage());
         }
     }

+ 25 - 7
alien-store/src/main/java/shop/alien/store/controller/StoreStaffConfigController.java

@@ -101,10 +101,10 @@ public class StoreStaffConfigController {
     /**
      * 员工列表查询接口(用户端)
      *
-     * @param page    分页页数
-     * @param size    分页条数
-     * @param storeId 店铺ID
-     * @param status  员工状态
+     * @param page    分页页数,默认1
+     * @param size    分页条数,默认10
+     * @param storeId 店铺ID,必填
+     * @param status  员工状态,可选(0-待审核 1-审核通过 2-审核拒绝)
      * @return 员工列表
      */
     @ApiOperation("员工列表查询(用户端)")
@@ -118,11 +118,29 @@ public class StoreStaffConfigController {
     @GetMapping("/queryStaffList")
     public R<IPage<StoreStaffConfig>> queryStaffList(
             @RequestParam(value = "page", defaultValue = "1") Integer page,
-            @RequestParam(value = "size", defaultValue = "100") Integer size,
-            @RequestParam(value = "storeId", required = true) Integer storeId,
+            @RequestParam(value = "size", defaultValue = "10") Integer size,
+            @RequestParam(value = "storeId") Integer storeId,
             @RequestParam(value = "status", required = false) String status) {
-        log.info("StoreStaffConfigController.queryStaffList?page={}&size={}&storeId={}&status={}", page, size, storeId, status);
+        log.info("查询员工列表,参数:page={}, size={}, storeId={}, status={}", page, size, storeId, status);
+        
+        // 参数校验
+        if (storeId == null || storeId <= 0) {
+            log.warn("查询员工列表失败,店铺ID无效:storeId={}", storeId);
+            return R.fail("店铺ID不能为空且必须大于0");
+        }
+        if (page == null || page < 1) {
+            page = 1;
+        }
+        if (size == null || size < 1) {
+            size = 10;
+        }
+        // 限制分页大小,防止查询过多数据
+        if (size > 100) {
+            size = 100;
+        }
+        
         IPage<StoreStaffConfig> result = storeStaffConfigService.queryStaffList(page, size, storeId, status);
+        log.info("查询员工列表成功,共{}条记录", result.getTotal());
         return R.data(result);
     }
 

+ 6 - 5
alien-store/src/main/java/shop/alien/store/service/SportsEquipmentFacilityService.java

@@ -100,14 +100,15 @@ public interface SportsEquipmentFacilityService extends IService<SportsEquipment
     /**
      * 查询分类的设备详情(用户端)
      * 包含图片列表、各子分类的设备数量汇总、设备列表
-     * 如果facilityCategory为空,返回所有分类的数据
+     * 按facility_category_name查询,支持商户自定义分类名称
+     * 如果facilityCategoryName为空,返回所有分类的数据
      * 如果equipmentType为空,返回该分类下所有类型的数据
      *
-     * @param storeId          门店ID,不能为空且必须大于0
-     * @param facilityCategory 设施分类(1:有氧区, 2:力量区, 3:单功能机械区),可选,为空时返回所有分类
-     * @param equipmentType    设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选,为空时返回所有类型
+     * @param storeId            门店ID,不能为空且必须大于0
+     * @param facilityCategoryName 设施分类名称(商户自定义),可选,为空时返回所有分类
+     * @param equipmentType       设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选,为空时返回所有类型
      * @return 分类详情列表,不会返回null
      */
-    List<FitnessEquipmentCategoryDetailVo> getCategoryDetail(Integer storeId, Integer facilityCategory, Integer equipmentType);
+    List<FitnessEquipmentCategoryDetailVo> getCategoryDetail(Integer storeId, String facilityCategoryName, Integer equipmentType);
 }
 

+ 10 - 6
alien-store/src/main/java/shop/alien/store/service/StoreStaffConfigService.java

@@ -37,13 +37,17 @@ public interface StoreStaffConfigService {
 
 
     /**
-     * 员工列表查询
+     * 员工列表查询(用户端)
+     * <p>
+     * 查询指定店铺的员工列表,支持按状态筛选
+     * 排序规则:先按置顶状态降序,再按置顶时间降序,最后按创建时间降序
+     * </p>
      *
-     * @param page    分页页数
-     * @param size    分页条数
-     * @param storeId 店铺ID
-     * @param status  员工状态
-     * @return 员工列表
+     * @param page    分页页数,必须大于0
+     * @param size    分页条数,必须大于0
+     * @param storeId 店铺ID,必须大于0
+     * @param status  员工状态,可选(0-待审核 1-审核通过 2-审核拒绝),为空时查询所有状态
+     * @return 员工列表分页结果
      */
     IPage<StoreStaffConfig> queryStaffList(Integer page, Integer size, Integer storeId, String status);
 

+ 268 - 34
alien-store/src/main/java/shop/alien/store/service/impl/SportsEquipmentFacilityServiceImpl.java

@@ -201,6 +201,7 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
      * 查询指定店铺按分类汇总的设备信息(用户端)
      * 包含每个分类的设备数量、图片列表和设备列表
      * 通过fitnessEquipmentIds关联FitnessEquipmentInfo信息
+     * 按facility_category_name分组查询,支持商户自定义分类名称
      *
      * @param storeId 门店ID,不能为空且必须大于0
      * @return 分类汇总列表,不会返回null
@@ -218,11 +219,22 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
         try {
             List<SportsEquipmentFacilityCategorySummaryVo> result = new ArrayList<>();
             
-            // 遍历所有分类(1:有氧区, 2:力量区, 3:单功能机械区)
-            for (int category = MIN_CATEGORY_NUM; category < FACILITY_CATEGORY_NAMES.length; category++) {
-                SportsEquipmentFacilityCategorySummaryVo categoryVo = buildCategorySummaryVo(
-                        storeId, category);
-                result.add(categoryVo);
+            // 查询该店铺下所有不同的设施分类名称
+            List<String> categoryNameList = queryDistinctCategoryNames(storeId);
+            
+            if (CollectionUtils.isEmpty(categoryNameList)) {
+                log.info("查询指定店铺按分类汇总的设备信息完成,storeId={},未找到分类数据", storeId);
+                return result;
+            }
+            
+            // 按分类名称分组查询
+            for (String categoryName : categoryNameList) {
+                SportsEquipmentFacilityCategorySummaryVo categoryVo = buildCategorySummaryVoByCategoryName(
+                        storeId, categoryName);
+                // 只添加有设备数据的分类
+                if (categoryVo.getFacilityCount() > 0 || !CollectionUtils.isEmpty(categoryVo.getFacilityList())) {
+                    result.add(categoryVo);
+                }
             }
             
             log.info("查询指定店铺按分类汇总的设备信息完成,storeId={},分类数量:{}", storeId, result.size());
@@ -234,12 +246,99 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
     }
     
     /**
-     * 构建分类汇总VO对象
+     * 查询指定店铺下所有不同的设施分类名称
+     *
+     * @param storeId 门店ID
+     * @return 分类名称列表,不会返回null
+     */
+    private List<String> queryDistinctCategoryNames(Integer storeId) {
+        try {
+            LambdaQueryWrapper<SportsEquipmentFacility> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(SportsEquipmentFacility::getStoreId, storeId)
+                    .eq(SportsEquipmentFacility::getDeleteFlag, DELETE_FLAG_NOT_DELETED)
+                    .isNotNull(SportsEquipmentFacility::getFacilityCategoryName)
+                    .ne(SportsEquipmentFacility::getFacilityCategoryName, "");
+            
+            List<SportsEquipmentFacility> facilityList = facilityMapper.selectList(queryWrapper);
+            
+            if (CollectionUtils.isEmpty(facilityList)) {
+                return new ArrayList<>();
+            }
+            
+            // 提取所有不同的分类名称并排序
+            return facilityList.stream()
+                    .map(SportsEquipmentFacility::getFacilityCategoryName)
+                    .filter(StringUtils::isNotBlank)
+                    .distinct()
+                    .sorted()
+                    .collect(Collectors.toList());
+        } catch (Exception e) {
+            log.error("查询设施分类名称列表异常,storeId={},异常信息:{}", storeId, e.getMessage(), e);
+            return new ArrayList<>();
+        }
+    }
+    
+    /**
+     * 根据分类名称构建分类汇总VO对象
+     *
+     * @param storeId      门店ID
+     * @param categoryName 分类名称
+     * @return 分类汇总VO对象
+     */
+    private SportsEquipmentFacilityCategorySummaryVo buildCategorySummaryVoByCategoryName(Integer storeId, String categoryName) {
+        SportsEquipmentFacilityCategorySummaryVo categoryVo = new SportsEquipmentFacilityCategorySummaryVo();
+        categoryVo.setStoreId(storeId);
+        categoryVo.setFacilityCategoryName(categoryName);
+        
+        // 查询该分类名称下的设备列表
+        List<SportsEquipmentFacility> facilityList = queryFacilityListByCategoryName(storeId, categoryName);
+        
+        // 设置设备数量:统计该分类名称下的SportsEquipmentFacility记录数量
+        categoryVo.setFacilityCount(facilityList != null ? facilityList.size() : 0);
+        
+        // 收集并解析fitnessEquipmentIds
+        List<Integer> fitnessEquipmentIdList = collectFitnessEquipmentIds(facilityList, storeId, null);
+        
+        // 查询FitnessEquipmentInfo列表
+        List<FitnessEquipmentInfo> fitnessEquipmentInfoList = queryFitnessEquipmentInfoList(fitnessEquipmentIdList, null, storeId);
+        
+        // 设置设备列表
+        categoryVo.setFacilityList(fitnessEquipmentInfoList);
+        
+        // 查询并设置图片列表
+        // 兼容处理:图片存储时business_id存储的是facility_category编号
+        // 需要从该分类名称下的设备中获取facility_category值来查询图片
+        List<String> imageList = queryCategoryImageListByCategoryName(storeId, categoryName, facilityList);
+        categoryVo.setImageList(imageList);
+        
+        return categoryVo;
+    }
+    
+    /**
+     * 根据分类名称查询设备列表
+     *
+     * @param storeId      门店ID
+     * @param categoryName 分类名称
+     * @return 设备列表
+     */
+    private List<SportsEquipmentFacility> queryFacilityListByCategoryName(Integer storeId, String categoryName) {
+        LambdaQueryWrapper<SportsEquipmentFacility> facilityWrapper = new LambdaQueryWrapper<>();
+        facilityWrapper.eq(SportsEquipmentFacility::getStoreId, storeId)
+                .eq(SportsEquipmentFacility::getFacilityCategoryName, categoryName)
+                .eq(SportsEquipmentFacility::getDeleteFlag, DELETE_FLAG_NOT_DELETED)
+                .orderByDesc(SportsEquipmentFacility::getCreatedTime);
+        return facilityMapper.selectList(facilityWrapper);
+    }
+    
+    /**
+     * 构建分类汇总VO对象(旧方法,已废弃,保留用于兼容)
      *
      * @param storeId  门店ID
      * @param category 分类编号
      * @return 分类汇总VO对象
+     * @deprecated 请使用 buildCategorySummaryVoByCategoryName 方法
      */
+    @Deprecated
     private SportsEquipmentFacilityCategorySummaryVo buildCategorySummaryVo(Integer storeId, Integer category) {
         SportsEquipmentFacilityCategorySummaryVo categoryVo = new SportsEquipmentFacilityCategorySummaryVo();
         categoryVo.setStoreId(storeId);
@@ -286,7 +385,7 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
      *
      * @param facilityList 设备列表
      * @param storeId      门店ID(用于日志)
-     * @param category     分类编号(用于日志)
+     * @param category     分类编号(用于日志,可为null
      * @return 去重后的设备ID列表
      */
     private List<Integer> collectFitnessEquipmentIds(List<SportsEquipmentFacility> facilityList, 
@@ -411,7 +510,55 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
     }
     
     /**
-     * 查询分类下的图片列表
+     * 根据分类名称查询图片列表
+     * 兼容处理:图片存储时business_id存储的是facility_category编号
+     * 需要从该分类名称下的设备中获取facility_category值来查询图片
+     *
+     * @param storeId      门店ID
+     * @param categoryName 分类名称
+     * @param facilityList 该分类下的设备列表
+     * @return 图片URL列表
+     */
+    private List<String> queryCategoryImageListByCategoryName(Integer storeId, String categoryName, 
+                                                               List<SportsEquipmentFacility> facilityList) {
+        try {
+            // 从设备列表中获取所有不同的facility_category值
+            List<Integer> categoryIdList = facilityList.stream()
+                    .map(SportsEquipmentFacility::getFacilityCategory)
+                    .filter(category -> category != null && category > 0)
+                    .distinct()
+                    .collect(Collectors.toList());
+            
+            if (CollectionUtils.isEmpty(categoryIdList)) {
+                return new ArrayList<>();
+            }
+            
+            // 查询所有相关分类的图片
+            LambdaQueryWrapper<StoreImg> imageWrapper = new LambdaQueryWrapper<>();
+            imageWrapper.eq(StoreImg::getStoreId, storeId)
+                    .in(StoreImg::getBusinessId, categoryIdList)
+                    .eq(StoreImg::getImgType, IMG_TYPE_SPORTS_EQUIPMENT)
+                    .orderByAsc(StoreImg::getImgSort);
+            
+            List<StoreImg> imageList = storeImgMapper.selectList(imageWrapper);
+            
+            if (CollectionUtils.isEmpty(imageList)) {
+                return new ArrayList<>();
+            }
+            
+            return imageList.stream()
+                    .map(StoreImg::getImgUrl)
+                    .distinct()
+                    .collect(Collectors.toList());
+        } catch (Exception e) {
+            log.error("查询分类图片列表异常,storeId={},categoryName={},异常信息:{}", 
+                    storeId, categoryName, e.getMessage(), e);
+            return new ArrayList<>();
+        }
+    }
+    
+    /**
+     * 查询分类下的图片列表(旧方法,保留用于兼容)
      *
      * @param storeId  门店ID
      * @param category 分类编号
@@ -582,18 +729,19 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
      * 查询分类的设备详情(用户端)
      * 包含图片列表、各子分类的设备数量汇总、设备列表
      * 通过fitnessEquipmentIds关联FitnessEquipmentInfo信息
-     * 如果facilityCategory为空,返回所有分类的数据
+     * 按facility_category_name查询,支持商户自定义分类名称
+     * 如果facilityCategoryName为空,返回所有分类的数据
      * 如果equipmentType为空,返回该分类下所有类型的数据
      *
-     * @param storeId          门店ID,不能为空且必须大于0
-     * @param facilityCategory 设施分类(1:有氧区, 2:力量区, 3:单功能机械区),可选,为空时返回所有分类
-     * @param equipmentType    设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选,为空时返回所有类型
+     * @param storeId            门店ID,不能为空且必须大于0
+     * @param facilityCategoryName 设施分类名称(商户自定义),可选,为空时返回所有分类
+     * @param equipmentType       设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选,为空时返回所有类型
      * @return 分类详情列表,不会返回null
      */
     @Override
-    public List<FitnessEquipmentCategoryDetailVo> getCategoryDetail(Integer storeId, Integer facilityCategory, Integer equipmentType) {
-        log.info("查询分类的设备详情(用户端),storeId={},facilityCategory={},equipmentType={}", 
-                storeId, facilityCategory, equipmentType);
+    public List<FitnessEquipmentCategoryDetailVo> getCategoryDetail(Integer storeId, String facilityCategoryName, Integer equipmentType) {
+        log.info("查询分类的设备详情(用户端),storeId={},facilityCategoryName={},equipmentType={}", 
+                storeId, facilityCategoryName, equipmentType);
         
         // 参数验证
         if (!isValidStoreId(storeId)) {
@@ -604,41 +752,91 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
         try {
             List<FitnessEquipmentCategoryDetailVo> resultList = new ArrayList<>();
             
-            // 如果facilityCategory为空,返回所有分类的数据
-            if (facilityCategory == null) {
-                for (int category = MIN_CATEGORY_NUM; category < FACILITY_CATEGORY_NAMES.length; category++) {
-                    FitnessEquipmentCategoryDetailVo detailVo = buildCategoryDetailVo(storeId, category, equipmentType);
-                    resultList.add(detailVo);
+            // 如果facilityCategoryName为空,返回所有分类的数据
+            if (StringUtils.isBlank(facilityCategoryName)) {
+                // 查询该店铺下所有不同的设施分类名称
+                List<String> categoryNameList = queryDistinctCategoryNames(storeId);
+                
+                if (CollectionUtils.isEmpty(categoryNameList)) {
+                    log.info("查询分类详情完成,storeId={},未找到分类数据", storeId);
+                    return resultList;
                 }
-            } else {
-                // 验证facilityCategory有效性
-                if (!isValidFacilityCategory(facilityCategory)) {
-                    log.warn("查询分类详情失败,设施分类无效:{}", facilityCategory);
-                    return new ArrayList<>();
+                
+                // 遍历所有分类名称
+                for (String categoryName : categoryNameList) {
+                    FitnessEquipmentCategoryDetailVo detailVo = buildCategoryDetailVoByCategoryName(storeId, categoryName, equipmentType);
+                    // 只添加有设备数据的分类
+                    if (detailVo.getEquipmentTypeList() != null && !detailVo.getEquipmentTypeList().isEmpty()) {
+                        resultList.add(detailVo);
+                    }
                 }
-                // 返回指定分类的数据
-                FitnessEquipmentCategoryDetailVo detailVo = buildCategoryDetailVo(storeId, facilityCategory, equipmentType);
+            } else {
+                // 返回指定分类名称的数据
+                FitnessEquipmentCategoryDetailVo detailVo = buildCategoryDetailVoByCategoryName(storeId, facilityCategoryName, equipmentType);
                 resultList.add(detailVo);
             }
             
-            log.info("查询分类详情成功,storeId={},facilityCategory={},equipmentType={},返回分类数量:{}", 
-                    storeId, facilityCategory, equipmentType, resultList.size());
+            log.info("查询分类详情成功,storeId={},facilityCategoryName={},equipmentType={},返回分类数量:{}", 
+                    storeId, facilityCategoryName, equipmentType, resultList.size());
             return resultList;
         } catch (Exception e) {
-            log.error("查询分类详情异常,storeId={},facilityCategory={},equipmentType={},异常信息:{}", 
-                    storeId, facilityCategory, equipmentType, e.getMessage(), e);
+            log.error("查询分类详情异常,storeId={},facilityCategoryName={},equipmentType={},异常信息:{}", 
+                    storeId, facilityCategoryName, equipmentType, e.getMessage(), e);
             throw new RuntimeException("查询分类详情异常:" + e.getMessage(), e);
         }
     }
     
     /**
-     * 构建单个分类的详情VO对象
+     * 根据分类名称构建单个分类的详情VO对象
+     *
+     * @param storeId            门店ID
+     * @param facilityCategoryName 设施分类名称
+     * @param equipmentType       设备类型,可选,如果传入则只返回该类型的设备列表
+     * @return 分类详情VO对象
+     */
+    private FitnessEquipmentCategoryDetailVo buildCategoryDetailVoByCategoryName(Integer storeId, String facilityCategoryName, Integer equipmentType) {
+        FitnessEquipmentCategoryDetailVo detailVo = buildBaseCategoryDetailVoByCategoryName(storeId, facilityCategoryName);
+        
+        // 查询该分类名称下的设备列表(用于查询图片)
+        List<SportsEquipmentFacility> facilityList = queryFacilityListByCategoryName(storeId, facilityCategoryName);
+        
+        // 查询并设置设备相关信息
+        List<FitnessEquipmentInfo> allEquipmentList = queryCategoryEquipmentListByCategoryName(storeId, facilityCategoryName);
+        
+        // 如果传入了equipmentType,只筛选该类型的设备
+        List<FitnessEquipmentInfo> filteredEquipmentList = filterAndSortEquipmentList(allEquipmentList, equipmentType);
+        
+        // 构建设备类型汇总列表(包含设备列表)
+        List<FitnessEquipmentTypeSummaryVo> equipmentTypeList = buildEquipmentTypeSummaryList(filteredEquipmentList);
+        detailVo.setEquipmentTypeList(equipmentTypeList);
+        
+        // 计算所有equipmentList中的设备总数
+        int totalEquipmentCount = equipmentTypeList.stream()
+                .mapToInt(vo -> vo.getEquipmentList() != null ? vo.getEquipmentList().size() : 0)
+                .sum();
+        
+        // 设置设备数量:所有equipmentTypeList中equipmentList的设备总数
+        detailVo.setFacilityCount(totalEquipmentCount);
+        
+        // 查询并设置图片列表
+        List<String> imageList = queryCategoryImageListByCategoryName(storeId, facilityCategoryName, facilityList);
+        detailVo.setImageList(imageList);
+        
+        log.debug("构建分类详情VO完成,storeId={},facilityCategoryName={},equipmentType={},设备数量:{}", 
+                storeId, facilityCategoryName, equipmentType, totalEquipmentCount);
+        return detailVo;
+    }
+    
+    /**
+     * 构建单个分类的详情VO对象(旧方法,已废弃,保留用于兼容)
      *
      * @param storeId          门店ID
      * @param facilityCategory 设施分类
      * @param equipmentType    设备类型,可选,如果传入则只返回该类型的设备列表
      * @return 分类详情VO对象
+     * @deprecated 请使用 buildCategoryDetailVoByCategoryName 方法
      */
+    @Deprecated
     private FitnessEquipmentCategoryDetailVo buildCategoryDetailVo(Integer storeId, Integer facilityCategory, Integer equipmentType) {
         FitnessEquipmentCategoryDetailVo detailVo = buildBaseCategoryDetailVo(storeId, facilityCategory);
         
@@ -688,12 +886,28 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
     }
     
     /**
-     * 构建基础分类详情VO对象
+     * 根据分类名称构建基础分类详情VO对象
+     *
+     * @param storeId            门店ID
+     * @param facilityCategoryName 设施分类名称
+     * @return 基础分类详情VO对象
+     */
+    private FitnessEquipmentCategoryDetailVo buildBaseCategoryDetailVoByCategoryName(Integer storeId, String facilityCategoryName) {
+        FitnessEquipmentCategoryDetailVo detailVo = new FitnessEquipmentCategoryDetailVo();
+        detailVo.setStoreId(storeId);
+        detailVo.setFacilityCategoryName(facilityCategoryName);
+        return detailVo;
+    }
+    
+    /**
+     * 构建基础分类详情VO对象(旧方法,已废弃,保留用于兼容)
      *
      * @param storeId          门店ID
      * @param facilityCategory 设施分类
      * @return 基础分类详情VO对象
+     * @deprecated 请使用 buildBaseCategoryDetailVoByCategoryName 方法
      */
+    @Deprecated
     private FitnessEquipmentCategoryDetailVo buildBaseCategoryDetailVo(Integer storeId, Integer facilityCategory) {
         FitnessEquipmentCategoryDetailVo detailVo = new FitnessEquipmentCategoryDetailVo();
         detailVo.setStoreId(storeId);
@@ -705,12 +919,32 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
     }
     
     /**
-     * 查询分类下的设备列表
+     * 根据分类名称查询分类下的设备列表
+     *
+     * @param storeId            门店ID
+     * @param facilityCategoryName 设施分类名称
+     * @return 设备信息列表
+     */
+    private List<FitnessEquipmentInfo> queryCategoryEquipmentListByCategoryName(Integer storeId, String facilityCategoryName) {
+        // 查询该分类名称下的设备列表
+        List<SportsEquipmentFacility> facilityList = queryFacilityListByCategoryName(storeId, facilityCategoryName);
+        
+        // 收集并解析fitnessEquipmentIds
+        List<Integer> fitnessEquipmentIdList = collectFitnessEquipmentIds(facilityList, storeId, null);
+        
+        // 查询所有有效的FitnessEquipmentInfo列表
+        return queryAllFitnessEquipmentInfo(fitnessEquipmentIdList, storeId, null);
+    }
+    
+    /**
+     * 查询分类下的设备列表(旧方法,已废弃,保留用于兼容)
      *
      * @param storeId          门店ID
      * @param facilityCategory 设施分类
      * @return 设备信息列表
+     * @deprecated 请使用 queryCategoryEquipmentListByCategoryName 方法
      */
+    @Deprecated
     private List<FitnessEquipmentInfo> queryCategoryEquipmentList(Integer storeId, Integer facilityCategory) {
         // 查询该分类下的设备列表
         List<SportsEquipmentFacility> facilityList = queryFacilityListByCategory(storeId, facilityCategory);

+ 33 - 13
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -1,5 +1,6 @@
 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.metadata.IPage;
@@ -14,6 +15,7 @@ import shop.alien.entity.store.excelVo.StoreStaffConfigExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.mapper.StoreStaffConfigMapper;
 import shop.alien.store.service.StoreStaffConfigService;
+import shop.alien.store.util.CommonConstant;
 import shop.alien.util.ali.AliOSSUtil;
 
 import java.io.File;
@@ -171,20 +173,38 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
 
     @Override
     public IPage<StoreStaffConfig> queryStaffList(Integer page, Integer size, Integer storeId, String status) {
-        IPage<StoreStaffConfig> storePage = new Page<>(page, size);
-        QueryWrapper<StoreStaffConfig> queryWrapper = new QueryWrapper<>();
-        // 按照店铺ID查询
-        if (storeId != null && storeId > 0) {
-            queryWrapper.eq("store_id", storeId);
+        // 参数校验
+        if (page == null || page < 1) {
+            page = 1;
         }
-        // 如果状态不为空,则进行精确匹配查询
-//        if (StringUtils.isNotEmpty(status)) {
-//            queryWrapper.eq("status", status);
-//        }
-        // 只查询未删除的记录
-        queryWrapper.eq("delete_flag", 0);
-        queryWrapper.orderByDesc("created_time");
-        return storeStaffConfigMapper.selectPage(storePage, queryWrapper);
+        if (size == null || size < 1) {
+            size = 10;
+        }
+        if (storeId == null || storeId <= 0) {
+            throw new IllegalArgumentException("店铺ID不能为空且必须大于0");
+        }
+
+        // 构建分页对象
+        IPage<StoreStaffConfig> staffPage = new Page<>(page, size);
+
+        // 使用 LambdaQueryWrapper 构建查询条件,类型安全
+        LambdaQueryWrapper<StoreStaffConfig> queryWrapper = new LambdaQueryWrapper<>();
+
+        // 必须条件:店铺ID和未删除
+        queryWrapper.eq(StoreStaffConfig::getStoreId, storeId)
+                .eq(StoreStaffConfig::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
+
+        // 可选条件:员工状态筛选
+        if (StringUtils.isNotEmpty(status)) {
+            queryWrapper.eq(StoreStaffConfig::getStatus, status);
+        }
+
+        // 排序规则:先按置顶状态降序(置顶的在前),再按置顶时间降序,最后按创建时间降序
+        queryWrapper.orderByDesc(StoreStaffConfig::getTopStatus)
+                .orderByDesc(StoreStaffConfig::getTopTime)
+                .orderByDesc(StoreStaffConfig::getCreatedTime);
+
+        return storeStaffConfigMapper.selectPage(staffPage, queryWrapper);
     }
 
     @Override

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

@@ -55,4 +55,23 @@ public class CommonConstant {
     public static final String FOOD_LICENCE_EXPIRE_STATUS = "0";
     public static final String FOOD_LICENCE_ABOUT_TO_EXPIRE_STATUS = "1";
     public static final String FOOD_LICENCE_NOT_EXPIRED_STATUS = "2";
+
+    /**
+     * 员工状态:0-待审核 1-审核通过 2-审核拒绝
+     */
+    public static final String STAFF_STATUS_PENDING = "0";
+    public static final String STAFF_STATUS_APPROVED = "1";
+    public static final String STAFF_STATUS_REJECTED = "2";
+
+    /**
+     * 置顶状态:0-未置顶 1-已置顶
+     */
+    public static final Integer TOP_STATUS_NOT_TOP = 0;
+    public static final Integer TOP_STATUS_TOP = 1;
+
+    /**
+     * 默认分页大小
+     */
+    public static final Integer DEFAULT_PAGE_SIZE = 10;
+    public static final Integer DEFAULT_PAGE_NUM = 1;
 }