From 1b3dbe8e1e991477695a8981822e1f72dfeb41dd Mon Sep 17 00:00:00 2001 From: sunhongfei01 Date: Fri, 19 Jul 2024 17:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=85=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E6=96=B9=E6=B3=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MappedCdpActionComponentGenerator.java | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/createvmmetadata/MappedCdpActionComponentGenerator.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/createvmmetadata/MappedCdpActionComponentGenerator.java index 1984177..38ab1fe 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/createvmmetadata/MappedCdpActionComponentGenerator.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/createvmmetadata/MappedCdpActionComponentGenerator.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.inspur.edp.formserver.vmmanager.createvmmetadata; @@ -22,16 +38,12 @@ import com.inspur.edp.formserver.vmmanager.exception.VoManagerErrorCodes; import com.inspur.edp.formserver.vmmanager.generatacmpcode.JavaCompCodeNames; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; import com.inspur.edp.lcm.metadata.api.entity.GspProject; -import com.inspur.edp.lcm.metadata.api.service.GspProjectService; import com.inspur.edp.lcm.metadata.api.service.MetadataService; import io.iec.edp.caf.commons.utils.SpringBeanUtils; import org.apache.commons.lang3.StringUtils; import java.util.Iterator; - -import java.io.IOException; - public class MappedCdpActionComponentGenerator { /** * 业务实体编号 @@ -96,17 +108,9 @@ public class MappedCdpActionComponentGenerator { */ private String getPackagePrefix(String relativePath) { DataValidator.checkForEmptyString(relativePath,"relativePath"); - - GspProjectService gspProjectService = SpringBeanUtils.getBean(GspProjectService.class); - try { - GspProject gspProject = gspProjectService.getGspProjectInfo(relativePath); - if (gspProject == null) { - throw new NullPointerException("GspProject is null"); - } - return gspProject.getPackagePrefix(); - } catch (IOException e) { - throw new RuntimeException(e); - } + GspProject gspProject = SpringBeanUtils.getBean(MetadataService.class).getGspProjectInfo(relativePath); + DataValidator.checkForNullReference(gspProject, "gspProject"); + return gspProject.getPackagePrefix(); } /** -- Gitee