mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-10 08:11:52 +08:00
code review:积分、优惠劵、佣金等逻辑
This commit is contained in:
@@ -34,7 +34,7 @@ public class ProductSpuApiImpl implements ProductSpuApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductSpuRespDTO> getSpuListAndValidate(Collection<Long> ids) {
|
||||
public List<ProductSpuRespDTO> validateSpuList(Collection<Long> ids) {
|
||||
return ProductSpuConvert.INSTANCE.convertList2(spuService.validateSpuList(ids));
|
||||
}
|
||||
|
||||
@@ -43,9 +43,4 @@ public class ProductSpuApiImpl implements ProductSpuApi {
|
||||
return ProductSpuConvert.INSTANCE.convert02(spuService.getSpu(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateSpuList(Collection<Long> ids) {
|
||||
spuService.validateSpuList(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -109,8 +109,8 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
|
||||
return;
|
||||
}
|
||||
// 获得商品分类信息
|
||||
List<ProductCategoryDO> categoryList = productCategoryMapper.selectBatchIds(ids);
|
||||
Map<Long, ProductCategoryDO> categoryMap = CollectionUtils.convertMap(categoryList, ProductCategoryDO::getId);
|
||||
List<ProductCategoryDO> list = productCategoryMapper.selectBatchIds(ids);
|
||||
Map<Long, ProductCategoryDO> categoryMap = CollectionUtils.convertMap(list, ProductCategoryDO::getId);
|
||||
// 校验
|
||||
ids.forEach(id -> {
|
||||
ProductCategoryDO category = categoryMap.get(id);
|
||||
|
@@ -146,8 +146,8 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 获得商品信息
|
||||
List<ProductSpuDO> spuList = productSpuMapper.selectBatchIds(ids);
|
||||
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(spuList, ProductSpuDO::getId);
|
||||
List<ProductSpuDO> list = productSpuMapper.selectBatchIds(ids);
|
||||
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
|
||||
// 校验
|
||||
ids.forEach(id -> {
|
||||
ProductSpuDO spu = spuMap.get(id);
|
||||
@@ -158,8 +158,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
throw exception(SPU_NOT_ENABLE, spu.getName());
|
||||
}
|
||||
});
|
||||
|
||||
return spuList;
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user