heheng
2025-05-21 a05869a12d95375df2333459c8fa4079de7e5953
变动大幅度版本
已修改4个文件
33 ■■■■ 文件已修改
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java
@@ -211,6 +211,8 @@
     */
    private Byte stagingTag;
    private Long reportId;
    private List<ExperimentAndTypeRespDTO> typeList;
    private List<ExperimentAndSiteRespDTO> siteList;
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java
@@ -219,6 +219,8 @@
     */
    private Byte stagingTag;
    private Long reportId;
    private List<ExperimentAndTypeDTO> types;
src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java
@@ -314,6 +314,7 @@
            if (!ObjectUtils.isEmpty(byExperimentId)){
                experimentInfo.setAssessLevel(byExperimentId.getAssessLevel());
                experimentInfo.setAssessTime(byExperimentId.getAssessTime());
                experimentInfo.setReportId(byExperimentId.getId());
            }
            List<ExperimentAndTypeDTO> types = experimentInfo.getTypes();
            if (!CollectionUtils.isEmpty(types)){
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java
@@ -60,8 +60,7 @@
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@@ -305,7 +304,7 @@
        if (roleTag == 0){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"不是管理员,无权生成报告");
        }
        if (!ObjectUtils.isEmpty(reSubmit) && "1".equals(reSubmit) && experimentById.getStage() >= StatusEnum.EXPERIMENT_STATUS_REPORT.getCode().byteValue()){
        if (!ObjectUtils.isEmpty(reSubmit) && "1".equals(reSubmit) && experimentById.getStage() >= StatusEnum.EXPERIMENT_STATUS_FINISH.getCode().byteValue()){
            //删除已生成的报告数据
            delReportData(id,currentUserId);
        }else {
@@ -346,6 +345,8 @@
        //检查该实验所有的评价结果,遍历评价结果等级
        Set<Byte> riskLevelList = new HashSet<>();
        int a = 1;
        StringBuilder analysis = new StringBuilder();
        List<RiskAssessPlanEvaluateLec> lecByIds = lecService.getLecByIds(assessPlanIds);
@@ -356,6 +357,7 @@
        if (lecByIds .size() > 0){
            for (RiskAssessPlanEvaluateLec lecById : lecByIds) {
                if (lecById.getRiskLevel() > level){
                    riskLevelList.add(lecById.getRiskLevel());
                    level = lecById.getRiskLevel();
                    analysis.append(a + lecById.getSafeRiskAnalysis() + ";");//todo 安全风险分析
                    a++;
@@ -365,6 +367,7 @@
        if (lsByIds .size() > 0){
            for (RiskAssessPlanEvaluateLs lsById : lsByIds) {
                if (lsById.getRiskLevel() > level){
                    riskLevelList.add(lsById.getRiskLevel());
                    level = lsById.getRiskLevel();
                    analysis.append(a + lsById.getSafeRiskAnalysis() + ";");
                    a++;
@@ -374,6 +377,7 @@
        if (mesByIds .size() > 0){
            for (RiskAssessPlanEvaluateMes mesById : mesByIds) {
                if (mesById.getRiskLevel() > level){
                    riskLevelList.add(mesById.getRiskLevel());
                    level = mesById.getRiskLevel();
                    analysis.append(a + mesById.getSafeRiskAnalysis() + ";");
                    a++;
@@ -384,6 +388,7 @@
        if (rsByIds .size() > 0){
            for (RiskAssessPlanEvaluateRs rsById : rsByIds) {
                if (rsById.getRiskLevel() > level){
                    riskLevelList.add(rsById.getRiskLevel());
                    level = rsById.getRiskLevel();
                    analysis.append(a + rsById.getSafeRiskAnalysis() + ";");
                    a++;
@@ -416,7 +421,22 @@
        reportInfo.setSafeRiskAnalysis(analysis.toString());
        reportInfo.setAssessPerson(null);
        reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_1.getCode().byteValue());
        if (ObjectUtils.isEmpty(riskLevelList)){
            reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_4.getCode().byteValue());
        }else {
            byte b = riskLevelList.stream().max(Comparator.comparing(Integer::valueOf)).get();
            if (b == StatusEnum.REPORT_LEVEL_1.getCode().byteValue()){
                reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_4.getCode().byteValue());
            }else if (b == StatusEnum.REPORT_LEVEL_2.getCode().byteValue()){
                reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_3.getCode().byteValue());
            }else if (b == StatusEnum.REPORT_LEVEL_3.getCode().byteValue()){
                reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_2.getCode().byteValue());
            }else if (b == StatusEnum.REPORT_LEVEL_4.getCode().byteValue()){
                reportInfo.setAssessLevel(StatusEnum.REPORT_LEVEL_1.getCode().byteValue());
            }
        }
        //todo 不确定是否需要部门
        reportInfo.setDepId(null);
//       reportInfo.setSafeRiskAnalysis(null);