From 6d6f2f9fe9ee5e0d2b1b63bb7cde575f2a93876b Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期三, 21 五月 2025 16:14:52 +0800
Subject: [PATCH] 变动大幅度版本

---
 src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java |   34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java
index 886e335..f8867a6 100644
--- a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java
+++ b/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;
@@ -564,8 +594,6 @@
         if (currentUserId < 0){
             throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录");
         }
-        //todo   需要评价人员都评价完成才可以
-
 
         //提交评价结果
         AssessPlanUpdateDTO evaluateSubmitResult= assessPlanService.evaluateSubmit(currentUserId, id);

--
Gitblit v1.9.2