定时删除过期访客
This commit is contained in:
parent
cc1f33fc50
commit
eccf6f1406
|
@ -3,8 +3,10 @@
|
|||
package net.shapelight.modules.job.task;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.shapelight.common.utils.Constant;
|
||||
import net.shapelight.common.utils.DateUtils;
|
||||
import net.shapelight.modules.face.util.UserRamGroup;
|
||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||
import net.shapelight.modules.sys.entity.SysDbBakEntity;
|
||||
import net.shapelight.modules.sys.service.SysDbBakService;
|
||||
|
@ -27,6 +29,7 @@ import java.util.List;
|
|||
*/
|
||||
@Component("personProcessTask")
|
||||
@Data
|
||||
@Slf4j
|
||||
public class PersonProcessTask implements ITask {
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
|
@ -39,22 +42,26 @@ public class PersonProcessTask implements ITask {
|
|||
|
||||
@Override
|
||||
public void run(String params) {
|
||||
logger.debug("personProcessTask定时任务正在执行,参数为:{}", params);
|
||||
logger.debug("personProcessTask定时任务正在执行.................................");
|
||||
//1. 遍历人员表,找出所有过期的访客并设置为过期不可用
|
||||
List<TenPersonEntity> guestList = tenPersonService.getAllExpireGuest();
|
||||
for (TenPersonEntity guest : guestList) {
|
||||
guest.setStatus(Constant.PESON_SUATUS_GUEST_DATE_OUT);
|
||||
//修改人员表
|
||||
tenPersonService.updateStatusById(guest);
|
||||
//特征保存到内存
|
||||
UserRamGroup.removeUser(guest.getPersonId()+"",guest.getCellId()+"");
|
||||
// UserRamCache.removeUser(guest.getPersonId()+"");
|
||||
log.debug("内存删除人员:"+guest.getPersonId()+" 姓名:"+guest.getName());
|
||||
//修改同步表
|
||||
List<TenPersonSyncEntity> syncEntityList = tenPersonSyncService.findByPersonId(guest.getPersonId(),guest.getTenantId());
|
||||
for(TenPersonSyncEntity syncEntity: syncEntityList){
|
||||
syncEntity.setState(Constant.PERSON_SYNC_DELETE);
|
||||
tenPersonSyncService.updateById(syncEntity);
|
||||
}
|
||||
// List<TenPersonSyncEntity> syncEntityList = tenPersonSyncService.findByPersonId(guest.getPersonId(),guest.getTenantId());
|
||||
// for(TenPersonSyncEntity syncEntity: syncEntityList){
|
||||
// syncEntity.setState(Constant.PERSON_SYNC_DELETE);
|
||||
// tenPersonSyncService.updateById(syncEntity);
|
||||
// }
|
||||
}
|
||||
//断开说有设备
|
||||
serverApiService.closeAll();
|
||||
logger.debug("personProcessTask定时任务执行完毕");
|
||||
// serverApiService.closeAll();
|
||||
logger.debug("personProcessTask定时任务执行完毕....................");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue