Procházet zdrojové kódy

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy před 10 měsíci
rodič
revize
66bb1cd68c

+ 2 - 2
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectReportServiceImpl.java

@@ -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);
         }