|
|
@ -210,9 +210,6 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic |
|
|
|
private void addOneClassify(CereProductClassify classify, String time, |
|
|
|
List<CereProductClassify> updates, List<Long> updateIds, |
|
|
|
List<CereProductClassifyLangInfo> langInfoList) throws CoBusinessException{ |
|
|
|
if(EmptyUtils.isEmpty(classify.getClassifyName())){ |
|
|
|
throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL); |
|
|
|
} |
|
|
|
CereProductClassify cereProductClassify=new CereProductClassify(); |
|
|
|
cereProductClassify.setClassifyId(classify.getClassifyId()); |
|
|
|
cereProductClassify.setClassifyName(classify.getClassifyName()); |
|
|
@ -220,10 +217,13 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic |
|
|
|
cereProductClassify.setClassifyImage(classify.getClassifyImage()); |
|
|
|
cereProductClassify.setClassifyLevel(IntegerEnum.CLASSIFY_LEVEL_ONE.getCode()); |
|
|
|
cereProductClassify.setLink(classify.getLink()); |
|
|
|
cereProductClassify.setProject(ProjectUtil.DEFAULT_PROJECT); |
|
|
|
cereProductClassify.setProject(ContextUtil.getProject()); |
|
|
|
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); |
|
|
@ -240,7 +240,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); |
|
|
|
} |
|
|
@ -257,9 +257,6 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic |
|
|
|
List<Long> updateIds, |
|
|
|
String time, CereProductClassify child,Integer level, |
|
|
|
List<CereProductClassifyLangInfo> langInfoList) throws CoBusinessException{ |
|
|
|
if(EmptyUtils.isEmpty(child.getClassifyName())){ |
|
|
|
throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL); |
|
|
|
} |
|
|
|
CereProductClassify productClassify=new CereProductClassify(); |
|
|
|
productClassify.setClassifyId(child.getClassifyId()); |
|
|
|
productClassify.setClassifyName(child.getClassifyName()); |
|
|
@ -267,10 +264,13 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic |
|
|
|
productClassify.setClassifyLevel(level); |
|
|
|
productClassify.setLink(child.getLink()); |
|
|
|
productClassify.setClassifyImage(child.getClassifyImage()); |
|
|
|
productClassify.setProject(ProjectUtil.DEFAULT_PROJECT); |
|
|
|
productClassify.setProject(ContextUtil.getProject()); |
|
|
|
productClassify.setClassifyHierarchy(parent.getClassifyHierarchy()+"-"+child.getClassifyName()); |
|
|
|
productClassify.setLangInfoMap(child.getLangInfoMap()); |
|
|
|
productClassify.initData(); |
|
|
|
if(EmptyUtils.isEmpty(productClassify.getClassifyName())){ |
|
|
|
throw new CoBusinessException(CoReturnFormat.CLASSIFY_NAME_NULL); |
|
|
|
} |
|
|
|
if(!EmptyUtils.isLongEmpty(child.getClassifyId())){ |
|
|
|
//更新子级类别 |
|
|
|
productClassify.setUpdateTime(time); |
|
|
@ -287,7 +287,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); |
|
|
|
} |
|
|
|