|
@@ -310,16 +310,6 @@ public class ReportController {
|
|
|
//检查项目是否可填报; 修改为不校验项目,前端加载的项目已经过滤掉了完成和撤销的
|
|
|
List<Integer> integers = Arrays.asList(projectId);
|
|
|
List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", integers));
|
|
|
- List<ProjectCategory> categoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id",company.getId()));
|
|
|
- List<Integer> buIds = projectList.stream().map(pl -> {
|
|
|
- if (!StringUtils.isEmpty(pl.getBuId())) {
|
|
|
- String[] split = pl.getBuId().split(",");
|
|
|
- return Integer.parseInt(split[split.length - 1]);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- buIds.add(-1);
|
|
|
- List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().in("department_id", buIds));
|
|
|
TimeType comTimeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
|
|
|
|
|
@@ -876,7 +866,7 @@ public class ReportController {
|
|
|
double sum = reportList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId())).mapToDouble(Report::getWorkingTime).sum();
|
|
|
BigDecimal bigDecimal=new BigDecimal(sum);
|
|
|
bigDecimal=bigDecimal.subtract(new BigDecimal(comTimeType.getAllday()));
|
|
|
- if(report.getOvertimeHours()>bigDecimal.doubleValue()){
|
|
|
+ if(report.getOvertimeHours()>0&&report.getOvertimeHours()>bigDecimal.doubleValue()){
|
|
|
httpRespMsg.setError("加班时长不得超过总工作时长-正常工作时长");
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -963,7 +953,18 @@ public class ReportController {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ //项目所属bu审核
|
|
|
if(comTimeType.getReportAuditType()==4){
|
|
|
+ List<ProjectCategory> categoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id",company.getId()));
|
|
|
+ List<Integer> buIds = projectList.stream().map(pl -> {
|
|
|
+ if (!StringUtils.isEmpty(pl.getBuId())) {
|
|
|
+ String[] split = pl.getBuId().split(",");
|
|
|
+ return Integer.parseInt(split[split.length - 1]);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ buIds.add(-1);
|
|
|
+ List<Department> buDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().in("department_id", buIds));
|
|
|
for (Report report : reportList) {
|
|
|
Optional<Project> project = projectList.stream().filter(pl -> pl.getId().equals(report.getProjectId())).findFirst();
|
|
|
Optional<ProjectCategory> category = categoryList.stream().filter(cl -> cl.getId().equals(project.get().getCategory())).findFirst();
|
|
@@ -978,7 +979,7 @@ public class ReportController {
|
|
|
return msg;
|
|
|
}
|
|
|
String[] split = project.get().getBuId().split(",");
|
|
|
- Optional<Department> department = departmentList.stream().filter(dl -> dl.getDepartmentId().equals(Integer.parseInt(split[split.length - 1]))).findFirst();
|
|
|
+ Optional<Department> department = buDepartmentList.stream().filter(dl -> dl.getDepartmentId().equals(Integer.parseInt(split[split.length - 1]))).findFirst();
|
|
|
report.setAuditDeptid(department.get().getDepartmentId());
|
|
|
report.setAuditDeptManagerid(department.get().getManagerId());
|
|
|
report.setIsDeptAudit(1);
|
|
@@ -990,6 +991,29 @@ public class ReportController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(comTimeType.getReportAuditType()==5){
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",user.getCompanyId()));
|
|
|
+ for (Report report : reportList) {
|
|
|
+ report.setDepartmentAuditState(0);
|
|
|
+ Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentId().equals(report.getDeptId())).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ if(StringUtils.isEmpty(first.get().getManagerId())){
|
|
|
+ HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("当前所在部门["+first.get().getDepartmentName()+"]不存在负责人,请联系管理员设置");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ report.setAuditDeptid(first.get().getDepartmentId());
|
|
|
+ report.setProjectAuditorId(null);
|
|
|
+ report.setProjectAuditState(0);
|
|
|
+ report.setAuditDeptManagerid(first.get().getManagerId());
|
|
|
+ report.setIsDeptAudit(1);
|
|
|
+ if(report.getCreatorId().equals(first.get().getManagerId())){
|
|
|
+ report.setState(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
//只有项目管理专业版才要检查成本预算
|