停用账号不分配审批bug修复

This commit is contained in:
Koi-tsk 2022-09-01 17:10:47 +08:00
parent 7865ebbd27
commit 087b1ca78f
3 changed files with 6 additions and 6 deletions

View File

@ -94,9 +94,9 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId(), "status", "1"));
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream().sorted(Comparator.comparing(SysUserEntity::getUpdateDate).reversed()).collect(Collectors.toList()).stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId())).findFirst();
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId()) && user.getStatus()==1).findFirst();
if (userEntityOptional.isPresent()) {
userId = userEntityOptional.get().getId().toString();
}

View File

@ -95,9 +95,9 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId(), "status", "1"));
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream().sorted(Comparator.comparing(SysUserEntity::getUpdateDate).reversed()).collect(Collectors.toList()).stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.TWO).getId())).findFirst();
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.TWO).getId()) && user.getStatus()==1).findFirst();
if (userEntityOptional.isPresent()) {
userId = userEntityOptional.get().getId().toString();
}

View File

@ -91,9 +91,9 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A
logger.error("regionEntityId:" + regionEntity.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId(), "status", "1"));
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream().sorted(Comparator.comparing(SysUserEntity::getUpdateDate).reversed()).collect(Collectors.toList()).stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId())).findFirst();
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId()) && user.getStatus()==1).findFirst();
if (userEntityOptional.isPresent()) {
userId = userEntityOptional.get().getId().toString();
}