From a700abf1326ed4a4e2fd951ccd4abc43bf9374f1 Mon Sep 17 00:00:00 2001 From: yuanxiangyu Date: Thu, 27 Jun 2024 14:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=9B=86=E6=88=90=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E9=85=8D=E7=BD=AE=E5=B0=86=E4=BC=A0=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=AF=B9=E8=B1=A1=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=A7=8D=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 ++++++ view-object-webapi/pom.xml | 6 ------ .../VoBuildFormFormatConfig.java | 5 +++-- .../VoBuildFormFormatServiceImpl.java | 21 +++++++++++++++++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 9f9c5a8..d67beea 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,12 @@ metadata-deploy-api ${metadata.deploy.version} + + com.inspur.edp + metadata-businesstype-api + 0.1.3 + compile + diff --git a/view-object-webapi/pom.xml b/view-object-webapi/pom.xml index b59cac7..ad38c41 100644 --- a/view-object-webapi/pom.xml +++ b/view-object-webapi/pom.xml @@ -58,12 +58,6 @@ com.inspur.edp lcm-metadata-api - - com.inspur.edp - metadata-businesstype-api - 0.1.2 - compile - com.inspur.edp web-help-metadata diff --git a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatConfig.java b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatConfig.java index e03c870..74d1b87 100644 --- a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatConfig.java +++ b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatConfig.java @@ -2,13 +2,14 @@ package com.inspur.edp.formserver.viewmodel.core.buildformformat; import com.inspur.edp.formserver.vmapi.formconfig.VoBuildFormFormatService; import com.inspur.edp.lcm.metadata.api.service.MetadataService; +import com.inspur.edp.metadata.businesstype.api.MdBizTypeMappingService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration("com.inspur.edp.formserver.viewmodel.core.buildformformat.VoBuildFormFormatConfig") public class VoBuildFormFormatConfig { @Bean("com.inspur.edp.formserver.vmmanager.config.VMManagerConfig.BuildFormFormat()") - public VoBuildFormFormatService getBuildFormFormat(MetadataService metadataService) { - return new VoBuildFormFormatServiceImpl(metadataService); + public VoBuildFormFormatService getBuildFormFormat(MetadataService metadataService, MdBizTypeMappingService mdBizTypeMappingService) { + return new VoBuildFormFormatServiceImpl(metadataService, mdBizTypeMappingService); } } diff --git a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatServiceImpl.java b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatServiceImpl.java index 54846ac..3d78508 100644 --- a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatServiceImpl.java +++ b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/core/buildformformat/VoBuildFormFormatServiceImpl.java @@ -10,12 +10,17 @@ import com.inspur.edp.formserver.viewmodel.formentity.*; import com.inspur.edp.formserver.vmapi.formconfig.VoBuildFormFormatService; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; import com.inspur.edp.lcm.metadata.api.service.MetadataService; +import com.inspur.edp.metadata.businesstype.api.MdBizTypeMappingService; import com.inspur.edp.wf.bizprocess.entity.*; import com.inspur.edp.wf.bizprocess.service.FormFormatRpcService; +import com.inspur.lcm.metadata.logging.LoggerDisruptorQueue; +import io.iec.edp.caf.boot.context.CAFContext; import io.iec.edp.caf.commons.exception.ExceptionLevel; import io.iec.edp.caf.commons.utils.SpringBeanUtils; import io.iec.edp.caf.rpc.client.RpcClassHolder; import lombok.NonNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @@ -26,8 +31,13 @@ public class VoBuildFormFormatServiceImpl implements VoBuildFormFormatService { private final MetadataService metadataService; - public VoBuildFormFormatServiceImpl(MetadataService metadataService) { + private final MdBizTypeMappingService mdBizTypeMappingService; + + private static final Logger logger = LoggerFactory.getLogger(VoBuildFormFormatServiceImpl.class); + + public VoBuildFormFormatServiceImpl(MetadataService metadataService, MdBizTypeMappingService mdBizTypeMappingService) { this.metadataService = metadataService; + this.mdBizTypeMappingService = mdBizTypeMappingService; } /** @@ -47,7 +57,14 @@ public class VoBuildFormFormatServiceImpl implements VoBuildFormFormatService { String formId = voFormModel.getId(); format.setId(formId); format.setCode(voFormModel.getCode()); - format.setBizCategory(bizCategory); + List bizTypeIds = mdBizTypeMappingService.getBizTypeIdsByBoId(bizCategory); + if(bizTypeIds == null || bizTypeIds.isEmpty()){ + LoggerDisruptorQueue.publishEvent("[ERROR] 当前表单未获取到对应的业务对象,无法推送表单格式至流程设计", CAFContext.current.getUserId()); + logger.warn("bizTypeId is null"); + return; + } + String bizTypeId = bizTypeIds.get(0); + format.setBizCategory(bizTypeId); format.setName(voFormModel.getName()); format.setFormatType(voFormModel.getFormatType()); if (voFormModel.getUrl() == null || voFormModel.getUrl().isEmpty()) { -- Gitee