|
@@ -163,7 +163,7 @@ public class StoreProductItemServiceImpl extends ServiceImpl<StoreProductItemMap
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public R<List<StoreProductItemDto>> getStoreProductItemById(Integer id) {
|
|
|
|
|
|
|
+ public R<List<StoreProductItemDto>> getStoreProductItemById(Integer id,Integer modelType) {
|
|
|
log.info("StoreProductItemServiceImpl.getStoreProductItemById?id={}", id);
|
|
log.info("StoreProductItemServiceImpl.getStoreProductItemById?id={}", id);
|
|
|
StoreProductItem storeProductItem = this.getById(id);
|
|
StoreProductItem storeProductItem = this.getById(id);
|
|
|
if (storeProductItem == null) {
|
|
if (storeProductItem == null) {
|
|
@@ -171,8 +171,15 @@ public class StoreProductItemServiceImpl extends ServiceImpl<StoreProductItemMap
|
|
|
StoreProductItemDto storeProductItemDto = new StoreProductItemDto();
|
|
StoreProductItemDto storeProductItemDto = new StoreProductItemDto();
|
|
|
list.add(storeProductItemDto);
|
|
list.add(storeProductItemDto);
|
|
|
BeanUtils.copyProperties(storeProductItem,storeProductItemDto);
|
|
BeanUtils.copyProperties(storeProductItem,storeProductItemDto);
|
|
|
- List<StoreProductBar> barList = storeProductBarService.getByExtId(id);
|
|
|
|
|
- storeProductItemDto.setSubList(barList);
|
|
|
|
|
|
|
+ List<?> sublist =null;
|
|
|
|
|
+ if (modelType == CommonEnum.ModelType.BAR.getCode()) {
|
|
|
|
|
+ sublist = storeProductBarService.getByExtId(id);
|
|
|
|
|
+ }else if (modelType == CommonEnum.ModelType.DELICACY.getCode()) {
|
|
|
|
|
+ sublist = storeProductDelicaciesService.getByExtId(id);
|
|
|
|
|
+ }else if (modelType == CommonEnum.ModelType.GYM.getCode()) {
|
|
|
|
|
+ sublist = storeProductGymService.getByExtId(id);
|
|
|
|
|
+ }
|
|
|
|
|
+ storeProductItemDto.setSubList(sublist);
|
|
|
return R.data(list);
|
|
return R.data(list);
|
|
|
}
|
|
}
|
|
|
return R.fail("未找到数据");
|
|
return R.fail("未找到数据");
|