营养类别等相关接口调试修复
This commit is contained in:
parent
4015c6942f
commit
4fe71a435b
|
|
@ -63,6 +63,7 @@ public class MenuNutrition extends BaseEntity {
|
||||||
@ApiModelProperty(value = "类别id")
|
@ApiModelProperty(value = "类别id")
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
|
|
||||||
/** 食材大类 */
|
/** 食材大类 */
|
||||||
@Excel(name = "食材大类")
|
@Excel(name = "食材大类")
|
||||||
@ApiModelProperty(value = "食材大类")
|
@ApiModelProperty(value = "食材大类")
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ public class MenuNutritionDTO {
|
||||||
private Integer price;
|
private Integer price;
|
||||||
@ApiModelProperty("食材颜色")
|
@ApiModelProperty("食材颜色")
|
||||||
private String color;
|
private String color;
|
||||||
|
@ApiModelProperty("食材小类id")
|
||||||
|
private Long categoryId;
|
||||||
@ApiModelProperty("食材大类")
|
@ApiModelProperty("食材大类")
|
||||||
private @NotNull( message = "{menu_big_type_null}" ) String bigType;
|
private @NotNull( message = "{menu_big_type_null}" ) String bigType;
|
||||||
@ApiModelProperty("食材小类")
|
@ApiModelProperty("食材小类")
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public class MenuNutritionServiceImpl implements IMenuNutritionService {
|
||||||
return menuNutritionMapper.insertMenuNutrition(menuNutrition);
|
return menuNutritionMapper.insertMenuNutrition(menuNutrition);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,14 @@ public class MenuNutritionTypeServiceImpl implements IMenuNutritionTypeService {
|
||||||
public int insertMenuNutritionType(MenuNutritionType menuNutritionType) {
|
public int insertMenuNutritionType(MenuNutritionType menuNutritionType) {
|
||||||
menuNutritionType.setCreateBy(SecurityUtils.getUserId()+"");
|
menuNutritionType.setCreateBy(SecurityUtils.getUserId()+"");
|
||||||
MenuNutritionType one = menuNutritionTypeMapper.getOne(menuNutritionType);
|
MenuNutritionType one = menuNutritionTypeMapper.getOne(menuNutritionType);
|
||||||
|
try {
|
||||||
if(one !=null ){
|
if(one !=null ){
|
||||||
throw new ServiceException("该营养基础类型已存在");
|
throw new ServiceException("该营养基础类型已存在");
|
||||||
}
|
}
|
||||||
MenuNutritionType getParentOne = menuNutritionTypeMapper.getParentOne(menuNutritionType);
|
MenuNutritionType getParentOne = menuNutritionTypeMapper.getParentOne(menuNutritionType);
|
||||||
|
if(menuNutritionType.getParentId() == 0L){
|
||||||
|
return menuNutritionTypeMapper.insertMenuNutritionType(menuNutritionType);
|
||||||
|
}else{
|
||||||
if(getParentOne == null){
|
if(getParentOne == null){
|
||||||
throw new ServiceException("无效的父级节点");
|
throw new ServiceException("无效的父级节点");
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -73,10 +77,10 @@ public class MenuNutritionTypeServiceImpl implements IMenuNutritionTypeService {
|
||||||
menuNutritionType.setLevel("2");
|
menuNutritionType.setLevel("2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
return menuNutritionTypeMapper.insertMenuNutritionType(menuNutritionType);
|
return menuNutritionTypeMapper.insertMenuNutritionType(menuNutritionType);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
or parent_id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectTypeList" parameterType="String" resultType="String">
|
<select id="selectTypeList" parameterType="String" resultType="String">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue