heheng
2024-11-07 3ca43826a747fda1447b2501901f84fc1a9019dd
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(), "编号已被使用");
        }