3ea61dd8477c0e652ff660aabbd11a11cdf63a45..a27162cb82ef0cabf9b43cbfd1f3eb8c177d1e14
2025-01-13 heheng
修改问题
a27162 对比 | 目录
2024-11-07 heheng
修改验证及编码逻辑处理修改
3ca438 对比 | 目录
2024-11-07 heheng
修改暂存和详情暂时及列表数据处理
37b0d2 对比 | 目录
已修改46个文件
已添加11个文件
1197 ■■■■ 文件已修改
pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/OldRiskAssessResDTO.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndTypeInsertReqBO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndTypeRespDTO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/config/annotation/RepeatSubmit.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/config/interceptor/RepeatSubmitInterceptor.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/basic/service/OldRiskAssessService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/OldRiskAssessServiceImpl.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndType.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStagingEnum.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndTypeDTO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndTypeRepository.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndTypeService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndTypeServiceImpl.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/application-dev.yaml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/application.yaml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/redisson-dev.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -65,6 +65,11 @@
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.31</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.83</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>com.baomidou</groupId>-->
<!--            <artifactId>mybatis-plus-boot-starter</artifactId>-->
src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/OldRiskAssessResDTO.java
对比新文件
@@ -0,0 +1,52 @@
package com.gkhy.labRiskManage.api.controller.basic.dto.respDto;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
public class OldRiskAssessResDTO implements Serializable {
    private Integer sort;
    private Long id;
    private String region;
    private String potentialAccident;
    private String dangerReason;
    private String triggerFactor;
    private String accidentResult;
    private String l;
    private String e;
    private String c;
    private String d;
    private String dangerLevel;
    private String controlMeasure;
    private String controlLevel;
    private LocalDateTime createTime;
    private Long createByUserId;
    private String createByUserName;
    private LocalDateTime updateTime;
    private Long updateByUserId;
    private String updateByUserName;
}
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java
@@ -51,6 +51,16 @@
        experimentAppService.save(getCurrentUserId(),experimentInsertReqBO);
        return result;
    }
    @PostMapping(value = "/temporary")
    public Result temporary(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){
        Result result = new Result();
        result.setCode(ResultCode.OK);
        result.setMsg("暂存成功");
        experimentAppService.temporary(getCurrentUserId(),experimentInsertReqBO);
        return result;
    }
    /**
     * 录入信息
     * @param experimentInsertReqBO
@@ -65,6 +75,15 @@
        return result;
    }
    @PostMapping(value = "develop/temporary")
    public Result developTemporary(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){
        Result result = new Result();
        result.setCode(ResultCode.OK);
        result.setMsg("暂存成功");
        experimentAppService.developTemporary(getCurrentUserId(),experimentInsertReqBO);
        return result;
    }
    @PostMapping(value = "rectify/save")
    public Result rectifySave(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){
        Result result = new Result();
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java
@@ -30,6 +30,12 @@
            for (ExperimentInfoAppQueryDTO experimentInfoAppQueryDTO:experimentInfoAppQueryDTOList){
                ExperimentInfoRespDTO experimentInfoRespDTO = new ExperimentInfoRespDTO();
                BeanUtils.copyProperties(experimentInfoAppQueryDTO,experimentInfoRespDTO);
                //实验类型
                List<ExperimentAndTypeRespDTO> typeRespDTOs = new ArrayList<>();
                if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getTypes())){
                    typeRespDTOs = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getTypes(),ExperimentAndTypeRespDTO.class);
                }
                experimentInfoRespDTO.setTypeList(typeRespDTOs);
                //实验场所
                List<ExperimentAndSiteRespDTO> siteRespDTOs = new ArrayList<>();
                if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getSites())){
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndTypeInsertReqBO.java
对比新文件
@@ -0,0 +1,20 @@
package com.gkhy.labRiskManage.api.controller.experiment.dto.req;
import lombok.Data;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2023/3/20
 * @time: 14:54
 */
@Data
public class ExperimentAndTypeInsertReqBO {
    private Long typeId;
    /**
     * 类型名称
     */
    private String typeName;
}
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java
@@ -29,7 +29,6 @@
     */
    private Long liabilityUserId;
    private String liabilityUserPhone;
    /**
     * 安全负责人id
     */
@@ -135,6 +134,10 @@
     * 措施
     */
    private String measure;
    /**
     * 暂存保存:1-保存;2-暂存
     */
    private Byte stagingTag;
    /**
     * 危废情况
@@ -160,8 +163,16 @@
   private List<ExperimentAndSiteInsertReqBO> siteList;
    /**
     * 实验类型
     */
    private List<ExperimentAndTypeInsertReqBO> typeList;
    /**
     * 演练情况
     */
    private List<ExperimentAndEmergencyInsertReqBO> emergencyList;
}
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndTypeRespDTO.java
对比新文件
@@ -0,0 +1,20 @@
package com.gkhy.labRiskManage.api.controller.experiment.dto.resp;
import lombok.Data;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2022/12/28
 * @time: 15:24
 */
@Data
public class ExperimentAndTypeRespDTO {
    private Long typeId;
    /**
     * 类型名称
     */
    private String typeName;
}
src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java
@@ -31,6 +31,10 @@
     */
    private Byte experimentType;
    /**
     * 实验类型名称
     */
    private String experimentTypeName;
    /**
     * 实验负责人id
     */
    private Long liabilityUserId;
@@ -202,6 +206,13 @@
     */
    private String assessPerson;
    /**
     * 暂存保存:1-保存;2-暂存
     */
    private Byte stagingTag;
    private List<ExperimentAndTypeRespDTO> typeList;
    private List<ExperimentAndSiteRespDTO> siteList;
    private List<ExperimentAndPersonRespDTO> persons;
src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java
@@ -12,6 +12,7 @@
import com.gkhy.labRiskManage.commons.domain.SearchResult;
import com.gkhy.labRiskManage.commons.enums.ResultCode;
import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils;
import com.gkhy.labRiskManage.config.annotation.RepeatSubmit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -36,8 +37,9 @@
        result.setMsg("查询成功");
        SearchResult<ReportQueryRespDTO> queryResult = reportAppService.selectRiskReportPage(getCurrentUserId(), queryReqBO);
        result.setData(BeanCopyUtils.copyReportQueryResp(queryResult.getData(), ReportQueryRespDTO.class));
        BeanCopyUtils.copyReportQueryResp(queryResult.getData(), ReportQueryRespDTO.class);
        result.setData(BeanCopyUtils.copyReportQueryResp(queryResult.getData(), ReportQueryRespDTO.class));
        result.setPageIndex(queryResult.getPageIndex());
        result.setPageSize(queryResult.getPageSize());
        result.setTotal(queryResult.getTotal());
@@ -50,6 +52,7 @@
     * 风险评估报告 - 生成报告信息
     */
    @PostMapping("/insert/insertRiskReport")
    @RepeatSubmit()
    public Result insertRiskReport(@RequestBody JSONObject jsonObject){
        Result result = new Result();
        result.setCode(ResultCode.OK);
@@ -69,6 +72,7 @@
     * 风险评估报告 - 填写报告信息
     */
    @PostMapping("/update/updateRiskReport")
    @RepeatSubmit()
    public Result updateRiskReport(@RequestBody ReportUpdateReqBO updateReqBO){
        Result result = new Result();
        result.setCode(ResultCode.OK);
@@ -106,6 +110,7 @@
     * 风险评估报告 - 报告审核 - 旧 - 两层审核
     */
    @PostMapping("/update/report")
    @RepeatSubmit()
    public Result report(@RequestBody ReportReqBO reportReqBO){
        Result result = new Result();
        result.setCode(ResultCode.OK);
@@ -125,6 +130,7 @@
     * 风险评估报告 - 报告审核 - 新 - 单次审核
     */
    @PostMapping("/update/reportNew")
    @RepeatSubmit()
    public Result reportNew(@RequestBody ReportReqBO reportReqBO){
        Result result = new Result();
        result.setCode(ResultCode.OK);
src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java
@@ -161,5 +161,10 @@
     */
    private String planUserName;
    /**
     * 工艺流程
     */
    private String process;
}
src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java
@@ -14,6 +14,7 @@
    private List<Long> roleIds;
    private String pwd;
    private String phone;
src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java
@@ -333,7 +333,7 @@
        createUserBO.setRealName(createNewUserAppReqDTO.getRealName());
        //如果没有提供密码,初始密码为“123456”
        if(createNewUserAppReqDTO.getPwd() == null || createNewUserAppReqDTO.getPwd().isEmpty()){
            createNewUserAppReqDTO.setPwd("Gkhy@c413");
            createNewUserAppReqDTO.setPwd("Gs@123456");
        }
        //todo 2024 弱口令问题处理
@@ -403,6 +403,28 @@
        bo.setDepId(updateUserAppReqDTO.getDepId());
        bo.setIdentityStatus(updateUserAppReqDTO.getIdentityStatus());
        bo.setQualificationAttId(updateUserAppReqDTO.getQualificationAttId());
        if (!ObjectUtils.isEmpty(updateUserAppReqDTO.getPwd())){
            if (updateUserAppReqDTO.getPwd().length() < 8){
                throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"密码长度不够");
            }
            if (!updateUserAppReqDTO.getPwd().matches(".*[A-Z].*")){
                throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"密码需要包含大小写字母、数字、特殊符号");
            }
            if (!updateUserAppReqDTO.getPwd().matches(".*[a-z].*")){
                throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"密码需要包含大小写字母、数字、特殊符号");
            }
            if (!updateUserAppReqDTO.getPwd().matches(".*\\d.*")){
                throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"密码需要包含大小写字母、数字、特殊符号");
            }
            if (!updateUserAppReqDTO.getPwd().matches(".*[!@#$%^&*.()?+`~<>,-].*")){
                throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"密码需要包含大小写字母、数字、特殊符号");
            }
            bo.setPwd(updateUserAppReqDTO.getPwd());
        }
        UserInfoDomainDTO updateRs = userDomainService.updateUserInfo(bo);
        //修改用户绑定角色
        userRoleDomainService.updateUserRole(updateUserAppReqDTO.getId(), updateUserAppReqDTO.getRoleIds());
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java
@@ -16,6 +16,9 @@
 */
@Data
public class ExperimentAppInsertBO {
    private Long id;
    /**
     * 实验名称
     */
src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java
@@ -2,9 +2,15 @@
import com.gkhy.labRiskManage.api.controller.experiment.dto.resp.ExperimentAndEmergencyRespDTO;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAssessLog;
import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentAndTypeDTO;
import lombok.Data;
import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.time.LocalDateTime;
import java.util.List;
@@ -30,6 +36,10 @@
     * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类
     */
    private Byte experimentType;
    /**
     * 实验类型名称
     */
    private String experimentTypeName;
    /**
     * 实验负责人id
     */
@@ -204,12 +214,25 @@
     * 填报人
     */
    private String assessPerson;
    /**
     * 暂存保存:1-保存;2-暂存
     */
    private Byte stagingTag;
    private List<ExperimentAndTypeDTO> types;
    private List<ExperimentAndSiteAppQueryDTO> sites;
    private List<ExperimentAndDeviceAppQueryDTO> devices;
    private List<ExperimentAndPersonAppQueryDTO> persons;
    private List<ExperimentAndDeviceAppQueryDTO> devices;
    private List<ExperimentAndStuffAppQueryDTO> stuffs;
    private List<ExperimentHazardousWasteAppQueryDTO> wastes;
    private List<ExperimentAndSiteAppQueryDTO> sites;
    private List<ExperimentAndStuffAppQueryDTO> stuffs;
    /**
     * 演练情况
     */
src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java
@@ -12,8 +12,13 @@
public interface ExperimentAppService {
    int save(Long currentUserId, ExperimentInsertReqBO experimentAppInsertBO);
    int temporary(Long currentUserId, ExperimentInsertReqBO experimentAppInsertBO);
    int developSave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO);
    int developTemporary(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO);
    int deleteById(Long id, Long currentUserId);
    int updateDevelop(Long currentUserId, List<ExperimentAppDevelopUpdateBO> appDevelopUpdateBOList);
src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java
@@ -13,13 +13,12 @@
import com.gkhy.labRiskManage.commons.exception.BusinessException;
import com.gkhy.labRiskManage.commons.model.PageQuery;
import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAssessLog;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo;
import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentStatusEnum;
import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentTagEnum;
import com.gkhy.labRiskManage.domain.experiment.enums.*;
import com.gkhy.labRiskManage.domain.experiment.model.bo.*;
import com.gkhy.labRiskManage.domain.experiment.enums.HazardousWasteEnum;
import com.gkhy.labRiskManage.domain.experiment.enums.TimeoutEnum;
import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentAndTypeDTO;
import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO;
import com.gkhy.labRiskManage.domain.experiment.service.*;
import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessInfo;
@@ -57,6 +56,8 @@
    private ExperimentAppConverter experimentAppConverter;
    @Autowired
    private ExperimentAssessLogService experimentAssessLogService;
    @Autowired
    private ExperimentAndTypeService experimentAndTypeService;
    @Transactional
    @Override
    public int save(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) {
@@ -80,9 +81,14 @@
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getSiteList())){
            siteIds = experimentInsertReqBO.getSiteList().stream().map(ExperimentAndSiteInsertReqBO::getSiteId).collect(Collectors.toList());
        }
        //实验类型中间表
        List<Long> typeIds = new ArrayList<>();
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getTypeList())){
            typeIds = experimentInsertReqBO.getTypeList().stream().map(ExperimentAndTypeInsertReqBO::getTypeId).collect(Collectors.toList());
        }
        //危废中间表
        List<ExperimentHazardousWasteAppInsertBO> hazardousWasteInsertBOList = new ArrayList<>();
        if(!CollectionUtils.isEmpty(experimentAppInsertBO.getHazardousWasteList())){
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getHazardousWasteList())){
            hazardousWasteInsertBOList = experimentAppConverter.getHazardousWasteInsertBOList(experimentInsertReqBO.getHazardousWasteList(),experimentInfoDTO.getId());
        }
        //应急演练
@@ -90,10 +96,14 @@
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getEmergencyList())){
            experimentAndEmergencyAppInsertBOList = experimentAppConverter.getExperimentAndEmergencyAppInsertBOList(experimentInsertReqBO.getEmergencyList(), experimentInfoDTO.getId());
        }
        // 暂存清空了之前绑定数据
        dealDelete(experimentInfoDTO.getId(),currentUserId);
        experimentAndDeviceService.saveBatch(currentUserId,deviceAppInsertBOList);
        experimentAndStuffService.saveBatch(currentUserId,stuffInsertBOList);
        experimentAndPersonService.saveBatch(currentUserId,personIds,experimentInfoDTO.getId());
        experimentAndSiteService.saveBatch(currentUserId, siteIds, experimentInfoDTO.getId());
        experimentAndTypeService.saveBatch(currentUserId, typeIds, experimentInfoDTO.getId());
        experimentHazardousWasteService.saveBatch(currentUserId,hazardousWasteInsertBOList);
        experimentAndEmergencyService.saveBatch(currentUserId,experimentAndEmergencyAppInsertBOList);
        Integer code = StatusEnum.SUCCESS.getCode();
@@ -102,6 +112,31 @@
        }
        return code;
    }
    @Override
    @Transactional
    public int temporary(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) {
//        if(ExperimentStagingEnum.SAVE.getValue().equals(experimentInsertReqBO.getStagingTag())){
//            throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"已保存数据不可操作暂存!");
//        }
        //实验基础信息
        ExperimentAppInsertBO experimentAppInsertBO = new ExperimentAppInsertBO();
        BeanUtils.copyProperties(experimentInsertReqBO,experimentAppInsertBO);
        ExperimentInfoDTO experimentInfoDTO = experimentInfoService.temporary(currentUserId,experimentAppInsertBO);
        //删除业务数据
        dealDelete(experimentInfoDTO.getId(),currentUserId);
        temporary(currentUserId,experimentInsertReqBO,experimentInfoDTO.getId(),experimentAppInsertBO);
        Integer code = StatusEnum.SUCCESS.getCode();
        if(ObjectUtils.isEmpty(experimentInfoDTO)){
            code = StatusEnum.FAIL.getCode();
        }
        return code;
    }
    @Transactional
    @Override
    public int developSave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) {
@@ -126,7 +161,7 @@
        }
        //危废中间表
        List<ExperimentHazardousWasteAppInsertBO> hazardousWasteInsertBOList = new ArrayList<>();
        if(!CollectionUtils.isEmpty(experimentAppInsertBO.getHazardousWasteList())){
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getHazardousWasteList())){
            hazardousWasteInsertBOList = experimentAppConverter.getHazardousWasteInsertBOList(experimentInsertReqBO.getHazardousWasteList(),experimentInfoDTO.getId());
        }
        //应急演练
@@ -134,11 +169,20 @@
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getEmergencyList())){
            experimentAndEmergencyAppInsertBOList = experimentAppConverter.getExperimentAndEmergencyAppInsertBOList(experimentInsertReqBO.getEmergencyList(), experimentInfoDTO.getId());
        }
        //实验类型中间表
        List<Long> typeIds = new ArrayList<>();
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getTypeList())){
            typeIds = experimentInsertReqBO.getTypeList().stream().map(ExperimentAndTypeInsertReqBO::getTypeId).collect(Collectors.toList());
        }
        // 暂存清空了之前绑定数据
        dealDelete(experimentInfoDTO.getId(),currentUserId);
        experimentAndDeviceService.saveBatch(currentUserId,deviceAppInsertBOList);
        experimentAndStuffService.saveBatch(currentUserId,stuffInsertBOList);
        experimentAndPersonService.saveBatch(currentUserId,personIds,experimentInfoDTO.getId());
        experimentAndSiteService.saveBatch(currentUserId, siteIds, experimentInfoDTO.getId());
        experimentAndTypeService.saveBatch(currentUserId, typeIds, experimentInfoDTO.getId());
        experimentHazardousWasteService.saveBatch(currentUserId,hazardousWasteInsertBOList);
        experimentAndEmergencyService.saveBatch(currentUserId,experimentAndEmergencyAppInsertBOList);
        Integer code = StatusEnum.SUCCESS.getCode();
@@ -146,6 +190,88 @@
            code = StatusEnum.FAIL.getCode();
        }
        return code;
    }
    @Override
    @Transactional
    public int developTemporary(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) {
        //实验基础信息
        ExperimentAppInsertBO experimentAppInsertBO = new ExperimentAppInsertBO();
        BeanUtils.copyProperties(experimentInsertReqBO,experimentAppInsertBO);
        ExperimentInfoDTO experimentInfoDTO = experimentInfoService.developTemporary(currentUserId,experimentAppInsertBO);
        //处理中间表数据
        dealDelete(experimentInfoDTO.getId(),currentUserId);
        temporary(currentUserId,experimentInsertReqBO,experimentInfoDTO.getId(),experimentAppInsertBO);
        Integer code = StatusEnum.SUCCESS.getCode();
        if(ObjectUtils.isEmpty(experimentInfoDTO)){
            code = StatusEnum.FAIL.getCode();
        }
        return code;
    }
    /**
     * 处理删除
     * @param id
     * @param currentUserId
     */
    private void dealDelete(Long id ,Long currentUserId){
        experimentAndTypeService.deleteByExperimentId(id);
        experimentAndDeviceService.deleteByExperimentId(id,currentUserId);
        experimentHazardousWasteService.deleteByExperimentId(id,currentUserId);
        experimentAndPersonService.deleteByExperimentId(id,currentUserId);
        experimentAndStuffService.deleteByExperimentId(id,currentUserId);
        experimentAndSiteService.deleteByExperimentId(id);
        experimentAndEmergencyService.deleteByExperimentId(id);
    }
    /**
     * 处理中间表数据
     * @param currentUserId
     * @param experimentInsertReqBO
     * @param experimentAppInsertBO
     */
    private void temporary(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO,Long id ,ExperimentAppInsertBO experimentAppInsertBO) {
        if (!CollectionUtils.isEmpty(experimentInsertReqBO.getDeviceList())){
            //设备中间表
            List<ExperimentAndDeviceAppInsertBO> deviceAppInsertBOList = experimentAppConverter.getDeviceInsertBOList(experimentInsertReqBO.getDeviceList(),id);
            experimentAndDeviceService.saveBatch(currentUserId,deviceAppInsertBOList);
        }
        if (!CollectionUtils.isEmpty(experimentInsertReqBO.getStuffList())) {
            //材料中间表
            List<ExperimentAndStuffAppInsertBO> stuffInsertBOList = experimentAppConverter.getStuffInsertBOList(experimentInsertReqBO.getStuffList(), id);
            experimentAndStuffService.saveBatch(currentUserId,stuffInsertBOList);
        }
        //实验人员
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getPersons())){
            List<Long> personIds =  experimentInsertReqBO.getPersons().stream().map(ExperimentAndPersonInsertReqBO::getPersonId).collect(Collectors.toList());
            experimentAndPersonService.saveBatch(currentUserId,personIds,id);
        }
        //实验地点中间表
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getSiteList())){
            List<Long> siteIds = experimentInsertReqBO.getSiteList().stream().map(ExperimentAndSiteInsertReqBO::getSiteId).collect(Collectors.toList());
            experimentAndSiteService.saveBatch(currentUserId, siteIds, id);
        }
        //实验类型中间表
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getTypeList())){
            List<Long> typeIds = experimentInsertReqBO.getTypeList().stream().map(ExperimentAndTypeInsertReqBO::getTypeId).collect(Collectors.toList());
            experimentAndTypeService.saveBatch(currentUserId, typeIds, id);
        }
        //危废中间表
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getHazardousWasteList())){
            List<ExperimentHazardousWasteAppInsertBO> hazardousWasteInsertBOList = experimentAppConverter.getHazardousWasteInsertBOList(experimentInsertReqBO.getHazardousWasteList(),id);
            experimentHazardousWasteService.saveBatch(currentUserId,hazardousWasteInsertBOList);
        }
        //应急演练
        if(!CollectionUtils.isEmpty(experimentInsertReqBO.getEmergencyList())){
            List<ExperimentAndEmergencyAppInsertBO> experimentAndEmergencyAppInsertBOList = experimentAppConverter.getExperimentAndEmergencyAppInsertBOList(experimentInsertReqBO.getEmergencyList(), id);
            experimentAndEmergencyService.saveBatch(currentUserId,experimentAndEmergencyAppInsertBOList);
        }
    }
    @Transactional
    @Override
@@ -189,6 +315,11 @@
                experimentInfo.setAssessLevel(byExperimentId.getAssessLevel());
                experimentInfo.setAssessTime(byExperimentId.getAssessTime());
            }
            List<ExperimentAndTypeDTO> types = experimentInfo.getTypes();
            if (!CollectionUtils.isEmpty(types)){
                String collect = types.stream().map(type -> type.getTypeName()).collect(Collectors.joining(","));
                experimentInfo.setExperimentTypeName(collect);
            }
        }
        result.setData(experimentInfoAppQueryDTOS);
@@ -206,6 +337,7 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteById(Long id, Long currentUserId) {
        experimentInfoService.deleteById(id,currentUserId);
        experimentAndDeviceService.deleteByExperimentId(id,currentUserId);
        experimentHazardousWasteService.deleteByExperimentId(id,currentUserId);
@@ -213,6 +345,7 @@
        experimentAndStuffService.deleteByExperimentId(id,currentUserId);
        experimentAndSiteService.deleteByExperimentId(id);
        experimentAndEmergencyService.deleteByExperimentId(id);
        experimentAndTypeService.deleteByExperimentId(id);
        return StatusEnum.SUCCESS.getCode();
    }
@@ -275,7 +408,8 @@
            BeanUtils.copyProperties(searchResult,result);
        }
        List<ExperimentInfoDTO> experimentInfoDTOS = (List<ExperimentInfoDTO>)searchResult.getData();
        List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOS = BeanCopyUtils.copyBeanList(experimentInfoDTOS, ExperimentInfoAppQueryDTO.class);
        List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOS = BeanCopyUtils.list2OtherList(experimentInfoDTOS, ExperimentInfoAppQueryDTO.class);
        for (ExperimentInfoAppQueryDTO experimentInfo : experimentInfoAppQueryDTOS) {
            List<ExperimentAssessLog> assessLogs = experimentAssessLogService.getAssessLogs(experimentInfo.getExperimentCode());
@@ -287,6 +421,12 @@
                experimentInfo.setAssessLevel(byExperimentId.getAssessLevel());
                experimentInfo.setAssessTime(byExperimentId.getAssessTime());
            }
            List<ExperimentAndTypeDTO> types = experimentInfo.getTypes();
            if (!CollectionUtils.isEmpty(types)){
                String collect = types.stream().map(type -> type.getTypeName()).collect(Collectors.joining(","));
                experimentInfo.setExperimentTypeName(collect);
            }
        }
        result.setData(experimentInfoAppQueryDTOS);
@@ -311,7 +451,7 @@
            BeanUtils.copyProperties(searchResult,result);
        }
        List<ExperimentInfoDTO> experimentInfoDTOS = (List<ExperimentInfoDTO>)searchResult.getData();
        List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOS = BeanCopyUtils.copyBeanList(experimentInfoDTOS, ExperimentInfoAppQueryDTO.class);
        List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOS = BeanCopyUtils.list2OtherList(experimentInfoDTOS, ExperimentInfoAppQueryDTO.class);
        for (ExperimentInfoAppQueryDTO experimentInfo : experimentInfoAppQueryDTOS) {
            List<ExperimentAssessLog> assessLogs = experimentAssessLogService.getAssessLogs(experimentInfo.getExperimentCode());
@@ -323,6 +463,11 @@
                experimentInfo.setAssessLevel(byExperimentId.getAssessLevel());
                experimentInfo.setAssessTime(byExperimentId.getAssessTime());
            }
            List<ExperimentAndTypeDTO> types = experimentInfo.getTypes();
            if (!CollectionUtils.isEmpty(types)){
                String collect = types.stream().map(type -> type.getTypeName()).collect(Collectors.joining(","));
                experimentInfo.setExperimentTypeName(collect);
            }
        }
        result.setData(experimentInfoAppQueryDTOS);
src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java
@@ -1,9 +1,12 @@
package com.gkhy.labRiskManage.application.riskReport.dto.dto;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessResDTO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportExperimentSiteQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportRiskSourceQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportSourceTypeQueryRespDTO;
import com.gkhy.labRiskManage.domain.basic.entity.OldRiskAssess;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import lombok.Data;
import java.time.LocalDateTime;
@@ -142,6 +145,11 @@
     */
    private LocalDateTime evaluateTime;
    /**
     * 工艺流程
     */
    private String process;
    List<ReportPersonQueryRespDTO> person;
    /**
     * 风险源类型
@@ -155,5 +163,13 @@
     *
     */
    List<ReportExperimentSiteQueryRespDTO> experimentSite;
    /**
     * 实验类型
     */
    List<ExperimentAndType> experimentAndType;
    /**
     * 附件
     */
    List<OldRiskAssessResDTO> oldRiskAssess;
}
src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java
@@ -1,9 +1,11 @@
package com.gkhy.labRiskManage.application.riskReport.dto.dto;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
 *
@@ -161,6 +163,13 @@
     */
    private String planUserName;
    /**
     * 工艺流程
     */
    private String process;
}
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java
@@ -14,6 +14,7 @@
import com.gkhy.labRiskManage.commons.enums.StatusEnum;
import com.gkhy.labRiskManage.commons.exception.BusinessException;
import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils;
import com.gkhy.labRiskManage.config.annotation.RepeatSubmit;
import com.gkhy.labRiskManage.domain.account.service.UserDomainService;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService;
import com.gkhy.labRiskManage.domain.riskReport.model.dto.*;
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java
@@ -607,14 +607,15 @@
        }
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag != 1){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
        }
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
        //20241107修改注释权限
//        if (roleTag != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
//        }
        if (ObjectUtils.isEmpty(riskUnitInsertReqBO.getExperimentId())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空");
        }
@@ -715,14 +716,15 @@
        }
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag != 1){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限修改");
        }
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
        //20241107修改注释权限
//        if (roleTag != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限修改");
//        }
        if (ObjectUtils.isEmpty(updateReqBO.getExperimentId())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空,或实验已被删除");
        }
@@ -764,14 +766,15 @@
        }
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag != 1){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
        }
        //20241107注释
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
//        if (roleTag != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
//        }
        RiskUnitDeleteDTO deleteResult = riskUnitService.deleteRiskUnit(currentUserId, id);
        if (ObjectUtils.isEmpty(deleteResult)){
src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java
@@ -1,5 +1,6 @@
package com.gkhy.labRiskManage.commons.utils;
import com.alibaba.fastjson.*;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.*;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.*;
import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO;
@@ -13,6 +14,8 @@
import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskAssessPlanQueryDTO;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -64,6 +67,18 @@
                .collect(Collectors.toList());
    }
    public static <T> List<T> list2OtherList(List originList,Class<T> tClass){
        List<T> list = new ArrayList<>();
        for (Object info : originList) {
            T t = JSON.parseObject(JSON.toJSONString(info),tClass);
            list.add(t);
        }
        return list;
    }
    public static Object copyDeviceAppQueryList(Object data, Class<BasicExperimentDeviceAppQueryDTO> basicExperimentDeviceAppQueryDTOClass) {
        return data;
    }
src/main/java/com/gkhy/labRiskManage/config/annotation/RepeatSubmit.java
对比新文件
@@ -0,0 +1,23 @@
package com.gkhy.labRiskManage.config.annotation;
import java.lang.annotation.*;
/**
 * 自定义注解防止表单重复提交
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {
    /**
     * 间隔时间(ms) 小于此时间视为重复提交
     * @return
     */
    public int interval() default 5000;
    /**
     * 提示消息
     * @return
     */
    public String message() default "不允许重复提交,请稍后再试";
}
src/main/java/com/gkhy/labRiskManage/config/interceptor/RepeatSubmitInterceptor.java
对比新文件
@@ -0,0 +1,55 @@
package com.gkhy.labRiskManage.config.interceptor;
import com.gkhy.labRiskManage.commons.enums.ResultCode;
import com.gkhy.labRiskManage.commons.exception.BusinessException;
import com.gkhy.labRiskManage.config.annotation.RepeatSubmit;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
/**
 * 防止器重复提交拦截
 *
 */
@Component
public abstract class RepeatSubmitInterceptor implements HandlerInterceptor
{
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
    {
        if (handler instanceof HandlerMethod)
        {
            HandlerMethod handlerMethod = (HandlerMethod) handler;
            Method method = handlerMethod.getMethod();
            RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
            if (annotation != null)
            {
                if (this.isRepeatSubmit(request, annotation))
                {
                    //throw new RuntimeException(annotation.message());
                    throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), annotation.message());
                }
            }
            return true;
        }
        else
        {
            return true;
        }
    }
    /**
     * 验证是否重复提交由子类实现具体的防重复提交的规则
     *
     * @param request 请求对象
     * @param annotation 防复注解
     * @return 结果
     */
    public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation) throws Exception;
}
src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java
@@ -1,6 +1,7 @@
package com.gkhy.labRiskManage.config.serializa;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
@@ -27,6 +28,7 @@
        javaTimeModule.addSerializer(LocalDateTime.class,
                new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        mapper.registerModule(javaTimeModule);
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
        return mapper;
    }
}
src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java
@@ -27,5 +27,7 @@
    private Long qualificationAttId;
    private String pwd;
}
src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java
@@ -38,6 +38,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.*;
import java.nio.charset.StandardCharsets;
@@ -157,6 +158,9 @@
        user.setPhone(updateUserBO.getPhone());
        user.setIdentityStatus(updateUserBO.getIdentityStatus());
        user.setQualificationAttId(updateUserBO.getQualificationAttId());
        if (!ObjectUtils.isEmpty(updateUserBO.getPwd())){
            user.setHash(genPasswordHash(updateUserBO.getPwd(), user.getSalt()));
        }
        //写库
        User saveUserRs = userRepository.save(user);
        return userInfoDomainConverter.toUserInfoDTO(saveUserRs);
@@ -345,7 +349,7 @@
        User user = userOptional.get();
        //设置初始密码
        String newPwd = "Gkhy@c413";
        String newPwd = "Gs@123456";
        String newHash = genPasswordHash(newPwd, user.getSalt());
//        Integer integer = userRepository.resetPassword(uid, newHash, LocalDateTime.now());
src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java
@@ -1,5 +1,6 @@
package com.gkhy.labRiskManage.domain.basic.repository.jpa;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentType;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -20,5 +21,10 @@
     */
    @Query(value = "select t from BasicExperimentType t where t.deleteStatus = 0")
    List<BasicExperimentType> listType();
    /**
     * 基础实验类型 - 通过id列表查询
     * */
    @Query(value = "select t from BasicExperimentType t where t.id in (?1) and t.deleteStatus = 0")
    List<BasicExperimentType> batchById(List<Long> ids);
}
src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java
@@ -1,6 +1,7 @@
package com.gkhy.labRiskManage.domain.basic.service;
import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO;
import com.gkhy.labRiskManage.domain.basic.model.dto.TypeListDTO;
import java.util.List;
@@ -14,4 +15,8 @@
     * 基础实验类型 - 列表
     */
    List<TypeListDTO> listBasicExperimentType();
    /**
     * 实验类型 - 通过id列表查询
     * */
    List<TypeListDTO> getBasicExperimentTypeByIdList(List<Long> ids);
}
src/main/java/com/gkhy/labRiskManage/domain/basic/service/OldRiskAssessService.java
@@ -3,6 +3,7 @@
import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.OldRiskAssessQueryReqBO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessExportRespDTO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessResDTO;
import com.gkhy.labRiskManage.commons.domain.Result;
import com.gkhy.labRiskManage.commons.domain.SearchResult;
import com.gkhy.labRiskManage.domain.basic.entity.OldRiskAssess;
@@ -10,6 +11,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
public interface OldRiskAssessService {
@@ -24,4 +26,7 @@
    int importOldRiskAssess(Long currentUserId, MultipartFile file);
    Result<OldRiskAssessExportRespDTO> exportOldRiskAssess(Long currentUserId, OldRiskAssessQueryReqBO queryReqDO, HttpServletResponse response, HttpServletRequest request);
    List<OldRiskAssessResDTO> getOldRiskAssessListByRegion(List<String> region);
}
src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java
@@ -1,13 +1,18 @@
package com.gkhy.labRiskManage.domain.basic.service.impl;
import com.gkhy.labRiskManage.commons.enums.ResultCode;
import com.gkhy.labRiskManage.commons.exception.BusinessException;
import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentType;
import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO;
import com.gkhy.labRiskManage.domain.basic.model.dto.TypeListDTO;
import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentTypeRepository;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
@@ -28,4 +33,18 @@
        List<BasicExperimentType> listResult  = typeRepository.listType();
        return BeanCopyUtils.copyBeanList(listResult, TypeListDTO.class);
    }
    @Override
    public List<TypeListDTO> getBasicExperimentTypeByIdList(List<Long> ids) {
        if (ids.size() < 1){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空");
        }
        List<BasicExperimentType> listResult = typeRepository.batchById(ids);
        if (listResult.size() < 1){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空");
        }
        return BeanCopyUtils.copyBeanList(listResult, TypeListDTO.class);
    }
}
src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/OldRiskAssessServiceImpl.java
@@ -3,6 +3,7 @@
import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.OldRiskAssessQueryReqBO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessExportRespDTO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessResDTO;
import com.gkhy.labRiskManage.commons.domain.Result;
import com.gkhy.labRiskManage.commons.domain.SearchResult;
import com.gkhy.labRiskManage.commons.enums.ResultCode;
@@ -15,7 +16,6 @@
import com.gkhy.labRiskManage.domain.basic.repository.jpa.OldRiskAssessRepository;
import com.gkhy.labRiskManage.domain.basic.service.OldRiskAssessService;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@@ -23,7 +23,6 @@
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Base64Utils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
@@ -31,14 +30,9 @@
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.text.NumberFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -454,6 +448,33 @@
    }
    @Override
    public List<OldRiskAssessResDTO> getOldRiskAssessListByRegion(List<String> region) {
        Specification<OldRiskAssess> specification = new Specification<OldRiskAssess>() {
            @Override
            public Predicate toPredicate(Root<OldRiskAssess> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
                query.orderBy(criteriaBuilder.asc(root.get("region")));
                List<Predicate> predicateList = new ArrayList<>();
                predicateList.add(criteriaBuilder.in(root.get("region")).value(region));
                predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode()));
                //返回组装的条件
                return criteriaBuilder.and(predicateList.toArray(predicateList.toArray(new Predicate[0])));
            }
        };
        List<OldRiskAssess> all = repository.findAll(specification);
        if (ObjectUtils.isEmpty(all)){
            return null;
        }
        List<OldRiskAssessResDTO> oldRiskAssessResDTOS = BeanCopyUtils.copyBeanList(all, OldRiskAssessResDTO.class);
        oldRiskAssessResDTOS.forEach(oldRiskAssessResDTO -> {
            oldRiskAssessResDTO.setSort(oldRiskAssessResDTOS.indexOf(oldRiskAssessResDTO) + 1);
        });
        return oldRiskAssessResDTOS;
    }
    @Override
    public SearchResult<OldRiskAssessQueryRespDTO> getOldRiskAssessPage(Long currentUserId, OldRiskAssessQueryReqBO queryReqDO) {
        //校验参数
src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java
@@ -44,6 +44,21 @@
                //实验基础信息
                ExperimentInfoDTO experimentInfoDTO = new ExperimentInfoDTO();
                BeanUtils.copyProperties(experimentInfo,experimentInfoDTO);
                //实验类型数据
                List<ExperimentAndTypeDTO> types = new ArrayList<>();
                if(!ObjectUtils.isEmpty(experimentInfo.getTypes())){
                    for (ExperimentAndType experimentAndType : experimentInfo.getTypes()){
                        ExperimentAndTypeDTO experimentAndTypeDTO = new ExperimentAndTypeDTO();
                        experimentAndTypeDTO.setTypeId(experimentAndType.getTypeId());
                        if(null != experimentAndType.getType()){
                            experimentAndTypeDTO.setTypeName(experimentAndType.getType().getExperimentType());
                        }
                        types.add(experimentAndTypeDTO);
                    }
                }
                experimentInfoDTO.setTypes(types);
                //实验场所数据
                List<ExperimentAndSiteDTO> sites = new ArrayList<>();
                if(!ObjectUtils.isEmpty(experimentInfo.getSites())){
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDevice;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@@ -18,6 +19,7 @@
@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "experiment_and_device")
@Where(clause = "delete_status = 0")
public class ExperimentAndDevice implements Serializable {
    private static final long serialVersionUID = -74398808654954420L;
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
@@ -17,6 +18,7 @@
@Data
@Entity
@Table(name = "experiment_and_emergency")
@Where(clause = "delete_status = 0")
public class ExperimentAndEmergency {
    @Id
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java
@@ -1,6 +1,7 @@
package com.gkhy.labRiskManage.domain.experiment.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@@ -16,6 +17,7 @@
@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "experiment_and_person")
@Where(clause = "delete_status = 0")
public class ExperimentAndPerson implements Serializable {
    private static final long serialVersionUID = 217943177919881451L;
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java
@@ -3,6 +3,7 @@
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
@@ -16,6 +17,7 @@
@Data
@Entity
@Table(name = "experiment_and_site")
@Where(clause = "delete_status = 0")
public class ExperimentAndSite {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@@ -19,6 +20,7 @@
@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "experiment_and_stuff")
@Where(clause = "delete_status = 0")
public class ExperimentAndStuff implements Serializable {
    private static final long serialVersionUID = -79650379228221888L;
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndType.java
对比新文件
@@ -0,0 +1,43 @@
package com.gkhy.labRiskManage.domain.experiment.entity;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite;
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentType;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2023/3/20
 * @time: 15:54
 */
@Data
@Entity
@Table(name = "experiment_and_type")
@Where(clause = "delete_status = 0")
public class ExperimentAndType {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;
    /**
     * 实验ID
     */
    @Column(name = "experiment_id")
    private Long experimentId;
    /**
     * 类型
     */
    @Column(name = "type_id")
    private Long typeId;
    /**
     * 删除状态:0-正常;1-已删除
     */
    private Byte deleteStatus;
    @OneToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH})
    @JoinColumn(name = "type_id",referencedColumnName = "id",insertable =false ,updatable = false)
    private BasicExperimentType type;
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java
@@ -1,6 +1,7 @@
package com.gkhy.labRiskManage.domain.experiment.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@@ -16,6 +17,7 @@
@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "experiment_hazardous_waste")
@Where(clause = "delete_status = 0")
public class ExperimentHazardousWaste implements Serializable {
    private static final long serialVersionUID = -50912711565680265L;
src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java
@@ -214,6 +214,15 @@
     * 填报人
     */
    private String informant;
    /**
     * 暂存保存:1-保存;2-暂存
     */
    private Byte stagingTag;
    @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH})
    @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false)
    @Fetch(FetchMode.SUBSELECT)
    private List<ExperimentAndType> types;
    @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH})
    @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false)
src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStagingEnum.java
对比新文件
@@ -0,0 +1,62 @@
package com.gkhy.labRiskManage.domain.experiment.enums;
import java.util.HashMap;
import java.util.Map;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2022/12/20
 * @time: 17:31
 */
public enum ExperimentStagingEnum {
    SAVE((byte)1,"保存"),
    NOT_SAVE((byte)2,"暂存"),
    ;
    private Byte value;
    private String dec;
    ExperimentStagingEnum(Byte value, String dec) {
        this.value = value;
        this.dec = dec;
    }
    public Byte getValue() {
        return value;
    }
    public void setValue(Byte value) {
        this.value = value;
    }
    public static Map<Byte, ExperimentStagingEnum> getMap() {
        return map;
    }
    public static void setMap(Map<Byte, ExperimentStagingEnum> map) {
        ExperimentStagingEnum.map = map;
    }
    public String getDec() {
        return dec;
    }
    public void setDec(String dec) {
        this.dec = dec;
    }
    static Map<Byte, ExperimentStagingEnum> map;
    static {
        map = new HashMap<>();
        for(ExperimentStagingEnum e : ExperimentStagingEnum.values()){
            map.put(e.value,e);
        }
    }
    public static ExperimentStagingEnum prase(Byte value){
        return map.get(value);
    }
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndTypeDTO.java
对比新文件
@@ -0,0 +1,18 @@
package com.gkhy.labRiskManage.domain.experiment.model.dto;
import lombok.Data;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2022/12/27
 * @time: 15:27
 */
@Data
public class ExperimentAndTypeDTO {
    private Long typeId;
    /**
     * 场所名称
     */
    private String typeName;
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java
@@ -1,5 +1,6 @@
package com.gkhy.labRiskManage.domain.experiment.model.dto;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAssessLog;
import lombok.Data;
@@ -196,6 +197,12 @@
     */
    private String assessPerson;
    /**
     * 暂存保存:1-保存;2-暂存
     */
    private Byte stagingTag;
    private List<ExperimentAndTypeDTO> types;
    private List<ExperimentAndSiteDTO> sites;
src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndTypeRepository.java
对比新文件
@@ -0,0 +1,27 @@
package com.gkhy.labRiskManage.domain.experiment.repository.jpa;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2023/3/20
 * @time: 16:18
 */
@Repository
public interface ExperimentAndTypeRepository extends JpaRepository<ExperimentAndType, Long> {
    @Modifying
    @Query(value = "update experiment_and_type set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true)
    int deleteByExperimentId(Long experimentId);
    @Query(value = "select * from experiment_and_type where delete_status = 0 and experiment_id = :id",nativeQuery = true)
    List<ExperimentAndType> getByExperimentId(Long id);
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndTypeService.java
对比新文件
@@ -0,0 +1,20 @@
package com.gkhy.labRiskManage.domain.experiment.service;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import java.util.List;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2023/3/20
 * @time: 15:51
 */
public interface ExperimentAndTypeService {
    boolean saveBatch(Long currentUserId, List<Long> siteIds, Long experimentId);
    void deleteByExperimentId(Long id);
    List<ExperimentAndType>  getByExperimentId(Long id);
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java
@@ -18,8 +18,13 @@
public interface ExperimentInfoService {
    ExperimentInfoDTO save(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO);
    ExperimentInfoDTO temporary(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO);
    ExperimentInfoDTO developSave(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO);
    ExperimentInfoDTO developTemporary(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO);
    boolean deleteById(Long id,Long currentUserId);
    ExperimentInfoDTO getExperimentById(Long id);
    ExperimentInfoDTO getExperimentByName(String experimentName);
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java
@@ -38,6 +38,8 @@
                experimentAndEmergency.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
                experimentAndEmergency.setCreateByUserId(currentUserId);
                experimentAndEmergency.setUpdateByUserId(currentUserId);
                //暂时处理20241106
                experimentAndEmergency.setId(null);
                experimentAndEmergencyList.add(experimentAndEmergency);
            }
            List<ExperimentAndEmergency> emergencies = repository.saveAll(experimentAndEmergencyList);
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndTypeServiceImpl.java
对比新文件
@@ -0,0 +1,85 @@
package com.gkhy.labRiskManage.domain.experiment.service.impl;
import com.gkhy.labRiskManage.commons.enums.ResultCode;
import com.gkhy.labRiskManage.commons.enums.StatusEnum;
import com.gkhy.labRiskManage.commons.exception.BusinessException;
import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO;
import com.gkhy.labRiskManage.domain.basic.model.dto.TypeListDTO;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceTypeService;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentTypeService;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndType;
import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndSiteRepository;
import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndTypeRepository;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2023/3/20
 * @time: 16:01
 */
@Service
public class ExperimentAndTypeServiceImpl implements ExperimentAndTypeService {
    @Autowired
    private BasicExperimentTypeService basicExperimentTypeService;
    @Autowired
    private ExperimentAndTypeRepository repository;
    @Override
    public boolean saveBatch(Long currentUserId, List<Long> typeIds, Long experimentId) {
        boolean flag = false;
        if(CollectionUtils.isEmpty(typeIds)){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择实验类型!");
        }
        if(ObjectUtils.isEmpty(experimentId)){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验信息主键不可为空!");
        }
        List<TypeListDTO> basicExperimentTypeByIdList = basicExperimentTypeService.getBasicExperimentTypeByIdList(typeIds);
        for(Long typeId : typeIds){
            List<TypeListDTO> collect = basicExperimentTypeByIdList.stream().filter(site -> site.getId().equals(typeId)).collect(Collectors.toList());
            if(collect.size() == 0){
                throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"实验类型信息不存在!");
            }
        }
        List<ExperimentAndType> typeList = new ArrayList<>();
        typeIds.forEach(e ->{
            ExperimentAndType experimentAndType = new ExperimentAndType();
            experimentAndType.setExperimentId(experimentId);
            experimentAndType.setTypeId(e);
            experimentAndType.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
            typeList.add(experimentAndType);
        });
        List<ExperimentAndType> experimentAndTypeList = repository.saveAll(typeList);
        if(!CollectionUtils.isEmpty(experimentAndTypeList)){
            flag = true;
        }
        return flag;
    }
    @Override
    public void deleteByExperimentId(Long id) {
        if(ObjectUtils.isEmpty(id)){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!");
        }
        repository.deleteByExperimentId(id);
    }
    @Override
    public List<ExperimentAndType>  getByExperimentId(Long id) {
        List<ExperimentAndType> experimentAndTypeList = repository.getByExperimentId(id);
        return experimentAndTypeList;
    }
}
src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java
@@ -43,6 +43,7 @@
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
@@ -76,31 +77,32 @@
    @Override
    public ExperimentInfoDTO save(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) {
        UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId);
        //验证权限
        List<SysUserRoleBindDomainDTO> roles = operator.getRoles();
        boolean flag = false;
        if(roles != null && roles.size() > 0){
            for (SysUserRoleBindDomainDTO role : roles){
                if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) {
                    flag = true;
                    break;
                }
            }
        }
        if (!flag){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!");
        }
        // 20211105去掉权限验证
//        //验证权限
//        List<SysUserRoleBindDomainDTO> roles = operator.getRoles();
//        boolean flag = false;
//        if(roles != null && roles.size() > 0){
//            for (SysUserRoleBindDomainDTO role : roles){
//                if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) {
//                    flag = true;
//                    break;
//                }
//            }
//        }
//        if (!flag){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!");
//        }
        //验证
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentName())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验名称!");
        }
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!");
        }
        if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!");
        }
//        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!");
//        }
//        if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!");
//        }
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getLiabilityUserId())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择实验负责人!");
        }
@@ -177,6 +179,7 @@
        }
        ExperimentInfo experimentInfo = new ExperimentInfo();
        BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo);
        experimentInfo.setStagingTag(ExperimentStagingEnum.SAVE.getValue());
        experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
        experimentInfo.setLiabilityUser(operator.getName());
        experimentInfo.setLiabilityUserId(currentUserId);
@@ -193,33 +196,58 @@
        return converter.getExperimentInfoDTO(experiment);
    }
    @Override
    public ExperimentInfoDTO temporary(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) {
        UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId);
        ExperimentInfo experimentInfo = new ExperimentInfo();
        BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo);
        experimentInfo.setStagingTag(ExperimentStagingEnum.NOT_SAVE.getValue());
        experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
        experimentInfo.setLiabilityUser(operator.getName());
        experimentInfo.setLiabilityUserId(currentUserId);
        experimentInfo.setStage(ExperimentStageEnum.NOT_EVALUATION.getValue());
        experimentInfo.setStatus(ExperimentStatusEnum.NOT_APPLY.getValue());
        experimentInfo.setExperimentTag(ExperimentTagEnum.NEW_CREATE.getValue());
        experimentInfo.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue());
        experimentInfo.setExperimentCode(generateTestNumber());
        experimentInfo.setCreateByUserId(currentUserId);
        experimentInfo.setInformant(operator == null?"":operator.getName());
        experimentInfo.setUpdateByUserId(currentUserId);
        experimentInfo.setApprovalStatus(ExperimentApprovalStatusEnum.NOT_APPROVAL.getValue());
        ExperimentInfo experiment = repository.save(experimentInfo);
        return converter.getExperimentInfoDTO(experiment);
    }
    @Override
    public ExperimentInfoDTO developSave(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) {
        UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId);
        //验证权限
        List<SysUserRoleBindDomainDTO> roles = operator.getRoles();
        boolean flag = false;
        if(roles != null && roles.size() > 0){
            for (SysUserRoleBindDomainDTO role : roles){
                if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) {
                    flag = true;
                    break;
                }
            }
        }
        if (!flag){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!");
        }
        // 20211105去掉权限验证
//        //验证权限
//        List<SysUserRoleBindDomainDTO> roles = operator.getRoles();
//        boolean flag = false;
//        if(roles != null && roles.size() > 0){
//            for (SysUserRoleBindDomainDTO role : roles){
//                if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) {
//                    flag = true;
//                    break;
//                }
//            }
//        }
//        if (!flag){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!");
//        }
        //验证
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentName())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验名称!");
        }
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!");
        }
        if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!");
        }
//        if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!");
//        }
//        if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){
//            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!");
//        }
        if(ObjectUtils.isEmpty(experimentAppInsertBO.getLiabilityUserPhone())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验负责人手机号!");
        }
@@ -304,6 +332,7 @@
        }
        ExperimentInfo experimentInfo = new ExperimentInfo();
        BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo);
        experimentInfo.setStagingTag(ExperimentStagingEnum.SAVE.getValue());
        experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
        experimentInfo.setLiabilityUserId(currentUserId);
        experimentInfo.setLiabilityUser(operator.getName());
@@ -319,6 +348,30 @@
        ExperimentInfo experiment = repository.save(experimentInfo);
        return converter.getExperimentInfoDTO(experiment);
    }
    @Override
    public ExperimentInfoDTO developTemporary(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) {
        UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId);
        ExperimentInfo experimentInfo = new ExperimentInfo();
        BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo);
        experimentInfo.setStagingTag(ExperimentStagingEnum.NOT_SAVE.getValue());
        experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue());
        experimentInfo.setLiabilityUserId(currentUserId);
        experimentInfo.setLiabilityUser(operator.getName());
        experimentInfo.setStage(ExperimentStageEnum.NOT_EVALUATION.getValue());
        experimentInfo.setStatus(ExperimentStatusEnum.NOT_APPLY.getValue());
        experimentInfo.setExperimentTag(ExperimentTagEnum.AREADLY_DEVELOP.getValue());
        experimentInfo.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue());
        experimentInfo.setExperimentCode(generateTestNumber());
        experimentInfo.setCreateByUserId(currentUserId);
        experimentInfo.setInformant(operator == null?"":operator.getName());
        experimentInfo.setUpdateByUserId(currentUserId);
        experimentInfo.setApprovalStatus(ExperimentApprovalStatusEnum.NOT_APPROVAL.getValue());
        ExperimentInfo experiment = repository.save(experimentInfo);
        return converter.getExperimentInfoDTO(experiment);
    }
    @Override
@@ -551,9 +604,9 @@
                if(!ObjectUtils.isEmpty(ExperimentTagEnum.prase(queryBO.getExperimentTag()))){
                    predicateList.add(criteriaBuilder.equal(root.get("experimentTag"),queryBO.getExperimentTag()));
                }
                if (!ObjectUtils.isEmpty(ExperimentTypeEnum.prase(queryBO.getExperimentType()))){
                    predicateList.add(criteriaBuilder.equal(root.get("experimentType"), queryBO.getExperimentType()));
                }
//                if (!ObjectUtils.isEmpty(ExperimentTypeEnum.prase(queryBO.getExperimentType()))){
//                    predicateList.add(criteriaBuilder.equal(root.get("experimentType"), queryBO.getExperimentType()));
//                }
                if (StrUtil.isNotBlank(queryBO.getExperimentName())){
                    predicateList.add(criteriaBuilder.like(root.get("experimentName"), '%'+ queryBO.getExperimentName()+'%'));
                }
@@ -575,6 +628,10 @@
                    );
                    query.groupBy(root.get("id"));
                }
                if (!ObjectUtils.isEmpty(ExperimentTypeEnum.prase(queryBO.getExperimentType()))){
                    Join<ExperimentInfo, ExperimentAndType> typeJoin = root.join("types", JoinType.LEFT);
                    predicateList.add(criteriaBuilder.equal(typeJoin.get("typeId"), queryBO.getExperimentType()));
                }
                //返回组装的条件
                return criteriaBuilder.and(predicateList.toArray(predicateList.toArray(new Predicate[0])));
src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java
@@ -2,6 +2,7 @@
import com.gkhy.labRiskManage.domain.basic.entity.BasicTip;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.math.BigDecimal;
@@ -15,6 +16,7 @@
@Data
@Entity
@Table(name = "risk_assess_plan")
@Where(clause = "delete_status = 0")
public class RiskAssessPlan implements Serializable {
    private static final long serialVersionUID = -44756780317221858L;
src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java
@@ -19,8 +19,8 @@
    /**
     * 实验风险单元 - 查询 by code
     */
    @Query(value = "select t from RiskUnit t where t.riskCode = :riskCode and t.deleteStatus = 0")
    RiskUnit getUnitByCode(String riskCode);
    @Query(value = "select t from RiskUnit t where t.riskCode = :riskCode and t.experimentId = :experimentId and t.deleteStatus = 0")
    RiskUnit getUnitByCode(String riskCode,Long experimentId);
    /**
     * 风险单元 - 查询 by id
     */
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java
@@ -1,5 +1,7 @@
package com.gkhy.labRiskManage.domain.riskReport.service.impl;
import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.OldRiskAssessResDTO;
import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndPersonInsertReqBO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportExperimentSiteQueryRespDTO;
import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO;
@@ -19,10 +21,12 @@
import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO;
import com.gkhy.labRiskManage.domain.account.service.UserDomainService;
import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType;
import com.gkhy.labRiskManage.domain.basic.entity.OldRiskAssess;
import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService;
import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService;
import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService;
import com.gkhy.labRiskManage.domain.basic.service.OldRiskAssessService;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAssessLog;
import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo;
@@ -30,6 +34,7 @@
import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentRectifyStatusEnum;
import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndSiteService;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndTypeService;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAssessLogService;
import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService;
import com.gkhy.labRiskManage.domain.riskReport.entity.*;
@@ -48,6 +53,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
@@ -56,6 +62,7 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -103,6 +110,12 @@
    private RiskAssessPlanEvaluateMesService mesService;
    @Autowired
    private RiskAssessPlanEvaluateRsService rsService;
    @Autowired
    private ExperimentAndTypeService experimentAndTypeService;
    @Autowired
    private OldRiskAssessService oldRiskAssessService;
    /**
@@ -191,6 +204,8 @@
        List<ReportAppQueryDTO> reportAppQueryDTOS = BeanCopyUtils.copyBeanList(reportQueryDTOS, ReportAppQueryDTO.class);
        List<UserInfoDomainDTO> userList = userDomainService.getUserList();
        for (ReportAppQueryDTO reportQueryDTO : reportAppQueryDTOS) {
            //获取审批人员
            List<ReportPersonQueryRespDTO> personByReportId = reportPersonService.listPersonByReportId(reportQueryDTO.getId());
@@ -205,6 +220,10 @@
            //获取评估计划
            List<AssessPlanQueryDTO> assessPlanByExperimentId = assessPlanService.getAssessPlanByExperimentId(reportQueryDTO.getExperimentId());
            reportQueryDTO.setEvaluateTime(experimentById.getCreateTime());
            if (!ObjectUtils.isEmpty(experimentById.getProcess())){
                reportQueryDTO.setProcess(experimentById.getProcess());
            }
            if (!ObjectUtils.isEmpty(assessPlanByExperimentId)){
                for (AssessPlanQueryDTO assessPlan : assessPlanByExperimentId) {
@@ -225,6 +244,16 @@
            }
            if (!ObjectUtils.isEmpty(siteByReportId)){
                reportQueryDTO.setExperimentSite(BeanCopyUtils.copyBeanList(siteByReportId, ReportExperimentSiteQueryRespDTO.class));
                if (queryBO.getExperimentId() != null){
                    List<ReportExperimentSiteQueryRespDTO> experimentSite = reportQueryDTO.getExperimentSite();
                    List<String> collect = experimentSite.stream().map(ReportExperimentSiteQueryRespDTO::getSiteName).collect(Collectors.toList());
                    List<OldRiskAssessResDTO> oldRiskAssessListByRegion = oldRiskAssessService.getOldRiskAssessListByRegion(collect);
                    if (!ObjectUtils.isEmpty(oldRiskAssessListByRegion)){
                        reportQueryDTO.setOldRiskAssess(oldRiskAssessListByRegion);
                    }
                    reportQueryDTO.setExperimentAndType(experimentAndTypeService.getByExperimentId(reportQueryDTO.getExperimentId()));
                }
            }
            reportQueryDTO.setExperimentCode(experimentById.getExperimentCode());
@@ -236,6 +265,9 @@
                    reportQueryDTO.setUpdateByUserName(userInfo.getRealName());
                }
            }
        }
        searchResult.setData(reportAppQueryDTOS);
@@ -243,6 +275,7 @@
        return searchResult;
    }
    /**
     * 风险评估报告 - 生成报告信息
     */
@@ -557,6 +590,9 @@
        reportById.setAssessPerson(reportUpdateBO.getAssessPerson());
        reportById.setAssessLevel(reportUpdateBO.getAssessLevel());
        reportById.setDescription(reportUpdateBO.getDescription());
        if(!ObjectUtils.isEmpty(reportUpdateBO.getSafeRiskAnalysis())){
            reportById.setSafeRiskAnalysis(reportUpdateBO.getSafeRiskAnalysis());
        }
        reportById.setUpdateTime(LocalDateTime.now());
        reportById.setUpdateByUserId(currentUserId);
@@ -724,6 +760,7 @@
     * 风险评估报告 - 报告审核 - 新 - 单次审核
     */
    @Override
    @Transactional
    public int reportNew(Long currentUserId, ReportReqBO reportReqBO) {
        if (currentUserId < 0){
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java
@@ -100,14 +100,15 @@
        // 检查是否是实验管理者
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag ==0 ){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划");
        }
        //20241107修改注释
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
//        if (roleTag ==0 ){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划");
//        }
        if (ObjectUtils.isEmpty(user)){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除");
        }
@@ -364,14 +365,15 @@
        // 检查是否是实验管理者
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag ==0 ){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划");
        }
        //20241107修改注释
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
//        if (roleTag ==0 ){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划");
//        }
        //参数校验
        if (ObjectUtils.isEmpty(updateParam)){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要求改的参数为空");
@@ -473,14 +475,15 @@
        // 检查是否是实验管理者
        int roleTag = 0;
        UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        if (roleTag ==0 ){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划");
        }
        //20241107注释
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
//        if (roleTag ==0 ){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划");
//        }
        UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId);
        if (ObjectUtils.isEmpty(userInfoById)){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除");
src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java
@@ -85,7 +85,7 @@
        if (ObjectUtils.isEmpty(insertParam.getRiskCode())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空");
        }
        RiskUnit unitByCode = riskUnitRepository.getUnitByCode(insertParam.getRiskCode());
        RiskUnit unitByCode = riskUnitRepository.getUnitByCode(insertParam.getRiskCode(), insertParam.getExperimentId());
        if (!ObjectUtils.isEmpty(unitByCode)){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "编号已被使用");
        }
@@ -279,7 +279,7 @@
        if (ObjectUtils.isEmpty(updateParam.getRiskCode())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空");
        }
        RiskUnit unitByCode = riskUnitRepository.getUnitByCode(updateParam.getRiskCode());
        RiskUnit unitByCode = riskUnitRepository.getUnitByCode(updateParam.getRiskCode(),updateParam.getExperimentId());
        if (!ObjectUtils.isEmpty(unitByCode) && !updateParam.getId().equals(unitByCode.getId())){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "编号已被使用");
        }
src/main/resources/config/application-dev.yaml
@@ -6,14 +6,14 @@
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.0.52:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
    username: gkhy_dev_team
    password: Sjscn783fsDsa21
    url: jdbc:mysql://127.0.0.1:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
    username: root
    password: 123456
    master:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.0.52:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
      username: gkhy_dev_team
      password: Sjscn783fsDsa21
      url: jdbc:mysql://127.0.0.1:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
      username: root
      password: 123456
      type: com.alibaba.druid.pool.DruidDataSource
  jpa:
    hibernate:
src/main/resources/config/application.yaml
@@ -2,5 +2,5 @@
  application:
    name: labRiskManage
  profiles:
    active: dev
   # active: gslab
    active: online-uat
src/main/resources/config/redisson-dev.yml
@@ -10,13 +10,14 @@
  #  命令重试发送时间间隔,单位:毫秒
  retryInterval: 1500
  #  密码
  password: SEF98uvs98dUAUEF90Udssa
  #password:
  #password: SEF98uvs98dUAUEF90Udssa
  #  单个连接最大订阅数量
  subscriptionsPerConnection: 5
  #  客户端名称
#  clientName: null
  #  节点地址
  address: redis://192.168.0.52:6371
  address: redis://127.0.0.1:6379
#  #  发布和订阅连接的最小空闲连接数
#  subscriptionConnectionMinimumIdleSize: 1
#  #  发布和订阅连接池大小