From 2f2203d7eee620aa8d826a6b2b0f76fd22d9262a Mon Sep 17 00:00:00 2001 From: suixing <1350698476@qq.com> Date: Fri, 25 Oct 2024 19:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E9=97=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../httpapi/controler/HttpApiController.java | 10 ++++++++-- .../ten/controller/TenDeviceController.java | 20 ++++++++----------- .../net/shapelight/modules/vo/TenUserVo.java | 1 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/httpapi/controler/HttpApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/httpapi/controler/HttpApiController.java index 95ed36d..65736fe 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/httpapi/controler/HttpApiController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/httpapi/controler/HttpApiController.java @@ -159,6 +159,11 @@ public class HttpApiController { } } + // 处理 open 标志位 + String openKey = "DeviceOpen-" + sn; + Object openValue = redisUtils.get(openKey); + Integer open = (openValue != null) ? Integer.valueOf(openValue.toString()) : 0; + //保存人脸个数 // deviceEntity.setFaceCount(faceCount); // deviceEntity.setLastUpdateTime(new Date()); @@ -253,6 +258,8 @@ public class HttpApiController { }else{ configMap.put("displayFaceFlag",1); } + // 返回 open 标志位 + configMap.put("open", open); return R.ok().put("data",configMap); } @@ -460,6 +467,7 @@ public class HttpApiController { puser.setLabelName(p.getLabelName()); puser.setIsProtectDevice(p.getIsProtectDevice()); puser.setIsEnterSulfurArea(p.getIsEnterSulfurArea()); + puser.setIsCheckCert(p.getIsCheckCert()); puser.setIsWatchSafeVideo(p.getIsWatchSafeVideo()); List tenPersonCertList = certService.list(new LambdaQueryWrapper() @@ -1885,8 +1893,6 @@ public class HttpApiController { return R.error("陌生人,禁止通行"); } - - @PostMapping("/updatePersonByIdCard") @ApiOperation("设备修改人员") @ApiImplicitParams({ diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDeviceController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDeviceController.java index 4e710e3..f8c45aa 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDeviceController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDeviceController.java @@ -169,7 +169,7 @@ public class TenDeviceController extends AbstractController { @ApiImplicitParam(name="deviceSn",value = "设备Sn",paramType = "query",dataType = "String",required = true), }) public R cleanPerson(@RequestBody Map deviceSn){ - String sn = (String)deviceSn.get("deviceSn"); +/* String sn = (String)deviceSn.get("deviceSn"); // CmdProcess.publishCleanPerson(sn); //清除数据 int r = serverApiService.cleanData(sn); @@ -183,20 +183,16 @@ public class TenDeviceController extends AbstractController { //升级app // TenAppVerison v = new TenAppVerison(); // int a = serverApiService.appUpdate(sn,v); - - if(r == -1){ return R.error("设备离线"); } - - //重新配置同步表 - - - - - - - return R.ok(); + //重新配置同步表*/ + String sn = (String) deviceSn.get("deviceSn"); + // 设置 open 标志位的值为 1 + String openKey = "DeviceOpen-" + sn; + redisUtils.set(openKey, "1", 30L); + return R.ok("开门成功"); + } /** diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/vo/TenUserVo.java b/shapelight-admin/src/main/java/net/shapelight/modules/vo/TenUserVo.java index 91ac3fe..b998a91 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/vo/TenUserVo.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/vo/TenUserVo.java @@ -57,6 +57,7 @@ public class TenUserVo { private Integer isProtectDevice; private Integer isWatchSafeVideo; private Integer isBlacklistPersonnel; + private Integer IsCheckCert; private List tenPersonCertList; private List tenPersonTrainList;