Browse Source

解决平台端新建类别业务bug

multiwx
dy-hu 11 months ago
parent
commit
f1d0d89ef1
  1. 7
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereProductClassifyServiceImpl.java

7
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<String, CereProductClassifyLangInfo> 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<String, CereProductClassifyLangInfo> productClassifyLangInfoEntry : productClassify.getLangInfoMap().entrySet()) {
CereProductClassifyLangInfo productClassifyLangInfo = productClassifyLangInfoEntry.getValue();
productClassifyLangInfo.setClassifyId(child.getClassifyId());
productClassifyLangInfo.setClassifyId(productClassify.getClassifyId());
productClassifyLangInfo.setId(null);
langInfoList.add(productClassifyLangInfo);
}

Loading…
Cancel
Save