bug--商品属性保存时候会添加一条数据

This commit is contained in:
xuwenbo
2020-05-27 14:21:37 +08:00
parent 09a713e2e2
commit d583006737

View File

@ -247,10 +247,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
//保存属性 //保存属性
yxStoreProductAttrService.saveBatch(attrGroup); yxStoreProductAttrService.saveOrUpdateBatch(attrGroup);
//保存值 //保存值
yxStoreProductAttrValueService.saveBatch(valueGroup); yxStoreProductAttrValueService.saveOrUpdateBatch(valueGroup);
Map<String,Object> map = new LinkedHashMap<>(); Map<String,Object> map = new LinkedHashMap<>();
map.put("attr",jsonObject.get("items")); map.put("attr",jsonObject.get("items"));
@ -267,9 +267,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
yxStoreProductAttrResult.setResult(JSON.toJSONString(map)); yxStoreProductAttrResult.setResult(JSON.toJSONString(map));
yxStoreProductAttrResult.setChangeTime(OrderUtil.getSecondTimestampTwo()); yxStoreProductAttrResult.setChangeTime(OrderUtil.getSecondTimestampTwo());
yxStoreProductAttrService.remove(new QueryWrapper<YxStoreProductAttr>().eq("product_id",id)); yxStoreProductAttrResultService.remove(new QueryWrapper<YxStoreProductAttrResult>().eq("product_id",id));
yxStoreProductAttrResultService.save(yxStoreProductAttrResult); yxStoreProductAttrResultService.saveOrUpdate(yxStoreProductAttrResult);
} }
@Override @Override