Compare commits
2 Commits
c3f81c5997
...
cf758fd0d5
| Author | SHA1 | Date | |
|---|---|---|---|
| cf758fd0d5 | |||
| 84e4bc63e6 |
@ -117,6 +117,7 @@ public class ShopBaseProductCategoryController {
|
||||
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
|
||||
}else {
|
||||
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
|
||||
oldShopBaseProductCategory.setCategory_is_enable(shopBaseProductCategory.getCategory_is_enable());
|
||||
}
|
||||
return CommonResult.success(shopBaseProductCategoryService.editCategory(oldShopBaseProductCategory));
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public interface ShopBaseProductCategoryService extends IBaseService<ShopBasePro
|
||||
* @param categoryName
|
||||
* @return
|
||||
*/
|
||||
ShopBaseProductCategory getCategoryByName(String categoryName);
|
||||
ShopBaseProductCategory getCategoryByName(String categoryName,String storeId);
|
||||
|
||||
/**
|
||||
* 根据父类id,分类名称,店铺Id获取一条记录
|
||||
|
||||
@ -1141,9 +1141,10 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopBaseProductCategory getCategoryByName(String categoryName) {
|
||||
public ShopBaseProductCategory getCategoryByName(String categoryName,String storeId) {
|
||||
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("category_name", categoryName);
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.orderByAsc("category_parent_id").orderByAsc("category_order");
|
||||
List<ShopBaseProductCategory> list = list(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
|
||||
@ -185,7 +185,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
firstCategoryName=firstCategoryName.replace(forbidCategoryName,"");
|
||||
}
|
||||
// TODO storeId 不判断一下吗?
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(firstCategoryName);
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(firstCategoryName,storeId);
|
||||
if (cate != null) {
|
||||
list.get(i).setCategory_parent_id(cate.getCategory_id());
|
||||
} else{
|
||||
@ -217,7 +217,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
secondCategoryName=secondCategoryName.replace(forbidCategoryName,"");
|
||||
}
|
||||
// TODO storeId 不判断一下吗?
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(secondCategoryName);
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(secondCategoryName,storeId);
|
||||
if (cate != null) {
|
||||
list.get(i).setCategory_parent_id(cate.getCategory_id());
|
||||
} else {
|
||||
@ -282,7 +282,7 @@ public abstract class SyncBaseThirdSxAbstract{
|
||||
JSONObject o = (JSONObject) brandListJSON.get(i);
|
||||
if (o != null && StrUtil.isNotBlank(o.getStr("category"))) {
|
||||
// category 一般是父分类名
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(o.getStr("category"));
|
||||
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(o.getStr("category"),storeId);
|
||||
if (cate != null) {
|
||||
goodBrandList.get(i).setCategory_id(cate.getCategory_id());
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user