diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGenerator.java index d68b34d9dc2699c4f384da6fbafd86bf3a92577c..6e6bf87bdd4be4ae2c1407dd88c7e3d85b945a50 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGenerator.java @@ -22,6 +22,8 @@ import com.inspur.edp.bff.designtime.generator.core.VmCoreGenerator; import com.inspur.edp.bff.designtime.generator.core.config.BffConfigGenerator; import com.inspur.edp.bff.designtime.generator.core.rtgen.variable.FSVariableGenerator; import com.inspur.edp.bff.designtime.generator.entity.VmEntityGenerator; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.BaseGenerator; import com.inspur.edp.caf.generator.module.ModuleGenerator; import com.inspur.edp.cef.designtime.api.IGspCommonField; @@ -33,7 +35,6 @@ import com.inspur.edp.cef.generator.coreGenerator.base.CefCoreGenerator; import com.inspur.edp.cef.generator.coreGenerator.entityGenerator.CommonModelCoreGenerator; import com.inspur.edp.cef.generator.entityGenerator.BaseEntityGenerator; import com.inspur.edp.cef.generator.entityGenerator.entity.CommonModelEntityGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.cef.generator.overall.commonModel.CommonModelGenerator; import com.inspur.edp.cef.generator.overall.commonModel.CommonModelGeneratorContext; import com.inspur.edp.cef.generator.repository.RepositoryGenerator; @@ -155,8 +156,8 @@ public class VmGenerator extends CommonModelGenerator { return; } if (modelMetadata == null) { - throw new CefGenException(getContext().getVm().getCode() + "引用的ID为" + refId - + "实体没有找到,请检查元数据是否存在"); + GspViewModel vm = getContext().getVm(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0001,vm.getID(),vm.getCode(),vm.getName(),refId); } getContext().getRefEntityCollection().put(refId, modelMetadata); } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGeneratorContext.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGeneratorContext.java index 0ecd393f29e6326154d5d2ddd27e1232a80f1e3a..fab736fe0fd97527668c070d9eb1b3ccda911810 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGeneratorContext.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/VmGeneratorContext.java @@ -16,14 +16,14 @@ package com.inspur.edp.bff.designtime.generator; -import static io.iec.edp.caf.runtime.config.BeanUtil.getAppCtx; - import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bff.designtime.generator.changeconvertor.FSChangeConvertorGenContext; import com.inspur.edp.bff.designtime.generator.common.IMetadataPool; import com.inspur.edp.bff.designtime.generator.common.MetadataInfo; import com.inspur.edp.bff.designtime.generator.entity.VmEntityGenContext; import com.inspur.edp.bff.designtime.generator.entitydataconvertor.VMObjectDataConvertorGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.bff.designtime.generator.udt.UdtInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.item.ClassGeneratorContext; @@ -31,19 +31,14 @@ import com.inspur.edp.caf.generator.module.ModuleGenerator; import com.inspur.edp.cef.designtime.api.IGspCommonDataType; import com.inspur.edp.cef.entity.config.MgrConfig; import com.inspur.edp.cef.generator.entityGenerator.base.dataTypeData.DataTypeDataGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.cef.generator.overall.commonModel.CommonModelGeneratorContext; import com.inspur.edp.cef.variable.dtgenerator.VariableGeneratorContext; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; -import com.inspur.edp.lcm.metadata.api.service.MetadataService; import com.inspur.edp.lcm.metadata.api.service.RefCommonService; import com.inspur.edp.udt.designtime.api.entity.UnifiedDataTypeDef; import io.iec.edp.caf.commons.utils.SpringBeanUtils; -import io.iec.edp.caf.runtime.config.BeanUtil; -import lombok.var; -import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; import java.util.HashMap; @@ -568,7 +563,7 @@ public class VmGeneratorContext extends CommonModelGeneratorContext implements I UnifiedDataTypeDef udt = (UnifiedDataTypeDef)((metadataInfo.getMetadata().getContent() instanceof UnifiedDataTypeDef) ? metadataInfo.getMetadata().getContent() : null); if (udt == null) { - throw new CefGenException("ID为【" + udtId + "】的业务字段元数据没有获取成功"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0002,this.vo.getID(),this.vo.getCode(),this.vo.getName(),udtId); } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/actioninterface/method/MgrActionBuildUtil.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/actioninterface/method/MgrActionBuildUtil.java index ede53a5823efe35df5f9e4c067954b70b57f990e..17d047f5556bc4899268731ea628b9040e043005 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/actioninterface/method/MgrActionBuildUtil.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/actioninterface/method/MgrActionBuildUtil.java @@ -16,13 +16,16 @@ package com.inspur.edp.bff.designtime.generator.api.actioninterface.method; +import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bef.bizentity.operation.BizOperation; import com.inspur.edp.bef.component.base.GspComponent; import com.inspur.edp.bef.component.detailcmpentity.bemgr.BEMgrMethod; import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethod; import com.inspur.edp.bff.designtime.generator.api.VmApiGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.BaseGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; +import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.formserver.viewmodel.action.MappedCdpAction; import com.inspur.edp.formserver.viewmodel.action.ViewModelAction; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; @@ -32,16 +35,16 @@ public class MgrActionBuildUtil { public static void addActionGenertors(VmApiGenContext apiGenCtx, ArrayList childGenerators) { - - for (ViewModelAction vmAction : apiGenCtx.getVmGenContext().getVm().getActions()) { + GspViewModel vm = apiGenCtx.getVmGenContext().getVm(); + for (ViewModelAction vmAction : vm.getActions()) { switch (vmAction.getType()) { case BEAction: - BizOperation beMgrAction = apiGenCtx.getVmGenContext() - .getRefBizEntity().getBizMgrActions().getItem(vmAction.getMapping().getTargetObjId()); + GspBusinessEntity refBizEntity = apiGenCtx.getVmGenContext().getRefBizEntity(); + BizOperation beMgrAction = refBizEntity.getBizMgrActions().getItem(vmAction.getMapping().getTargetObjId()); if (beMgrAction == null) { - throw new CefGenException( - "vm[" + apiGenCtx.getVmGenContext().getVm() + "]的动作[" + vmAction.getCode() - + "]对应的be动作没有找到,be动作Id为" + vmAction.getMapping().getTargetObjId()); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0003, + vm.getID(),vm.getCode(),vm.getName(),vmAction.getCode(), + refBizEntity.getCode(),vmAction.getMapping().getTargetObjId()); } BEMgrMethod method = getBeMgrMethod(apiGenCtx, beMgrAction.getComponentId(), beMgrAction.getComponentPkgName()); @@ -57,7 +60,7 @@ public class MgrActionBuildUtil { vmMethod = getVmMgrMethod(apiGenCtx, action.getComponentEntityId(), action.getComponentPkgName()); } catch (Exception e) { - throw new CefGenException("方法" + action.getCode() + "对应的构件元数据获取异常", e); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0004, e,action.getCode(),action.getComponentEntityId(),action.getComponentPkgName()); } ActionInterfaceMethodGenerator vmGen = new ActionInterfaceMethodGenerator(vmMethod, @@ -74,7 +77,7 @@ public class MgrActionBuildUtil { .getMetadata(compPkgName, compId); GspComponent comp = (GspComponent) metadata.getContent(); if (!comp.getComponentType().equals("BEMgrComponent")) { - throw new CefGenException("错误的类型"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0005,compId,compPkgName,comp.getComponentType()); } return (BEMgrMethod) comp.getMethod(); } @@ -84,11 +87,11 @@ public class MgrActionBuildUtil { GspMetadata metadata = apiGenCtx.getVmGenContext().getMetadataPool() .getMetadata(compPkgName, compId); if (metadata == null) { - throw new CefGenException("构件元数据没有获取到,构件id为" + compId); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0006, compId,compPkgName); } GspComponent comp = (GspComponent) metadata.getContent(); if (!comp.getComponentType().equals("VMComponent")) { - throw new CefGenException("错误的类型:" + comp.getComponentType()); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0007,compId,compPkgName,comp.getComponentType()); } return (VMMethod) comp.getMethod(); } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/entityinterface/resourceinfo/BffResourceInfoCtorGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/entityinterface/resourceinfo/BffResourceInfoCtorGenerator.java index 3107354f3c6283d31cbf86009753d91c88653aef..e531556ad1d4f607e9d9829a860862da36e3d77a 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/entityinterface/resourceinfo/BffResourceInfoCtorGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/api/entityinterface/resourceinfo/BffResourceInfoCtorGenerator.java @@ -16,14 +16,16 @@ package com.inspur.edp.bff.designtime.generator.api.entityinterface.resourceinfo; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.utils.ExpressionUtils; import com.inspur.edp.cef.designtime.api.IGspCommonDataType; import com.inspur.edp.cef.entity.condition.SortCondition; import com.inspur.edp.cef.entity.condition.SortType; import com.inspur.edp.cef.generator.apiGenerator.dataType.entityInterface.resourceInfo.ResourceInfoCtorGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.das.commonmodel.IGspCommonElement; +import com.inspur.edp.das.commonmodel.IGspCommonModel; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.das.commonmodel.entity.GspCommonObject; import io.iec.edp.caf.common.JSONSerializer; @@ -77,7 +79,8 @@ public class BffResourceInfoCtorGenerator extends ResourceInfoCtorGenerator { private static String getFieldPath(GspCommonObject node, String labelId) { IGspCommonElement element = node.getElementByLabelId(labelId); if(element == null) { - throw new CefGenException("模型" + node.getBelongModel().getCode() + "的节点" + node.getCode() + "上设置的排序字段" + labelId + "不存在, 请重新设置排序字段."); + IGspCommonModel belongModel = node.getBelongModel(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0008,belongModel.getID(),belongModel.getCode(),belongModel.getName(),node.getCode(),labelId ); } if(element.getParentAssociation() != null) { return element.getParentAssociation().getBelongElement().getLabelID() + "." + element.getLabelID(); @@ -94,9 +97,9 @@ public class BffResourceInfoCtorGenerator extends ResourceInfoCtorGenerator { try { return JSONSerializer.deserialize(orderByStr, List.class, SortCondition.class); } catch (Exception e) { - throw new CefGenException( - dataType.getBelongModel() != null ? dataType.getBelongModel().getCode() - : "" + "节点" + dataType.getCode() + "定义的排序条件格式不正确, 请检查", e); + IGspCommonModel belongModel = dataType.getBelongModel(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0009,e,true, + belongModel != null ? belongModel.getCode() : "" ,dataType.getCode(),orderByStr); } } } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormBeGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormBeGenerator.java index 6afae46e08ed43175945284819e450a0a77d7a37..fd844dd51f62fbf4d097b680f5a76fcb0a7b335f 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormBeGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormBeGenerator.java @@ -19,14 +19,17 @@ package com.inspur.edp.bff.designtime.generator.changeconvertor.methodgenerator; import com.inspur.edp.bef.bizentity.GspBizEntityElement; import com.inspur.edp.bff.designtime.generator.changeconvertor.FSChangeConvertorGenContext; import com.inspur.edp.bff.designtime.generator.common.GenUtils; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.caf.generator.utils.ExpressionUtils; +import com.inspur.edp.cef.designtime.api.element.GspAssociation; import com.inspur.edp.cef.entity.changeset.ModifyChangeDetail; import com.inspur.edp.cef.entity.i18n.MultiLanguageInfo; import com.inspur.edp.cef.generator.DotNetToJavaStringHelper; -import com.inspur.edp.cef.generator.exception.CefGenException; +import com.inspur.edp.das.commonmodel.IGspCommonModel; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import lombok.var; import org.eclipse.jdt.core.dom.*; @@ -132,11 +135,8 @@ public class ConvertModifyPropertiesFormBeGenerator extends ClassMethodGenerator if (item == null || (item.getIsVirtual() && item.getIsVirtualViewElement())) { continue; } - if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) - //TODO 异常封装 - { - throw new CefGenException( - "#GspBefError# 字段" + item.getCode() + " 的Mapping字段ID不允许为空#GspBefError#"); + if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) { + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0010, item.getCode(),item.getMapping().getTargetObjId()); } if (item.getMapping().getTargetMetadataId().equals(changeConvertorContext.getVmGeneratorContext() @@ -187,9 +187,7 @@ public class ConvertModifyPropertiesFormBeGenerator extends ClassMethodGenerator addEnumElementMapBlock(vmElement, beElement, result); break; default: - throw new CefGenException( - "#GspBefError# 错误的类型" + vmElement.getObjectType().toString() - + " #GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0011, vmElement.getObjectType().toString()); } } @@ -301,24 +299,24 @@ public class ConvertModifyPropertiesFormBeGenerator extends ClassMethodGenerator private void assPropMapBlock(GspViewModelElement vmElement, GspBizEntityElement beElement, Block elseBlock) { - - for (var gspCommonField : vmElement.getChildAssociations().get(0).getRefElementCollection()) { + GspAssociation gspAssociation = vmElement.getChildAssociations().get(0); + for (var gspCommonField : gspAssociation.getRefElementCollection()) { var item = (GspViewModelElement) gspCommonField; if (item == null) { continue; } - + GspAssociation beAsso = beElement.getChildAssociations().get(0); GspBizEntityElement beAssElement = (GspBizEntityElement) ( - (beElement.getChildAssociations().get(0).getRefElementCollection() + (beAsso.getRefElementCollection() .getItem(item.getMapping().getTargetObjId()) instanceof GspBizEntityElement) - ? beElement.getChildAssociations().get(0).getRefElementCollection() + ? beAsso.getRefElementCollection() .getItem(item.getMapping().getTargetObjId()) : null); if (beAssElement == null) { - throw new CefGenException( - "找不到Vo[" + item.getBelongObject().getBelongModel().getCode() + "]中字段[" - + item.getLabelID() + "]对应的be字段"); + String refBeCode=beAsso.getRefModelCode(); + IGspCommonModel belongModel = item.getBelongObject().getBelongModel(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0012, belongModel.getCode(),item.getLabelID(),refBeCode,item.getMapping().getTargetObjId()); } var beData = ExpressionUtils.getMethodInvocation(ast,"beAss", "get" + beAssElement.getLabelID()); var voData = ExpressionUtils.getMethodInvocation(ast,"vmAss", "set" + item.getLabelID()); diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormVoGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormVoGenerator.java index 050f589529134fef2e505568ae7ab55685465d4b..8be70f122237be70ad0c3cf1dc5cb5a61f6b6f7e 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormVoGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertModifyPropertiesFormVoGenerator.java @@ -17,10 +17,10 @@ package com.inspur.edp.bff.designtime.generator.changeconvertor.methodgenerator; import com.inspur.edp.bef.bizentity.GspBizEntityElement; -import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bff.designtime.generator.changeconvertor.FSChangeConvertorGenContext; import com.inspur.edp.bff.designtime.generator.common.GenUtils; -import com.inspur.edp.bff.designtime.generator.common.MetadataInfo; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.bff.designtime.generator.udt.UdtInfo; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; @@ -31,9 +31,7 @@ import com.inspur.edp.cef.designtime.api.element.GspElementObjectType; import com.inspur.edp.cef.entity.changeset.ModifyChangeDetail; import com.inspur.edp.cef.entity.changeset.ValueObjModifyChangeDetail; import com.inspur.edp.cef.generator.DotNetToJavaStringHelper; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; -import lombok.var; import org.eclipse.jdt.core.dom.*; import java.util.ArrayList; import java.util.Arrays; @@ -63,8 +61,7 @@ public class ConvertModifyPropertiesFormVoGenerator extends ClassMethodGenerator continue; } if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) { - throw new CefGenException( - "#GspBefError# 字段" + item.getCode() + " 的Mapping字段ID不允许为空#GspBefError#"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0010, item.getCode(),item.getMapping().getTargetObjId()); } if (item.getMapping().getTargetMetadataId() .equals(changeConvertorContext.getVmGeneratorContext() @@ -138,9 +135,7 @@ public class ConvertModifyPropertiesFormVoGenerator extends ClassMethodGenerator addEnumElementMapBlock(vmElement, beElement, result); break; default: - throw new CefGenException( - "#GspBefError# 错误的类型" + vmElement.getObjectType().toString() - + " #GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0011, vmElement.getObjectType().toString()); } } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromBeGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromBeGenerator.java index 62c891283567ab917a02f7dccfc8590ce98b6d07..62a36d8287582403fb9f257c2198230ad85e0133 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromBeGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromBeGenerator.java @@ -18,28 +18,24 @@ package com.inspur.edp.bff.designtime.generator.changeconvertor.methodgenerator; import com.inspur.edp.bef.bizentity.GspBizEntityElement; import com.inspur.edp.bff.designtime.generator.changeconvertor.FSChangeConvertorGenContext; -import com.inspur.edp.bff.designtime.generator.common.GenUtils; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.caf.generator.utils.ExpressionUtils; import com.inspur.edp.cef.entity.changeset.ModifyChangeDetail; import com.inspur.edp.cef.entity.i18n.MultiLanguageInfo; import com.inspur.edp.cef.generator.DotNetToJavaStringHelper; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import java.util.ArrayList; import java.util.Arrays; import lombok.var; import org.eclipse.jdt.core.dom.Block; -import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.ExpressionStatement; -import org.eclipse.jdt.core.dom.InfixExpression; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.Statement; import org.eclipse.jdt.core.dom.StringLiteral; import org.eclipse.jdt.core.dom.SuperMethodInvocation; -import org.eclipse.jdt.core.dom.SwitchCase; import org.eclipse.jdt.core.dom.SwitchStatement; public class ConvertMultiLanguageModifyPropFromBeGenerator extends ClassMethodGenerator { @@ -96,11 +92,8 @@ public class ConvertMultiLanguageModifyPropFromBeGenerator extends ClassMethodGe if (item == null || item.getIsVirtual()) { continue; } - if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) - //TODO 异常封装 - { - throw new CefGenException( - "#GspBefError# 字段" + item.getCode() + " 的Mapping字段ID不允许为空#GspBefError#"); + if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) { + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0010, item.getCode(),item.getMapping().getTargetObjId()); } if (item.getMapping().getTargetMetadataId() @@ -151,8 +144,7 @@ public class ConvertMultiLanguageModifyPropFromBeGenerator extends ClassMethodGe case Enum: break; default: - throw new CefGenException( - "#GspBefError# 错误的类型" + vmElement.getObjectType().toString() + " #GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0011, vmElement.getObjectType().toString()); } } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromVoGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromVoGenerator.java index e676293d24e41cb6f5521ec02f4afe66f7fda9fa..89ba88822f49ade04056c94d4d6cb6f64360ebdc 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromVoGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/ConvertMultiLanguageModifyPropFromVoGenerator.java @@ -18,41 +18,29 @@ package com.inspur.edp.bff.designtime.generator.changeconvertor.methodgenerator; import com.inspur.edp.bef.bizentity.GspBizEntityElement; import com.inspur.edp.bff.designtime.generator.changeconvertor.FSChangeConvertorGenContext; -import com.inspur.edp.bff.designtime.generator.common.GenUtils; -import com.inspur.edp.bff.designtime.generator.udt.UdtInfo; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.caf.generator.utils.ExpressionUtils; import com.inspur.edp.cef.designtime.api.IGspCommonField; -import com.inspur.edp.cef.designtime.api.element.GspElementObjectType; import com.inspur.edp.cef.entity.changeset.ModifyChangeDetail; -import com.inspur.edp.cef.entity.changeset.ValueObjModifyChangeDetail; import com.inspur.edp.cef.entity.i18n.MultiLanguageInfo; import com.inspur.edp.cef.generator.DotNetToJavaStringHelper; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import java.util.ArrayList; import java.util.Arrays; import lombok.var; -import org.eclipse.jdt.core.dom.ArrayAccess; -import org.eclipse.jdt.core.dom.Assignment; import org.eclipse.jdt.core.dom.Block; -import org.eclipse.jdt.core.dom.CastExpression; -import org.eclipse.jdt.core.dom.ClassInstanceCreation; import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.ExpressionStatement; -import org.eclipse.jdt.core.dom.IfStatement; -import org.eclipse.jdt.core.dom.InfixExpression; import org.eclipse.jdt.core.dom.MethodInvocation; import org.eclipse.jdt.core.dom.Modifier; -import org.eclipse.jdt.core.dom.SimpleType; import org.eclipse.jdt.core.dom.Statement; import org.eclipse.jdt.core.dom.StringLiteral; import org.eclipse.jdt.core.dom.SuperMethodInvocation; -import org.eclipse.jdt.core.dom.SwitchCase; import org.eclipse.jdt.core.dom.SwitchStatement; -import org.eclipse.jdt.core.dom.Type; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; @@ -82,8 +70,7 @@ public class ConvertMultiLanguageModifyPropFromVoGenerator extends ClassMethodGe continue; } if (DotNetToJavaStringHelper.isNullOrEmpty(item.getMapping().getTargetObjId())) { - throw new CefGenException( - "#GspBefError# 字段" + item.getCode() + " 的Mapping字段ID不允许为空#GspBefError#"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0010, item.getCode(),item.getMapping().getTargetObjId()); } if (item.getMapping().getTargetMetadataId() @@ -144,8 +131,7 @@ public class ConvertMultiLanguageModifyPropFromVoGenerator extends ClassMethodGe case Enum: break; default: - throw new CefGenException( - "#GspBefError# 错误的类型" + vmElement.getObjectType().toString() + " #GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0011, vmElement.getObjectType().toString()); } } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/GetChildChangeConvertorGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/GetChildChangeConvertorGenerator.java index 8af1a6c6461c9a6b31066cd1b69018a75d138917..aad84bfd1bb7e964871d58f274a5586f618a0a50 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/GetChildChangeConvertorGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/changeconvertor/methodgenerator/GetChildChangeConvertorGenerator.java @@ -24,7 +24,7 @@ import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.caf.generator.utils.ExpressionUtils; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.generator.overall.GeneratorUtil; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.formserver.viewmodel.GspViewObject; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/common/BffGeneratorResourceUtil.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/common/BffGeneratorResourceUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..6e61d76e708670d3489f406fdfe6dd537013cca0 --- /dev/null +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/common/BffGeneratorResourceUtil.java @@ -0,0 +1,18 @@ +package com.inspur.edp.bff.designtime.generator.common; + +import io.iec.edp.caf.commons.utils.SpringBeanUtils; +import io.iec.edp.caf.i18n.api.ResourceLocalizer; + +public class BffGeneratorResourceUtil { + private final static String SU = "pfcommon"; + private final static String RESOURCE_FILE = "bff_dtgenerator_exception.properties"; + + public static String getResourceValue(String su, String resourceFile, String key) { + ResourceLocalizer localizer = SpringBeanUtils.getBean(ResourceLocalizer.class); + return localizer.getString(key, resourceFile, su, ""); + } + + public static String getResourceValue(String key) { + return getResourceValue(SU, RESOURCE_FILE, key); + } +} diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/VmCoreGenContext.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/VmCoreGenContext.java index 7d335d12e9f12dac9f0463ee521a007ff1ae6153..b568bb582fff0538d468f25878e4bc90ad520564 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/VmCoreGenContext.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/VmCoreGenContext.java @@ -20,12 +20,11 @@ import com.inspur.edp.bff.designtime.generator.VmGeneratorContext; import com.inspur.edp.bff.designtime.generator.core.rtgen.datagenerator.FSDataGeneratorContext; import com.inspur.edp.bff.designtime.generator.core.rtgen.managergenerator.FSMgrGeneratorContext; import com.inspur.edp.bff.designtime.generator.core.rtgen.typeinfo.FSIntermediateTypeInfo; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.cef.entity.dependenceTemp.DataValidator; import com.inspur.edp.cef.gencommon.MediateType; import com.inspur.edp.cef.generator.coreGenerator.entityGenerator.CommonModelCoreGeneratorContext; -import com.inspur.edp.cef.generator.exception.CefGenException; -import com.inspur.edp.cef.variable.dtgenerator.VariableGeneratorContext; -import com.inspur.edp.cef.variable.dtgenerator.core.VariableCoreGenCtx; import com.inspur.edp.das.commonmodel.IGspCommonModel; import com.inspur.edp.formserver.viewmodel.GspViewModel; @@ -102,21 +101,32 @@ public class VmCoreGenContext extends CommonModelCoreGeneratorContext { } public final java.lang.Class getCustomActionType(String assemblyName, String className, - String compId) throws ClassNotFoundException { + String compId) { DataValidator.checkForEmptyString(assemblyName, "assemblyName"); DataValidator.checkForEmptyString(className, "className"); - Class c = Class.forName(className); + Class c = null; + try { + c = Class.forName(className); + } catch (ClassNotFoundException e) { + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0013,e,className); + } if (c == null) { - throw new CefGenException("加载构件程序集" + assemblyName + "失败。"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0013,className); } return c; } - private java.lang.Class getTypeFromAssembly(String className) throws ClassNotFoundException { - Class c = Class.forName(className); + private java.lang.Class getTypeFromAssembly(String className) { + Class c = null; + try { + c = Class.forName(className); + } catch (ClassNotFoundException e) { + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0013,e,className); + } if (c == null) { - throw new CefGenException("加载构件程序集失败。"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0013,className); + } return c; } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/extendaction/method/ActionConfigCtorGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/extendaction/method/ActionConfigCtorGenerator.java index 99047be5887f0c30e3aaebd1f1ffecb0fc568a9a..a8ab263e9f9b4fc81a505c8692f219ab60895b92 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/extendaction/method/ActionConfigCtorGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/extendaction/method/ActionConfigCtorGenerator.java @@ -19,6 +19,8 @@ package com.inspur.edp.bff.designtime.generator.core.extendaction.method; import com.inspur.edp.bef.component.detailcmpentity.vm.VMComponent; import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethod; import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.bff.spi.action.changemapping.ChangeMappingAction; import com.inspur.edp.bff.spi.action.changemapping.ChangeReversalMappingAction; import com.inspur.edp.bff.spi.action.changemapping.DefaultChangeMapAction; @@ -56,7 +58,6 @@ import com.inspur.edp.bff.spi.action.save.BeforeSaveAction; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.formserver.viewmodel.action.MappedCdpAction; import com.inspur.edp.formserver.viewmodel.action.ViewModelAction; @@ -251,7 +252,7 @@ public class ActionConfigCtorGenerator extends ClassMethodGenerator { MappedCdpAction mappedCdpAction = (MappedCdpAction) action; GspMetadata metadata = coreGenCtx.getVmGenContext().getMetadataPool().getMetadata(mappedCdpAction.getComponentPkgName(), mappedCdpAction.getComponentEntityId()); if(metadata == null) - throw new CefGenException("未找到构件元数据["+mappedCdpAction.getCode()+"],元数据id为" + mappedCdpAction.getComponentEntityId()); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0014,mappedCdpAction.getCode(),mappedCdpAction.getComponentEntityId(),mappedCdpAction.getComponentPkgName()); VMComponent compMetadata = (VMComponent) metadata.getContent(); VMMethod method = compMetadata.getVmMethod(); return method.getClassName(); @@ -390,21 +391,21 @@ public class ActionConfigCtorGenerator extends ClassMethodGenerator { else if (ExAction_ChangeReversalMapperTypes.equals(propName)) { return ChangeReversalMappingAction.class; } else { - throw new CefGenException("未定义的vo扩展操作类型" + propName); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0015, propName); } } private void checkExtendActionType(java.lang.Class type, String propName, ViewModelAction action) { - String message = "vo元数据'" + vo.getCode() + "'中'{" + propName + "}'类型扩展操作'{" + action.getCode() + "}'"; +// String message = "vo元数据'" + vo.getCode() + "'中'{" + propName + "}'类型扩展操作'{" + action.getCode() + "}'"; if (type == null) { - throw new CefGenException(message + "对应的构件类型'{type.Name}'未找到。"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0016,vo.getCode(), propName,action.getCode()); } java.lang.Class baseType = getExtendActionBaseType(propName); //C# TO JAVA CONVERTER TODO TASK: There is no equivalent to implicit typing in Java: Boolean checkResult = baseType.isAssignableFrom(type); if (!checkResult) { - throw new CefGenException(message + "对应的构件类型基类应为{" + baseType.getTypeName() + "},请修改。"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0017,vo.getCode(), propName,action.getCode(),type.getName(), baseType.getTypeName()); } } } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/BeActionMethodGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/BeActionMethodGenerator.java index 79cb79b499cdafce14eed0c91ebdf733aeb4f667..9ecd9dada40e737ac6600136b41bebd3aee404ef 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/BeActionMethodGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/BeActionMethodGenerator.java @@ -17,6 +17,7 @@ package com.inspur.edp.bff.designtime.generator.core.mgrimpl; +import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bef.bizentity.operation.BizOperation; import com.inspur.edp.bef.component.base.GspComponent; import com.inspur.edp.bef.component.detailcmpentity.bemgr.BEMgrComponent; @@ -24,6 +25,8 @@ import com.inspur.edp.bef.component.detailcmpentity.bemgr.BEMgrMethod; import com.inspur.edp.bef.component.detailcmpentity.bemgr.BEMgrMethodParameter; import com.inspur.edp.bff.designtime.generator.VmGeneratorContext; import com.inspur.edp.bff.designtime.generator.common.IMetadataPool; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.bff.spi.action.actionstatck.VoActionContext; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; @@ -31,7 +34,6 @@ import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.cef.api.RefObject; import com.inspur.edp.cef.core.entityaction.CefActionStack; import com.inspur.edp.cef.entity.changeset.Tuple; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.cef.generator.overall.Utils; import com.inspur.edp.formserver.viewmodel.action.MappedBizAction; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; @@ -69,10 +71,10 @@ public class BeActionMethodGenerator extends ClassMethodGenerator { @Override protected void doInitialize() { - bizMgrAction = vmGenCtx.getRefBizEntity().getBizMgrActions().getItem(action.getMapping().getTargetObjId()); + GspBusinessEntity refBizEntity = vmGenCtx.getRefBizEntity(); + bizMgrAction = refBizEntity.getBizMgrActions().getItem(action.getMapping().getTargetObjId()); if (bizMgrAction == null) { - throw new CefGenException( - "#GspBefError# 映射BE上没有找到对应的MgrAction:" + action.getCode() + "#GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0018,action.getCode(),refBizEntity.getCode()); } GspMetadata metadata = pool @@ -80,7 +82,7 @@ public class BeActionMethodGenerator extends ClassMethodGenerator { GspComponent comp = (GspComponent) metadata.getContent(); if (!comp.getComponentType().equals("BEMgrComponent")) { - throw new CefGenException("错误的类型"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0005,bizMgrAction.getComponentId(),bizMgrAction.getComponentPkgName(),comp.getComponentType()); } compMetadata = (BEMgrComponent) ((comp instanceof BEMgrComponent) ? comp : null); method = (BEMgrMethod)comp.getMethod(); diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/VmActionMethodGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/VmActionMethodGenerator.java index 0f387b33b881563d21c89e354840aec1175a6a3a..8c03b312d982ceed9f3bc2dbd4278c2570754aa7 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/VmActionMethodGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/mgrimpl/VmActionMethodGenerator.java @@ -22,11 +22,12 @@ import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethod; import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethodParameter; import com.inspur.edp.bff.designtime.generator.common.IMetadataPool; import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.cef.entity.changeset.Tuple; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.cef.generator.overall.Utils; import com.inspur.edp.formserver.viewmodel.action.MappedCdpAction; import com.inspur.edp.formserver.viewmodel.action.viewmodelbase.ViewModelParActualValue; @@ -66,8 +67,7 @@ public class VmActionMethodGenerator extends ClassMethodGenerator { compMetadata = (VMComponent) metadata.getContent(); if (compMetadata == null) { - throw new CefGenException( - "#GspBefError#VM动作构件【" + action.getComponentEntityId() + "】不存在#GspBefError# "); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0004,action.getCode(),action.getComponentEntityId(),action.getComponentPkgName()); } method = compMetadata.getVmMethod(); } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/propertymapper/GetBEPropNameMethodGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/propertymapper/GetBEPropNameMethodGenerator.java index fe78af2c5a07b37bc774608c6b4e5407b2623c5e..5d5d35082ed087594c4af3067bbd2cc6c04f9526 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/propertymapper/GetBEPropNameMethodGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/propertymapper/GetBEPropNameMethodGenerator.java @@ -17,12 +17,14 @@ package com.inspur.edp.bff.designtime.generator.core.propertymapper; import com.inspur.edp.bef.bizentity.GspBizEntityObject; +import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bff.api.dataprocessor.MapperBEPropertyInfo; import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.das.commonmodel.IGspCommonElement; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import com.inspur.edp.formserver.viewmodel.GspViewObject; @@ -60,10 +62,10 @@ public class GetBEPropNameMethodGenerator extends ClassMethodGenerator { } private void addBuildStatementByElement(Block block, GspViewModelElement item, String beType) { - GspBizEntityObject beNode = (GspBizEntityObject) coreGenContext.getVmGenContext() - .getRefBizEntity().findObjectById(item.getMapping().getTargetObjectId()); + GspBusinessEntity refBizEntity = coreGenContext.getVmGenContext().getRefBizEntity(); + GspBizEntityObject beNode = (GspBizEntityObject) refBizEntity.findObjectById(item.getMapping().getTargetObjectId()); if(beNode == null){ - throw new CefGenException("未找到["+item.getLabelID()+"]对应的BE节点"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0019,item.getLabelID(),refBizEntity.getCode(),item.getMapping().getTargetObjectId()); } MethodInvocation methodInvocation = ast.newMethodInvocation(); methodInvocation.setName(ast.newSimpleName("addBEPropertyNameFromVO")); @@ -78,7 +80,7 @@ public class GetBEPropNameMethodGenerator extends ClassMethodGenerator { StringLiteral par2_2 = ast.newStringLiteral(); IGspCommonElement beElement = beNode.findElement(item.getMapping().getTargetObjId()); if(beElement == null){ - throw new CefGenException("未找到["+item.getLabelID()+"]对应的be元素,对应节点为["+beNode.getCode()+"],be字段ID为["+item.getMapping().getTargetObjId()+"]"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0020,item.getLabelID(),refBizEntity.getCode(),beNode.getCode(),item.getMapping().getTargetObjId()); } par2_2.setLiteralValue(beElement.getLabelID()); par2.arguments().add(par2_2); diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefalutFilterConditionGenereator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefalutFilterConditionGenereator.java index d33d8e62ae5299ed48fa906921206a28a761b8ab..ba666e4d681a221f8d7405161d55f60b1965ec5e 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefalutFilterConditionGenereator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefalutFilterConditionGenereator.java @@ -25,7 +25,7 @@ import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.entity.condition.FilterCondition; import com.inspur.edp.cef.generator.overall.GeneratorUtil; import org.eclipse.jdt.core.dom.*; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefaultSortConditionGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefaultSortConditionGenerator.java index 7a1ea7d6d8e42bca59dba10eb11ff8f5bfd7b9a1..2e5fbd97f5c6bdd4c1a6b089cf95d9658eccaf2e 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefaultSortConditionGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/querycondition/VMDefaultSortConditionGenerator.java @@ -25,7 +25,7 @@ import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.entity.condition.SortCondition; import com.inspur.edp.cef.generator.overall.GeneratorUtil; import org.eclipse.jdt.core.dom.*; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/GetChildDeserConvertorGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/GetChildDeserConvertorGenerator.java index 59cc6293ff392f02cdc190bb8dfcda40865866da..88de21a2aa703f27c9a5cfa24cb0bd2e50cee2b2 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/GetChildDeserConvertorGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/GetChildDeserConvertorGenerator.java @@ -20,7 +20,7 @@ import com.inspur.edp.bef.generator.exception.BefGenerationException; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.gencommon.MediateType; import com.inspur.edp.cef.generator.coreGenerator.base.serializer.dataser.deserializer.EntityDataDeserGenCtx; import com.inspur.edp.cef.generator.overall.GeneratorUtil; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/JsonSerializerGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/JsonSerializerGenerator.java index 47f88e85f6aabcf82e22133172acf56ac43db7d6..594aec1335e3524963b594080e0a703c673f58df 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/JsonSerializerGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/dataconverter/method/JsonSerializerGenerator.java @@ -24,7 +24,7 @@ import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.caf.generator.utils.ExpressionUtils; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.entity.entity.ICefData; import com.inspur.edp.cef.gencommon.MediateType; import com.inspur.edp.cef.generator.overall.GeneratorUtil; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/entitygenerator/method/GetChildEntityGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/entitygenerator/method/GetChildEntityGenerator.java index b01b50cd9da75e4f34ea4e73c4bc4122495a17ba..551882cb4e458cd43ab114208b46da34416496cf 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/entitygenerator/method/GetChildEntityGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/entitygenerator/method/GetChildEntityGenerator.java @@ -24,7 +24,7 @@ import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; import com.inspur.edp.cef.api.dataType.entity.ICefEntity; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.generator.overall.GeneratorUtil; import com.inspur.edp.cef.generator.repository.RepositoryGenUtil; import org.eclipse.jdt.core.dom.*; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/assembler/method/BaseGetActionsGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/assembler/method/BaseGetActionsGenerator.java index b8fd9f85e4468fe0e973edb798a88fcb50055906..9b808d5fb72e0cbe37eb35e9680efcfeef5a2994 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/assembler/method/BaseGetActionsGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/assembler/method/BaseGetActionsGenerator.java @@ -20,10 +20,11 @@ package com.inspur.edp.bff.designtime.generator.core.rtgen.managergenerator.asse import com.inspur.edp.bef.component.detailcmpentity.vm.VMComponent; import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethod; import com.inspur.edp.bff.designtime.generator.core.VmCoreGenContext; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.action.MappedCdpAction; import com.inspur.edp.formserver.viewmodel.action.ViewModelAction; import com.inspur.edp.formserver.viewmodel.collection.VMActionCollection; @@ -136,7 +137,7 @@ public abstract class BaseGetActionsGenerator extends ClassMethodGenerator { MappedCdpAction mappedCdpAction = (MappedCdpAction) action; GspMetadata metadata = parentGenContext.getVmGenContext().getMetadataPool().getMetadata(mappedCdpAction.getComponentPkgName(), mappedCdpAction.getComponentEntityId()); if (metadata == null) - throw new CefGenException("未找到构件元数据[" + mappedCdpAction.getCode() + "],元数据id为" + mappedCdpAction.getComponentEntityId()); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0004,mappedCdpAction.getCode(),mappedCdpAction.getComponentEntityId() ,mappedCdpAction.getComponentPkgName()); VMComponent compMetadata = (VMComponent) metadata.getContent(); VMMethod method = compMetadata.getVmMethod(); return method.getClassName(); diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/CreateChildDataMethodGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/CreateChildDataMethodGenerator.java index d822fc2e6abc1a323e0d4e3cd80dd1fc7ea9d244..1ff1cfdcae7a22cce3b93676fad0f91d88346342 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/CreateChildDataMethodGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/CreateChildDataMethodGenerator.java @@ -24,7 +24,7 @@ import com.inspur.edp.bff.designtime.generator.core.rtgen.typeinfo.FSDataClassTy import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.compileunit.CompileUnitGeneratorContext; -import com.inspur.edp.cef.api.message.CefException; + import com.inspur.edp.cef.designtime.api.IGspCommonField; import com.inspur.edp.cef.designtime.api.element.GspElementObjectType; import com.inspur.edp.cef.entity.entity.IEntityData; diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/GetHelpConfigMethodGenerator.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/GetHelpConfigMethodGenerator.java index 6bb5400f26a34cef91f88d2e4651b0894ef8af47..89bb153c86f290d8e402d258f4e89ec69ab96cae 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/GetHelpConfigMethodGenerator.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/core/rtgen/managergenerator/mgrImplclass/methodgenerators/GetHelpConfigMethodGenerator.java @@ -18,17 +18,14 @@ package com.inspur.edp.bff.designtime.generator.core.rtgen.managergenerator.mgrI import com.inspur.edp.bef.component.detailcmpentity.vm.VMComponent; import com.inspur.edp.bef.component.detailcmpentity.vm.VMMethod; -import com.inspur.edp.bff.api.attribute.VMDataExtendAttribute; -import com.inspur.edp.bff.api.attribute.VMRootAttribute; import com.inspur.edp.bff.designtime.generator.core.rtgen.managergenerator.mgrImplclass.FSMgrImplGenContext; -import com.inspur.edp.bff.spi.IHelpMapping; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.bff.spi.VMHelpConfig; import com.inspur.edp.bff.spi.utils.ReflectInfo; import com.inspur.edp.caf.generator.baseInfo.ParameterInfo; import com.inspur.edp.caf.generator.baseInfo.TypeInfo; import com.inspur.edp.caf.generator.method.ClassMethodGenerator; -import com.inspur.edp.cef.gencommon.ReflectionUtils; -import com.inspur.edp.cef.generator.exception.CefGenException; import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.formserver.viewmodel.action.MappedCdpAction; import com.inspur.edp.formserver.viewmodel.action.ViewModelAction; @@ -299,7 +296,7 @@ public class GetHelpConfigMethodGenerator extends ClassMethodGenerator { String originalKey = config.getElementId(); //此ID分两段,用/区分 String[] info = originalKey.split("[/]", -1); if (info.length != 2) { - throw new CefGenException("ValueHelpConfig对象的ElementId字段不符合约定"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0021,originalKey); } String key = info[0] + info[1]; @@ -315,7 +312,7 @@ public class GetHelpConfigMethodGenerator extends ClassMethodGenerator { VMComponent compMetadata = (VMComponent) ((metadata.getContent() instanceof VMComponent) ? metadata.getContent() : null); if (compMetadata == null) { - throw new CefGenException("加载构件失败"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0022,action.getCode(),action.getComponentEntityId(),action.getComponentPkgName()); } List parameters = new ArrayList<>(); for(int i=0;i parameters = new ArrayList<>(); for(int i=0;i sections = new ArrayList<>(); var asso = voElement.getChildAssociations().get(0); for (var refElement : asso.getRefElementCollection()) { + IGspCommonField beElement = getBeElement( (GspViewModelElement) ((refElement instanceof GspViewModelElement) ? refElement : null)); - if(beElement == null) - throw new CefGenException(((GspViewObject)voElement.getBelongObject()).getBelongModel().getCode()+ - "中,关联字段"+voElement.getLabelID()+"的关联带出字段"+refElement.getLabelID() - +"对应的be带出字段不存在"); + if(beElement == null) { + GspViewObject belongObject = (GspViewObject) voElement.getBelongObject(); + IGspCommonModel belongModel = belongObject.getBelongModel(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0027, belongModel.getCode() ,belongObject.getCode(), voElement.getLabelID(), + refElement.getLabelID(),((GspViewModelElement)refElement).getMapping().getTargetElementId()); + } IGspCommonField udtRefElement = getUdtRefElement(refElement, udtAsso); var childValue = DotNetToJavaStringHelper.isNullOrEmpty(returnValue) ? beElement.getLabelID() : returnValue; @@ -249,7 +252,7 @@ public class TransFilterMethodGenerator extends ClassMethodGenerator { } } catch (Exception ex){ - throw new CefGenException("获取" + refElement.getLabelID() +" 对应的" + refElement.getUdtID() + "udt元数据失败"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0028,voElement.getCode(),voElement.getUdtID(),voElement.getUdtPkgName()); } sections.addAll(buildSection(refElement, childLabel, childValue)); } else { @@ -290,7 +293,7 @@ public class TransFilterMethodGenerator extends ClassMethodGenerator { var objId = voElement.getMapping().getTargetObjectId(); if(objId == null || "".equals(objId)) - throw new CefGenException("字段"+voElement.getCode()+"上没有记录映射对象Id,请打开vo设计器重新添加字段"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0029,voElement.getCode()); if (objId .equals( beObject.getID())) { return getBeElemet(voElement, beObject); } @@ -301,7 +304,7 @@ public class TransFilterMethodGenerator extends ClassMethodGenerator { var beObj = be.findObjectById(objId); if(beObj == null) - throw new CefGenException("be元数据"+be.getCode()+"上没有找到对象"+objId+",对应vo对象为"+voElement.getBelongObject().getCode()); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0030,voElement.getBelongObject().getCode(),voElement.getCode(),objId); return getBeElemet(voElement, beObj); } @@ -336,10 +339,10 @@ public class TransFilterMethodGenerator extends ClassMethodGenerator { if (udt.getDbInfo().getMappingType() == ColumnMapType.SingleColumn) { return null; } - IGspCommonField beElement = getBeElement( - (GspViewModelElement) ((voElement instanceof GspViewModelElement) ? voElement : null)); + GspViewModelElement vmElement= (GspViewModelElement) voElement ; + IGspCommonField beElement = getBeElement(vmElement); if (beElement == null) { - throw new CefGenException("没有找到字段" + voElement.getLabelID() + "的映射字段"); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0026, voElement.getLabelID(),beObject.getCode(), vmElement.getMapping().getTargetElementId()); } ArrayList statements = new ArrayList<>(); @@ -349,12 +352,14 @@ public class TransFilterMethodGenerator extends ClassMethodGenerator { var udtEleId = mapping.getValueInfo(); IGspCommonField beChildElement = getBeChildElement(beElement, beChildEleId); - + if (beChildElement == null) { + IGspCommonModel belongModel = beObject.getBelongModel(); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0031,belongModel.getCode(),beObject.getCode(),beElement.getCode(),beChildEleId); + } var udtElement = udt.findElement(udtEleId); - if (beChildElement == null || udtElement == null) { - throw new CefGenException( - "Vo" + vmObject.getBelongModel().getCode() + "编译失败,多值UDT" - + udt.getCode() + "数据库映射有异常"); + + if (udtElement == null) { + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_0032,udt.getCode(),udtEleId); } statements.addAll(buildUdtElementSection(voElement, udtElement, beChildElement, udt)); } diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmCoincidenceCheck.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmCoincidenceCheck.java index 51e4ecd59ae924e746e18dbac40abd47729ccdd8..dc1a5576b0afc8e6d2e245189da1476b79fa9d4f 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmCoincidenceCheck.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmCoincidenceCheck.java @@ -19,7 +19,9 @@ package com.inspur.edp.bff.designtime.generator.metadatacompile; import com.inspur.edp.bef.bizentity.GspBusinessEntity; import com.inspur.edp.bef.bizentity.operation.BizMgrAction; import com.inspur.edp.bef.bizentity.operation.BizOperation; -import com.inspur.edp.cef.generator.exception.CefGenException; +import com.inspur.edp.bff.designtime.generator.common.BffGeneratorResourceUtil; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorException; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.formserver.viewmodel.GspViewObject; @@ -28,8 +30,6 @@ import com.inspur.edp.formserver.viewmodel.action.ViewModelActionType; import com.inspur.edp.formserver.viewmodel.collection.VMActionCollection; import com.inspur.edp.jittojava.context.JitContext; import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; -import io.iec.edp.caf.commons.exception.CAFRuntimeException; -import io.iec.edp.caf.commons.exception.ExceptionLevel; import java.util.ArrayList; import java.util.HashMap; @@ -72,14 +72,15 @@ class VmCoincidenceCheck { || this.exceptionMessage.toString().length() == 0) { return; } - this.exceptionMessage.append(" 请重新打开VO保存!"); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1001); + this.exceptionMessage.append(message); // try{ // throw new CAFRuntimeException("", "0001", "VO和BE一致性校验异常,详细信息见控制台。", null, // ExceptionLevel.Error, true); // }catch (CAFRuntimeException e){ // throw new CefGenException(addNumExceptionMessage(this.exceptionMessage.toString()),e); // } - throw new CefGenException(addNumExceptionMessage(this.exceptionMessage.toString())); + throw new BffDtGeneratorException(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1000,addNumExceptionMessage(this.exceptionMessage.toString()),true); } private String addNumExceptionMessage(String message) { diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmElementCoincidenceCheck.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmElementCoincidenceCheck.java index c0cff669f7f1084a5d7fa643c64b641119da0517..86bf963a19a5b56c15a3f9f2607a87d371df2f2d 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmElementCoincidenceCheck.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmElementCoincidenceCheck.java @@ -18,11 +18,12 @@ package com.inspur.edp.bff.designtime.generator.metadatacompile; import com.inspur.edp.bef.bizentity.GspBizEntityObject; import com.inspur.edp.bef.bizentity.GspBusinessEntity; +import com.inspur.edp.bff.designtime.generator.common.BffGeneratorResourceUtil; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.cef.designtime.api.IGspCommonField; import com.inspur.edp.cef.designtime.api.element.GspAssociation; import com.inspur.edp.cef.designtime.api.element.GspElementObjectType; import com.inspur.edp.cef.designtime.api.element.GspEnumValue; -import com.inspur.edp.das.commonmodel.IGspCommonElement; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import com.inspur.edp.jittojava.context.JitContext; @@ -95,14 +96,16 @@ class VmElementCoincidenceCheck extends VmObjectCoincidenceCheck { //退出循环,查找下一vmItem } if (vmIndexFound == false) { - this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,"枚举值没找到,请检查!序号为: "+vmItem.getIndex())); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1002); + this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,message+vmItem.getIndex())); } } } protected void checkAssociation() { if (!beElement.getHasAssociation()) { - this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,"关联字段对应的BE上字段不是关联类型。")); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1003); + this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,message)); return; } for (GspAssociation vmAssoField : vmElement.getChildAssociations()) { @@ -111,7 +114,8 @@ class VmElementCoincidenceCheck extends VmObjectCoincidenceCheck { continue; } if (!(vmBringOutField instanceof GspViewModelElement)) { - this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,"关联带出字段类型异常。")); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1004); + this.exceptionMessage.append(CheckCoincidenceException.throwFieldAssociationException(viewModel,viewModelObject,vmElement,businessEntity,bizEntityObject, beElement,message)); continue; } checkMappingElement((GspViewModelElement) vmBringOutField); diff --git a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmObjectCoincidenceCheck.java b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmObjectCoincidenceCheck.java index dee5db47b5270fb3b984628ed9fe58e10b4b147d..60c26705b3575f741762501bc1931cfd61c873c0 100644 --- a/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmObjectCoincidenceCheck.java +++ b/bff-generator/src/main/java/com/inspur/edp/bff/designtime/generator/metadatacompile/VmObjectCoincidenceCheck.java @@ -18,11 +18,12 @@ package com.inspur.edp.bff.designtime.generator.metadatacompile; import com.inspur.edp.bef.bizentity.GspBizEntityObject; import com.inspur.edp.bef.bizentity.GspBusinessEntity; +import com.inspur.edp.bff.designtime.generator.common.BffGeneratorResourceUtil; +import com.inspur.edp.bff.designtime.generator.exception.BffDtGeneratorExceptionCodes; import com.inspur.edp.cef.designtime.api.IGspCommonField; import com.inspur.edp.das.commonmodel.IGspCommonElement; import com.inspur.edp.das.commonmodel.IGspCommonObject; import com.inspur.edp.das.commonmodel.collection.GspElementCollection; -import com.inspur.edp.formserver.viewmodel.GspViewModel; import com.inspur.edp.formserver.viewmodel.GspViewModelElement; import com.inspur.edp.formserver.viewmodel.GspViewObject; import com.inspur.edp.formserver.viewmodel.collection.VMElementCollection; @@ -86,12 +87,14 @@ class VmObjectCoincidenceCheck extends VmCoincidenceCheck { protected IGspCommonElement getRelativeBeElement(IGspCommonField vmElement, GspBizEntityObject bizEntityObject) { if (!(vmElement instanceof GspViewModelElement)) { - this.exceptionMessage.append(CheckCoincidenceException.throwElementException(this.viewModel,this.viewModelObject,vmElement,"数据类型异常")); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1005); + this.exceptionMessage.append(CheckCoincidenceException.throwElementException(this.viewModel,this.viewModelObject,vmElement,message)); return null; } String targetElementId = ((GspViewModelElement) vmElement).getMapping().getTargetElementId(); if (bizEntityObject.findElement(targetElementId) == null) { - this.exceptionMessage.append(CheckCoincidenceException.throwElementException(this.viewModel,this.viewModelObject,vmElement,"在BE上没有找到VO字段对应的BE字段")); + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1006); + this.exceptionMessage.append(CheckCoincidenceException.throwElementException(this.viewModel,this.viewModelObject,vmElement,message)); return null; } return bizEntityObject.findElement(targetElementId); @@ -118,16 +121,18 @@ class VmObjectCoincidenceCheck extends VmCoincidenceCheck { protected void checkMappingElement(GspViewModelElement vmField) { if (vmField.getMapping() == null) { + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1007); this.exceptionMessage.append(CheckCoincidenceException - .throwElementException(this.viewModel,this.viewModelObject,vmField,"VO字段无法找到对应的BE字段!")); + .throwElementException(this.viewModel,this.viewModelObject,vmField,message)); return; } GspBusinessEntity businessEntity = getBizEntityByMetadataId( vmField.getMapping().getTargetMetadataId(),this.viewModelObject); if (businessEntity == null) { + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1007); this.exceptionMessage.append(CheckCoincidenceException - .throwElementException(this.viewModel,this.viewModelObject,vmField,"VO字段无法找到对应的BE字段!")); + .throwElementException(this.viewModel,this.viewModelObject,vmField,message)); return; } @@ -135,16 +140,18 @@ class VmObjectCoincidenceCheck extends VmCoincidenceCheck { .findObjectById(vmField.getMapping().getTargetObjectId()); if (findObject == null || !(findObject instanceof GspBizEntityObject)) { + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1007); this.exceptionMessage.append(CheckCoincidenceException - .throwElementException(this.viewModel,this.viewModelObject,vmField,"VO字段无法找到对应的BE字段")); + .throwElementException(this.viewModel,this.viewModelObject,vmField,message)); return; } IGspCommonElement commonElement = findObject .findElement(vmField.getMapping().getTargetElementId()); if (commonElement == null) { + String message= BffGeneratorResourceUtil.getResourceValue(BffDtGeneratorExceptionCodes.GSP_BFF_DTGENERATOR_1007); this.exceptionMessage.append(CheckCoincidenceException - .throwElementException(this.viewModel,this.viewModelObject,vmField,"VO字段无法找到对应的BE字段")); + .throwElementException(this.viewModel,this.viewModelObject,vmField,message)); return; } VmElementCoincidenceCheck vmElementCheck = new VmElementCoincidenceCheck(this.jitContext, diff --git a/i18nresource/bff_dtgenerator_exception.properties b/i18nresource/bff_dtgenerator_exception.properties new file mode 100644 index 0000000000000000000000000000000000000000..22ea0b251856d389b3e077ce74c6c578817f8986 --- /dev/null +++ b/i18nresource/bff_dtgenerator_exception.properties @@ -0,0 +1,39 @@ +GSP_BFF_DTGENERATOR_0001=\u6DFB\u52A0\u89C6\u56FE\u5BF9\u8C61\u5F15\u7528\u7684\u5143\u6570\u636E\u65F6\uFF0C\u89C6\u56FE\u5BF9\u8C61[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u7F16\u53F7:{1}\uFF0C\u540D\u79F0{2}]\u5F15\u7528\u7684\u5143\u6570\u636E[\u5143\u6570\u636EID\uFF1A{3}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0002=\u89C6\u56FE\u5BF9\u8C61[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u7F16\u53F7:{1}\uFF0C\u540D\u79F0{2}]\u5F15\u7528\u7684\u4E1A\u52A1\u5B57\u6BB5\u5143\u6570\u636E[\u5143\u6570\u636EID\uFF1A{3}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0003=\u89C6\u56FE\u5BF9\u8C61[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u7F16\u53F7:{1}\uFF0C\u540D\u79F0{2}]\u4E0A\u7684\u4E1A\u52A1\u5B9E\u4F53\u6620\u5C04\u64CD\u4F5C[{3}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u4E0A[{4}]\u64CD\u4F5C[{5}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0004=\u672A\u83B7\u53D6\u5230\u89C6\u56FE\u5BF9\u8C61\u64CD\u4F5C[{0}]\u5BF9\u5E94\u7684\u6784\u4EF6[\u552F\u4E00\u6807\u8BC6\uFF1A{1}\uFF0C\u5305\u540D\u79F0\uFF1A{2}]\u5143\u6570\u636E\u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0005=\u83B7\u53D6\u5230\u7684\u4E1A\u52A1\u5B9E\u4F53\u6620\u5C04\u64CD\u4F5C\u6784\u4EF6\u5143\u6570\u636E[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u5305\u540D\u79F0\uFF1A{1}]\u7C7B\u578B[{2}]\u4E0D\u662F\u81EA\u5B9A\u4E49\u52A8\u4F5C\u7C7B\u578B[BEMgrComponent]\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0006=\u89C6\u56FE\u5BF9\u8C61\u64CD\u4F5C\u6784\u4EF6\u5143\u6570\u636E[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u5305\u540D\u79F0\uFF1A{1}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0007=\u83B7\u53D6\u5230\u7684\u89C6\u56FE\u5BF9\u8C61\u64CD\u4F5C\u6784\u4EF6\u5143\u6570\u636E\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u5305\u540D\u79F0\uFF1A{1}\u7C7B\u578B[{2}]\u4E0D\u662F\u89C6\u56FE\u5BF9\u8C61\u64CD\u4F5C\u7C7B\u578B[VMComponent]\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0008=\u89C6\u56FE\u5BF9\u8C61[\u552F\u4E00\u6807\u8BC6\uFF1A{0}\uFF0C\u7F16\u53F7:{1}\uFF0C\u540D\u79F0{2}]\u4E0A\u5BF9\u8C61[{3}]\u8BBE\u7F6E\u7684\u6392\u5E8F\u5B57\u6BB5[{4}]\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0009=\u89C6\u56FE\u5BF9\u8C61[{0}]\u4E0A\u5BF9\u8C61[{1}]\u8BBE\u7F6E\u7684\u6392\u5E8F\u6761\u4EF6\u683C\u5F0F[{2}]\u4E0D\u6B63\u786E\uFF0C\u5BFC\u81F4\u89E3\u6790\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0010=\u5BF9\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u8BB0\u5F55\u7684\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u7684\u5B57\u6BB5\u4FE1\u606F\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0011=\u5B57\u6BB5\u5BF9\u8C61\u7C7B\u578B\u4E0D\u652F\u6301[{0}]\u7684\u7C7B\u578B\u3002 +GSP_BFF_DTGENERATOR_0012=\u672A\u83B7\u53D6\u5230\u89C6\u56FE\u5BF9\u8C61[{0}]\u4E0A\u5173\u8054\u5E26\u51FA\u5B57\u6BB5[{1}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53[{2}]\u5B57\u6BB5[{3}]\u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0013=\u6784\u4EF6\u7C7B[{0}]\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8BE5\u7C7B\u662F\u5426\u5B58\u5728\u3002 +GSP_BFF_DTGENERATOR_0014=\u89C6\u56FE\u5BF9\u8C61\u64CD\u4F5C[{0}]\u5BF9\u5E94\u7684\u6784\u4EF6[\u552F\u4E00\u6807\u8BC6\uFF1A{1}\uFF0C\u7F16\u53F7\uFF1A{2}]\u5143\u6570\u636E\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0015=\u89C6\u56FE\u5BF9\u8C61\u6269\u5C55\u64CD\u4F5C\u4E0D\u652F\u6301[{0}]\u7684\u7C7B\u578B\u3002 +GSP_BFF_DTGENERATOR_0016=\u89C6\u56FE\u5BF9\u8C61[{0}]\u4E2D\u7C7B\u578B\u4E3A[{1}\u7684\u6269\u5C55\u64CD\u4F5C[{2}]\u5BF9\u5E94\u7684\u6784\u4EF6\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0017=\u89C6\u56FE\u5BF9\u8C61[{0}]\u4E2D\u7C7B\u578B\u4E3A[{1}\u7684\u6269\u5C55\u64CD\u4F5C[{2}]\u7C7B\u578B[{3}]\u4E0E\u5BF9\u5F53\u524D\u4F20\u5165\u7684\u7C7B\u578B[{4}]\u4E0D\u5339\u914D,\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0018=\u4E1A\u52A1\u5B9E\u4F53\u6620\u5C04\u64CD\u4F5C[{0}]\u8BB0\u5F55\u7684\u4E1A\u52A1\u5B9E\u4F53[{1}]\u4E0A\u7684\u64CD\u4F5C\u672A\u5339\u914D\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0019=\u5B57\u6BB5[{0}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53[{1}]\u5BF9\u8C61\u4FE1\u606F[{2}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0020=\u5B57\u6BB5[{0}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53[{1}]\u5BF9\u8C61[{2}]\u4E0A\u7684\u5B57\u6BB5[{3}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0021=\u5E2E\u52A9\u914D\u7F6E\u8BBE\u7F6E\u7684ElementId\u4FE1\u606F[{0}]\u683C\u5F0F\u4E0D\u5BF9\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0022=\u5E2E\u52A9\u524D\u4E8B\u4EF6[{0}]\u5BF9\u5E94\u7684\u6784\u4EF6\u5143\u6570\u636E[\u552F\u4E00\u6807\u8BC6\uFF1A{1}\uFF0C\u5305\u540D\u79F0\uFF1A{2}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0023=\u89C6\u56FE\u5BF9\u8C61\u4E0D\u652F\u6301\u7C7B\u578B\u4E3A[{0}]\u7684\u6570\u636E\u6E90\u7C7B\u578B\u3002 +GSP_BFF_DTGENERATOR_0024=\u5B57\u6BB5\u4E0D\u652F\u6301[{0}]\u7684\u6570\u636E\u7C7B\u578B\u3002 +GSP_BFF_DTGENERATOR_0025=\u89C6\u56FE\u5BF9\u8C61[{0}]\u7684\u5BF9\u8C61[{1}]\u4E0A\u4E0D\u5B58\u5728\u4E3B\u952E\u5B57\u6BB5\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0026=\u5B57\u6BB5[{0}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u5BF9\u8C61[{1}]\u4E0A\u5B57\u6BB5[2}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0027=\u89C6\u56FE\u5BF9\u8C61[{0}]\u5BF9\u8C61[{1}]\u4E0A\u5173\u8054\u5B57\u6BB5[{2}]\u7684\u5E26\u51FA\u5B57\u6BB5[{3}]\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u5B57\u6BB5[{4}]\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0028=\u5B57\u6BB5[{0}]\u5F15\u7528\u7684\u4E1A\u52A1\u5B57\u6BB5[\u552F\u4E00\u6807\u8BC6\uFF1A{1}\uFF0C\u5305\u540D\u79F0\uFF1A{2}]\u5143\u6570\u636E\u672A\u83B7\u53D6\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0029=\u5B57\u6BB5[{0}]\u8BB0\u5F55\u7684\u4E1A\u52A1\u5B9E\u4F53\u5B57\u6BB5\u4FE1\u606F\u4E3A\u7A7A\uFF0C\u8BF7\u91CD\u65B0\u4FDD\u5B58\u6216\u8005\u5220\u9664\u5B57\u6BB5\u91CD\u65B0\u6DFB\u52A0\u3002 +GSP_BFF_DTGENERATOR_0030=\u5BF9\u8C61[{0}]\u4E0A\u89C6\u56FE\u5B57\u6BB5[{1}]\u8BB0\u5F55\u7684\u4E1A\u52A1\u5B9E\u4F53\u5BF9\u8C61[{2}]\u4FE1\u606F\u672A\u83B7\u53D6\u5230,\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0031=\u4E1A\u52A1\u5B9E\u4F53[{0}]\u5BF9\u8C61[{1}]\u4E0A\u5B57\u6BB5[{2}]\u8BB0\u5F55\u7684\u4E1A\u52A1\u5B57\u6BB5\u4FE1\u606F[{3}]\u4E3A\u5339\u914D\u5230\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_0032=\u4E1A\u52A1\u5B57\u6BB5[{0}]\u5143\u6570\u636E\u4E0A\u4E0D\u5B58\u5728ID\u4E3A[{1}]\u7684\u5B57\u6BB5\uFF0C\u8BF7\u68C0\u67E5\u3002 +GSP_BFF_DTGENERATOR_1001= \u8BF7\u91CD\u65B0\u6253\u5F00\u89C6\u56FE\u5BF9\u8C61\u4FDD\u5B58\uFF01 +GSP_BFF_DTGENERATOR_1002=\u679A\u4E3E\u503C\u6CA1\u627E\u5230\uFF0C\u8BF7\u68C0\u67E5\uFF01\u5E8F\u53F7\u4E3A\uFF1A +GSP_BFF_DTGENERATOR_1003=\u5173\u8054\u5B57\u6BB5\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u5B57\u6BB5\u4E0D\u662F\u5173\u8054\u7C7B\u578B\u3002 +GSP_BFF_DTGENERATOR_1004=\u5173\u8054\u5E26\u51FA\u5B57\u6BB5\u7C7B\u578B\u5F02\u5E38\u3002 +GSP_BFF_DTGENERATOR_1005=\u6570\u636E\u7C7B\u578B\u5F02\u5E38 +GSP_BFF_DTGENERATOR_1006=\u5728\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u6CA1\u6709\u627E\u5230\u89C6\u56FE\u5BF9\u8C61\u5B57\u6BB5\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u5B57\u6BB5 +GSP_BFF_DTGENERATOR_1007=\u89C6\u56FE\u5BF9\u8C61\u5B57\u6BB5\u65E0\u6CD5\u627E\u5230\u5BF9\u5E94\u7684\u4E1A\u52A1\u5B9E\u4F53\u5B57\u6BB5\uFF01 diff --git a/i18nresource/en/bff_dtgenerator_exception.en.properties b/i18nresource/en/bff_dtgenerator_exception.en.properties new file mode 100644 index 0000000000000000000000000000000000000000..e91a495bef00278eece0bcbedb02db6cc74bb8b5 --- /dev/null +++ b/i18nresource/en/bff_dtgenerator_exception.en.properties @@ -0,0 +1,39 @@ +GSP_BFF_DTGENERATOR_0001=Failed to retrieve metadata referenced by view object [ID: {0}, Code: {1}, Name: {2}] for metadata [ID: {3}], please check. +GSP_BFF_DTGENERATOR_0002=Failed to retrieve business field metadata [ID: {3}] referenced by view object [ID: {0}, Code: {1}, Name: {2}], please check. +GSP_BFF_DTGENERATOR_0003=Failed to retrieve the business entity operation [{5}] corresponding to the business entity [{3}] mapping operation [{4}] on view object [ID: {0}, Code: {1}, Name: {2}], please check. +GSP_BFF_DTGENERATOR_0004=Failed to retrieve the component metadata [ID: {1}, Package Name: {2}] corresponding to view object operation [{0}], please check. +GSP_BFF_DTGENERATOR_0005=The retrieved business entity mapping operation component metadata [ID: {0}, Package Name: {1}] has a type [{2}] that is not the custom action type [BEMgrComponent], please check. +GSP_BFF_DTGENERATOR_0006=Failed to retrieve the view object operation component metadata [ID: {0}, Package Name: {1}], please check. +GSP_BFF_DTGENERATOR_0007=The retrieved view object operation component metadata with ID: {0}, Package Name: {1} has a type [{2}] that is not the view object operation type [VMComponent], please check. +GSP_BFF_DTGENERATOR_0008=The sorting field [{4}] set for object [{3}] on view object [ID: {0}, Code: {1}, Name: {2}] does not exist, please check. +GSP_BFF_DTGENERATOR_0009=The sorting condition format [{2}] set for object [{1}] on view object [{0}] is incorrect, resulting in parsing failure, please check. +GSP_BFF_DTGENERATOR_0010=The business entity field information recorded for field [{1}] on object [{0}] is empty, please check. +GSP_BFF_DTGENERATOR_0011=Unsupported field object type [{0}]. +GSP_BFF_DTGENERATOR_0012=Failed to retrieve the business entity [{2}] field [{3}] information corresponding to the associated carried-out field [{1}] on view object [{0}], please check. +GSP_BFF_DTGENERATOR_0013=Failed to load component class [{0}], please check if the class exists. +GSP_BFF_DTGENERATOR_0014=Failed to retrieve the component metadata [ID: {1}, Code: {2}] corresponding to view object operation [{0}], please check. +GSP_BFF_DTGENERATOR_0015=Unsupported type [{0}] for view object extension operation. +GSP_BFF_DTGENERATOR_0016=The component corresponding to the extension operation [{2}] of type [{1}] in view object [{0}] was not retrieved, please check. +GSP_BFF_DTGENERATOR_0017=The type [{3}] of the extension operation [{2}] of type [{1}] in view object [{0}] does not match the currently passed type [{4}], please check. +GSP_BFF_DTGENERATOR_0018=The operation on the business entity [{1}] recorded for business entity mapping operation [{0}] was not matched, please check. +GSP_BFF_DTGENERATOR_0019=Failed to retrieve the business entity [{1}] object information [{2}] corresponding to field [{0}], please check. +GSP_BFF_DTGENERATOR_0020=Failed to retrieve the field [{3}] on the business entity [{1}] object [{2}] corresponding to field [{0}], please check. +GSP_BFF_DTGENERATOR_0021=The ElementId information [{0}] set for help configuration has an incorrect format, please check. +GSP_BFF_DTGENERATOR_0022=Failed to retrieve the component metadata [ID: {1}, Package Name: {2}] corresponding to the help pre-event [{0}], please check. +GSP_BFF_DTGENERATOR_0023=View object does not support data source type [{0}]. +GSP_BFF_DTGENERATOR_0024=Field does not support data type [{0}]. +GSP_BFF_DTGENERATOR_0025=No primary key field exists on object [{1}] of view object [{0}], please check. +GSP_BFF_DTGENERATOR_0026=Failed to retrieve the field [{2}] on the business entity object [{1}] corresponding to field [{0}], please check. +GSP_BFF_DTGENERATOR_0027=Failed to retrieve the business entity field [{4}] corresponding to the carried-out field [{3}] of the associated field [{2}] on object [{1}] of view object [{0}], please check. +GSP_BFF_DTGENERATOR_0028=Failed to retrieve the business field metadata [ID: {1}, Package Name: {2}] referenced by field [{0}], please check. +GSP_BFF_DTGENERATOR_0029=The business entity field information recorded for field [{0}] is empty, please save again or delete and re-add the field. +GSP_BFF_DTGENERATOR_0030=Failed to retrieve the business entity object [{2}] information recorded for view field [{1}] on object [{0}], please check. +GSP_BFF_DTGENERATOR_0031=The business field information [{3}] recorded for field [{2}] on business entity [{0}] object [{1}] was not matched, please check. +GSP_BFF_DTGENERATOR_0032=There is no field with ID [{1}] exists on the business field [{0}] metadata, please check. +GSP_BFF_DTGENERATOR_1001= Please reopen the view object to save! +GSP_BFF_DTGENERATOR_1002=Enumeration value not found, please check! The sequence Code is: +GSP_BFF_DTGENERATOR_1003=The field on the associated business entity is not of association type. +GSP_BFF_DTGENERATOR_1004=Exception in the type of associated carried-out field. +GSP_BFF_DTGENERATOR_1005=Data type exception +GSP_BFF_DTGENERATOR_1006=Unable to find the business entity field corresponding to the view object field on the business entity +GSP_BFF_DTGENERATOR_1007=Unable to find the corresponding business entity field for the view object field! \ No newline at end of file diff --git a/i18nresource/zh-CHT/bff_dtgenerator_exception.zh-CHT.properties b/i18nresource/zh-CHT/bff_dtgenerator_exception.zh-CHT.properties new file mode 100644 index 0000000000000000000000000000000000000000..ac5cbb4df623bf3248085c76765cfb6ecb5bb440 --- /dev/null +++ b/i18nresource/zh-CHT/bff_dtgenerator_exception.zh-CHT.properties @@ -0,0 +1,39 @@ +GSP_BFF_DTGENERATOR_0001=\u6DFB\u52A0\u8996\u5716\u5C0D\u8C61\u5F15\u7528\u7684\u5143\u6578\u64DA\u6642\uFF0C\u8996\u5716\u5C0D\u8C61[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u7DE8\u865F:{1}\uFF0C\u540D\u7A31{2}]\u5F15\u7528\u7684\u5143\u6578\u64DA[\u5143\u6578\u64DAID\uFF1A{3}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0002=\u8996\u5716\u5C0D\u8C61[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u7DE8\u865F:{1}\uFF0C\u540D\u7A31{2}]\u5F15\u7528\u7684\u696D\u52D9\u5B57\u6BB5\u5143\u6578\u64DA[\u5143\u6578\u64DAID\uFF1A{3}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0003=\u8996\u5716\u5C0D\u8C61[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u7DE8\u865F:{1}\uFF0C\u540D\u7A31{2}]\u4E0A\u7684\u696D\u52D9\u5BE6\u9AD4\u6620\u5C04\u64CD\u4F5C[{3}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u4E0A[{4}]\u64CD\u4F5C[{5}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0004=\u672A\u7372\u53D6\u5230\u8996\u5716\u5C0D\u8C61\u64CD\u4F5C[{0}]\u5C0D\u61C9\u7684\u69CB\u4EF6[\u552F\u4E00\u6A19\u8B58\uFF1A{1}\uFF0C\u5305\u540D\u7A31\uFF1A{2}]\u5143\u6578\u64DA\u4FE1\u606F\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0005=\u7372\u53D6\u5230\u7684\u696D\u52D9\u5BE6\u9AD4\u6620\u5C04\u64CD\u4F5C\u69CB\u4EF6\u5143\u6578\u64DA[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u5305\u540D\u7A31\uFF1A{1}]\u985E\u578B[{2}]\u4E0D\u662F\u81EA\u5B9A\u7FA9\u52D5\u4F5C\u985E\u578B[BEMgrComponent]\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0006=\u8996\u5716\u5C0D\u8C61\u64CD\u4F5C\u69CB\u4EF6\u5143\u6578\u64DA[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u5305\u540D\u7A31\uFF1A{1}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0007=\u7372\u53D6\u5230\u7684\u8996\u5716\u5C0D\u8C61\u64CD\u4F5C\u69CB\u4EF6\u5143\u6578\u64DA\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u5305\u540D\u7A31\uFF1A{1}\u985E\u578B[{2}]\u4E0D\u662F\u8996\u5716\u5C0D\u8C61\u64CD\u4F5C\u985E\u578B[VMComponent]\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0008=\u8996\u5716\u5C0D\u8C61[\u552F\u4E00\u6A19\u8B58\uFF1A{0}\uFF0C\u7DE8\u865F:{1}\uFF0C\u540D\u7A31{2}]\u4E0A\u5C0D\u8C61[{3}]\u8A2D\u7F6E\u7684\u6392\u5E8F\u5B57\u6BB5[{4}]\u4E0D\u5B58\u5728\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0009=\u8996\u5716\u5C0D\u8C61[{0}]\u4E0A\u5C0D\u8C61[{1}]\u8A2D\u7F6E\u7684\u6392\u5E8F\u689D\u4EF6\u683C\u5F0F[{2}]\u4E0D\u6B63\u78BA\uFF0C\u5C0E\u81F4\u89E3\u6790\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0010=\u5C0D\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u8A18\u9304\u7684\u696D\u52D9\u5BE6\u9AD4\u4E0A\u7684\u5B57\u6BB5\u4FE1\u606F\u70BA\u7A7A\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0011=\u5B57\u6BB5\u5C0D\u8C61\u985E\u578B\u4E0D\u652F\u6301[{0}]\u7684\u985E\u578B\u3002 +GSP_BFF_DTGENERATOR_0012=\u672A\u7372\u53D6\u5230\u8996\u5716\u5C0D\u8C61[{0}]\u4E0A\u95DC\u806F\u5E36\u51FA\u5B57\u6BB5[{1}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4[{2}]\u5B57\u6BB5[{3}]\u4FE1\u606F\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0013=\u69CB\u4EF6\u985E[{0}]\u52A0\u8F09\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u8A72\u985E\u662F\u5426\u5B58\u5728\u3002 +GSP_BFF_DTGENERATOR_0014=\u8996\u5716\u5C0D\u8C61\u64CD\u4F5C[{0}]\u5C0D\u61C9\u7684\u69CB\u4EF6[\u552F\u4E00\u6A19\u8B58\uFF1A{1}\uFF0C\u7DE8\u865F\uFF1A{2}]\u5143\u6578\u64DA\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0015=\u8996\u5716\u5C0D\u8C61\u64F4\u5C55\u64CD\u4F5C\u4E0D\u652F\u6301[{0}]\u7684\u985E\u578B\u3002 +GSP_BFF_DTGENERATOR_0016=\u8996\u5716\u5C0D\u8C61[{0}]\u4E2D\u985E\u578B\u70BA[{1}\u7684\u64F4\u5C55\u64CD\u4F5C[{2}]\u5C0D\u61C9\u7684\u69CB\u4EF6\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0017=\u8996\u5716\u5C0D\u8C61[{0}]\u4E2D\u985E\u578B\u70BA[{1}\u7684\u64F4\u5C55\u64CD\u4F5C[{2}]\u985E\u578B[{3}]\u8207\u5C0D\u7576\u524D\u50B3\u5165\u7684\u985E\u578B[{4}]\u4E0D\u5339\u914D,\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0018=\u696D\u52D9\u5BE6\u9AD4\u6620\u5C04\u64CD\u4F5C[{0}]\u8A18\u9304\u7684\u696D\u52D9\u5BE6\u9AD4[{1}]\u4E0A\u7684\u64CD\u4F5C\u672A\u5339\u914D\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0019=\u5B57\u6BB5[{0}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4[{1}]\u5C0D\u8C61\u4FE1\u606F[{2}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0020=\u5B57\u6BB5[{0}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4[{1}]\u5C0D\u8C61[{2}]\u4E0A\u7684\u5B57\u6BB5[{3}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0021=\u5E6B\u52A9\u914D\u7F6E\u8A2D\u7F6E\u7684ElementId\u4FE1\u606F[{0}]\u683C\u5F0F\u4E0D\u5C0D\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0022=\u5E6B\u52A9\u524D\u4E8B\u4EF6[{0}]\u5C0D\u61C9\u7684\u69CB\u4EF6\u5143\u6578\u64DA[\u552F\u4E00\u6A19\u8B58\uFF1A{1}\uFF0C\u5305\u540D\u7A31\uFF1A{2}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0023=\u8996\u5716\u5C0D\u8C61\u4E0D\u652F\u6301\u985E\u578B\u70BA[{0}]\u7684\u6578\u64DA\u6E90\u985E\u578B\u3002 +GSP_BFF_DTGENERATOR_0024=\u5B57\u6BB5\u4E0D\u652F\u6301[{0}]\u7684\u6578\u64DA\u985E\u578B\u3002 +GSP_BFF_DTGENERATOR_0025=\u8996\u5716\u5C0D\u8C61[{0}]\u7684\u5C0D\u8C61[{1}]\u4E0A\u4E0D\u5B58\u5728\u4E3B\u9375\u5B57\u6BB5\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0026=\u5B57\u6BB5[{0}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u5C0D\u8C61[{1}]\u4E0A\u5B57\u6BB5[2}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0027=\u8996\u5716\u5C0D\u8C61[{0}]\u5C0D\u8C61[{1}]\u4E0A\u95DC\u806F\u5B57\u6BB5[{2}]\u7684\u5E36\u51FA\u5B57\u6BB5[{3}]\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u5B57\u6BB5[{4}]\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0028=\u5B57\u6BB5[{0}]\u5F15\u7528\u7684\u696D\u52D9\u5B57\u6BB5[\u552F\u4E00\u6A19\u8B58\uFF1A{1}\uFF0C\u5305\u540D\u7A31\uFF1A{2}]\u5143\u6578\u64DA\u672A\u7372\u53D6\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0029=\u5B57\u6BB5[{0}]\u8A18\u9304\u7684\u696D\u52D9\u5BE6\u9AD4\u5B57\u6BB5\u4FE1\u606F\u70BA\u7A7A\uFF0C\u8ACB\u91CD\u65B0\u4FDD\u5B58\u6216\u8005\u522A\u9664\u5B57\u6BB5\u91CD\u65B0\u6DFB\u52A0\u3002 +GSP_BFF_DTGENERATOR_0030=\u5C0D\u8C61[{0}]\u4E0A\u8996\u5716\u5B57\u6BB5[{1}]\u8A18\u9304\u7684\u696D\u52D9\u5BE6\u9AD4\u5C0D\u8C61[{2}]\u4FE1\u606F\u672A\u7372\u53D6\u5230,\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0031=\u696D\u52D9\u5BE6\u9AD4[{0}]\u5C0D\u8C61[{1}]\u4E0A\u5B57\u6BB5[{2}]\u8A18\u9304\u7684\u696D\u52D9\u5B57\u6BB5\u4FE1\u606F[{3}]\u70BA\u5339\u914D\u5230\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_0032=\u696D\u52D9\u5B57\u6BB5[{0}]\u5143\u6578\u64DA\u4E0A\u4E0D\u5B58\u5728ID\u70BA[{1}]\u7684\u5B57\u6BB5\uFF0C\u8ACB\u6AA2\u67E5\u3002 +GSP_BFF_DTGENERATOR_1001= \u8ACB\u91CD\u65B0\u6253\u958B\u8996\u5716\u5C0D\u8C61\u4FDD\u5B58\uFF01 +GSP_BFF_DTGENERATOR_1002=\u679A\u8209\u503C\u6C92\u627E\u5230\uFF0C\u8ACB\u6AA2\u67E5\uFF01\u5E8F\u865F\u70BA\uFF1A +GSP_BFF_DTGENERATOR_1003=\u95DC\u806F\u5B57\u6BB5\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u4E0A\u5B57\u6BB5\u4E0D\u662F\u95DC\u806F\u985E\u578B\u3002 +GSP_BFF_DTGENERATOR_1004=\u95DC\u806F\u5E36\u51FA\u5B57\u6BB5\u985E\u578B\u7570\u5E38\u3002 +GSP_BFF_DTGENERATOR_1005=\u6578\u64DA\u985E\u578B\u7570\u5E38 +GSP_BFF_DTGENERATOR_1006=\u5728\u696D\u52D9\u5BE6\u9AD4\u4E0A\u6C92\u6709\u627E\u5230\u8996\u5716\u5C0D\u8C61\u5B57\u6BB5\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u5B57\u6BB5 +GSP_BFF_DTGENERATOR_1007=\u8996\u5716\u5C0D\u8C61\u5B57\u6BB5\u7121\u6CD5\u627E\u5230\u5C0D\u61C9\u7684\u696D\u52D9\u5BE6\u9AD4\u5B57\u6BB5\uFF01