Преглед на файлове

debug 运维项目

tags/24080901
PoffyZhang преди 1 година
родител
ревизия
8cb4fb04c4
променени са 2 файла, в които са добавени 21 реда и са изтрити 2 реда
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java
  2. +19
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java Целия файл

@@ -414,11 +414,11 @@ public class EarlyWarningInstanceNotStartTask {
for(ProjectRenewalFundDeclaration needToWaringProject : needToWaringProjects){
Project project = projectService.getProjectByCode(needToWaringProject.getProjectCode());
//去预警通知 发给区管
List<UserInfo> users = roleManage.getUsersByRoleType(RoleEnum.REGION_MANAGER.name());
List<UserInfo> users = roleManage.getUsersByRoleType(RoleEnum.REGION_MANAGER.name(),needToWaringProject.getRegionCode());
for(UserInfo user : users){
earlyWarningManage.doEarlyWarning(noticeMethod,noticeContent,time,null,
needToWaringProject.getUpdateOn(),user.getEmployeeCode(),project,
WarningRuleTypeEnum.OPERATION_WARNING.getCode());
WarningRuleTypeEnum.RENEWAL_FUND.getCode());
}
}
});


+ 19
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RoleManage.java Целия файл

@@ -106,4 +106,23 @@ public class RoleManage {
.collect(Collectors.toList());
return userInfoService.listByIds(userIds);
}

public List<UserInfo> getUsersByRoleType(String roleType,String regionCode) {
Role regionRole = roleService.getOne(Wrappers.lambdaQuery(Role.class)
.eq(Role::getCode, roleType)
.last(BizConst.LIMIT_1));
if(Objects.isNull(regionRole)){
return Collections.emptyList();
}
List<UserRole> userRoles = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class)
.eq(UserRole::getRoleId, regionRole.getId()));
if(CollUtil.isEmpty(userRoles)){
return Collections.emptyList();
}
List<Long> userIds = userRoles.stream().map(UserRole::getUserId)
.collect(Collectors.toList());
return userInfoService.list(Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getId,userIds)
.eq(UserInfo::getRegionCode,regionCode));
}
}

Loading…
Отказ
Запис