heheng
2025-05-23 761bdc5b3f17df62aae1b424f2d2dabc11e844bc
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java
@@ -184,6 +184,11 @@
        if (currentUserId < 0){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录");
        }
        UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId);
        if (userInfoById == null){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录");
        }
        String realName = userInfoById.getRealName();
        RiskAssessPlanAppIdentificationBO identificationParam = BeanCopyUtils.copyBean(identificationReqBO, RiskAssessPlanAppIdentificationBO.class);
        int tag = 1;
@@ -198,6 +203,8 @@
        if (identificationParam.getIdentificationMethod() == 1){
            RiskAssessPlanIdentificationPha pha = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationPha.class);
            pha.setAssessPlanId(identificationParam.getId());
            pha.setCreateByUser(realName);
            pha.setCreateByUserId(currentUserId.intValue());
            phaInsertDTO = phaService.insertPha(currentUserId, pha);
            if (ObjectUtils.isEmpty(phaInsertDTO)){
                tag = 0;
@@ -208,6 +215,8 @@
        }else if (identificationParam.getIdentificationMethod() == 2){
            RiskAssessPlanIdentificationJha jha = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationJha.class);
            jha.setAssessPlanId(identificationParam.getId());
            jha.setCreateByUser(realName);
            jha.setCreateByUserId(currentUserId.intValue());
            jhaInsertDTO = jhaService.insertJha(currentUserId, jha);
            if (ObjectUtils.isEmpty(jhaInsertDTO)){
                tag = 0;
@@ -218,6 +227,8 @@
        }else if (identificationParam.getIdentificationMethod() == 3){
            RiskAssessPlanIdentificationScl scl = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationScl.class);
            scl.setAssessPlanId(identificationParam.getId());
            scl.setCreateByUser(realName);
            scl.setCreateByUserId(currentUserId.intValue());
            sclInsertDTO = sclService.insertScl(currentUserId, scl);
            if (ObjectUtils.isEmpty(sclInsertDTO)){
                tag = 0;
@@ -228,6 +239,9 @@
        }else if (identificationParam.getIdentificationMethod() == 4){
            RiskAssessPlanIdentificationHazop hazop = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationHazop.class);
            hazop.setAssessPlanId(identificationParam.getId());
            hazop.setCreateByUser(realName);
            hazop.setCreateByUserId(currentUserId.intValue());
            hazopInsertDTO = hazopService.insertHazop(currentUserId, hazop);
            if (ObjectUtils.isEmpty(hazopInsertDTO)){
                tag = 0;
@@ -238,6 +252,8 @@
        }else if (identificationParam.getIdentificationMethod() == 5){
            RiskAssessPlanIdentificationAnalogy analogy = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationAnalogy.class);
            analogy.setAssessPlanId(identificationParam.getId());
            analogy.setCreateByUser(realName);
            analogy.setCreateByUserId(currentUserId.intValue());
            analogyInsertDTO = analogyService.insertAnalogy(currentUserId, analogy);
            if (ObjectUtils.isEmpty(analogyInsertDTO)){
                tag = 0;
@@ -267,7 +283,11 @@
        if (currentUserId < 0){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录");
        }
        UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId);
        if (userInfoById == null){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录");
        }
        String realName = userInfoById.getRealName();
        RiskAssessPlanIdentificationAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanIdentificationAppUpdateBO.class);
        int tag = 1;
        FactorQueryDTO factorQueryDTO = new FactorQueryDTO();
@@ -277,6 +297,8 @@
            RiskAssessPlanIdentificationPha pha = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationPha.class);
            pha.setAssessPlanId(updateParam.getId());
            pha.setId(updateParam.getPhaId());
            pha.setUpdateByUser(realName);
            pha.setUpdateByUserId(currentUserId.intValue());
            PhaInsertDTO phaInsertDTO = phaService.updatePha(currentUserId, pha);
            if (ObjectUtils.isEmpty(phaInsertDTO)){
                tag = 0;
@@ -288,6 +310,8 @@
            RiskAssessPlanIdentificationJha jha = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationJha.class);
            jha.setAssessPlanId(updateParam.getId());
            jha.setId(updateParam.getJhaId());
            jha.setUpdateByUser(realName);
            jha.setUpdateByUserId(currentUserId.intValue());
            JhaInsertDTO jhaInsertDTO = jhaService.updateJha(currentUserId, jha);
            if (ObjectUtils.isEmpty(jhaInsertDTO)){
                tag = 0;
@@ -299,6 +323,8 @@
            RiskAssessPlanIdentificationScl scl = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationScl.class);
            scl.setAssessPlanId(updateParam.getId());
            scl.setId(updateParam.getSclId());
            scl.setUpdateByUser(realName);
            scl.setUpdateByUserId(currentUserId.intValue());
            SclInsertDTO sclInsertDTO = sclService.updateScl(currentUserId, scl);
            if (ObjectUtils.isEmpty(sclInsertDTO)){
                tag = 0;
@@ -310,6 +336,8 @@
            RiskAssessPlanIdentificationHazop hazop = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationHazop.class);
            hazop.setAssessPlanId(updateParam.getId());
            hazop.setId(updateParam.getHazopId());
            hazop.setUpdateByUser(realName);
            hazop.setUpdateByUserId(currentUserId.intValue());
            HazopInsertDTO hazopInsertDTO = hazopService.updateHazop(currentUserId, hazop);
            if (ObjectUtils.isEmpty(hazopInsertDTO)){
                tag = 0;
@@ -321,6 +349,8 @@
            RiskAssessPlanIdentificationAnalogy analogy = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationAnalogy.class);
            analogy.setAssessPlanId(updateParam.getId());
            analogy.setId(updateParam.getAnalogyId());
            analogy.setUpdateByUser(realName);
            analogy.setUpdateByUserId(currentUserId.intValue());
            AnalogyInsertDTO analogyInsertDTO = analogyService.updateAnalogy(currentUserId, analogy);
            if (ObjectUtils.isEmpty(analogyInsertDTO)){
                tag = 0;