From 33a56b7d950688b4b108bd39e3c609e0e84c6137 Mon Sep 17 00:00:00 2001 From: gaoben Date: Thu, 15 Aug 2024 18:45:51 +0800 Subject: [PATCH] =?UTF-8?q?v10,bug=E4=BF=AE=E5=A4=8D=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/utils/IDCardValidator.java | 2 +- .../httpapi/controler/HttpApiController.java | 7 +- .../service/impl/DeviceApiServiceImpl.java | 28 +++---- .../ten/controller/TenDataViewController.java | 16 ++-- .../ten/controller/TenPersonController.java | 2 +- .../service/impl/TenPersonServiceImpl.java | 76 +++++++++---------- 6 files changed, 66 insertions(+), 65 deletions(-) diff --git a/shapelight-admin/src/main/java/net/shapelight/common/utils/IDCardValidator.java b/shapelight-admin/src/main/java/net/shapelight/common/utils/IDCardValidator.java index aa37c9a..c28e0ed 100644 --- a/shapelight-admin/src/main/java/net/shapelight/common/utils/IDCardValidator.java +++ b/shapelight-admin/src/main/java/net/shapelight/common/utils/IDCardValidator.java @@ -25,7 +25,7 @@ public class IDCardValidator { } public static void main(String[] args) { - String id = "610402196509200013"; + String id = "610402196509200013 7"; boolean valid = isValidChineseID(id); System.out.println("身份证号码 " + id + " 是否有效: " + valid); } 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 6efc1a6..246ca46 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 @@ -1501,7 +1501,7 @@ public class HttpApiController { byte[] feature = faceEngineService.extractFaceFeature(rgbData, faceInfo, ExtractType.RECOGNIZE); if (feature != null) { // List userCompareInfos = faceEngineService.faceRecognition(feature, UserRamCache.getUserList(), 0.8f); - List userCompareInfos = faceEngineService.faceRecognition(feature, UserRamGroup.getUserList(deviceEntity.getCellId()+""), 0.8f); + List userCompareInfos = faceEngineService.faceRecognition(feature, UserRamGroup.getUserList(deviceEntity.getCellId()+""), Float.parseFloat(globalValue.getRecFaceThd())); if (CollectionUtil.isNotEmpty(userCompareInfos)) { faceRecognitionResDTO = new FaceRecognitionResDTO(); faceRecognitionResDTO.setPersonId(userCompareInfos.get(0).getFaceId()); @@ -1523,6 +1523,7 @@ public class HttpApiController { ImageInfo imageFace = ImageFactory.getRGBData(bytesFace); byte[] bytesId = idFile.getBytes(); ImageInfo imageId = ImageFactory.getRGBData(bytesId); + //身份证照片和现场照片比对 Float score = faceEngineService.compareFace(imageId,imageFace); if(score > Float.parseFloat(globalValue.getRecIdThd())){ //身份证比对成功,访客 @@ -1649,7 +1650,7 @@ public class HttpApiController { boolean isInTime3 = false; if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){ - isInTime2 = TimeUtils.isIn(personLabel.getOpenPeriod3()); + isInTime3 = TimeUtils.isIn(personLabel.getOpenPeriod3()); } if (isInTime1 || isInTime2 || isInTime3) { @@ -1746,7 +1747,7 @@ public class HttpApiController { boolean isInTime3 = false; if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){ - isInTime2 = TimeUtils.isIn(personLabel.getOpenPeriod3()); + isInTime3 = TimeUtils.isIn(personLabel.getOpenPeriod3()); } if (isInTime1 || isInTime2 || isInTime3) { log.debug("刷卡成功保存识别记录:"+sn); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/nettyapi/service/impl/DeviceApiServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/nettyapi/service/impl/DeviceApiServiceImpl.java index b922683..c233f98 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/nettyapi/service/impl/DeviceApiServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/nettyapi/service/impl/DeviceApiServiceImpl.java @@ -708,20 +708,20 @@ public class DeviceApiServiceImpl implements DeviceApiService { channel.writeAndFlush(message); //配置同步数据 - List syncEntitys = tenPersonSyncService.findByPersonId(p.getPersonId(), p.getTenantId()); - for (TenPersonSyncEntity syncEn : syncEntitys) { - syncEn.setLastUpdateTime(p.getLastUpdateTime()); - syncEn.setState(2); - tenPersonSyncService.updateById(syncEn); - //下发通知 - List list = new ArrayList<>(); - TenPersonOperationVo vo = new TenPersonOperationVo(); - vo.setUid(p.getPersonId()); - vo.setOperation(2); - vo.setLast_update_stamp(p.getLastUpdateTime()); - list.add(vo); - serverApiService.personOperation(syncEn.getDeviceSn(), list); - } +// List syncEntitys = tenPersonSyncService.findByPersonId(p.getPersonId(), p.getTenantId()); +// for (TenPersonSyncEntity syncEn : syncEntitys) { +// syncEn.setLastUpdateTime(p.getLastUpdateTime()); +// syncEn.setState(2); +// tenPersonSyncService.updateById(syncEn); +// //下发通知 +// List list = new ArrayList<>(); +// TenPersonOperationVo vo = new TenPersonOperationVo(); +// vo.setUid(p.getPersonId()); +// vo.setOperation(2); +// vo.setLast_update_stamp(p.getLastUpdateTime()); +// list.add(vo); +// serverApiService.personOperation(syncEn.getDeviceSn(), list); +// } } catch (Exception e) { log.error(e.getMessage()); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDataViewController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDataViewController.java index 503f8de..6eccad5 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDataViewController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenDataViewController.java @@ -247,10 +247,10 @@ public class TenDataViewController extends AbstractController { int personGuestCount = tenPersonService.getAllCount(params); // //获取物业人员 - personTypeList.clear(); - personTypeList.add(Constant.PERSON_TYPE_PROPERTY); - params.put("personTypeList",personTypeList); - int personPropertyCount = tenPersonService.getAllCount(params); +// personTypeList.clear(); +// personTypeList.add(Constant.PERSON_TYPE_PROPERTY); +// params.put("personTypeList",personTypeList); +// int personPropertyCount = tenPersonService.getAllCount(params); // // data.put("personCount",personCount); // data.put("personOwnerCount",personOwnerCount); @@ -263,10 +263,10 @@ public class TenDataViewController extends AbstractController { c1.setValue(personGuestCount); data.add(c1); - NameValueClass c2 = new NameValueClass(); - c2.setName("物业"); - c2.setValue(personGuestCount); - data.add(c2); +// NameValueClass c2 = new NameValueClass(); +// c2.setName("物业"); +// c2.setValue(personGuestCount); +// data.add(c2); //标签 List labelList = tenLabelService.list(new QueryWrapper() diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java index 277a157..17b0748 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java @@ -773,7 +773,7 @@ public class TenPersonController extends AbstractController { - @SysLog("批量导入人员") +// @SysLog("批量导入人员") @PostMapping("/uploadZip") @ApiOperation("上传人员信息zip文件") public R uploadZip(MultipartFile file) { diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java index 6f06051..32b9e49 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java @@ -532,30 +532,30 @@ public class TenPersonServiceImpl implements TenPersonService { } //发送设备通知 - List devList = tenDeviceService.findByCellId(entity.getCellId()); - //状态是0正常,发送推送 - if (entity.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) { - for (TenDeviceVo dev : devList) { - //添加到同步表,下发设备通知 - TenPersonSyncEntity syncEntity = new TenPersonSyncEntity(); - syncEntity.setPersonId(entity.getPersonId()); - syncEntity.setTenantId(entity.getTenantId()); - syncEntity.setDeviceSn(dev.getSn()); - syncEntity.setDeviceId(dev.getDeviceId()); - syncEntity.setState(1); - syncEntity.setLastUpdateTime(entity.getLastUpdateTime()); - tenPersonSyncService.insert(syncEntity); - - //下发通知 - List list = new ArrayList<>(); - TenPersonOperationVo vo = new TenPersonOperationVo(); - vo.setUid(syncEntity.getPersonId()); - vo.setOperation(1); - vo.setLast_update_stamp(syncEntity.getLastUpdateTime()); - list.add(vo); - serverApiService.personOperation(dev.getSn(), list); - } - } +// List devList = tenDeviceService.findByCellId(entity.getCellId()); +// //状态是0正常,发送推送 +// if (entity.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) { +// for (TenDeviceVo dev : devList) { +// //添加到同步表,下发设备通知 +// TenPersonSyncEntity syncEntity = new TenPersonSyncEntity(); +// syncEntity.setPersonId(entity.getPersonId()); +// syncEntity.setTenantId(entity.getTenantId()); +// syncEntity.setDeviceSn(dev.getSn()); +// syncEntity.setDeviceId(dev.getDeviceId()); +// syncEntity.setState(1); +// syncEntity.setLastUpdateTime(entity.getLastUpdateTime()); +// tenPersonSyncService.insert(syncEntity); +// +// //下发通知 +// List list = new ArrayList<>(); +// TenPersonOperationVo vo = new TenPersonOperationVo(); +// vo.setUid(syncEntity.getPersonId()); +// vo.setOperation(1); +// vo.setLast_update_stamp(syncEntity.getLastUpdateTime()); +// list.add(vo); +// serverApiService.personOperation(dev.getSn(), list); +// } +// } return 0; } return 1; @@ -1510,20 +1510,20 @@ public class TenPersonServiceImpl implements TenPersonService { log.debug("内存增加人员:"+entity.getPersonId()+" 姓名:"+entity.getName()); //配置同步数据 - List syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getTenantId()); - for (TenPersonSyncEntity syncEn : syncEntitys) { - syncEn.setLastUpdateTime(entity.getLastUpdateTime()); - syncEn.setState(2); - tenPersonSyncService.updateById(syncEn); - //下发通知 - List list = new ArrayList<>(); - TenPersonOperationVo vo = new TenPersonOperationVo(); - vo.setUid(entity.getPersonId()); - vo.setOperation(2); - vo.setLast_update_stamp(entity.getLastUpdateTime()); - list.add(vo); - serverApiService.personOperation(syncEn.getDeviceSn(), list); - } +// List syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getTenantId()); +// for (TenPersonSyncEntity syncEn : syncEntitys) { +// syncEn.setLastUpdateTime(entity.getLastUpdateTime()); +// syncEn.setState(2); +// tenPersonSyncService.updateById(syncEn); +// //下发通知 +// List list = new ArrayList<>(); +// TenPersonOperationVo vo = new TenPersonOperationVo(); +// vo.setUid(entity.getPersonId()); +// vo.setOperation(2); +// vo.setLast_update_stamp(entity.getLastUpdateTime()); +// list.add(vo); +// serverApiService.personOperation(syncEn.getDeviceSn(), list); +// } } tenPersonDao.updateById(entity);