|
@@ -1821,7 +1821,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保存日报的记录(提交和审核通过)
|
|
//保存日报的记录(提交和审核通过)
|
|
|
- private void saveReportWithAuditLog(List<User> userList, List<Report> reportList) {
|
|
|
|
|
|
|
+ private void saveReportWithAuditLog(List<User> userList, List<Report> reportList, boolean showAutoApprove) {
|
|
|
if (reportList.size() == 0) return;
|
|
if (reportList.size() == 0) return;
|
|
|
Report r = reportList.get(0);
|
|
Report r = reportList.get(0);
|
|
|
List<ReportLog> addLogList = new ArrayList<>();
|
|
List<ReportLog> addLogList = new ArrayList<>();
|
|
@@ -1876,6 +1876,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
addLogDetailList.add(detail);
|
|
addLogDetailList.add(detail);
|
|
|
|
|
|
|
|
//审核记录
|
|
//审核记录
|
|
|
|
|
+ System.out.println("report.getProjectAuditorId()==="+report.getProjectAuditorId());
|
|
|
if (report.getProjectAuditorId() != null) {
|
|
if (report.getProjectAuditorId() != null) {
|
|
|
String auditorId = report.getProjectAuditorId();
|
|
String auditorId = report.getProjectAuditorId();
|
|
|
log = new ReportLog();
|
|
log = new ReportLog();
|
|
@@ -1892,7 +1893,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
User auditorUser = userList.stream().filter(u -> u.getId().equals(auditorId)).findFirst().orElse(null);
|
|
User auditorUser = userList.stream().filter(u -> u.getId().equals(auditorId)).findFirst().orElse(null);
|
|
|
if (auditorUser != null) {
|
|
if (auditorUser != null) {
|
|
|
//日报审核
|
|
//日报审核
|
|
|
- log.setMsg(auditorUser.getName() + "审核通过了日报");
|
|
|
|
|
|
|
+ log.setMsg(auditorUser.getName() + "审核通过了日报"+(showAutoApprove?"(自动审核)": ""));
|
|
|
log.setCompanyId(companyId);
|
|
log.setCompanyId(companyId);
|
|
|
addLogList.add(log);
|
|
addLogList.add(log);
|
|
|
|
|
|
|
@@ -6588,6 +6589,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setCreatorId(reportCreator.getId());
|
|
report.setCreatorId(reportCreator.getId());
|
|
|
report.setDeptId(reportCreator.getDepartmentId());
|
|
report.setDeptId(reportCreator.getDepartmentId());
|
|
|
report.setProjectId(project.getId());
|
|
report.setProjectId(project.getId());
|
|
|
|
|
+ report.setIsImport(true);
|
|
|
if (withCheckIn != null) {
|
|
if (withCheckIn != null) {
|
|
|
if (row.getCell(workContentIndex) != null) {
|
|
if (row.getCell(workContentIndex) != null) {
|
|
|
workContent = row.getCell(workContentIndex).getStringCellValue().trim();
|
|
workContent = row.getCell(workContentIndex).getStringCellValue().trim();
|
|
@@ -6853,13 +6855,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
msg.setError(MessageUtils.message("report.data"));
|
|
msg.setError(MessageUtils.message("report.data"));
|
|
|
return msg;
|
|
return msg;
|
|
|
}
|
|
}
|
|
|
- List<String> projectList = new ArrayList<>();
|
|
|
|
|
- List<String> subProjectList = new ArrayList<>();
|
|
|
|
|
List<Project> allProjectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
|
|
List<Project> allProjectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
|
|
|
List<SubProject> allSubProjectList = subProjectMapper.selectList(new QueryWrapper<SubProject>().eq("company_id", companyId));
|
|
List<SubProject> allSubProjectList = subProjectMapper.selectList(new QueryWrapper<SubProject>().eq("company_id", companyId));
|
|
|
List<Report> reportList = new ArrayList<>();
|
|
List<Report> reportList = new ArrayList<>();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
List<String> userNameList=new ArrayList<>();
|
|
List<String> userNameList=new ArrayList<>();
|
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
|
Row row = sheet.getRow(rowIndex);
|
|
Row row = sheet.getRow(rowIndex);
|
|
@@ -7040,12 +7039,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setWorkingTime(time);
|
|
report.setWorkingTime(time);
|
|
|
report.setStage(stageName);
|
|
report.setStage(stageName);
|
|
|
report.setContent(workContent);
|
|
report.setContent(workContent);
|
|
|
|
|
+ report.setIsImport(true);
|
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
|
// report.setFillUserid(user.getId()); 导入时,处理为自己填写的
|
|
// report.setFillUserid(user.getId()); 导入时,处理为自己填写的
|
|
|
if (timeType.getImportReportAuditNormal() == 0) {
|
|
if (timeType.getImportReportAuditNormal() == 0) {
|
|
|
//老的导入日报审核模式
|
|
//老的导入日报审核模式
|
|
|
if (timeType.getNeedDeptAudit() == 0) {
|
|
if (timeType.getNeedDeptAudit() == 0) {
|
|
|
report.setState(1);//导入的直接算审核通过
|
|
report.setState(1);//导入的直接算审核通过
|
|
|
|
|
+ //已通过的也要设置日报审核人,叠加审批流
|
|
|
|
|
+ if (timeType.getReportAuditType() == 0) {
|
|
|
|
|
+ //目前仅支持项目审核人审核的模式,叠加审批流
|
|
|
|
|
+ setReportProjectAuditor(company, project, user, report, reportCreator, timeType);
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
report.setState(-1);//待部门上级审核员审核
|
|
report.setState(-1);//待部门上级审核员审核
|
|
|
report.setDepartmentAuditState(1);//部门已审核,到上层领导审核
|
|
report.setDepartmentAuditState(1);//部门已审核,到上层领导审核
|
|
@@ -7054,37 +7059,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setState(0);//待审核
|
|
report.setState(0);//待审核
|
|
|
//目前仅支持项目审核人审核的模式,叠加审批流
|
|
//目前仅支持项目审核人审核的模式,叠加审批流
|
|
|
if (timeType.getReportAuditType() == 0) {
|
|
if (timeType.getReportAuditType() == 0) {
|
|
|
- int mode = 0;
|
|
|
|
|
- if (company.getNonProjectSimple() == 1) {
|
|
|
|
|
- //启用了简易模式
|
|
|
|
|
- List<ProjectAuditor> pAuditorList = new ArrayList<>();
|
|
|
|
|
- if (project.getIsPublic() == 1) {
|
|
|
|
|
- //非项目,该员工的部门主要负责人审核
|
|
|
|
|
- mode = 1;
|
|
|
|
|
- //优先取员工的上级领导
|
|
|
|
|
- String superiorId = user.getSuperiorId();
|
|
|
|
|
- if (superiorId == null) {
|
|
|
|
|
- Integer departmentId = user.getDepartmentId();
|
|
|
|
|
- Department department = departmentMapper.selectById(departmentId);
|
|
|
|
|
- if (department != null) {
|
|
|
|
|
- superiorId = department.getManagerId();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- report.setProjectAuditorId(superiorId);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (mode == 0) {
|
|
|
|
|
- //没有设置部门的审核人,按项目日报审核人设置
|
|
|
|
|
- List<ProjectAuditor> projectAuditors = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", project.getId()));
|
|
|
|
|
- if (projectAuditors.size() > 0) {
|
|
|
|
|
- report.setProjectAuditorId(projectAuditors.get(0).getAuditorId());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- List<AuditWorkflowTimeSetting> auditWorkflowList
|
|
|
|
|
- = auditWorkflowTimeSettingMapper.selectList(
|
|
|
|
|
- new QueryWrapper<AuditWorkflowTimeSetting>().eq("dept_id", reportCreator.getDepartmentId()).orderByAsc("seq"));
|
|
|
|
|
- List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", reportCreator.getCompanyId()));
|
|
|
|
|
- setReportWorkflowAuditor(auditWorkflowList, allDeptList, report,timeType);
|
|
|
|
|
|
|
+ setReportProjectAuditor(company, project, user, report, reportCreator, timeType);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -7147,7 +7122,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
reportService.saveBatch(reportList);
|
|
reportService.saveBatch(reportList);
|
|
|
if (companyId == 7836) {//江西祥益鼎盛
|
|
if (companyId == 7836) {//江西祥益鼎盛
|
|
|
//保存日报提交和审批记录
|
|
//保存日报提交和审批记录
|
|
|
- saveReportWithAuditLog(allUserList, reportList);
|
|
|
|
|
|
|
+ saveReportWithAuditLog(allUserList, reportList, true);
|
|
|
} else {
|
|
} else {
|
|
|
saveFillReportLog(reportList);
|
|
saveFillReportLog(reportList);
|
|
|
}
|
|
}
|
|
@@ -7217,6 +7192,40 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
return msg;
|
|
return msg;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void setReportProjectAuditor(Company company, Project project, User user, Report report, User reportCreator, TimeType timeType) {
|
|
|
|
|
+ int mode = 0;
|
|
|
|
|
+ if (company.getNonProjectSimple() == 1) {
|
|
|
|
|
+ //启用了简易模式
|
|
|
|
|
+ List<ProjectAuditor> pAuditorList = new ArrayList<>();
|
|
|
|
|
+ if (project.getIsPublic() == 1) {
|
|
|
|
|
+ //非项目,该员工的部门主要负责人审核
|
|
|
|
|
+ mode = 1;
|
|
|
|
|
+ //优先取员工的上级领导
|
|
|
|
|
+ String superiorId = user.getSuperiorId();
|
|
|
|
|
+ if (superiorId == null) {
|
|
|
|
|
+ Integer departmentId = user.getDepartmentId();
|
|
|
|
|
+ Department department = departmentMapper.selectById(departmentId);
|
|
|
|
|
+ if (department != null) {
|
|
|
|
|
+ superiorId = department.getManagerId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ report.setProjectAuditorId(superiorId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mode == 0) {
|
|
|
|
|
+ //没有设置部门的审核人,按项目日报审核人设置
|
|
|
|
|
+ List<ProjectAuditor> projectAuditors = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", project.getId()));
|
|
|
|
|
+ if (projectAuditors.size() > 0) {
|
|
|
|
|
+ report.setProjectAuditorId(projectAuditors.get(0).getAuditorId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ List<AuditWorkflowTimeSetting> auditWorkflowList
|
|
|
|
|
+ = auditWorkflowTimeSettingMapper.selectList(
|
|
|
|
|
+ new QueryWrapper<AuditWorkflowTimeSetting>().eq("dept_id", reportCreator.getDepartmentId()).orderByAsc("seq"));
|
|
|
|
|
+ List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", reportCreator.getCompanyId()));
|
|
|
|
|
+ setReportWorkflowAuditor(auditWorkflowList, allDeptList, report,timeType);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void setReportWorkflowAuditor(List<AuditWorkflowTimeSetting> auditWorkflowList, List<Department> allDeptList, Report report, TimeType comTimeType) {
|
|
private void setReportWorkflowAuditor(List<AuditWorkflowTimeSetting> auditWorkflowList, List<Department> allDeptList, Report report, TimeType comTimeType) {
|
|
|
if (auditWorkflowList.size() == 0) {
|
|
if (auditWorkflowList.size() == 0) {
|
|
|
//没有自定义审核流,默认的直接是项目负责人审核
|
|
//没有自定义审核流,默认的直接是项目负责人审核
|
|
@@ -13820,6 +13829,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
|
report.setMultiDegrId(contentIds);
|
|
report.setMultiDegrId(contentIds);
|
|
|
report.setContent(workContent);
|
|
report.setContent(workContent);
|
|
|
|
|
+ report.setIsImport(true);
|
|
|
if (timeType.getImportReportAuditNormal() == 0) {
|
|
if (timeType.getImportReportAuditNormal() == 0) {
|
|
|
//老的导入日报审核模式
|
|
//老的导入日报审核模式
|
|
|
if (timeType.getNeedDeptAudit() == 0) {
|
|
if (timeType.getNeedDeptAudit() == 0) {
|
|
@@ -15831,6 +15841,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
report.setMultiWorktime(timeType.getMultiWorktime());
|
|
|
report.setContent(workContent);
|
|
report.setContent(workContent);
|
|
|
report.setIsOvertime(isOvertime);
|
|
report.setIsOvertime(isOvertime);
|
|
|
|
|
+ report.setIsImport(true);
|
|
|
if (isOvertime == 1) {
|
|
if (isOvertime == 1) {
|
|
|
report.setOvertimeHours(report.getWorkingTime());
|
|
report.setOvertimeHours(report.getWorkingTime());
|
|
|
}
|
|
}
|
|
@@ -15868,7 +15879,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
return msg;
|
|
return msg;
|
|
|
} else {
|
|
} else {
|
|
|
reportService.saveBatch(reportList);
|
|
reportService.saveBatch(reportList);
|
|
|
- saveReportWithAuditLog(allUserList, reportList);
|
|
|
|
|
|
|
+ saveReportWithAuditLog(allUserList, reportList, false);
|
|
|
msg.data = dataCount;
|
|
msg.data = dataCount;
|
|
|
String originName = fileName;
|
|
String originName = fileName;
|
|
|
//定义一个独立的文件夹
|
|
//定义一个独立的文件夹
|