开门接口

This commit is contained in:
suixing 2024-10-25 19:40:43 +08:00
parent ca1ca75079
commit 2f2203d7ee
3 changed files with 17 additions and 14 deletions

View File

@ -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.setFaceCount(faceCount);
// deviceEntity.setLastUpdateTime(new Date()); // deviceEntity.setLastUpdateTime(new Date());
@ -253,6 +258,8 @@ public class HttpApiController {
}else{ }else{
configMap.put("displayFaceFlag",1); configMap.put("displayFaceFlag",1);
} }
// 返回 open 标志位
configMap.put("open", open);
return R.ok().put("data",configMap); return R.ok().put("data",configMap);
} }
@ -460,6 +467,7 @@ public class HttpApiController {
puser.setLabelName(p.getLabelName()); puser.setLabelName(p.getLabelName());
puser.setIsProtectDevice(p.getIsProtectDevice()); puser.setIsProtectDevice(p.getIsProtectDevice());
puser.setIsEnterSulfurArea(p.getIsEnterSulfurArea()); puser.setIsEnterSulfurArea(p.getIsEnterSulfurArea());
puser.setIsCheckCert(p.getIsCheckCert());
puser.setIsWatchSafeVideo(p.getIsWatchSafeVideo()); puser.setIsWatchSafeVideo(p.getIsWatchSafeVideo());
List<TenPersonCert> tenPersonCertList = certService.list(new LambdaQueryWrapper<TenPersonCert>() List<TenPersonCert> tenPersonCertList = certService.list(new LambdaQueryWrapper<TenPersonCert>()
@ -1885,8 +1893,6 @@ public class HttpApiController {
return R.error("陌生人,禁止通行"); return R.error("陌生人,禁止通行");
} }
@PostMapping("/updatePersonByIdCard") @PostMapping("/updatePersonByIdCard")
@ApiOperation("设备修改人员") @ApiOperation("设备修改人员")
@ApiImplicitParams({ @ApiImplicitParams({

View File

@ -169,7 +169,7 @@ public class TenDeviceController extends AbstractController {
@ApiImplicitParam(name="deviceSn",value = "设备Sn",paramType = "query",dataType = "String",required = true), @ApiImplicitParam(name="deviceSn",value = "设备Sn",paramType = "query",dataType = "String",required = true),
}) })
public R cleanPerson(@RequestBody Map<String, Object> deviceSn){ public R cleanPerson(@RequestBody Map<String, Object> deviceSn){
String sn = (String)deviceSn.get("deviceSn"); /* String sn = (String)deviceSn.get("deviceSn");
// CmdProcess.publishCleanPerson(sn); // CmdProcess.publishCleanPerson(sn);
//清除数据 //清除数据
int r = serverApiService.cleanData(sn); int r = serverApiService.cleanData(sn);
@ -183,20 +183,16 @@ public class TenDeviceController extends AbstractController {
//升级app //升级app
// TenAppVerison v = new TenAppVerison(); // TenAppVerison v = new TenAppVerison();
// int a = serverApiService.appUpdate(sn,v); // int a = serverApiService.appUpdate(sn,v);
if(r == -1){ if(r == -1){
return R.error("设备离线"); return R.error("设备离线");
} }
//重新配置同步表*/
//重新配置同步表 String sn = (String) deviceSn.get("deviceSn");
// 设置 open 标志位的值为 1
String openKey = "DeviceOpen-" + sn;
redisUtils.set(openKey, "1", 30L);
return R.ok("开门成功");
return R.ok();
} }
/** /**

View File

@ -57,6 +57,7 @@ public class TenUserVo {
private Integer isProtectDevice; private Integer isProtectDevice;
private Integer isWatchSafeVideo; private Integer isWatchSafeVideo;
private Integer isBlacklistPersonnel; private Integer isBlacklistPersonnel;
private Integer IsCheckCert;
private List<TenPersonCert> tenPersonCertList; private List<TenPersonCert> tenPersonCertList;
private List<TenPersonTrain> tenPersonTrainList; private List<TenPersonTrain> tenPersonTrainList;