Skip to content

Commit

Permalink
优化修改sku时,如存在sku则不新增
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGaoRobot committed May 13, 2022
1 parent 7ca351f commit 46f1fcc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ public void update(List<Map<String, Object>> skuList, Goods goods, Boolean regen
} else {
newSkuList = new ArrayList<>();
for (Map<String, Object> map : skuList) {
GoodsSku sku = new GoodsSku();
GoodsSku sku = null;
if (map.get("id") != null) {
sku = this.getGoodsSkuByIdFromCache(map.get("id").toString());
}
if (sku == null || map.get("id") == null) {
sku = new GoodsSku();
}
//设置商品信息
goodsInfo(sku, goods);
//设置商品规格信息
Expand Down

0 comments on commit 46f1fcc

Please sign in to comment.