Przeglądaj źródła

修改体育设备相关逻辑

zhangchen 10 godzin temu
rodzic
commit
29a7287c2d

+ 94 - 0
alien-entity/src/main/java/shop/alien/entity/store/FitnessEquipmentInfo.java

@@ -0,0 +1,94 @@
+package shop.alien.entity.store;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 健身设备信息实体类
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@TableName("fitness_equipment_info")
+@ApiModel(value = "FitnessEquipmentInfo对象", description = "健身设备信息")
+public class FitnessEquipmentInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "设备名称", required = true)
+    @TableField("equipment_name")
+    private String equipmentName;
+
+    @ApiModelProperty(value = "设备编码")
+    @TableField("equipment_code")
+    private String equipmentCode;
+
+    @ApiModelProperty(value = "设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他)", required = true)
+    @TableField("equipment_type")
+    private Integer equipmentType;
+
+    @ApiModelProperty(value = "设备图标URL")
+    @TableField("equipment_icon")
+    private String equipmentIcon;
+
+    @ApiModelProperty(value = "设备图片URL")
+    @TableField("equipment_image")
+    private String equipmentImage;
+
+    @ApiModelProperty(value = "设备描述")
+    @TableField("description")
+    private String description;
+
+    @ApiModelProperty(value = "使用方法")
+    @TableField("usage_method")
+    private String usageMethod;
+
+    @ApiModelProperty(value = "注意事项")
+    @TableField("precautions")
+    private String precautions;
+
+    @ApiModelProperty(value = "排序号")
+    @TableField("sort_order")
+    private Integer sortOrder;
+
+    @ApiModelProperty(value = "状态(0:禁用, 1:启用)")
+    @TableField("status")
+    private Integer status;
+
+    @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(value = "created_user_id", fill = FieldFill.INSERT)
+    private Integer createdUserId;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updatedTime;
+
+    @ApiModelProperty(value = "修改人ID")
+    @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
+    private Integer updatedUserId;
+}
+

+ 7 - 2
alien-entity/src/main/java/shop/alien/entity/store/SportsEquipmentFacility.java

@@ -11,7 +11,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 /**
- * 运动器材设施表
+ * 店铺运动器材设施表
  *
  * @author system
  * @since 2025-01-XX
@@ -19,7 +19,7 @@ import java.util.Date;
 @Data
 @JsonInclude
 @TableName("sports_equipment_facility")
-@ApiModel(value = "SportsEquipmentFacility对象", description = "运动器材设施表")
+@ApiModel(value = "SportsEquipmentFacility对象", description = "店铺运动器材设施表")
 public class SportsEquipmentFacility implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -78,5 +78,10 @@ public class SportsEquipmentFacility implements Serializable {
     @ApiModelProperty(value = "修改人ID")
     @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
     private Integer updatedUserId;
+
+    @ApiModelProperty(value = "设备列表(fitness_equipment_info表的id,用逗号分隔)")
+    @TableField("fitness_equipment_ids")
+    private String fitnessEquipmentIds;
+
 }
 

+ 43 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/SportsEquipmentFacilityCategorySummaryVo.java

@@ -0,0 +1,43 @@
+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 shop.alien.entity.store.FitnessEquipmentInfo;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 运动器材设施分类汇总视图对象(用于categorySummary接口)
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel(value = "SportsEquipmentFacilityCategorySummaryVo对象", description = "运动器材设施分类汇总视图对象(用于categorySummary接口)")
+public class SportsEquipmentFacilityCategorySummaryVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "门店ID")
+    private Integer storeId;
+
+    @ApiModelProperty(value = "设施分类(1:有氧区, 2:力量区, 3:单功能机械区)")
+    private Integer facilityCategory;
+
+    @ApiModelProperty(value = "设施分类名称")
+    private String facilityCategoryName;
+
+    @ApiModelProperty(value = "该分类下的设备数量")
+    private Integer facilityCount;
+
+    @ApiModelProperty(value = "该分类下的图片列表")
+    private List<String> imageList;
+
+    @ApiModelProperty(value = "该分类下的设备列表(FitnessEquipmentInfo)")
+    private List<FitnessEquipmentInfo> facilityList;
+}
+

+ 16 - 0
alien-entity/src/main/java/shop/alien/mapper/FitnessEquipmentInfoMapper.java

@@ -0,0 +1,16 @@
+package shop.alien.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import shop.alien.entity.store.FitnessEquipmentInfo;
+
+/**
+ * 健身设备信息Mapper接口
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Mapper
+public interface FitnessEquipmentInfoMapper extends BaseMapper<FitnessEquipmentInfo> {
+}
+

+ 363 - 0
alien-store/src/main/java/shop/alien/store/controller/FitnessEquipmentInfoController.java

@@ -0,0 +1,363 @@
+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.FitnessEquipmentInfo;
+import shop.alien.store.service.FitnessEquipmentInfoService;
+
+import java.util.List;
+
+/**
+ * 健身设备信息控制器
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Slf4j
+@Api(tags = {"健身设备信息管理"})
+@ApiSort(1)
+@CrossOrigin
+@RestController
+@RequestMapping("/fitness/equipment/info")
+@RequiredArgsConstructor
+public class FitnessEquipmentInfoController {
+
+    /**
+     * 操作成功消息
+     */
+    private static final String OPERATION_SUCCESS_MSG = "操作成功";
+
+    /**
+     * 操作失败消息
+     */
+    private static final String OPERATION_FAIL_MSG = "操作失败";
+
+    /**
+     * 参数为空消息
+     */
+    private static final String PARAM_NULL_MSG = "参数不能为空";
+
+    /**
+     * 查询失败消息
+     */
+    private static final String QUERY_FAIL_MSG = "查询失败";
+
+    /**
+     * 新增成功消息
+     */
+    private static final String ADD_SUCCESS_MSG = "新增成功";
+
+    /**
+     * 修改成功消息
+     */
+    private static final String MODIFY_SUCCESS_MSG = "修改成功";
+
+    /**
+     * 删除成功消息
+     */
+    private static final String DELETE_SUCCESS_MSG = "删除成功";
+
+    /**
+     * 状态:启用
+     */
+    private static final int STATUS_ENABLED = 1;
+
+    /**
+     * 状态:禁用
+     */
+    private static final int STATUS_DISABLED = 0;
+
+    /**
+     * 健身设备信息服务
+     */
+    private final FitnessEquipmentInfoService fitnessEquipmentInfoService;
+
+    /**
+     * 分页查询健身设备信息列表
+     *
+     * @param pageNum       页码,默认1
+     * @param pageSize      页大小,默认10
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选
+     * @param equipmentName 设备名称(模糊查询),可选
+     * @param status        状态(0:禁用, 1:启用),可选
+     * @return 健身设备信息分页列表
+     */
+    @ApiOperation("分页查询健身设备信息列表")
+    @ApiOperationSupport(order = 1)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize", value = "页大小", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "equipmentType", value = "设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他)", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "equipmentName", value = "设备名称(模糊查询)", dataType = "String", paramType = "query", required = false),
+            @ApiImplicitParam(name = "status", value = "状态(0:禁用, 1:启用)", dataType = "Integer", paramType = "query", required = false)
+    })
+    @GetMapping("/page")
+    public R<IPage<FitnessEquipmentInfo>> getPageList(
+            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+            @RequestParam(required = false) Integer equipmentType,
+            @RequestParam(required = false) String equipmentName,
+            @RequestParam(required = false) Integer status) {
+        log.info("分页查询健身设备信息列表,pageNum={}, pageSize={}, equipmentType={}, equipmentName={}, status={}", 
+                pageNum, pageSize, equipmentType, equipmentName, status);
+
+        try {
+            IPage<FitnessEquipmentInfo> result = fitnessEquipmentInfoService.getPageList(
+                    pageNum, pageSize, equipmentType, equipmentName, status);
+            log.info("分页查询健身设备信息列表成功,查询到{}条记录", result.getTotal());
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("分页查询健身设备信息列表异常,异常信息:{}", e.getMessage(), e);
+            return R.fail(QUERY_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 查询健身设备信息列表
+     *
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选
+     * @param status        状态(0:禁用, 1:启用),可选
+     * @return 健身设备信息列表
+     */
+    @ApiOperation("查询健身设备信息列表")
+    @ApiOperationSupport(order = 2)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "equipmentType", value = "设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他)", dataType = "Integer", paramType = "query", required = false),
+            @ApiImplicitParam(name = "status", value = "状态(0:禁用, 1:启用)", dataType = "Integer", paramType = "query", required = false)
+    })
+    @GetMapping("/list")
+    public R<List<FitnessEquipmentInfo>> getList(
+            @RequestParam(required = false) Integer equipmentType,
+            @RequestParam(required = false) Integer status) {
+        log.info("查询健身设备信息列表,equipmentType={}, status={}", equipmentType, status);
+
+        try {
+            List<FitnessEquipmentInfo> result = fitnessEquipmentInfoService.getList(equipmentType, status);
+            log.info("查询健身设备信息列表成功,查询到{}条记录", result.size());
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("查询健身设备信息列表异常,异常信息:{}", e.getMessage(), e);
+            return R.fail(QUERY_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 根据设备类型查询设备列表(用于前端分类展示)
+     *
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),必传
+     * @return 健身设备信息列表
+     */
+    @ApiOperation("根据设备类型查询设备列表(用于前端分类展示)")
+    @ApiOperationSupport(order = 3)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "equipmentType", value = "设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他)", dataType = "Integer", paramType = "query", required = true)
+    })
+    @GetMapping("/listByType")
+    public R<List<FitnessEquipmentInfo>> getListByType(@RequestParam("equipmentType") Integer equipmentType) {
+        log.info("根据设备类型查询设备列表,equipmentType={}", equipmentType);
+
+        try {
+            // 参数验证
+            if (equipmentType == null || equipmentType <= 0) {
+                log.warn("根据设备类型查询设备列表失败,设备类型无效:{}", equipmentType);
+                return R.fail("设备类型不能为空且必须大于0");
+            }
+
+            List<FitnessEquipmentInfo> result = fitnessEquipmentInfoService.getListByType(equipmentType);
+            log.info("根据设备类型查询设备列表成功,equipmentType={},查询到{}条记录", equipmentType, result.size());
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("根据设备类型查询设备列表异常,equipmentType={},异常信息:{}", equipmentType, e.getMessage(), e);
+            return R.fail(QUERY_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 根据ID查询健身设备信息详情
+     *
+     * @param id 主键ID,不能为空
+     * @return 健身设备信息
+     */
+    @ApiOperation("根据ID查询健身设备信息详情")
+    @ApiOperationSupport(order = 4)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "query", required = true)
+    })
+    @GetMapping("/detail")
+    public R<FitnessEquipmentInfo> getDetailById(@RequestParam("id") Integer id) {
+        log.info("根据ID查询健身设备信息详情,id={}", id);
+
+        try {
+            // 参数验证
+            if (id == null || id <= 0) {
+                log.warn("根据ID查询健身设备信息详情失败,ID无效:{}", id);
+                return R.fail("ID不能为空且必须大于0");
+            }
+
+            FitnessEquipmentInfo result = fitnessEquipmentInfoService.getDetailById(id);
+            if (result == null) {
+                log.warn("根据ID查询健身设备信息详情失败,设备不存在,id={}", id);
+                return R.fail("设备不存在");
+            }
+
+            log.info("根据ID查询健身设备信息详情成功,id={}", id);
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("根据ID查询健身设备信息详情异常,id={},异常信息:{}", id, e.getMessage(), e);
+            return R.fail(QUERY_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 新增健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象,不能为空
+     * @return 操作结果
+     */
+    @ApiOperation("新增健身设备信息")
+    @ApiOperationSupport(order = 5)
+    @PostMapping("/save")
+    public R<Boolean> saveEquipment(@RequestBody FitnessEquipmentInfo fitnessEquipmentInfo) {
+        log.info("新增健身设备信息,请求参数:{}", fitnessEquipmentInfo);
+
+        try {
+            // 参数验证
+            if (fitnessEquipmentInfo == null) {
+                log.warn("新增健身设备信息失败,设备信息对象为空");
+                return R.fail(PARAM_NULL_MSG);
+            }
+
+            boolean result = fitnessEquipmentInfoService.saveEquipment(fitnessEquipmentInfo);
+            if (result) {
+                log.info("新增健身设备信息成功");
+                return R.success(ADD_SUCCESS_MSG);
+            } else {
+                log.warn("新增健身设备信息失败");
+                return R.fail(OPERATION_FAIL_MSG);
+            }
+        } catch (Exception e) {
+            log.error("新增健身设备信息异常,异常信息:{}", e.getMessage(), e);
+            return R.fail(OPERATION_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 修改健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象,不能为空
+     * @return 操作结果
+     */
+    @ApiOperation("修改健身设备信息")
+    @ApiOperationSupport(order = 6)
+    @PostMapping("/update")
+    public R<Boolean> updateEquipment(@RequestBody FitnessEquipmentInfo fitnessEquipmentInfo) {
+        log.info("修改健身设备信息,请求参数:{}", fitnessEquipmentInfo);
+
+        try {
+            // 参数验证
+            if (fitnessEquipmentInfo == null || fitnessEquipmentInfo.getId() == null) {
+                log.warn("修改健身设备信息失败,设备信息对象为空或ID为空");
+                return R.fail(PARAM_NULL_MSG);
+            }
+            if (fitnessEquipmentInfo.getId() <= 0) {
+                log.warn("修改健身设备信息失败,ID无效:{}", fitnessEquipmentInfo.getId());
+                return R.fail("ID不能为空且必须大于0");
+            }
+
+            boolean result = fitnessEquipmentInfoService.updateEquipment(fitnessEquipmentInfo);
+            if (result) {
+                log.info("修改健身设备信息成功,id={}", fitnessEquipmentInfo.getId());
+                return R.success(MODIFY_SUCCESS_MSG);
+            } else {
+                log.warn("修改健身设备信息失败,id={}", fitnessEquipmentInfo.getId());
+                return R.fail(OPERATION_FAIL_MSG);
+            }
+        } catch (Exception e) {
+            log.error("修改健身设备信息异常,异常信息:{}", e.getMessage(), e);
+            return R.fail(OPERATION_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 删除健身设备信息(逻辑删除)
+     *
+     * @param id 主键ID,不能为空
+     * @return 操作结果
+     */
+    @ApiOperation("删除健身设备信息")
+    @ApiOperationSupport(order = 7)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "query", required = true)
+    })
+    @DeleteMapping("/delete")
+    public R<Boolean> deleteEquipment(@RequestParam("id") Integer id) {
+        log.info("删除健身设备信息,id={}", id);
+
+        try {
+            // 参数验证
+            if (id == null || id <= 0) {
+                log.warn("删除健身设备信息失败,ID无效:{}", id);
+                return R.fail("ID不能为空且必须大于0");
+            }
+
+            boolean result = fitnessEquipmentInfoService.deleteEquipment(id);
+            if (result) {
+                log.info("删除健身设备信息成功,id={}", id);
+                return R.success(DELETE_SUCCESS_MSG);
+            } else {
+                log.warn("删除健身设备信息失败,id={}", id);
+                return R.fail(OPERATION_FAIL_MSG);
+            }
+        } catch (Exception e) {
+            log.error("删除健身设备信息异常,id={},异常信息:{}", id, e.getMessage(), e);
+            return R.fail(OPERATION_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+
+    /**
+     * 启用/禁用健身设备信息
+     *
+     * @param id     主键ID,不能为空
+     * @param status 状态(0:禁用, 1:启用),不能为空
+     * @return 操作结果
+     */
+    @ApiOperation("启用/禁用健身设备信息")
+    @ApiOperationSupport(order = 8)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "status", value = "状态(0:禁用, 1:启用)", dataType = "Integer", paramType = "query", required = true)
+    })
+    @PostMapping("/updateStatus")
+    public R<Boolean> updateStatus(@RequestParam("id") Integer id, @RequestParam("status") Integer status) {
+        log.info("启用/禁用健身设备信息,id={}, status={}", id, status);
+
+        try {
+            // 参数验证
+            if (id == null || id <= 0) {
+                log.warn("启用/禁用健身设备信息失败,ID无效:{}", id);
+                return R.fail("ID不能为空且必须大于0");
+            }
+            if (status == null || (status != STATUS_ENABLED && status != STATUS_DISABLED)) {
+                log.warn("启用/禁用健身设备信息失败,状态值无效:{}", status);
+                return R.fail("状态值必须为0(禁用)或1(启用)");
+            }
+
+            boolean result = fitnessEquipmentInfoService.updateStatus(id, status);
+            if (result) {
+                log.info("启用/禁用健身设备信息成功,id={}, status={}", id, status);
+                return R.success(OPERATION_SUCCESS_MSG);
+            } else {
+                log.warn("启用/禁用健身设备信息失败,id={}, status={}", id, status);
+                return R.fail(OPERATION_FAIL_MSG);
+            }
+        } catch (Exception e) {
+            log.error("启用/禁用健身设备信息异常,id={}, status={},异常信息:{}", id, status, e.getMessage(), e);
+            return R.fail(OPERATION_FAIL_MSG + ":" + e.getMessage());
+        }
+    }
+}
+

+ 15 - 3
alien-store/src/main/java/shop/alien/store/controller/SportsEquipmentFacilityController.java

@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.SportsEquipmentFacility;
+import shop.alien.entity.store.vo.SportsEquipmentFacilityCategorySummaryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityCategoryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityVo;
 import shop.alien.store.service.SportsEquipmentFacilityService;
@@ -158,9 +159,20 @@ public class SportsEquipmentFacilityController {
             @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "int", paramType = "query", required = true)
     })
     @GetMapping("/categorySummary")
-    public R<List<SportsEquipmentFacilityCategoryVo>> getCategorySummary(@RequestParam Integer storeId) {
-        log.info("SportsEquipmentFacilityController.getCategorySummary?storeId={}", storeId);
-        return R.data(facilityService.getCategorySummary(storeId));
+    public R<List<SportsEquipmentFacilityCategorySummaryVo>> getCategorySummary(@RequestParam Integer storeId) {
+        log.info("SportsEquipmentFacilityController.getCategorySummary,storeId={}", storeId);
+        try {
+            if (storeId == null || storeId <= 0) {
+                log.warn("查询分类汇总失败,门店ID无效:{}", storeId);
+                return R.fail("门店ID不能为空且必须大于0");
+            }
+            List<SportsEquipmentFacilityCategorySummaryVo> result = facilityService.getCategorySummary(storeId);
+            log.info("查询分类汇总成功,storeId={},返回分类数量:{}", storeId, result.size());
+            return R.data(result);
+        } catch (Exception e) {
+            log.error("查询分类汇总异常,storeId={},异常信息:{}", storeId, e.getMessage(), e);
+            return R.fail("查询失败:" + e.getMessage());
+        }
     }
 
 

+ 88 - 0
alien-store/src/main/java/shop/alien/store/service/FitnessEquipmentInfoService.java

@@ -0,0 +1,88 @@
+package shop.alien.store.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import shop.alien.entity.store.FitnessEquipmentInfo;
+
+import java.util.List;
+
+/**
+ * 健身设备信息服务接口
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+public interface FitnessEquipmentInfoService extends IService<FitnessEquipmentInfo> {
+
+    /**
+     * 分页查询健身设备信息列表
+     *
+     * @param pageNum       页码
+     * @param pageSize      页大小
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选
+     * @param equipmentName 设备名称(模糊查询),可选
+     * @param status        状态(0:禁用, 1:启用),可选
+     * @return 健身设备信息分页列表
+     */
+    IPage<FitnessEquipmentInfo> getPageList(Integer pageNum, Integer pageSize, 
+                                            Integer equipmentType, String equipmentName, Integer status);
+
+    /**
+     * 查询健身设备信息列表
+     *
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他),可选
+     * @param status        状态(0:禁用, 1:启用),可选
+     * @return 健身设备信息列表
+     */
+    List<FitnessEquipmentInfo> getList(Integer equipmentType, Integer status);
+
+    /**
+     * 根据设备类型查询设备列表(用于前端分类展示)
+     *
+     * @param equipmentType 设备类型(1:心肺训练, 2:核心训练, 3:臀腿训练, 4:上肢训练, 5:全身训练, 6:其他)
+     * @return 健身设备信息列表
+     */
+    List<FitnessEquipmentInfo> getListByType(Integer equipmentType);
+
+    /**
+     * 根据ID查询健身设备信息详情
+     *
+     * @param id 主键ID
+     * @return 健身设备信息
+     */
+    FitnessEquipmentInfo getDetailById(Integer id);
+
+    /**
+     * 新增健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象
+     * @return true表示新增成功,false表示新增失败
+     */
+    boolean saveEquipment(FitnessEquipmentInfo fitnessEquipmentInfo);
+
+    /**
+     * 修改健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象
+     * @return true表示修改成功,false表示修改失败
+     */
+    boolean updateEquipment(FitnessEquipmentInfo fitnessEquipmentInfo);
+
+    /**
+     * 删除健身设备信息(逻辑删除)
+     *
+     * @param id 主键ID
+     * @return true表示删除成功,false表示删除失败
+     */
+    boolean deleteEquipment(Integer id);
+
+    /**
+     * 启用/禁用健身设备信息
+     *
+     * @param id     主键ID
+     * @param status 状态(0:禁用, 1:启用)
+     * @return true表示操作成功,false表示操作失败
+     */
+    boolean updateStatus(Integer id, Integer status);
+}
+

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

@@ -3,6 +3,7 @@ package shop.alien.store.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import shop.alien.entity.store.SportsEquipmentFacility;
+import shop.alien.entity.store.vo.SportsEquipmentFacilityCategorySummaryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityCategoryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityVo;
 
@@ -71,13 +72,14 @@ public interface SportsEquipmentFacilityService extends IService<SportsEquipment
     boolean deleteFacility(Integer id);
 
     /**
-     * 查询指定店铺按分类汇总的设备信息
+     * 查询指定店铺按分类汇总的设备信息(用户端)
      * 包含每个分类的设备数量、图片列表和设备列表
+     * 通过fitnessEquipmentIds关联FitnessEquipmentInfo信息
      *
      * @param storeId 门店ID
-     * @return List<SportsEquipmentFacilityCategoryVo>
+     * @return List<SportsEquipmentFacilityCategorySummaryVo>
      */
-    List<SportsEquipmentFacilityCategoryVo> getCategorySummary(Integer storeId);
+    List<SportsEquipmentFacilityCategorySummaryVo> getCategorySummary(Integer storeId);
 
     SportsEquipmentFacilityVo getStoreDetail(Integer id);
 

+ 391 - 0
alien-store/src/main/java/shop/alien/store/service/impl/FitnessEquipmentInfoServiceImpl.java

@@ -0,0 +1,391 @@
+package shop.alien.store.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+import shop.alien.entity.store.FitnessEquipmentInfo;
+import shop.alien.mapper.FitnessEquipmentInfoMapper;
+import shop.alien.store.service.FitnessEquipmentInfoService;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 健身设备信息服务实现类
+ *
+ * @author system
+ * @since 2025-01-XX
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+@Transactional(rollbackFor = Exception.class)
+public class FitnessEquipmentInfoServiceImpl extends ServiceImpl<FitnessEquipmentInfoMapper, FitnessEquipmentInfo>
+        implements FitnessEquipmentInfoService {
+
+    /**
+     * 删除标志:未删除
+     */
+    private static final int DELETE_FLAG_NOT_DELETED = 0;
+
+    /**
+     * 状态:启用
+     */
+    private static final int STATUS_ENABLED = 1;
+
+    /**
+     * 状态:禁用
+     */
+    private static final int STATUS_DISABLED = 0;
+
+    /**
+     * 默认排序号
+     */
+    private static final int DEFAULT_SORT_ORDER = 0;
+
+    /**
+     * 默认页码
+     */
+    private static final int DEFAULT_PAGE = 1;
+
+    /**
+     * 默认页大小
+     */
+    private static final int DEFAULT_PAGE_SIZE = 10;
+
+    /**
+     * 健身设备信息Mapper
+     */
+    private final FitnessEquipmentInfoMapper fitnessEquipmentInfoMapper;
+
+    /**
+     * 分页查询健身设备信息列表
+     *
+     * @param pageNum       页码
+     * @param pageSize      页大小
+     * @param equipmentType 设备类型
+     * @param equipmentName 设备名称(模糊查询)
+     * @param status        状态
+     * @return 健身设备信息分页列表
+     */
+    @Override
+    public IPage<FitnessEquipmentInfo> getPageList(Integer pageNum, Integer pageSize, 
+                                                   Integer equipmentType, String equipmentName, Integer status) {
+        log.info("分页查询健身设备信息列表,pageNum={}, pageSize={}, equipmentType={}, equipmentName={}, status={}", 
+                pageNum, pageSize, equipmentType, equipmentName, status);
+
+        // 参数验证
+        if (pageNum == null || pageNum < DEFAULT_PAGE) {
+            log.warn("分页查询健身设备信息列表,页码参数无效,使用默认值:{}", pageNum);
+            pageNum = DEFAULT_PAGE;
+        }
+        if (pageSize == null || pageSize < 1) {
+            log.warn("分页查询健身设备信息列表,页大小参数无效,使用默认值:{}", pageSize);
+            pageSize = DEFAULT_PAGE_SIZE;
+        }
+
+        try {
+            Page<FitnessEquipmentInfo> page = new Page<>(pageNum, pageSize);
+            LambdaQueryWrapper<FitnessEquipmentInfo> queryWrapper = new LambdaQueryWrapper<>();
+
+            queryWrapper.eq(equipmentType != null, FitnessEquipmentInfo::getEquipmentType, equipmentType)
+                    .like(StringUtils.hasText(equipmentName), FitnessEquipmentInfo::getEquipmentName, equipmentName)
+                    .eq(status != null, FitnessEquipmentInfo::getStatus, status)
+                    .eq(FitnessEquipmentInfo::getDeleteFlag, DELETE_FLAG_NOT_DELETED)
+                    .orderByAsc(FitnessEquipmentInfo::getSortOrder)
+                    .orderByDesc(FitnessEquipmentInfo::getCreatedTime);
+
+            IPage<FitnessEquipmentInfo> result = fitnessEquipmentInfoMapper.selectPage(page, queryWrapper);
+            log.info("分页查询健身设备信息列表成功,查询到{}条记录", result.getTotal());
+            return result;
+        } catch (Exception e) {
+            log.error("分页查询健身设备信息列表异常,异常信息:{}", e.getMessage(), e);
+            throw new RuntimeException("分页查询健身设备信息列表异常:" + e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 查询健身设备信息列表
+     *
+     * @param equipmentType 设备类型
+     * @param status        状态
+     * @return 健身设备信息列表
+     */
+    @Override
+    public List<FitnessEquipmentInfo> getList(Integer equipmentType, Integer status) {
+        log.info("查询健身设备信息列表,equipmentType={}, status={}", equipmentType, status);
+
+        try {
+            LambdaQueryWrapper<FitnessEquipmentInfo> queryWrapper = new LambdaQueryWrapper<>();
+
+            queryWrapper.eq(equipmentType != null, FitnessEquipmentInfo::getEquipmentType, equipmentType)
+                    .eq(status != null, FitnessEquipmentInfo::getStatus, status)
+                    .eq(FitnessEquipmentInfo::getDeleteFlag, DELETE_FLAG_NOT_DELETED)
+                    .orderByAsc(FitnessEquipmentInfo::getSortOrder)
+                    .orderByDesc(FitnessEquipmentInfo::getCreatedTime);
+
+            List<FitnessEquipmentInfo> result = fitnessEquipmentInfoMapper.selectList(queryWrapper);
+            log.info("查询健身设备信息列表成功,查询到{}条记录", result.size());
+            return result;
+        } catch (Exception e) {
+            log.error("查询健身设备信息列表异常,异常信息:{}", e.getMessage(), e);
+            return Collections.emptyList();
+        }
+    }
+
+    /**
+     * 根据设备类型查询设备列表(用于前端分类展示)
+     *
+     * @param equipmentType 设备类型
+     * @return 健身设备信息列表
+     */
+    @Override
+    public List<FitnessEquipmentInfo> getListByType(Integer equipmentType) {
+        log.info("根据设备类型查询设备列表,equipmentType={}", equipmentType);
+
+        if (equipmentType == null || equipmentType <= 0) {
+            log.warn("根据设备类型查询设备列表失败,设备类型无效:{}", equipmentType);
+            return Collections.emptyList();
+        }
+
+        try {
+            LambdaQueryWrapper<FitnessEquipmentInfo> queryWrapper = new LambdaQueryWrapper<>();
+
+            queryWrapper.eq(FitnessEquipmentInfo::getEquipmentType, equipmentType)
+                    .eq(FitnessEquipmentInfo::getStatus, STATUS_ENABLED)
+                    .eq(FitnessEquipmentInfo::getDeleteFlag, DELETE_FLAG_NOT_DELETED)
+                    .orderByAsc(FitnessEquipmentInfo::getSortOrder)
+                    .orderByDesc(FitnessEquipmentInfo::getCreatedTime);
+
+            List<FitnessEquipmentInfo> result = fitnessEquipmentInfoMapper.selectList(queryWrapper);
+            log.info("根据设备类型查询设备列表成功,equipmentType={},查询到{}条记录", equipmentType, result.size());
+            return result;
+        } catch (Exception e) {
+            log.error("根据设备类型查询设备列表异常,equipmentType={},异常信息:{}", equipmentType, e.getMessage(), e);
+            return Collections.emptyList();
+        }
+    }
+
+    /**
+     * 根据ID查询健身设备信息详情
+     *
+     * @param id 主键ID
+     * @return 健身设备信息
+     */
+    @Override
+    public FitnessEquipmentInfo getDetailById(Integer id) {
+        log.info("根据ID查询健身设备信息详情,id={}", id);
+
+        if (id == null || id <= 0) {
+            log.warn("根据ID查询健身设备信息详情失败,ID无效:{}", id);
+            return null;
+        }
+
+        try {
+            FitnessEquipmentInfo result = fitnessEquipmentInfoMapper.selectById(id);
+            if (result != null && result.getDeleteFlag() != null && result.getDeleteFlag() == DELETE_FLAG_NOT_DELETED) {
+                log.info("根据ID查询健身设备信息详情成功,id={}", id);
+                return result;
+            } else {
+                log.warn("根据ID查询健身设备信息详情失败,设备不存在或已删除,id={}", id);
+                return null;
+            }
+        } catch (Exception e) {
+            log.error("根据ID查询健身设备信息详情异常,id={},异常信息:{}", id, e.getMessage(), e);
+            return null;
+        }
+    }
+
+    /**
+     * 新增健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象
+     * @return true表示新增成功,false表示新增失败
+     */
+    @Override
+    public boolean saveEquipment(FitnessEquipmentInfo fitnessEquipmentInfo) {
+        log.info("新增健身设备信息,请求参数:{}", fitnessEquipmentInfo);
+
+        if (fitnessEquipmentInfo == null) {
+            log.error("新增健身设备信息失败,设备信息对象为空");
+            return false;
+        }
+
+        // 参数验证
+        if (!StringUtils.hasText(fitnessEquipmentInfo.getEquipmentName())) {
+            log.error("新增健身设备信息失败,设备名称为空");
+            return false;
+        }
+        if (fitnessEquipmentInfo.getEquipmentType() == null || fitnessEquipmentInfo.getEquipmentType() <= 0) {
+            log.error("新增健身设备信息失败,设备类型无效:{}", fitnessEquipmentInfo.getEquipmentType());
+            return false;
+        }
+
+        try {
+            // 设置默认值
+            if (fitnessEquipmentInfo.getSortOrder() == null) {
+                fitnessEquipmentInfo.setSortOrder(DEFAULT_SORT_ORDER);
+            }
+            if (fitnessEquipmentInfo.getStatus() == null) {
+                fitnessEquipmentInfo.setStatus(STATUS_ENABLED);
+            }
+            fitnessEquipmentInfo.setDeleteFlag(DELETE_FLAG_NOT_DELETED);
+            // createdTime和updatedTime由MyBatis-Plus自动填充
+
+            int insertResult = fitnessEquipmentInfoMapper.insert(fitnessEquipmentInfo);
+            if (insertResult > 0) {
+                log.info("新增健身设备信息成功,id={}, equipmentName={}", 
+                        fitnessEquipmentInfo.getId(), fitnessEquipmentInfo.getEquipmentName());
+                return true;
+            } else {
+                log.warn("新增健身设备信息失败,插入记录数为0");
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("新增健身设备信息异常,异常信息:{}", e.getMessage(), e);
+            return false;
+        }
+    }
+
+    /**
+     * 修改健身设备信息
+     *
+     * @param fitnessEquipmentInfo 健身设备信息对象
+     * @return true表示修改成功,false表示修改失败
+     */
+    @Override
+    public boolean updateEquipment(FitnessEquipmentInfo fitnessEquipmentInfo) {
+        log.info("修改健身设备信息,请求参数:{}", fitnessEquipmentInfo);
+
+        if (fitnessEquipmentInfo == null || fitnessEquipmentInfo.getId() == null) {
+            log.error("修改健身设备信息失败,设备信息对象为空或ID为空");
+            return false;
+        }
+
+        // 参数验证
+        if (fitnessEquipmentInfo.getId() <= 0) {
+            log.error("修改健身设备信息失败,ID无效:{}", fitnessEquipmentInfo.getId());
+            return false;
+        }
+
+        try {
+            // 检查设备是否存在
+            FitnessEquipmentInfo existing = fitnessEquipmentInfoMapper.selectById(fitnessEquipmentInfo.getId());
+            if (existing == null || existing.getDeleteFlag() == null || existing.getDeleteFlag() != DELETE_FLAG_NOT_DELETED) {
+                log.warn("修改健身设备信息失败,设备不存在或已删除,id={}", fitnessEquipmentInfo.getId());
+                return false;
+            }
+
+            // updatedTime由MyBatis-Plus自动填充
+
+            int updateResult = fitnessEquipmentInfoMapper.updateById(fitnessEquipmentInfo);
+            if (updateResult > 0) {
+                log.info("修改健身设备信息成功,id={}", fitnessEquipmentInfo.getId());
+                return true;
+            } else {
+                log.warn("修改健身设备信息失败,更新记录数为0,id={}", fitnessEquipmentInfo.getId());
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("修改健身设备信息异常,id={},异常信息:{}", fitnessEquipmentInfo.getId(), e.getMessage(), e);
+            return false;
+        }
+    }
+
+    /**
+     * 删除健身设备信息(逻辑删除)
+     *
+     * @param id 主键ID
+     * @return true表示删除成功,false表示删除失败
+     */
+    @Override
+    public boolean deleteEquipment(Integer id) {
+        log.info("删除健身设备信息,id={}", id);
+
+        if (id == null || id <= 0) {
+            log.error("删除健身设备信息失败,ID无效:{}", id);
+            return false;
+        }
+
+        try {
+            // 检查设备是否存在
+            FitnessEquipmentInfo existing = fitnessEquipmentInfoMapper.selectById(id);
+            if (existing == null || existing.getDeleteFlag() == null || existing.getDeleteFlag() != DELETE_FLAG_NOT_DELETED) {
+                log.warn("删除健身设备信息失败,设备不存在或已删除,id={}", id);
+                return false;
+            }
+
+            // 逻辑删除
+            FitnessEquipmentInfo updateEntity = new FitnessEquipmentInfo();
+            updateEntity.setId(id);
+            updateEntity.setDeleteFlag(1);
+            // updatedTime由MyBatis-Plus自动填充
+
+            int updateResult = fitnessEquipmentInfoMapper.updateById(updateEntity);
+            if (updateResult > 0) {
+                log.info("删除健身设备信息成功,id={}", id);
+                return true;
+            } else {
+                log.warn("删除健身设备信息失败,更新记录数为0,id={}", id);
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("删除健身设备信息异常,id={},异常信息:{}", id, e.getMessage(), e);
+            return false;
+        }
+    }
+
+    /**
+     * 启用/禁用健身设备信息
+     *
+     * @param id     主键ID
+     * @param status 状态(0:禁用, 1:启用)
+     * @return true表示操作成功,false表示操作失败
+     */
+    @Override
+    public boolean updateStatus(Integer id, Integer status) {
+        log.info("更新健身设备信息状态,id={}, status={}", id, status);
+
+        if (id == null || id <= 0) {
+            log.error("更新健身设备信息状态失败,ID无效:{}", id);
+            return false;
+        }
+        if (status == null || (status != STATUS_ENABLED && status != STATUS_DISABLED)) {
+            log.error("更新健身设备信息状态失败,状态值无效:{}", status);
+            return false;
+        }
+
+        try {
+            // 检查设备是否存在
+            FitnessEquipmentInfo existing = fitnessEquipmentInfoMapper.selectById(id);
+            if (existing == null || existing.getDeleteFlag() == null || existing.getDeleteFlag() != DELETE_FLAG_NOT_DELETED) {
+                log.warn("更新健身设备信息状态失败,设备不存在或已删除,id={}", id);
+                return false;
+            }
+
+            FitnessEquipmentInfo updateEntity = new FitnessEquipmentInfo();
+            updateEntity.setId(id);
+            updateEntity.setStatus(status);
+            // updatedTime由MyBatis-Plus自动填充
+
+            int updateResult = fitnessEquipmentInfoMapper.updateById(updateEntity);
+            if (updateResult > 0) {
+                log.info("更新健身设备信息状态成功,id={}, status={}", id, status);
+                return true;
+            } else {
+                log.warn("更新健身设备信息状态失败,更新记录数为0,id={}", id);
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("更新健身设备信息状态异常,id={}, status={},异常信息:{}", id, status, e.getMessage(), e);
+            return false;
+        }
+    }
+}
+

+ 262 - 40
alien-store/src/main/java/shop/alien/store/service/impl/SportsEquipmentFacilityServiceImpl.java

@@ -10,12 +10,16 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import shop.alien.entity.store.FitnessEquipmentInfo;
 import shop.alien.entity.store.SportsEquipmentFacility;
 import shop.alien.entity.store.StoreImg;
+import shop.alien.entity.store.vo.SportsEquipmentFacilityCategorySummaryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityCategoryVo;
 import shop.alien.entity.store.vo.SportsEquipmentFacilityVo;
 import shop.alien.mapper.SportsEquipmentFacilityMapper;
 import shop.alien.mapper.StoreImgMapper;
+import shop.alien.store.service.FitnessEquipmentInfoService;
 import shop.alien.store.service.SportsEquipmentFacilityService;
 
 import java.util.ArrayList;
@@ -37,11 +41,42 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
 
     private final SportsEquipmentFacilityMapper facilityMapper;
     private final StoreImgMapper storeImgMapper;
+    private final FitnessEquipmentInfoService fitnessEquipmentInfoService;
 
     /**
      * 运动器材设施图片类型
      */
     private static final Integer IMG_TYPE_SPORTS_EQUIPMENT = 28;
+    
+    /**
+     * 删除标志:未删除
+     */
+    private static final int DELETE_FLAG_NOT_DELETED = 0;
+    
+    /**
+     * 状态:启用
+     */
+    private static final int STATUS_ENABLED = 1;
+    
+    /**
+     * ID分隔符
+     */
+    private static final String ID_SEPARATOR = ",";
+    
+    /**
+     * 最小分类编号
+     */
+    private static final int MIN_CATEGORY_NUM = 1;
+    
+    /**
+     * 默认排序号
+     */
+    private static final int DEFAULT_SORT_ORDER = 0;
+    
+    /**
+     * 最小有效ID
+     */
+    private static final int MIN_VALID_ID = 1;
 
     /**
      * 设施分类名称映射
@@ -140,61 +175,248 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
         return this.removeById(id);
     }
 
+    /**
+     * 查询指定店铺按分类汇总的设备信息(用户端)
+     * 包含每个分类的设备数量、图片列表和设备列表
+     * 通过fitnessEquipmentIds关联FitnessEquipmentInfo信息
+     *
+     * @param storeId 门店ID,不能为空且必须大于0
+     * @return 分类汇总列表,不会返回null
+     */
     @Override
-    public List<SportsEquipmentFacilityCategoryVo> getCategorySummary(Integer storeId) {
-        List<SportsEquipmentFacilityCategoryVo> result = new ArrayList<>();
+    public List<SportsEquipmentFacilityCategorySummaryVo> getCategorySummary(Integer storeId) {
+        log.info("查询指定店铺按分类汇总的设备信息(用户端),storeId={}", storeId);
         
-        // 遍历所有分类(1:有氧区, 2:力量区, 3:单功能机械区)
-        for (int category = 1; category < FACILITY_CATEGORY_NAMES.length; category++) {
-            SportsEquipmentFacilityCategoryVo categoryVo = new SportsEquipmentFacilityCategoryVo();
-            categoryVo.setFacilityCategory(category);
-            categoryVo.setFacilityCategoryName(FACILITY_CATEGORY_NAMES[category]);
-            
-            // 查询该分类下的设备列表(不分页)
-            LambdaQueryWrapper<SportsEquipmentFacility> facilityWrapper = new LambdaQueryWrapper<>();
-            facilityWrapper.eq(SportsEquipmentFacility::getStoreId, storeId)
-                    .eq(SportsEquipmentFacility::getFacilityCategory, category);
-            facilityWrapper.orderByDesc(SportsEquipmentFacility::getCreatedTime);
-            List<SportsEquipmentFacility> facilityList = facilityMapper.selectList(facilityWrapper);
+        // 参数验证
+        if (storeId == null || storeId <= 0) {
+            log.warn("查询分类汇总失败,门店ID无效:{}", storeId);
+            return new ArrayList<>();
+        }
+        
+        try {
+            List<SportsEquipmentFacilityCategorySummaryVo> result = new ArrayList<>();
             
-            // 设置设备数量
-            categoryVo.setFacilityCount(facilityList != null ? facilityList.size() : 0);
+            // 遍历所有分类(1:有氧区, 2:力量区, 3:单功能机械区)
+            for (int category = MIN_CATEGORY_NUM; category < FACILITY_CATEGORY_NAMES.length; category++) {
+                SportsEquipmentFacilityCategorySummaryVo categoryVo = buildCategorySummaryVo(
+                        storeId, category);
+                result.add(categoryVo);
+            }
             
-            // 转换为VO列表(不包含图片,避免重复查询)
-            List<SportsEquipmentFacilityVo> facilityVoList = new ArrayList<>();
-            if (!CollectionUtils.isEmpty(facilityList)) {
-                for (SportsEquipmentFacility facility : facilityList) {
-                    SportsEquipmentFacilityVo vo = new SportsEquipmentFacilityVo();
-                    BeanUtils.copyProperties(facility, vo);
-                    // 设置分类名称
-                    vo.setFacilityCategoryName(FACILITY_CATEGORY_NAMES[category]);
-                    // 设置显示状态文本
-                    if (facility.getDisplayInStoreDetail() != null) {
-                        vo.setDisplayInStoreDetailText(facility.getDisplayInStoreDetail() == 1 ? "显示" : "隐藏");
+            log.info("查询指定店铺按分类汇总的设备信息完成,storeId={},分类数量:{}", storeId, result.size());
+            return result;
+        } catch (Exception e) {
+            log.error("查询指定店铺按分类汇总的设备信息异常,storeId={},异常信息:{}", storeId, e.getMessage(), e);
+            throw new RuntimeException("查询分类汇总异常:" + e.getMessage(), e);
+        }
+    }
+    
+    /**
+     * 构建分类汇总VO对象
+     *
+     * @param storeId  门店ID
+     * @param category 分类编号
+     * @return 分类汇总VO对象
+     */
+    private SportsEquipmentFacilityCategorySummaryVo buildCategorySummaryVo(Integer storeId, Integer category) {
+        SportsEquipmentFacilityCategorySummaryVo categoryVo = new SportsEquipmentFacilityCategorySummaryVo();
+        categoryVo.setStoreId(storeId);
+        categoryVo.setFacilityCategory(category);
+        categoryVo.setFacilityCategoryName(FACILITY_CATEGORY_NAMES[category]);
+        
+        // 查询该分类下的设备列表
+        List<SportsEquipmentFacility> facilityList = queryFacilityListByCategory(storeId, category);
+        
+        // 收集并解析fitnessEquipmentIds
+        List<Integer> fitnessEquipmentIdList = collectFitnessEquipmentIds(facilityList, storeId, category);
+        
+        // 查询FitnessEquipmentInfo列表
+        List<FitnessEquipmentInfo> fitnessEquipmentInfoList = queryFitnessEquipmentInfoList(fitnessEquipmentIdList, category, storeId);
+        
+        // 设置设备信息
+        categoryVo.setFacilityCount(fitnessEquipmentInfoList.size());
+        categoryVo.setFacilityList(fitnessEquipmentInfoList);
+        
+        // 查询并设置图片列表
+        List<String> imageList = queryCategoryImageList(storeId, category);
+        categoryVo.setImageList(imageList);
+        
+        return categoryVo;
+    }
+    
+    /**
+     * 查询指定分类下的设备列表
+     *
+     * @param storeId  门店ID
+     * @param category 分类编号
+     * @return 设备列表
+     */
+    private List<SportsEquipmentFacility> queryFacilityListByCategory(Integer storeId, Integer category) {
+        LambdaQueryWrapper<SportsEquipmentFacility> facilityWrapper = new LambdaQueryWrapper<>();
+        facilityWrapper.eq(SportsEquipmentFacility::getStoreId, storeId)
+                .eq(SportsEquipmentFacility::getFacilityCategory, category)
+                .orderByDesc(SportsEquipmentFacility::getCreatedTime);
+        return facilityMapper.selectList(facilityWrapper);
+    }
+    
+    /**
+     * 从设备列表中收集fitnessEquipmentIds并解析为整数列表
+     *
+     * @param facilityList 设备列表
+     * @param storeId      门店ID(用于日志)
+     * @param category     分类编号(用于日志)
+     * @return 去重后的设备ID列表
+     */
+    private List<Integer> collectFitnessEquipmentIds(List<SportsEquipmentFacility> facilityList, 
+                                                      Integer storeId, Integer category) {
+        List<Integer> fitnessEquipmentIdList = new ArrayList<>();
+        
+        if (CollectionUtils.isEmpty(facilityList)) {
+            return fitnessEquipmentIdList;
+        }
+        
+        for (SportsEquipmentFacility facility : facilityList) {
+            String fitnessEquipmentIds = facility.getFitnessEquipmentIds();
+            if (StringUtils.isNotBlank(fitnessEquipmentIds)) {
+                List<Integer> parsedIds = parseFitnessEquipmentIds(fitnessEquipmentIds, storeId, category);
+                for (Integer id : parsedIds) {
+                    if (!fitnessEquipmentIdList.contains(id)) {
+                        fitnessEquipmentIdList.add(id);
                     }
-                    facilityVoList.add(vo);
                 }
             }
-            categoryVo.setFacilityList(facilityVoList);
+        }
+        
+        return fitnessEquipmentIdList;
+    }
+    
+    /**
+     * 解析逗号分隔的ID字符串为整数列表
+     *
+     * @param fitnessEquipmentIds ID字符串(逗号分隔)
+     * @param storeId             门店ID(用于日志)
+     * @param category            分类编号(用于日志)
+     * @return 解析后的ID列表
+     */
+    private List<Integer> parseFitnessEquipmentIds(String fitnessEquipmentIds, Integer storeId, Integer category) {
+        List<Integer> idList = new ArrayList<>();
+        
+        if (StringUtils.isBlank(fitnessEquipmentIds)) {
+            return idList;
+        }
+        
+        String[] idArray = fitnessEquipmentIds.split(ID_SEPARATOR);
+        for (String idStr : idArray) {
+            String trimmedId = idStr.trim();
+            if (StringUtils.isNotBlank(trimmedId)) {
+                try {
+                    Integer id = Integer.parseInt(trimmedId);
+                    if (id >= MIN_VALID_ID) {
+                        idList.add(id);
+                    } else {
+                        log.warn("解析fitnessEquipmentIds失败,ID小于最小值:{},storeId={},category={}", 
+                                trimmedId, storeId, category);
+                    }
+                } catch (NumberFormatException e) {
+                    log.warn("解析fitnessEquipmentIds失败,无效的ID格式:{},storeId={},category={},异常信息:{}", 
+                            trimmedId, storeId, category, e.getMessage());
+                }
+            }
+        }
+        
+        return idList;
+    }
+    
+    /**
+     * 查询健身设备信息列表
+     *
+     * @param fitnessEquipmentIdList 设备ID列表
+     * @param category               分类编号(用于日志)
+     * @param storeId                门店ID(用于日志)
+     * @return 过滤并排序后的设备信息列表
+     */
+    private List<FitnessEquipmentInfo> queryFitnessEquipmentInfoList(List<Integer> fitnessEquipmentIdList, 
+                                                                      Integer category, Integer storeId) {
+        if (CollectionUtils.isEmpty(fitnessEquipmentIdList)) {
+            return new ArrayList<>();
+        }
+        
+        try {
+            List<FitnessEquipmentInfo> allEquipmentList = new ArrayList<>(
+                    fitnessEquipmentInfoService.listByIds(fitnessEquipmentIdList));
             
-            // 查询该分类下的图片列表
+            // 过滤掉已删除和禁用的设备,并按sort_order排序
+            List<FitnessEquipmentInfo> filteredList = allEquipmentList.stream()
+                    .filter(this::isValidFitnessEquipment)
+                    .sorted(this::compareBySortOrder)
+                    .collect(Collectors.toList());
+            
+            log.info("查询到FitnessEquipmentInfo设备数量:{},分类:{},storeId:{}", 
+                    filteredList.size(), category, storeId);
+            
+            return filteredList;
+        } catch (Exception e) {
+            log.error("查询FitnessEquipmentInfo列表异常,category={},storeId={},异常信息:{}", 
+                    category, storeId, e.getMessage(), e);
+            return new ArrayList<>();
+        }
+    }
+    
+    /**
+     * 判断健身设备是否有效(未删除且已启用)
+     *
+     * @param info 健身设备信息
+     * @return true表示有效,false表示无效
+     */
+    private boolean isValidFitnessEquipment(FitnessEquipmentInfo info) {
+        return info.getDeleteFlag() != null 
+                && info.getDeleteFlag() == DELETE_FLAG_NOT_DELETED
+                && info.getStatus() != null 
+                && info.getStatus() == STATUS_ENABLED;
+    }
+    
+    /**
+     * 按排序号比较两个健身设备信息
+     *
+     * @param a 设备A
+     * @param b 设备B
+     * @return 比较结果
+     */
+    private int compareBySortOrder(FitnessEquipmentInfo a, FitnessEquipmentInfo b) {
+        Integer sortOrderA = a.getSortOrder() != null ? a.getSortOrder() : DEFAULT_SORT_ORDER;
+        Integer sortOrderB = b.getSortOrder() != null ? b.getSortOrder() : DEFAULT_SORT_ORDER;
+        return sortOrderA.compareTo(sortOrderB);
+    }
+    
+    /**
+     * 查询分类下的图片列表
+     *
+     * @param storeId  门店ID
+     * @param category 分类编号
+     * @return 图片URL列表
+     */
+    private List<String> queryCategoryImageList(Integer storeId, Integer category) {
+        try {
             LambdaQueryWrapper<StoreImg> imageWrapper = new LambdaQueryWrapper<>();
             imageWrapper.eq(StoreImg::getStoreId, storeId)
                     .eq(StoreImg::getBusinessId, category)
-                    .eq(StoreImg::getImgType, IMG_TYPE_SPORTS_EQUIPMENT);
-            imageWrapper.orderByAsc(StoreImg::getImgSort);
+                    .eq(StoreImg::getImgType, IMG_TYPE_SPORTS_EQUIPMENT)
+                    .orderByAsc(StoreImg::getImgSort);
+            
             List<StoreImg> imageList = storeImgMapper.selectList(imageWrapper);
-            if (!CollectionUtils.isEmpty(imageList)) {
-                categoryVo.setImageList(imageList.stream().map(StoreImg::getImgUrl)
-                        .collect(Collectors.toList()));
-            } else {
-                categoryVo.setImageList(new ArrayList<>());
+            
+            if (CollectionUtils.isEmpty(imageList)) {
+                return new ArrayList<>();
             }
             
-            result.add(categoryVo);
+            return imageList.stream()
+                    .map(StoreImg::getImgUrl)
+                    .collect(Collectors.toList());
+        } catch (Exception e) {
+            log.error("查询分类图片列表异常,storeId={},category={},异常信息:{}", 
+                    storeId, category, e.getMessage(), e);
+            return new ArrayList<>();
         }
-        
-        return result;
     }
 
     /**