Compare commits

..

No commits in common. "cf758fd0d57fda2cf292630f3e50c401244c365b" and "c3f81c5997f6d9e54ce28631a00fc03cca3bd2c6" have entirely different histories.

4 changed files with 5 additions and 7 deletions

View File

@ -117,7 +117,6 @@ public class ShopBaseProductCategoryController {
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order()); oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
}else { }else {
oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order()); oldShopBaseProductCategory.setCategory_order(shopBaseProductCategory.getCategory_order());
oldShopBaseProductCategory.setCategory_is_enable(shopBaseProductCategory.getCategory_is_enable());
} }
return CommonResult.success(shopBaseProductCategoryService.editCategory(oldShopBaseProductCategory)); return CommonResult.success(shopBaseProductCategoryService.editCategory(oldShopBaseProductCategory));
} }

View File

@ -115,7 +115,7 @@ public interface ShopBaseProductCategoryService extends IBaseService<ShopBasePro
* @param categoryName * @param categoryName
* @return * @return
*/ */
ShopBaseProductCategory getCategoryByName(String categoryName,String storeId); ShopBaseProductCategory getCategoryByName(String categoryName);
/** /**
* 根据父类id分类名称店铺Id获取一条记录 * 根据父类id分类名称店铺Id获取一条记录

View File

@ -1141,10 +1141,9 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl<ShopBase
* @return * @return
*/ */
@Override @Override
public ShopBaseProductCategory getCategoryByName(String categoryName,String storeId) { public ShopBaseProductCategory getCategoryByName(String categoryName) {
QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopBaseProductCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("category_name", categoryName); queryWrapper.eq("category_name", categoryName);
queryWrapper.eq("store_id", storeId);
queryWrapper.orderByAsc("category_parent_id").orderByAsc("category_order"); queryWrapper.orderByAsc("category_parent_id").orderByAsc("category_order");
List<ShopBaseProductCategory> list = list(queryWrapper); List<ShopBaseProductCategory> list = list(queryWrapper);
if (CollUtil.isNotEmpty(list)) { if (CollUtil.isNotEmpty(list)) {

View File

@ -185,7 +185,7 @@ public abstract class SyncBaseThirdSxAbstract{
firstCategoryName=firstCategoryName.replace(forbidCategoryName,""); firstCategoryName=firstCategoryName.replace(forbidCategoryName,"");
} }
// TODO storeId 不判断一下吗 // TODO storeId 不判断一下吗
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(firstCategoryName,storeId); ShopBaseProductCategory cate = productCategoryService.getCategoryByName(firstCategoryName);
if (cate != null) { if (cate != null) {
list.get(i).setCategory_parent_id(cate.getCategory_id()); list.get(i).setCategory_parent_id(cate.getCategory_id());
} else{ } else{
@ -217,7 +217,7 @@ public abstract class SyncBaseThirdSxAbstract{
secondCategoryName=secondCategoryName.replace(forbidCategoryName,""); secondCategoryName=secondCategoryName.replace(forbidCategoryName,"");
} }
// TODO storeId 不判断一下吗 // TODO storeId 不判断一下吗
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(secondCategoryName,storeId); ShopBaseProductCategory cate = productCategoryService.getCategoryByName(secondCategoryName);
if (cate != null) { if (cate != null) {
list.get(i).setCategory_parent_id(cate.getCategory_id()); list.get(i).setCategory_parent_id(cate.getCategory_id());
} else { } else {
@ -282,7 +282,7 @@ public abstract class SyncBaseThirdSxAbstract{
JSONObject o = (JSONObject) brandListJSON.get(i); JSONObject o = (JSONObject) brandListJSON.get(i);
if (o != null && StrUtil.isNotBlank(o.getStr("category"))) { if (o != null && StrUtil.isNotBlank(o.getStr("category"))) {
// category 一般是父分类名 // category 一般是父分类名
ShopBaseProductCategory cate = productCategoryService.getCategoryByName(o.getStr("category"),storeId); ShopBaseProductCategory cate = productCategoryService.getCategoryByName(o.getStr("category"));
if (cate != null) { if (cate != null) {
goodBrandList.get(i).setCategory_id(cate.getCategory_id()); goodBrandList.get(i).setCategory_id(cate.getCategory_id());
} else { } else {