新增接口,分类新增,校验
This commit is contained in:
parent
f833a26698
commit
cdeeef7b86
@ -1310,6 +1310,15 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
|||||||
productBrandService.saveOrUpdateBrand(shopBaseProductBrand);
|
productBrandService.saveOrUpdateBrand(shopBaseProductBrand);
|
||||||
}
|
}
|
||||||
List<ShopBaseProductCategory> shopBaseProductCategories = JSONUtil.toList(jsonArray, ShopBaseProductCategory.class);
|
List<ShopBaseProductCategory> shopBaseProductCategories = JSONUtil.toList(jsonArray, ShopBaseProductCategory.class);
|
||||||
|
//校验
|
||||||
|
for (ShopBaseProductCategory shopBaseProductCategory : shopBaseProductCategories) {
|
||||||
|
if(StringUtils.isEmpty(shopBaseProductCategory.getCategory_name())){
|
||||||
|
throw new ApiException("存在分类为空的值");
|
||||||
|
}
|
||||||
|
if(StringUtils.isEmpty(shopBaseProductCategory.getCategory_image())){
|
||||||
|
shopBaseProductCategory.setCategory_image("https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/media/media/plantform/20250906/b93a9751b35a49fca6cf979829230868.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
syncThirdDataService.baseSaveOrUpdateShopBaseProductCategoryBatch(shopBaseProductCategories,jsonArray,storeId);
|
syncThirdDataService.baseSaveOrUpdateShopBaseProductCategoryBatch(shopBaseProductCategories,jsonArray,storeId);
|
||||||
String redisKey = RedisConstant.Product_Cate_Key + ":" + storeId;
|
String redisKey = RedisConstant.Product_Cate_Key + ":" + storeId;
|
||||||
redisService.del(redisKey);
|
redisService.del(redisKey);
|
||||||
|
|||||||
@ -148,8 +148,9 @@ public abstract class SyncBaseThirdSxAbstract{
|
|||||||
}
|
}
|
||||||
list.get(i).setStore_id(storeId); // app 记录传进来
|
list.get(i).setStore_id(storeId); // app 记录传进来
|
||||||
list.get(i).setData_source(dataSource); // 思迅数据来源
|
list.get(i).setData_source(dataSource); // 思迅数据来源
|
||||||
list.get(i).setCategory_is_enable(1);
|
if(null== list.get(i).getCategory_is_enable()){
|
||||||
|
list.get(i).setCategory_is_enable(1);
|
||||||
|
}
|
||||||
JSONObject o = (JSONObject) categoryListJSON.get(i);
|
JSONObject o = (JSONObject) categoryListJSON.get(i);
|
||||||
ShopBaseProductType productType=new ShopBaseProductType();
|
ShopBaseProductType productType=new ShopBaseProductType();
|
||||||
productType.setType_is_draft(1);//发布
|
productType.setType_is_draft(1);//发布
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user