From 5d65c895b9946c4fd7dffc2d76fc3f1fc552f7b4 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 27 May 2025 17:25:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A3=9F=E5=A0=82=EF=BC=9A=E8=90=A5?= =?UTF-8?q?=E5=85=BB=E4=BF=A1=E6=81=AF=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cook/service/impl/CookNutritionTypeServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookNutritionTypeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookNutritionTypeServiceImpl.java index e20f1bb..cef73b5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookNutritionTypeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookNutritionTypeServiceImpl.java @@ -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()); From 0ebfb1e6be35199d953d1f3d0d041a2f1fb07fe2 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 27 May 2025 17:28:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E4=B8=BB=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/canteen/core/user/mapper/UserFaceMapper.java | 2 +- .../canteen/core/user/service/impl/UserFaceServiceImpl.java | 2 +- .../src/main/resources/mapper/user/UserFaceMapper.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserFaceMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserFaceMapper.java index c6e7379..9329c94 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserFaceMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserFaceMapper.java @@ -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); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserFaceServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserFaceServiceImpl.java index 05d0969..3f90104 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserFaceServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserFaceServiceImpl.java @@ -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("[虹软算法]:保存失败"); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserFaceMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserFaceMapper.xml index 0786b80..35a66be 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserFaceMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserFaceMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + 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},