v10,bug修复,优化

This commit is contained in:
gaoben 2024-08-15 18:45:51 +08:00
parent fc695f9372
commit 33a56b7d95
6 changed files with 66 additions and 65 deletions

View File

@ -25,7 +25,7 @@ public class IDCardValidator {
} }
public static void main(String[] args) { public static void main(String[] args) {
String id = "610402196509200013"; String id = "610402196509200013 7";
boolean valid = isValidChineseID(id); boolean valid = isValidChineseID(id);
System.out.println("身份证号码 " + id + " 是否有效: " + valid); System.out.println("身份证号码 " + id + " 是否有效: " + valid);
} }

View File

@ -1501,7 +1501,7 @@ public class HttpApiController {
byte[] feature = faceEngineService.extractFaceFeature(rgbData, faceInfo, ExtractType.RECOGNIZE); byte[] feature = faceEngineService.extractFaceFeature(rgbData, faceInfo, ExtractType.RECOGNIZE);
if (feature != null) { if (feature != null) {
// List<UserCompareInfo> userCompareInfos = faceEngineService.faceRecognition(feature, UserRamCache.getUserList(), 0.8f); // List<UserCompareInfo> userCompareInfos = faceEngineService.faceRecognition(feature, UserRamCache.getUserList(), 0.8f);
List<UserCompareInfo> userCompareInfos = faceEngineService.faceRecognition(feature, UserRamGroup.getUserList(deviceEntity.getCellId()+""), 0.8f); List<UserCompareInfo> userCompareInfos = faceEngineService.faceRecognition(feature, UserRamGroup.getUserList(deviceEntity.getCellId()+""), Float.parseFloat(globalValue.getRecFaceThd()));
if (CollectionUtil.isNotEmpty(userCompareInfos)) { if (CollectionUtil.isNotEmpty(userCompareInfos)) {
faceRecognitionResDTO = new FaceRecognitionResDTO(); faceRecognitionResDTO = new FaceRecognitionResDTO();
faceRecognitionResDTO.setPersonId(userCompareInfos.get(0).getFaceId()); faceRecognitionResDTO.setPersonId(userCompareInfos.get(0).getFaceId());
@ -1523,6 +1523,7 @@ public class HttpApiController {
ImageInfo imageFace = ImageFactory.getRGBData(bytesFace); ImageInfo imageFace = ImageFactory.getRGBData(bytesFace);
byte[] bytesId = idFile.getBytes(); byte[] bytesId = idFile.getBytes();
ImageInfo imageId = ImageFactory.getRGBData(bytesId); ImageInfo imageId = ImageFactory.getRGBData(bytesId);
//身份证照片和现场照片比对
Float score = faceEngineService.compareFace(imageId,imageFace); Float score = faceEngineService.compareFace(imageId,imageFace);
if(score > Float.parseFloat(globalValue.getRecIdThd())){ if(score > Float.parseFloat(globalValue.getRecIdThd())){
//身份证比对成功访客 //身份证比对成功访客
@ -1649,7 +1650,7 @@ public class HttpApiController {
boolean isInTime3 = false; boolean isInTime3 = false;
if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){ if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){
isInTime2 = TimeUtils.isIn(personLabel.getOpenPeriod3()); isInTime3 = TimeUtils.isIn(personLabel.getOpenPeriod3());
} }
if (isInTime1 || isInTime2 || isInTime3) { if (isInTime1 || isInTime2 || isInTime3) {
@ -1746,7 +1747,7 @@ public class HttpApiController {
boolean isInTime3 = false; boolean isInTime3 = false;
if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){ if(personLabel.getOpenPeriod3()!=null && personLabel.getOpenPeriod3().length()>0){
isInTime2 = TimeUtils.isIn(personLabel.getOpenPeriod3()); isInTime3 = TimeUtils.isIn(personLabel.getOpenPeriod3());
} }
if (isInTime1 || isInTime2 || isInTime3) { if (isInTime1 || isInTime2 || isInTime3) {
log.debug("刷卡成功保存识别记录:"+sn); log.debug("刷卡成功保存识别记录:"+sn);

View File

@ -708,20 +708,20 @@ public class DeviceApiServiceImpl implements DeviceApiService {
channel.writeAndFlush(message); channel.writeAndFlush(message);
//配置同步数据 //配置同步数据
List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(p.getPersonId(), p.getTenantId()); // List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(p.getPersonId(), p.getTenantId());
for (TenPersonSyncEntity syncEn : syncEntitys) { // for (TenPersonSyncEntity syncEn : syncEntitys) {
syncEn.setLastUpdateTime(p.getLastUpdateTime()); // syncEn.setLastUpdateTime(p.getLastUpdateTime());
syncEn.setState(2); // syncEn.setState(2);
tenPersonSyncService.updateById(syncEn); // tenPersonSyncService.updateById(syncEn);
//下发通知 // //下发通知
List<TenPersonOperationVo> list = new ArrayList<>(); // List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo(); // TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(p.getPersonId()); // vo.setUid(p.getPersonId());
vo.setOperation(2); // vo.setOperation(2);
vo.setLast_update_stamp(p.getLastUpdateTime()); // vo.setLast_update_stamp(p.getLastUpdateTime());
list.add(vo); // list.add(vo);
serverApiService.personOperation(syncEn.getDeviceSn(), list); // serverApiService.personOperation(syncEn.getDeviceSn(), list);
} // }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());

View File

@ -247,10 +247,10 @@ public class TenDataViewController extends AbstractController {
int personGuestCount = tenPersonService.getAllCount(params); int personGuestCount = tenPersonService.getAllCount(params);
// //
//获取物业人员 //获取物业人员
personTypeList.clear(); // personTypeList.clear();
personTypeList.add(Constant.PERSON_TYPE_PROPERTY); // personTypeList.add(Constant.PERSON_TYPE_PROPERTY);
params.put("personTypeList",personTypeList); // params.put("personTypeList",personTypeList);
int personPropertyCount = tenPersonService.getAllCount(params); // int personPropertyCount = tenPersonService.getAllCount(params);
// //
// data.put("personCount",personCount); // data.put("personCount",personCount);
// data.put("personOwnerCount",personOwnerCount); // data.put("personOwnerCount",personOwnerCount);
@ -263,10 +263,10 @@ public class TenDataViewController extends AbstractController {
c1.setValue(personGuestCount); c1.setValue(personGuestCount);
data.add(c1); data.add(c1);
NameValueClass c2 = new NameValueClass(); // NameValueClass c2 = new NameValueClass();
c2.setName("物业"); // c2.setName("物业");
c2.setValue(personGuestCount); // c2.setValue(personGuestCount);
data.add(c2); // data.add(c2);
//标签 //标签
List<TenLabelEntity> labelList = tenLabelService.list(new QueryWrapper<TenLabelEntity>() List<TenLabelEntity> labelList = tenLabelService.list(new QueryWrapper<TenLabelEntity>()

View File

@ -773,7 +773,7 @@ public class TenPersonController extends AbstractController {
@SysLog("批量导入人员") // @SysLog("批量导入人员")
@PostMapping("/uploadZip") @PostMapping("/uploadZip")
@ApiOperation("上传人员信息zip文件") @ApiOperation("上传人员信息zip文件")
public R uploadZip(MultipartFile file) { public R uploadZip(MultipartFile file) {

View File

@ -532,30 +532,30 @@ public class TenPersonServiceImpl implements TenPersonService {
} }
//发送设备通知 //发送设备通知
List<TenDeviceVo> devList = tenDeviceService.findByCellId(entity.getCellId()); // List<TenDeviceVo> devList = tenDeviceService.findByCellId(entity.getCellId());
//状态是0正常发送推送 // //状态是0正常发送推送
if (entity.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) { // if (entity.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) {
for (TenDeviceVo dev : devList) { // for (TenDeviceVo dev : devList) {
//添加到同步表下发设备通知 // //添加到同步表下发设备通知
TenPersonSyncEntity syncEntity = new TenPersonSyncEntity(); // TenPersonSyncEntity syncEntity = new TenPersonSyncEntity();
syncEntity.setPersonId(entity.getPersonId()); // syncEntity.setPersonId(entity.getPersonId());
syncEntity.setTenantId(entity.getTenantId()); // syncEntity.setTenantId(entity.getTenantId());
syncEntity.setDeviceSn(dev.getSn()); // syncEntity.setDeviceSn(dev.getSn());
syncEntity.setDeviceId(dev.getDeviceId()); // syncEntity.setDeviceId(dev.getDeviceId());
syncEntity.setState(1); // syncEntity.setState(1);
syncEntity.setLastUpdateTime(entity.getLastUpdateTime()); // syncEntity.setLastUpdateTime(entity.getLastUpdateTime());
tenPersonSyncService.insert(syncEntity); // tenPersonSyncService.insert(syncEntity);
//
//下发通知 // //下发通知
List<TenPersonOperationVo> list = new ArrayList<>(); // List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo(); // TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(syncEntity.getPersonId()); // vo.setUid(syncEntity.getPersonId());
vo.setOperation(1); // vo.setOperation(1);
vo.setLast_update_stamp(syncEntity.getLastUpdateTime()); // vo.setLast_update_stamp(syncEntity.getLastUpdateTime());
list.add(vo); // list.add(vo);
serverApiService.personOperation(dev.getSn(), list); // serverApiService.personOperation(dev.getSn(), list);
} // }
} // }
return 0; return 0;
} }
return 1; return 1;
@ -1510,20 +1510,20 @@ public class TenPersonServiceImpl implements TenPersonService {
log.debug("内存增加人员:"+entity.getPersonId()+" 姓名:"+entity.getName()); log.debug("内存增加人员:"+entity.getPersonId()+" 姓名:"+entity.getName());
//配置同步数据 //配置同步数据
List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getTenantId()); // List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getTenantId());
for (TenPersonSyncEntity syncEn : syncEntitys) { // for (TenPersonSyncEntity syncEn : syncEntitys) {
syncEn.setLastUpdateTime(entity.getLastUpdateTime()); // syncEn.setLastUpdateTime(entity.getLastUpdateTime());
syncEn.setState(2); // syncEn.setState(2);
tenPersonSyncService.updateById(syncEn); // tenPersonSyncService.updateById(syncEn);
//下发通知 // //下发通知
List<TenPersonOperationVo> list = new ArrayList<>(); // List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo(); // TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(entity.getPersonId()); // vo.setUid(entity.getPersonId());
vo.setOperation(2); // vo.setOperation(2);
vo.setLast_update_stamp(entity.getLastUpdateTime()); // vo.setLast_update_stamp(entity.getLastUpdateTime());
list.add(vo); // list.add(vo);
serverApiService.personOperation(syncEn.getDeviceSn(), list); // serverApiService.personOperation(syncEn.getDeviceSn(), list);
} // }
} }
tenPersonDao.updateById(entity); tenPersonDao.updateById(entity);