食堂:营养信息新增修改接口更变
This commit is contained in:
parent
1d4e22ca79
commit
5d65c895b9
|
|
@ -60,7 +60,7 @@ public class CookNutritionTypeServiceImpl implements ICookNutritionTypeService {
|
|||
throw new ServiceException("营养类别名称不能为空");
|
||||
}
|
||||
try {
|
||||
if (cookNutritionType.getParentId() == null){
|
||||
if (cookNutritionType.getParentId() == null || cookNutritionType.getParentId() == 0L){
|
||||
cookNutritionType.setParentId(0L);
|
||||
cookNutritionType.setLevel("0");
|
||||
}else{
|
||||
|
|
@ -93,11 +93,11 @@ public class CookNutritionTypeServiceImpl implements ICookNutritionTypeService {
|
|||
if (StringUtils.isBlank(cookNutritionType.getNutritionTypeName())){
|
||||
throw new ServiceException("营养类别名称不能为空");
|
||||
}
|
||||
if (cookNutritionType.getParentId() == null){
|
||||
if (cookNutritionType.getParentId() == null || cookNutritionType.getParentId() == 0L){
|
||||
cookNutritionType.setParentId(0L);
|
||||
cookNutritionType.setLevel("1");
|
||||
cookNutritionType.setLevel("0");
|
||||
}else{
|
||||
cookNutritionType.setLevel("2");
|
||||
cookNutritionType.setLevel("1");
|
||||
}
|
||||
//判断名称是否重复
|
||||
CookNutritionType nutritionType = cookNutritionTypeMapper.selectCookNutritionTypeByNutritionTypeName(cookNutritionType.getNutritionTypeName(),cookNutritionType.getNutritionTypeId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue