|
@@ -728,15 +728,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//对于简单模式的非项目,直接获取部门主管作为审核人
|
|
|
if (company.getNonProjectSimple() == 1 && project.getIsPublic() == 1) {
|
|
|
User user = userMapper.selectById(r.getCreatorId());
|
|
|
- Department department = departmentMapper.selectById(user.getDepartmentId());
|
|
|
- if (department != null) {
|
|
|
- User deptManager = userMapper.selectById(department.getManagerId());
|
|
|
- List<ProjectAuditor> auditorList1 = new ArrayList<>();
|
|
|
- ProjectAuditor auditor = new ProjectAuditor();
|
|
|
- auditor.setAuditorId(deptManager.getId());
|
|
|
- auditor.setAuditorName(deptManager.getName());
|
|
|
- auditorList1.add(auditor);
|
|
|
- r.setAuditUserList(auditorList1);
|
|
|
+ //优先取个人的非项目审核人
|
|
|
+ String superiorId = user.getSuperiorId();
|
|
|
+ //其次取员工的部门主要负责人
|
|
|
+ if (superiorId == null) {
|
|
|
+ Integer departmentId = user.getDepartmentId();
|
|
|
+ Department department = departmentMapper.selectById(departmentId);
|
|
|
+ if (department != null) {
|
|
|
+ superiorId = department.getManagerId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (superiorId != null) {
|
|
|
+ User superior = userMapper.selectById(superiorId);
|
|
|
+ if (superior != null) {
|
|
|
+ List<ProjectAuditor> auditorList1 = new ArrayList<>();
|
|
|
+ ProjectAuditor auditor = new ProjectAuditor();
|
|
|
+ auditor.setAuditorId(superiorId);
|
|
|
+ auditor.setAuditorName(superior.getName());
|
|
|
+ auditorList1.add(auditor);
|
|
|
+ r.setAuditUserList(auditorList1);
|
|
|
+ }
|
|
|
}
|
|
|
if (r.getProjectAuditorId() != null) {
|
|
|
Optional<ProjectAuditor> auItem = r.getAuditUserList().stream().filter(au->au.getAuditorId().equals(r.getProjectAuditorId())).findFirst();
|