|
@@ -2346,7 +2346,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
updateBatchById(updateReportList);
|
|
|
}
|
|
|
} else {
|
|
|
- //之前的流程逻辑,综合了一层项目审核,或者一层任务分组审核。 可叠加部门审批流
|
|
|
+ //之前的流程逻辑,综合了一层项目审核,或者一层任务分组审核。 可叠加部门审批流(部门审批时,本部门的负责人是否由上级部门负责人审核,可配置)
|
|
|
List<AuditWorkflowTimeSetting> settings = auditWorkflowTimeSettingMapper.selectList(
|
|
|
new QueryWrapper<AuditWorkflowTimeSetting>().eq("dept_id", auditTargetUser.getDepartmentId())
|
|
|
.orderByAsc("seq"));
|
|
@@ -2383,9 +2383,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
AuditWorkflowTimeSetting nextNode = settings.get(m + 1);
|
|
|
upR.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
if (upR.getIsDeptAudit() == 1) {
|
|
|
+ //下一个节点是部门审核
|
|
|
upR.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
- upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
- .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
+ Department curDept = allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(item.getCreatorId())) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// upR.setAuditDeptid(parentDeptId);
|
|
|
+ upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ }
|
|
|
}
|
|
|
upR.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|
|
@@ -2417,8 +2434,27 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
upR.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
if (upR.getIsDeptAudit() == 1) {
|
|
|
upR.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
- upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
- .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
+ Department curDept = allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(item.getCreatorId())) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// upR.setAuditDeptid(parentDeptId);
|
|
|
+ upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ }
|
|
|
+
|
|
|
+// upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
+// .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
}
|
|
|
upR.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|
|
@@ -2447,8 +2483,27 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
upR.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
if (upR.getIsDeptAudit() == 1) {
|
|
|
upR.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
- upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
- .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
+ Department curDept = allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(item.getCreatorId())) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// upR.setAuditDeptid(parentDeptId);
|
|
|
+ upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ upR.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ }
|
|
|
+
|
|
|
+// upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
+// .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
}
|
|
|
upR.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|
|
@@ -3136,7 +3191,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg batchApproveReport(String reportIds, Integer isDepartment, HttpServletRequest request,String evaluate) {
|
|
|
+ public HttpRespMsg batchApproveReport(String reportIds, Integer isDepartment, HttpServletRequest request,String evaluate) throws Exception {
|
|
|
String token = request.getHeader("Token");
|
|
|
User user = userMapper.selectById(token);
|
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
@@ -3559,12 +3614,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
Optional<Department> first = allDepts.stream()
|
|
|
.filter(ad -> ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst();
|
|
|
if (!first.isPresent()) {
|
|
|
-
|
|
|
System.out.println(item.getId()+"下个节点找不到: "+nextNode.getAuditDeptId()+", "+nextNode.getAuditDeptName());
|
|
|
-
|
|
|
+ throw new Exception("找不到部门");
|
|
|
+ }
|
|
|
+ Department curDept = first.get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(creatorId)) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// curReport.setAuditDeptid(parentDeptId);
|
|
|
+ curReport.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
}
|
|
|
- String managerId = first.get().getManagerId();
|
|
|
- curReport.setAuditDeptManagerid(managerId);
|
|
|
}
|
|
|
curReport.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|
|
@@ -3594,8 +3663,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
curReport.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
if (curReport.getIsDeptAudit() == 1) {
|
|
|
curReport.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
- curReport.setAuditDeptManagerid(allDepts.stream()
|
|
|
- .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
+ Department curDept = allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(creatorId)) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// curReport.setAuditDeptid(parentDeptId);
|
|
|
+ curReport.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ }
|
|
|
}
|
|
|
curReport.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
upR = curReport;
|
|
@@ -3639,8 +3724,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
upR.setIsDeptAudit(nextNode.getIsDeptAudit());
|
|
|
if (upR.getIsDeptAudit() == 1) {
|
|
|
upR.setAuditDeptid(nextNode.getAuditDeptId());
|
|
|
- upR.setAuditDeptManagerid(allDepts.stream()
|
|
|
- .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
|
|
|
+ Department curDept = allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get();
|
|
|
+ String curDeptManagerId = curDept.getManagerId();
|
|
|
+ //启用了本部门负责人的日报由上级部门主要负责人审核
|
|
|
+ if (timeType.getReportAuditFlowEnableSuperDeptAduit() == 1 && curDeptManagerId.equals(creatorId)) {
|
|
|
+ //当前提交的人是这个部门的主要负责人,那么要取该部门的上一级部门的主要负责人来审核
|
|
|
+ Integer parentDeptId = curDept.getSuperiorId();
|
|
|
+ if (parentDeptId == null) {
|
|
|
+ //没有上级部门,直接取当前部门的负责人
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ } else {
|
|
|
+// curReport.setAuditDeptid(parentDeptId);
|
|
|
+ curReport.setAuditDeptManagerid(allDepts.stream()
|
|
|
+ .filter(ad->ad.getDepartmentId().equals(parentDeptId)).findFirst().get().getManagerId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ curReport.setAuditDeptManagerid(curDeptManagerId);
|
|
|
+ }
|
|
|
}
|
|
|
upR.setIsFinalAudit(nextNode.getIsFinal());
|
|
|
break;
|