|
|
@@ -300,6 +300,13 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
|
|
|
names = remoteRoleService.getNames(roleConditionEto);
|
|
|
}
|
|
|
|
|
|
+ List<Long> tempTaskRoldIds = list.stream().filter(r -> ObjectUtil.isEmpty(r.getTaskType())).map(r -> r.getRoleId()).distinct().collect(Collectors.toList());
|
|
|
+ final List<IdNameVo> tempTaskRoles = new ArrayList();
|
|
|
+ if (CollectionUtil.isNotEmpty(tempTaskRoldIds)) {
|
|
|
+ RoleConditionEto eto = new RoleConditionEto();
|
|
|
+ eto.setIds(tempTaskRoldIds);
|
|
|
+ tempTaskRoles.addAll(remoteRoleService.getNames(eto));
|
|
|
+ }
|
|
|
|
|
|
for (CoreSafetyTaskExport task : list) {
|
|
|
task.setIndex(list.indexOf(task) + 1);
|
|
|
@@ -312,18 +319,24 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
|
|
|
}
|
|
|
if (ObjectUtil.isEmpty(task.getTaskType())) {
|
|
|
task.setTaskType("临时登记");
|
|
|
+ Optional<IdNameVo> opt = tempTaskRoles.stream().filter(role -> ObjectUtil.equal(task.getRoleId(), role.getId())).findFirst();
|
|
|
+ if (opt.isPresent()) {
|
|
|
+ task.setSubmitName(opt.get().getName());
|
|
|
+ }
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(toRoleList)) {
|
|
|
- List<IdNameVo> finalNames = names;
|
|
|
- String roleNames = toRoleList
|
|
|
- .stream()
|
|
|
- .map(r -> finalNames.stream()
|
|
|
- .filter(n -> ObjectUtil.equal(n.getId(), r.getRoleId()))
|
|
|
- .map(IdNameVo::getName)
|
|
|
- .collect(Collectors.toList()))
|
|
|
- .flatMap(Collection::stream)
|
|
|
- .collect(Collectors.joining(","));
|
|
|
- task.setSubmitName(roleNames);
|
|
|
+ else {
|
|
|
+ if (ObjectUtil.isNotEmpty(toRoleList)) {
|
|
|
+ List<IdNameVo> finalNames = names;
|
|
|
+ String roleNames = toRoleList
|
|
|
+ .stream()
|
|
|
+ .map(r -> finalNames.stream()
|
|
|
+ .filter(n -> ObjectUtil.equal(n.getId(), r.getRoleId()))
|
|
|
+ .map(IdNameVo::getName)
|
|
|
+ .collect(Collectors.toList()))
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ task.setSubmitName(roleNames);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|