|
@@ -63,7 +63,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
Set<String> projectIds = convertSet(projectList, Project::getId);
|
|
|
ProjectReportPeriod currentReportPeriod = projectReportPeriodService.getCurrentReportPeriod();
|
|
|
List<ProjectReportResp> resp = ProjectReportConvert.INSTANCE.convertList(projectList);
|
|
|
- if (ObjectUtil.isNotNull(currentReportPeriod)) {
|
|
|
+ if (ObjectUtil.isNotNull(currentReportPeriod)&& CollectionUtil.isNotEmpty(projectIds)) {
|
|
|
List<ProjectReport> reportList = projectReportMapper.getReportList(projectIds, currentReportPeriod.getId());
|
|
|
Map<String, ProjectReport> projectReportMap = CollectionUtils.convertMap(reportList, ProjectReport::getProjectId);
|
|
|
resp.forEach(projectReportResp -> {
|
|
@@ -96,7 +96,6 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
throw exception(REPORT_IS_SUBMITTED);
|
|
|
}
|
|
|
}
|
|
|
- entity.setReportStatus(ProjectReportStatusEnum.UNCOMMIT.getValue());
|
|
|
if (StringUtils.isNotEmpty(entity.getId())) {
|
|
|
projectReportMapper.updateById(entity);
|
|
|
} else {
|
|
@@ -104,6 +103,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
if (ObjectUtil.isNotNull(projectReport)) {
|
|
|
throw exception(REPORT_IS_EXISTS);
|
|
|
}
|
|
|
+ entity.setReportStatus(ProjectReportStatusEnum.UNCOMMIT.getValue());
|
|
|
entity.setReportDate(LocalDateTime.now());
|
|
|
projectReportMapper.insert(entity);
|
|
|
}
|