给试验报告审核页面显示报告状态
This commit is contained in:
@@ -234,4 +234,10 @@ public class Experiment implements Serializable {
|
|||||||
@Schema(description = "理化所统计")
|
@Schema(description = "理化所统计")
|
||||||
private Integer totalCountLhs;
|
private Integer totalCountLhs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试验报告审核状态,给报告审核页面用,不用存库。
|
||||||
|
*/
|
||||||
|
@Schema(description = "理化所统计")
|
||||||
|
private String reportStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jeecg.modules.database.constant.ExperimentReportStatus;
|
||||||
import org.jeecg.modules.database.constant.ExperimentStatus;
|
import org.jeecg.modules.database.constant.ExperimentStatus;
|
||||||
import org.jeecg.modules.database.entity.*;
|
import org.jeecg.modules.database.entity.*;
|
||||||
import org.jeecg.modules.database.mapper.ExperimentMapper;
|
import org.jeecg.modules.database.mapper.ExperimentMapper;
|
||||||
@@ -127,6 +128,13 @@ public class ExperimentServiceImpl extends ServiceImpl<ExperimentMapper, Experim
|
|||||||
List<ExperimentReport> reportList = experimentReportService.getByExperimentId(experiment.getId());
|
List<ExperimentReport> reportList = experimentReportService.getByExperimentId(experiment.getId());
|
||||||
if (CollUtil.isNotEmpty(reportList)) {
|
if (CollUtil.isNotEmpty(reportList)) {
|
||||||
experiment.setExperimentReportList(reportList);
|
experiment.setExperimentReportList(reportList);
|
||||||
|
//给试验报告审核页面显示报告状态
|
||||||
|
List<ExperimentReport> unFinishedReportList = reportList.stream().filter(v -> !v.getStatus().equals(ExperimentReportStatus.PASSED)).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(unFinishedReportList)) {
|
||||||
|
experiment.setReportStatus(unFinishedReportList.get(0).getStatus());
|
||||||
|
}else {
|
||||||
|
experiment.setReportStatus(ExperimentReportStatus.PASSED);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
experiment.setExperimentReportList(new ArrayList<>());
|
experiment.setExperimentReportList(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user