|
|
@@ -53,7 +53,14 @@ public class StorePlatformBathFacilityServiceImpl extends ServiceImpl<StorePlatf
|
|
|
if (id == null) {
|
|
|
throw new RuntimeException("设施ID不能为空");
|
|
|
}
|
|
|
- return super.getById(id);
|
|
|
+ StorePlatformBathFacility facility = super.getById(id);
|
|
|
+ List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
+ .eq(StoreImg::getStoreId, facility.getStoreId()).eq(StoreImg::getImgType, 29).in(StoreImg::getBusinessId, facility.getId()));
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(imgList)) {
|
|
|
+ facility.setImgUrl(imgList.get(0).getImgUrl());
|
|
|
+ }
|
|
|
+ return facility;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -83,7 +90,7 @@ public class StorePlatformBathFacilityServiceImpl extends ServiceImpl<StorePlatf
|
|
|
.ifPresent(img -> facility.setImgUrl(img.getImgUrl()));
|
|
|
});
|
|
|
}
|
|
|
- return this.list(queryWrapper);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -116,11 +123,11 @@ public class StorePlatformBathFacilityServiceImpl extends ServiceImpl<StorePlatf
|
|
|
.ifPresent(img -> facility.setImgUrl(img.getImgUrl()));
|
|
|
});
|
|
|
}
|
|
|
- return this.list(queryWrapper);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R<String> saveFacility(StorePlatformBathFacility facility) {
|
|
|
+ public R<StorePlatformBathFacility> saveFacility(StorePlatformBathFacility facility) {
|
|
|
log.info("StorePlatformBathFacilityServiceImpl.saveFacility facility={}", facility);
|
|
|
if (facility == null) {
|
|
|
return R.fail("设施信息不能为空");
|
|
|
@@ -145,11 +152,11 @@ public class StorePlatformBathFacilityServiceImpl extends ServiceImpl<StorePlatf
|
|
|
if (!flag) {
|
|
|
return R.fail("新增设施失败");
|
|
|
}
|
|
|
- return R.success("新增设施成功");
|
|
|
+ return R.data(facility);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R<String> updateFacility(StorePlatformBathFacility facility) {
|
|
|
+ public R<StorePlatformBathFacility> updateFacility(StorePlatformBathFacility facility) {
|
|
|
log.info("StorePlatformBathFacilityServiceImpl.updateFacility facility={}", facility);
|
|
|
if (facility == null || facility.getId() == null) {
|
|
|
return R.fail("设施信息或设施ID不能为空");
|
|
|
@@ -171,11 +178,11 @@ public class StorePlatformBathFacilityServiceImpl extends ServiceImpl<StorePlatf
|
|
|
if (!flag) {
|
|
|
return R.fail("修改设施失败");
|
|
|
}
|
|
|
- return R.success("修改设施成功");
|
|
|
+ return R.data(facility);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R<String> saveOrUpdateFacility(StorePlatformBathFacility facility) {
|
|
|
+ public R<StorePlatformBathFacility> saveOrUpdateFacility(StorePlatformBathFacility facility) {
|
|
|
log.info("StorePlatformBathFacilityServiceImpl.saveOrUpdateFacility facility={}", facility);
|
|
|
if (facility == null) {
|
|
|
return R.fail("设施信息不能为空");
|