feat(sis): 支持黑名单人员管理
- 新增人员标签类型字段,用于区分红名单、白名单和黑名单 - 修改授权逻辑,黑名单人员不进行授权记录和E8平台同步 - 优化定时任务,对不同名单类型的人员进行差异化处理 - 增加黑名单人员入内的告警功能
This commit is contained in:
@@ -108,6 +108,12 @@ public class ResidentPerson extends TenantEntity {
|
||||
* e8平台id
|
||||
*/
|
||||
private Long eEightId;
|
||||
|
||||
/**
|
||||
* 人员标签类型
|
||||
*/
|
||||
private Integer rosterType;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
|
@@ -121,5 +121,10 @@ public class ResidentPersonBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 人员标签类型
|
||||
*/
|
||||
private Integer rosterType = 2;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -138,5 +138,10 @@ public class ResidentPersonVo implements Serializable {
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 人员标签类型
|
||||
*/
|
||||
private Integer rosterType;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ public class RemoteResidentPersonServiceImpl implements RemoteResidentPersonServ
|
||||
remoteResidentPersonVo.setName(vo.getUserName());
|
||||
remoteResidentPersonVo.setIdCard(vo.getIdCard());
|
||||
remoteResidentPersonVo.setGender(vo.getGender());
|
||||
remoteResidentPersonVo.setRosterType(vo.getRosterType());
|
||||
remoteResidentPersonVo.setAuthGroupId(vo.getAuthGroupId());
|
||||
remoteResidentPersonVo.setAuthBegDate(vo.getAuthBegDate());
|
||||
remoteResidentPersonVo.setAuthEndDate(vo.getAuthEndDate());
|
||||
|
@@ -140,31 +140,26 @@ public class ResidentPersonServiceImpl implements IResidentPersonService {
|
||||
ResidentPerson update = MapstructUtils.convert(bo, ResidentPerson.class);
|
||||
assert update != null;
|
||||
|
||||
boolean flag;
|
||||
// 人脸照片存在时,才同步修改授权
|
||||
if (update.getAuthGroupId() != null && update.getAuthEndDate() != null && update.getImg() != null) {
|
||||
ResidentPersonVo vo = queryById(update.getId());
|
||||
Long e8Id = vo.getEEightId();
|
||||
baseMapper.updateById(update);
|
||||
|
||||
// 显式移除e8id
|
||||
LambdaUpdateWrapper<ResidentPerson> lqw = new LambdaUpdateWrapper<>();
|
||||
lqw.eq(ResidentPerson::getId, update.getId())
|
||||
.set(ResidentPerson::getEEightId, null);
|
||||
flag = baseMapper.update(lqw) > 0;
|
||||
boolean check = baseMapper.update(lqw) > 0;
|
||||
|
||||
|
||||
if (flag && e8Id != null) {
|
||||
if (check && e8Id != null) {
|
||||
log.info("开始修改授权记录, {}", bo.getUserName());
|
||||
// 先删除,定时任务增加
|
||||
Boolean auth = remoteSisAuthService.deletePersonAuth(List.of(update.getId()), List.of(e8Id));
|
||||
Assert.isTrue(auth, "修改授权记录失败!");
|
||||
}
|
||||
|
||||
} else {
|
||||
flag = baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
boolean flag = baseMapper.updateById(update) > 0;
|
||||
Assert.isTrue(flag, "修改入驻员工失败!");
|
||||
return flag;
|
||||
}
|
||||
|
Reference in New Issue
Block a user