|
@@ -6,6 +6,7 @@ import com.management.platform.entity.*;
|
|
import com.management.platform.mapper.*;
|
|
import com.management.platform.mapper.*;
|
|
import com.management.platform.service.ProjectAuditorService;
|
|
import com.management.platform.service.ProjectAuditorService;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -41,6 +42,8 @@ public class ProjectAuditorController {
|
|
private DepartmentMapper departmentMapper;
|
|
private DepartmentMapper departmentMapper;
|
|
@Resource
|
|
@Resource
|
|
HttpServletRequest request;
|
|
HttpServletRequest request;
|
|
|
|
+ @Autowired
|
|
|
|
+ private TimeTypeMapper timeTypeMapper;
|
|
|
|
|
|
@RequestMapping("/getList")
|
|
@RequestMapping("/getList")
|
|
private HttpRespMsg getList(Integer projectId) {
|
|
private HttpRespMsg getList(Integer projectId) {
|
|
@@ -57,10 +60,18 @@ public class ProjectAuditorController {
|
|
//非项目,该员工的部门主要负责人审核
|
|
//非项目,该员工的部门主要负责人审核
|
|
mode = 1;
|
|
mode = 1;
|
|
String superiorId = null;
|
|
String superiorId = null;
|
|
- Integer departmentId = user.getDepartmentId();
|
|
|
|
- Department department = departmentMapper.selectById(departmentId);
|
|
|
|
- if (department != null) {
|
|
|
|
- superiorId = department.getManagerId();
|
|
|
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
|
+ //优先取员工的上级领导
|
|
|
|
+ if (timeType.getReportAuditType() == 0) {
|
|
|
|
+ superiorId = user.getSuperiorId();
|
|
|
|
+ }
|
|
|
|
+ //其次取员工的部门主要负责人
|
|
|
|
+ if (superiorId == null) {
|
|
|
|
+ Integer departmentId = user.getDepartmentId();
|
|
|
|
+ Department department = departmentMapper.selectById(departmentId);
|
|
|
|
+ if (department != null) {
|
|
|
|
+ superiorId = department.getManagerId();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (superiorId != null) {
|
|
if (superiorId != null) {
|
|
User superior = userMapper.selectById(superiorId);
|
|
User superior = userMapper.selectById(superiorId);
|
|
@@ -69,9 +80,9 @@ public class ProjectAuditorController {
|
|
auditor.setAuditorId(superiorId);
|
|
auditor.setAuditorId(superiorId);
|
|
auditor.setAuditorName(superior.getName());
|
|
auditor.setAuditorName(superior.getName());
|
|
auditorList.add(auditor);
|
|
auditorList.add(auditor);
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
msg.data = auditorList;
|
|
msg.data = auditorList;
|
|
}
|
|
}
|
|
}
|
|
}
|