|
@@ -1489,6 +1489,28 @@ public class ReportController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
+ //对于正北(苏州和广州)需校验项目开始结束日期
|
|
|
|
+ if (company.getId() == 8138 || company.getId() == 7703) {
|
|
|
|
+ for (Report report : reportList) {
|
|
|
|
+ Optional<Project> first = projectList.stream().filter(p -> p.getId().equals(report.getProjectId())).findFirst();
|
|
|
|
+ if (first.isPresent()) {
|
|
|
|
+ Project project = first.get();
|
|
|
|
+ if (project.getPlanStartDate() != null && report.getCreateDate().isBefore(project.getPlanStartDate())) {
|
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
+ //httpRespMsg.setError("项目["+project.getProjectName()+"]的开始日期为"+project.getStartDate()+",结束日期为"+project.getEndDate()+",请检查日报日期是否在范围内");
|
|
|
|
+ httpRespMsg.setError("项目["+project.getProjectName()+"]的开始日期为"+dateTimeFormatter.format(project.getPlanStartDate())+",无法填报早于该日期的工时");
|
|
|
|
+ return httpRespMsg;
|
|
|
|
+ }
|
|
|
|
+ if (project.getPlanEndDate() != null && report.getCreateDate().isAfter(project.getPlanEndDate())) {
|
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
+ //httpRespMsg.setError("项目["+project.getProjectName()+"]的开始日期为"+project.getStartDate()+",结束日期为"+project.getEndDate()+",请检查日报日期是否在范围内");
|
|
|
|
+ httpRespMsg.setError("项目["+project.getProjectName()+"]的结束日期为"+dateTimeFormatter.format(project.getPlanStartDate())+",无法填报晚于该日期的工时");
|
|
|
|
+ return httpRespMsg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
//如果锁定工作时长上限的话,需要校验每日的合计工作时长
|
|
//如果锁定工作时长上限的话,需要校验每日的合计工作时长
|
|
for (Report report : reportList) {
|
|
for (Report report : reportList) {
|
|
@@ -1602,7 +1624,6 @@ public class ReportController {
|
|
if (errorMsg == null) {
|
|
if (errorMsg == null) {
|
|
//校验工单号的状态是否关闭
|
|
//校验工单号的状态是否关闭
|
|
if (first.get().getStatus() == 4 && report.getCreateDate().isAfter(first.get().getCloseDate())) {
|
|
if (first.get().getStatus() == 4 && report.getCreateDate().isAfter(first.get().getCloseDate())) {
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
errorMsg = "工单号:"+report.getExtraField4()+"于"+dateTimeFormatter.format(first.get().getCloseDate())+"已关闭";
|
|
errorMsg = "工单号:"+report.getExtraField4()+"于"+dateTimeFormatter.format(first.get().getCloseDate())+"已关闭";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1998,7 +2019,6 @@ public class ReportController {
|
|
}
|
|
}
|
|
//如果开启了计划日期的限制,需要校验
|
|
//如果开启了计划日期的限制,需要校验
|
|
if (comTimeType.getNotAllowedExpiredProject() == 1) {
|
|
if (comTimeType.getNotAllowedExpiredProject() == 1) {
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
for (Report report : reportList) {
|
|
for (Report report : reportList) {
|
|
Optional<Project> first = projectList.stream().filter(pl -> pl.getId().equals(report.getProjectId())).findFirst();
|
|
Optional<Project> first = projectList.stream().filter(pl -> pl.getId().equals(report.getProjectId())).findFirst();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|