Merge remote-tracking branch 'origin/master'

This commit is contained in:
gaowdong 2025-05-27 17:39:13 +08:00
commit 5976461505
4 changed files with 7 additions and 7 deletions

View File

@ -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());

View File

@ -10,5 +10,5 @@ import com.bonus.canteen.core.user.domain.UserFace;
* @date 2025-04-03
*/
public interface UserFaceMapper {
int insert(UserFace userFace);
int insertUserFace(UserFace userFace);
}

View File

@ -74,7 +74,7 @@ public class UserFaceServiceImpl implements IUserFaceService {
} else {
throw new ServiceException("[虹软算法]:特征值提取失败");
}
int code = UserFaceMapper.insert(list.get(0));
int code = UserFaceMapper.insertUserFace(list.get(0));
if (code == 0){
throw new ServiceException("[虹软算法]:保存失败");
}

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.user.mapper.UserFaceMapper">
<insert id="insert">
<insert id="insertUserFace" parameterType="com.bonus.canteen.core.user.domain.UserFace" useGeneratedKeys="true" keyProperty="faceId">
insert into user_face(user_id,photo_url,features,create_by,error_msg,create_time,update_by,update_time)
values(#{userId},#{photoUrl},#{features},#{createBy},#{errorMsg},#{createTime},#{updateBy},#{updateTime})
on duplicate key update features = #{features},