【同步】BOOT 和 CLOUD 的功能
This commit is contained in:
@@ -124,7 +124,7 @@ public class ProductSpuController {
|
||||
return success(productSpuService.getTabsCount());
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品")
|
||||
@PreAuthorize("@ss.hasPermission('product:spu:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
|
||||
@@ -10,10 +10,10 @@ import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.brand.ProductBrandMapper;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ProductBrandServiceImpl implements ProductBrandService {
|
||||
|
||||
@Override
|
||||
public List<ProductBrandDO> getBrandList(Collection<Long> ids) {
|
||||
return brandMapper.selectBatchIds(ids);
|
||||
return brandMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
|
||||
return;
|
||||
}
|
||||
// 获得商品分类信息
|
||||
List<ProductCategoryDO> list = productCategoryMapper.selectBatchIds(ids);
|
||||
List<ProductCategoryDO> list = productCategoryMapper.selectByIds(ids);
|
||||
Map<Long, ProductCategoryDO> categoryMap = CollectionUtils.convertMap(list, ProductCategoryDO::getId);
|
||||
// 校验
|
||||
ids.forEach(id -> {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ProductPropertyServiceImpl implements ProductPropertyService {
|
||||
|
||||
@Override
|
||||
public List<ProductPropertyDO> getPropertyList(Collection<Long> ids) {
|
||||
return productPropertyMapper.selectBatchIds(ids);
|
||||
return productPropertyMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
return productSkuMapper.selectBatchIds(ids);
|
||||
return productSkuMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -248,7 +248,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
||||
updateSkus.forEach(sku -> productSkuMapper.updateById(sku));
|
||||
}
|
||||
if (CollUtil.isNotEmpty(existsSkuMap)) {
|
||||
productSkuMapper.deleteBatchIds(existsSkuMap.values());
|
||||
productSkuMapper.deleteByIds(existsSkuMap.values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
||||
});
|
||||
|
||||
// 更新 SPU 库存
|
||||
List<ProductSkuDO> skus = productSkuMapper.selectBatchIds(
|
||||
List<ProductSkuDO> skus = productSkuMapper.selectByIds(
|
||||
convertSet(updateStockReqDTO.getItems(), ProductSkuUpdateStockReqDTO.Item::getId));
|
||||
Map<Long, Integer> spuStockIncrCounts = ProductSkuConvert.INSTANCE.convertSpuStockMap(
|
||||
updateStockReqDTO.getItems(), skus);
|
||||
|
||||
@@ -137,7 +137,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 获得商品信息
|
||||
List<ProductSpuDO> list = productSpuMapper.selectBatchIds(ids);
|
||||
List<ProductSpuDO> list = productSpuMapper.selectByIds(ids);
|
||||
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
|
||||
// 校验
|
||||
ids.forEach(id -> {
|
||||
@@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId);
|
||||
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectByIds(ids), ProductSpuDO::getId);
|
||||
// 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序
|
||||
return convertList(ids, spuMap::get);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user