智慧厨房

This commit is contained in:
gaowdong 2025-06-25 11:04:46 +08:00
parent 4169cf7d3a
commit cf67aeaabf
3 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package com.bonus.canteen.core.kitchen.mapper;
import com.bonus.canteen.core.kitchen.domain.KitchenStaffFace; import com.bonus.canteen.core.kitchen.domain.KitchenStaffFace;
import com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo; import com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo;
import java.util.List;
/** /**
* 人员生物识别特征Mapper接口 * 人员生物识别特征Mapper接口
* *
@ -17,4 +19,6 @@ public interface KitchenStaffFaceMapper {
int deleteStaffFaces(Long[] staffIds); int deleteStaffFaces(Long[] staffIds);
int updateStaffFaceState(KitchenStaffInfo kitchenStaffInfo); int updateStaffFaceState(KitchenStaffInfo kitchenStaffInfo);
KitchenStaffFace selectStaffFaceByStaffId(Long staffId);
} }

View File

@ -195,6 +195,10 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService {
if(!StaffFaceStateEnum.isValidFaceState(kitchenStaffInfo.getFaceState())) { if(!StaffFaceStateEnum.isValidFaceState(kitchenStaffInfo.getFaceState())) {
throw new ServiceException("无效的人脸状态"); throw new ServiceException("无效的人脸状态");
} }
KitchenStaffFace kitchenStaffFace = kitchenStaffFaceMapper.selectStaffFaceByStaffId(kitchenStaffInfo.getStaffId());
if(Objects.isNull(kitchenStaffFace)) {
throw new ServiceException("该员工没有人脸信息");
}
return kitchenStaffFaceMapper.updateStaffFaceState(kitchenStaffInfo); return kitchenStaffFaceMapper.updateStaffFaceState(kitchenStaffInfo);
} }

View File

@ -3,6 +3,12 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenStaffFaceMapper"> <mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenStaffFaceMapper">
<select id="selectStaffFaceByStaffId" resultType="com.bonus.canteen.core.kitchen.domain.KitchenStaffFace">
select staff_id,photo_url,features,create_by,error_msg,create_time,update_by,update_time
from kitchen_staff_face
where staff_id = #{staffId}
</select>
<insert id="insertStaffFace" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffFace"> <insert id="insertStaffFace" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffFace">
insert into kitchen_staff_face(staff_id,photo_url,features,create_by,error_msg,create_time,update_by,update_time) insert into kitchen_staff_face(staff_id,photo_url,features,create_by,error_msg,create_time,update_by,update_time)
values(#{staffId},#{photoUrl},#{features},#{createBy},#{errorMsg},#{createTime},#{updateBy},#{updateTime}) values(#{staffId},#{photoUrl},#{features},#{createBy},#{errorMsg},#{createTime},#{updateBy},#{updateTime})