|
@@ -5,6 +5,7 @@ import com.zjugis.business.bean.entity.Project;
|
|
|
import com.zjugis.business.bean.entity.ProjectReport;
|
|
|
import com.zjugis.business.bean.entity.ProjectReportAudit;
|
|
|
import com.zjugis.business.bean.entity.ProjectReportPeriod;
|
|
|
+import com.zjugis.business.bean.request.ProjectReportAuditBatchPassRequest;
|
|
|
import com.zjugis.business.bean.request.ProjectReportAuditPassRequest;
|
|
|
import com.zjugis.business.bean.request.ProjectReportAuditRejectRequest;
|
|
|
import com.zjugis.business.bean.response.ProjectReportResp;
|
|
@@ -29,8 +30,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
-import static com.zjugis.business.enums.ErrorCodeConstants.REPORT_IS_EXISTS;
|
|
|
-import static com.zjugis.business.enums.ErrorCodeConstants.REPORT_IS_SUBMITTED;
|
|
|
+import static com.zjugis.business.enums.ErrorCodeConstants.*;
|
|
|
import static com.zjugis.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static com.zjugis.framework.common.util.collection.CollectionUtils.convertSet;
|
|
|
|
|
@@ -84,11 +84,9 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
|
|
|
@Override
|
|
|
public ProjectReport save(ProjectReport entity) {
|
|
|
- entity.setReportStatus(ProjectReportStatusEnum.UNCOMMIT.getValue());
|
|
|
- entity.setReportDate(LocalDateTime.now());
|
|
|
ProjectReport projectReport = projectReportMapper.selectByProjectIdAndPeriodId(entity.getProjectId(), entity.getPeriodId());
|
|
|
- //填报已提交不允许修改
|
|
|
- if (!ProjectReportStatusEnum.UNCOMMIT.getValue().equals(projectReport.getReportStatus())) {
|
|
|
+ //填报待审核或者已通过不允许修改
|
|
|
+ if (ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus()) || (ProjectReportStatusEnum.PASS.getValue().equals(projectReport.getReportStatus()))) {
|
|
|
throw exception(REPORT_IS_SUBMITTED);
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(entity.getId())) {
|
|
@@ -98,6 +96,8 @@ 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);
|
|
|
}
|
|
|
return entity;
|
|
@@ -110,6 +110,10 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
if (ObjectUtil.isNotNull(projectReport)) {
|
|
|
throw exception(REPORT_IS_EXISTS);
|
|
|
}
|
|
|
+ //填报待审核或者已通过不允许修改
|
|
|
+ if (ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus()) || (ProjectReportStatusEnum.PASS.getValue().equals(projectReport.getReportStatus()))) {
|
|
|
+ throw exception(REPORT_IS_SUBMITTED);
|
|
|
+ }
|
|
|
String createWorker = projectReport.getCreateWorker();
|
|
|
AdminUserRespDTO userLeader = adminUserApi.getUserLeader(createWorker).getCheckedData();
|
|
|
projectReport.setReportStatus(ProjectReportStatusEnum.AUDIT.getValue());
|
|
@@ -130,6 +134,9 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
if (ObjectUtil.isNotNull(projectReport)) {
|
|
|
throw exception(REPORT_IS_EXISTS);
|
|
|
}
|
|
|
+ if (!ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus())) {
|
|
|
+ throw exception(REPORT_IS_NOT_AUDIT);
|
|
|
+ }
|
|
|
String createWorker = projectReport.getCreateWorker();
|
|
|
AdminUserRespDTO userLeader = adminUserApi.getUserLeader(createWorker).getCheckedData();
|
|
|
String loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
@@ -160,6 +167,9 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
if (ObjectUtil.isNotNull(projectReport)) {
|
|
|
throw exception(REPORT_IS_EXISTS);
|
|
|
}
|
|
|
+ if (!ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus())) {
|
|
|
+ throw exception(REPORT_IS_NOT_AUDIT);
|
|
|
+ }
|
|
|
projectReport.setReportAuditorId("");
|
|
|
projectReport.setReportStatus(ProjectReportStatusEnum.REJECT.getValue());
|
|
|
projectReport.setLatestModifyTime(null);
|
|
@@ -183,4 +193,13 @@ public class ProjectReportServiceImpl implements ProjectReportService {
|
|
|
List<ProjectReport> passList = projectReportMapper.getPassList(projectIds, currentReportPeriod.getId());
|
|
|
return ProjectReportConvert.INSTANCE.convertList01(passList);
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void batchPass(ProjectReportAuditBatchPassRequest reqVO) {
|
|
|
+ List<ProjectReportAuditPassRequest> passList = reqVO.getPassList();
|
|
|
+ passList.forEach(x->{
|
|
|
+ pass(x);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|