|
@@ -591,17 +591,20 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
} else {
|
|
|
if (r.getGroupId() != null && r.getGroupId() != 0) {
|
|
|
//直接获取分组的负责人作为审核人
|
|
|
- TaskGroup curGroup = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst().get();
|
|
|
- if (curGroup.getInchargerId() != null) {
|
|
|
- User user = userMapper.selectById(curGroup.getInchargerId());
|
|
|
- HashMap map = new HashMap();
|
|
|
- map.put("auditorId", user.getId());
|
|
|
- map.put("auditorName", user.getName());
|
|
|
- List list = new ArrayList();
|
|
|
- list.add(map);
|
|
|
- r.setAuditUserList(list);
|
|
|
- if (r.getProjectAuditorId() != null) {
|
|
|
- r.setProjectAuditorName(user.selectById(r.getProjectAuditorId()).getName());
|
|
|
+ Optional<TaskGroup> tgoup = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst();
|
|
|
+ if (tgoup.isPresent()) {
|
|
|
+ TaskGroup curGroup = tgoup.get();
|
|
|
+ if (curGroup.getInchargerId() != null) {
|
|
|
+ User user = userMapper.selectById(curGroup.getInchargerId());
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ map.put("auditorId", user.getId());
|
|
|
+ map.put("auditorName", user.getName());
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(map);
|
|
|
+ r.setAuditUserList(list);
|
|
|
+ if (r.getProjectAuditorId() != null) {
|
|
|
+ r.setProjectAuditorName(user.selectById(r.getProjectAuditorId()).getName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|