mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-17 03:31:54 +08:00
fix:完善 mall seckill 相关 ②
This commit is contained in:
@@ -42,6 +42,15 @@ public class ProductSkuApiImpl implements ProductSkuApi {
|
||||
return ProductSkuConvert.INSTANCE.convertList04(skus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductSkuRespDTO> getSkuListBySpuId(List<Long> spuIds) {
|
||||
if (CollUtil.isEmpty(spuIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spuIds);
|
||||
return ProductSkuConvert.INSTANCE.convertList04(skus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuStock(ProductSkuUpdateStockReqDTO updateStockReqDTO) {
|
||||
productSkuService.updateSkuStock(updateStockReqDTO);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.product.api.spu;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
|
||||
import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
|
||||
@@ -14,7 +14,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO LeeYan9: 类注释;
|
||||
* 商品 SPU API 接口实现类
|
||||
*
|
||||
* @author LeeYan9
|
||||
* @since 2022-09-06
|
||||
@@ -28,11 +28,12 @@ public class ProductSpuApiImpl implements ProductSpuApi {
|
||||
|
||||
@Override
|
||||
public List<ProductSpuRespDTO> getSpuList(Collection<Long> spuIds) {
|
||||
// TODO TODO LeeYan9: AllEmpty?
|
||||
if (CollectionUtils.isAnyEmpty(spuIds)) {
|
||||
// TODO 需不需要判断集合中是否有 null 值
|
||||
if (CollectionUtil.isEmpty(spuIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<ProductSpuDO> productSpuDOList = productSpuMapper.selectBatchIds(spuIds);
|
||||
return ProductSpuConvert.INSTANCE.convertList2(productSpuDOList);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public interface ProductSkuService {
|
||||
* 批量创建 SKU
|
||||
*
|
||||
* @param spuId 商品 SPU 编号
|
||||
* @param list SKU 对象集合
|
||||
* @param list SKU 对象集合
|
||||
*/
|
||||
void createSkuList(Long spuId, List<ProductSkuCreateOrUpdateReqVO> list);
|
||||
|
||||
@@ -63,13 +63,13 @@ public interface ProductSkuService {
|
||||
* 根据 SPU 编号,批量更新它的 SKU 信息
|
||||
*
|
||||
* @param spuId SPU 编码
|
||||
* @param skus SKU 的集合
|
||||
* @param skus SKU 的集合
|
||||
*/
|
||||
void updateSkuList(Long spuId, List<ProductSkuCreateOrUpdateReqVO> skus);
|
||||
|
||||
/**
|
||||
* 更新 SKU 库存(增量)
|
||||
*
|
||||
* <p>
|
||||
* 如果更新的库存不足,会抛出异常
|
||||
*
|
||||
* @param updateStockReqDTO 更行请求
|
||||
@@ -88,7 +88,7 @@ public interface ProductSkuService {
|
||||
* 获得 spu 对应的 SKU 集合
|
||||
*
|
||||
* @param spuIds spu 编码集合
|
||||
* @return 商品 sku 集合
|
||||
* @return 商品 sku 集合
|
||||
*/
|
||||
List<ProductSkuDO> getSkuListBySpuId(List<Long> spuIds);
|
||||
|
||||
@@ -123,4 +123,5 @@ public interface ProductSkuService {
|
||||
* @return int 影响的行数
|
||||
*/
|
||||
int updateSkuPropertyValue(Long propertyValueId, String propertyValueName);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user