|
@@ -1421,10 +1421,26 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(equipmentIdList)) {
|
|
if (!CollectionUtils.isEmpty(equipmentIdList)) {
|
|
|
- // 查询设备信息(用于后续扩展,当前vo中没有equipmentList字段)
|
|
|
|
|
- // List<FitnessEquipmentInfo> equipmentList = new ArrayList<>(
|
|
|
|
|
- // fitnessEquipmentInfoService.listByIds(equipmentIdList));
|
|
|
|
|
- // 注意:如果需要返回设备信息,可以在vo中添加equipmentList字段
|
|
|
|
|
|
|
+ // 查询设备信息,设置设备相关字段(取第一个设备的信息)
|
|
|
|
|
+ List<FitnessEquipmentInfo> equipmentList = new ArrayList<>(
|
|
|
|
|
+ fitnessEquipmentInfoService.listByIds(equipmentIdList));
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(equipmentList)) {
|
|
|
|
|
+ // 取第一个设备的信息(如果有多个设备,取第一个)
|
|
|
|
|
+ FitnessEquipmentInfo firstEquipment = equipmentList.get(0);
|
|
|
|
|
+ if (firstEquipment != null) {
|
|
|
|
|
+ // 设置设备ID
|
|
|
|
|
+ vo.setEquipmentId(firstEquipment.getId());
|
|
|
|
|
+ // 设置设备名称
|
|
|
|
|
+ vo.setEquipmentName(firstEquipment.getEquipmentName());
|
|
|
|
|
+ // 设置设备数量
|
|
|
|
|
+ vo.setEquipmentNums(firstEquipment.getEquipmentNums());
|
|
|
|
|
+ // 设置设备图片URL
|
|
|
|
|
+ vo.setEquipmentImage(firstEquipment.getEquipmentImage());
|
|
|
|
|
+ log.info("设置设备信息到VO,equipmentId={},equipmentName={},equipmentImage={}",
|
|
|
|
|
+ firstEquipment.getId(), firstEquipment.getEquipmentName(),
|
|
|
|
|
+ firstEquipment.getEquipmentImage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|