diff --git a/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java b/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java index 37f248e..4b04539 100644 --- a/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java +++ b/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java @@ -100,6 +100,9 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic cereProductClassify.setClassifyHierarchy("-"+classify.getClassifyName()); cereProductClassify.setLangInfoMap(classify.getLangInfoMap()); cereProductClassify.initData(); + if(EmptyUtils.isEmpty(cereProductClassify.getClassifyName())){ + throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL); + } if(!EmptyUtils.isLongEmpty(classify.getClassifyId())){ //更新一级类别 cereProductClassify.setUpdateTime(time); @@ -116,7 +119,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic for (Map.Entry productClassifyLangInfoEntry : cereProductClassify.getLangInfoMap().entrySet()) { CereProductClassifyLangInfo productClassifyLangInfo = productClassifyLangInfoEntry.getValue(); - productClassifyLangInfo.setClassifyId(classify.getClassifyId()); + productClassifyLangInfo.setClassifyId(cereProductClassify.getClassifyId()); productClassifyLangInfo.setId(null); langInfoList.add(productClassifyLangInfo); } @@ -163,7 +166,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic for (Map.Entry productClassifyLangInfoEntry : productClassify.getLangInfoMap().entrySet()) { CereProductClassifyLangInfo productClassifyLangInfo = productClassifyLangInfoEntry.getValue(); - productClassifyLangInfo.setClassifyId(child.getClassifyId()); + productClassifyLangInfo.setClassifyId(productClassify.getClassifyId()); productClassifyLangInfo.setId(null); langInfoList.add(productClassifyLangInfo); }