commit
068c6b986e
@ -296,4 +296,13 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
||||
* @return 库存数量
|
||||
*/
|
||||
Integer getGoodsStock(String goodsId);
|
||||
|
||||
/**
|
||||
* 更新sku运费模版
|
||||
*
|
||||
* @param goodsId 商品id
|
||||
* @param templateId 运费模版id
|
||||
* @return 操作结果
|
||||
*/
|
||||
Boolean freight(List<String> goodsId, String templateId);
|
||||
}
|
@ -437,6 +437,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
lambdaUpdateWrapper.in(Goods::getId, goodsIds);
|
||||
List<String> goodsCache = goodsIds.stream().map(item -> CachePrefix.GOODS.getPrefix() + item).collect(Collectors.toList());
|
||||
cache.multiDel(goodsCache);
|
||||
goodsSkuService.freight(goodsIds, templateId);
|
||||
return this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
|
@ -888,6 +888,17 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean freight(List<String> goodsId, String templateId) {
|
||||
LambdaUpdateWrapper<GoodsSku> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(GoodsSku::getGoodsId, goodsId);
|
||||
updateWrapper.set(GoodsSku::getFreightTemplateId, templateId);
|
||||
updateWrapper.set(GoodsSku::getUpdateTime, new Date());
|
||||
List<String> skuIds = this.list(updateWrapper).stream().map(GoodsSku::getId).collect(Collectors.toList());
|
||||
skuIds.forEach(this::clearCache);
|
||||
return this.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染商品sku
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user