From e18f48679e23f08f8b346779ec6ae930884bdeb9 Mon Sep 17 00:00:00 2001 From: 张晓波 <bingbo1993@126.com> Date: 星期五, 20 十月 2023 10:20:43 +0800 Subject: [PATCH] 苏州配置文件简 化 --- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java | 5 +++++ hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml | 11 ++++++++--- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java | 27 +++++++++++++++++++++++++++ hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java | 2 ++ hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/mapper/PlatUserMapper.java | 2 ++ 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java index 4508d37..2e948f2 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/controller/FaceController.java @@ -12,6 +12,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Base64; + @RestController @RequestMapping("face") public class FaceController { @@ -85,5 +91,26 @@ return jsonObject; } + @RequestMapping("/showFaceImg") + public void showFaceImg(String recordId, HttpServletResponse response){ + String oriStr = faceServer.queryOriStrById(recordId); + byte[] bytes = Base64.getDecoder().decode(oriStr); + OutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + outputStream.write(bytes); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + try { + if (outputStream!=null) { + outputStream.close(); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + } diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java index 6c239f3..0c57764 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/FaceServer.java @@ -18,4 +18,6 @@ void queryPer(String perId); void removeNotify(String mess); + + String queryOriStrById(String id); } diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java index f050360..707b5d1 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/service/impl/FaceServerImpl.java @@ -167,6 +167,11 @@ } } + @Override + public String queryOriStrById(String id) { + return userMapper.queryOriStrById(id); + } + public static void main(String[] args) { JSONObject jsonObject = new JSONObject(); jsonObject.put("method","delete_person"); diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/mapper/PlatUserMapper.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/mapper/PlatUserMapper.java index c54bfff..b988c39 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/mapper/PlatUserMapper.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/mapper/PlatUserMapper.java @@ -113,4 +113,6 @@ void syncResult(@Param("syncSuccess") int syncSuccess,@Param("userIdArray")List<String> userIdArray); void syncFail(@Param("userId") String userId,@Param("syncFailReason")String syncFailReason); + + String queryOriStrById(String id); } diff --git a/hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml b/hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml index 19fedf4..4591523 100644 --- a/hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml +++ b/hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml @@ -858,16 +858,21 @@ <select id="queryDoorUser" resultType="com.thhy.staff.modules.biz.platuser.entity.DoorUserVo"> - select fr.create_time,fr.employee_no_string as jobNum,spu.real_name as realName,sg.group_name as groupName,1 as staffStatus + select fr.id,fr.create_time,fr.employee_no_string as userId,fd.through_type,spu.real_name as realName,spu.job_num as jobNum,sg.group_name as groupName,1 as staffStatus from t_face_record fr - left join sys_plat_user spu on spu.job_num = fr.employee_no_string + left join t_face_device fd on fd.dev_sno = fr.mac_address + left join sys_plat_user spu on spu.user_id = fr.employee_no_string left join sys_group_user sgu on spu.user_id = sgu.user_id left join sys_group sg on sg.group_id = sgu.group_id - where fr.notice_type = 5 and fr.verify = 1 and (fr.mac_address='e0:ca:3c:f0:d9:3a' or fr.mac_address = 'e0:ca:3c:f0:a7:34' or fr.mac_address = 'e0:ca:3c:f0:d9:3b') + where fr.verify = 1 and fd.through_type = 2 order by fr.create_time desc limit 10 </select> + <select id="queryOriStrById" resultType="string"> + select ori_str from t_face_record where id = #{id} + </select> + <select id="countInDoorUserToday" resultType="int"> select count(distinct fr.employee_no_string) from t_face_record fr -- Gitblit v1.9.3