From 0b6189c1c208a4f1c4cd4b230dba10b3581d1ff9 Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期四, 16 五月 2024 16:01:16 +0800
Subject: [PATCH] fix: 获取司机配送员信息接口修改

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java
index 72b5a32..be1df9b 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/face/FaceImgController.java
@@ -18,12 +18,15 @@
 import cn.exrick.xboot.your.service.ICarService;
 import cn.exrick.xboot.your.service.IEventLogService;
 import cn.exrick.xboot.your.util.FaceSystem;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.gson.Gson;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -37,10 +40,12 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 //浜鸿劯姣斿妫�娴嬭溅鍘㈠紓甯稿紑鍚�
 @RestController
+@Api(tags = "浜鸿劯姣斿妫�娴嬭溅鍘㈠紓甯稿紑鍚�")
 @RequestMapping("/hk")
 public class FaceImgController {
 
@@ -61,7 +66,7 @@
     @Autowired
     private IEventLogService iEventLogService;
 
-
+    @ApiOperation(value = "浜鸿劯瀵规瘮鍥剧墖")
     @RequestMapping(value = "/faceImg", method = RequestMethod.POST)
     public void saveOrUpdate(HttpServletRequest request) throws IOException, ServletException {
         OssSetting os = new Gson().fromJson(settingService.get(SettingConstant.LOCAL_OSS).getValue(), OssSetting.class);
@@ -75,12 +80,26 @@
             String targetAttrs = jsonObject1.get("targetAttrs").toString();
             JSONObject jsonObject2 = JSONUtil.parseObj(targetAttrs);
             String deviceName = jsonObject2.get("deviceName").toString();
-            System.out.println(deviceName);
+            //System.out.println(deviceName);
 
             QueryWrapper<Car> wrapper = new QueryWrapper<Car>();
             wrapper.eq("car_no",deviceName.substring(0,deviceName.length()-1));
             Car one = iCarService.getOne(wrapper);
             if(one==null){
+                return;
+            }
+
+            Date date1 = new Date();
+            long time = date1.getTime()-2*60*1000;
+            Date date = new Date(time);
+            String format1 = DateUtil.format(date,"yyyy-MM-dd HH:mm:ss");
+            String format2 = DateUtil.format(date1,"yyyy-MM-dd HH:mm:ss");
+            QueryWrapper<Alarm> awrapper = new QueryWrapper<>();
+            awrapper.between("create_time",format1,format2);
+            awrapper.eq("car_no",one.getCarNo());
+            awrapper.eq("type",5);
+            List<Alarm> list = iAlarmService.list(awrapper);
+            if(list.size()>0){
                 return;
             }
 
@@ -109,7 +128,7 @@
                                 String avatar = user.getAvatar();
                                 if(StrUtil.isNotEmpty(avatar)){
                                     int result1 = FaceSystem.getResult(avatar, avatar2);
-                                    if(result1<60){
+                                    if(result1<50){
                                         flag++;
                                     }else{
                                         deleteFile(f.getId());//鏄竴涓汉鍒犻櫎鍥剧墖 flag=0
@@ -123,7 +142,7 @@
                                 String avatar = user1.getAvatar();
                                 if(StrUtil.isNotEmpty(avatar)){
                                     int result1 = FaceSystem.getResult(avatar, avatar2);
-                                    if(result1<60){
+                                    if(result1<50){
                                         flag++;
                                     }else{
                                         deleteFile(f.getId());
@@ -150,7 +169,7 @@
                             }
 
                         } catch (Exception e) {
-                            System.out.println(e.toString());
+                            //System.out.println(e.toString());
                         }
                     }
                 }

--
Gitblit v1.9.1