From d7eccce91e009cfcb6a155ed8826d87cabdab288 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Thu, 13 Oct 2022 16:12:37 +0800 Subject: [PATCH 01/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit switch-case方法增加default --- .../vmmanager/helpconfig/HelpConfigFilterSortHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/helpconfig/HelpConfigFilterSortHandler.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/helpconfig/HelpConfigFilterSortHandler.java index 6f6f0ae..15b3297 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/helpconfig/HelpConfigFilterSortHandler.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/helpconfig/HelpConfigFilterSortHandler.java @@ -116,6 +116,7 @@ public class HelpConfigFilterSortHandler { case SORT_CONDITION_PROPERTY: para.getActualValue().setValue(newSortCondition); break; + default: } }); } @@ -151,6 +152,7 @@ public class HelpConfigFilterSortHandler { case SORT_CONDITION_PROPERTY: para.getActualValue().setValue(newSortCondition); break; + default: } }); } -- Gitee From 05c09dcea24c2440ac74c66490531752d1f17c2a Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Thu, 13 Oct 2022 16:42:03 +0800 Subject: [PATCH 02/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去除冗余注释代码 --- .../BffMetadataRtEventListener.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/metadataeventlistener/BffMetadataRtEventListener.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/metadataeventlistener/BffMetadataRtEventListener.java index 8220181..cd29399 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/metadataeventlistener/BffMetadataRtEventListener.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/metadataeventlistener/BffMetadataRtEventListener.java @@ -48,26 +48,6 @@ public class BffMetadataRtEventListener implements IMetadataRtEventListener { } private static final Logger logger = LoggerFactory.getLogger(BffMetadataRtEventListener.class); @Override public void fireGeneratedMetadataSavedEvent(MetadataRtEventArgs args) { -// GspMetadata metadata=args.getMetadata(); -// if(metadata.getContent() instanceof GspBusinessEntity){ -// -// GspVoExtendInfoService service= SpringBeanUtils.getBean(GspVoExtendInfoService.class); -// -// CustomizationService customizationService=SpringBeanUtils.getBean(CustomizationService.class); -// -// GspBusinessEntity businessEntity= (GspBusinessEntity) metadata.getContent(); -// String beId=businessEntity.getId(); -// -// List voExtendInfos=service.getVoId(beId); -// if(voExtendInfos==null ||voExtendInfos.size()==0){ -// return; -// } -// ArrayList metadataLists=new ArrayList<>(); -// voExtendInfos.forEach(info -> metadataLists.add(info.getId())); -// -// customizationService.removeCacheByMetadataIds(metadataLists); -// -// } } @Override public void fireMetadataSavingEvent(MetadataRtEventArgs args) { -- Gitee From eab4c24e27e8ebd4983b82d8834b4d7063bad768 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Thu, 13 Oct 2022 16:50:39 +0800 Subject: [PATCH 03/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去除冗余无效代码 --- .../service/SimplifyVoBeforeSavedToDB.java | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/service/SimplifyVoBeforeSavedToDB.java diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/service/SimplifyVoBeforeSavedToDB.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/service/SimplifyVoBeforeSavedToDB.java deleted file mode 100644 index ce320e2..0000000 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/service/SimplifyVoBeforeSavedToDB.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © OpenAtom Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.inspur.edp.formserver.vmmanager.service; - -/*import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; -import com.inspur.edp.lcm.metadata.common.Utils; -import com.inspur.edp.metadata.rtcustomization.spi.MetadataBeforeSaveToDBExtend; -import com.inspur.edp.formserver.vmmanager.ContentSerializer; - -public class SimplifyVoBeforeSavedToDB implements MetadataBeforeSaveToDBExtend { - - public String execute(GspMetadata gspMetadata){ - ContentSerializer serializer = new ContentSerializer(); - JsonNode jsonNode = serializer.Serialize(gspMetadata.getContent()); - ObjectMapper mapper = Utils.getMapper(); - String mdValue; - try { - mdValue = mapper.writeValueAsString(jsonNode); - }catch (JsonProcessingException e){ - throw new RuntimeException("序列化失败,元数据id:"+gspMetadata.getHeader().getId()); - } - return mdValue; - } - -}*/ -- Gitee From ae8b1ee6c8ddc140092421681270ddbdb92301a3 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Fri, 14 Oct 2022 14:28:53 +0800 Subject: [PATCH 04/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加代码注释 --- .../vmmanager/config/MdPkgDeployConfig.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/config/MdPkgDeployConfig.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/config/MdPkgDeployConfig.java index b93bd6c..654c4c4 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/config/MdPkgDeployConfig.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/config/MdPkgDeployConfig.java @@ -25,12 +25,17 @@ import org.springframework.context.annotation.Configuration; import java.util.ArrayList; import java.util.List; -@Configuration(proxyBeanMethods=false) +/** + * 工程打包部署 + * + * @author haoxiaofei + */ +@Configuration(proxyBeanMethods = false) public class MdPkgDeployConfig { @Bean - public EventManagerData createEventManagerData(){ - EventManagerData data= new EventManagerData(); + public EventManagerData createEventManagerData() { + EventManagerData data = new EventManagerData(); data.setName("MdpkgChangedEventManager"); List listeners = new ArrayList<>(); data.setListeners(listeners); -- Gitee From 07d269b307b1e4a423d0e49d27ca9401847a595a Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Fri, 14 Oct 2022 14:34:35 +0800 Subject: [PATCH 05/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加代码注释 --- .../GspVoExtendInfoServiceImpl.java | 71 ++++++++++--------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/GspVoExtendInfoServiceImpl.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/GspVoExtendInfoServiceImpl.java index 113efea..e470682 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/GspVoExtendInfoServiceImpl.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/GspVoExtendInfoServiceImpl.java @@ -30,6 +30,11 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.concurrent.ConcurrentHashMap; +/** + * 实体模型扩展服务接口实现 + * + * @author haoxiaofei + */ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { private GspVoExtendInfoRepository extendInfoRepository; @@ -37,24 +42,25 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { protected static ConcurrentHashMap idGspVoExtendInfo; private String Lcm_SU = "Lcm"; - private String VIEWWMODEL_SERVICE="com.inspur.edp.formserver.voextendinfo.server.api.GspVoExtendInfoRpcService"; + private String VIEWWMODEL_SERVICE = "com.inspur.edp.formserver.voextendinfo.server.api.GspVoExtendInfoRpcService"; public GspVoExtendInfoServiceImpl(GspVoExtendInfoRepository extendInfoRepository) { this.extendInfoRepository = extendInfoRepository; configIdGspVoExtendInfo = new ConcurrentHashMap<>(); idGspVoExtendInfo = new ConcurrentHashMap<>(); } + // 使用be Id的取消缓存 @Override public GspVoExtendInfo getVoExtendInfo(String id) { GspVoExtendInfo voExtendInfo = idGspVoExtendInfo.get(id); - if(voExtendInfo == null) { + if (voExtendInfo == null) { RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); params.put("id", id); voExtendInfo = (GspVoExtendInfo) client.invoke(GspVoExtendInfo.class, getMethodString("getVoExtendInfo"), Lcm_SU, params, null); - if(voExtendInfo != null) { + if (voExtendInfo != null) { idGspVoExtendInfo.put(id, voExtendInfo); } } @@ -63,45 +69,45 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { @Override public GspVoExtendInfo getVoExtendInfoByConfigId(String configId) { - if(configIdGspVoExtendInfo.containsKey(configId)){ + if (configIdGspVoExtendInfo.containsKey(configId)) { return configIdGspVoExtendInfo.get(configId); } - try{ - RpcClient client= SpringBeanUtils.getBean(RpcClient.class); + try { + RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); params.put("configId", configId); - GspVoExtendInfo voExtendInfo=(GspVoExtendInfo)client.invoke(GspVoExtendInfo.class, - getMethodString("getVoExtendInfoByConfigId"),Lcm_SU,params,null); - putConfigIdGspVoExtendInfo(configId,voExtendInfo); + GspVoExtendInfo voExtendInfo = (GspVoExtendInfo) client.invoke(GspVoExtendInfo.class, + getMethodString("getVoExtendInfoByConfigId"), Lcm_SU, params, null); + putConfigIdGspVoExtendInfo(configId, voExtendInfo); return voExtendInfo; - }catch (IncorrectResultSizeDataAccessException e){ + } catch (IncorrectResultSizeDataAccessException e) { throw new CAFRuntimeException("", "", - "ConfigId为"+configId+"的vo有多个,请检查", null, ExceptionLevel.Error); + "ConfigId为" + configId + "的vo有多个,请检查", null, ExceptionLevel.Error); } } @Override public List getVoExtendInfos() { - RpcClient client= SpringBeanUtils.getBean(RpcClient.class); + RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); - Type type=getViewModelListType(); - List voExtendInfos=(List) client.invoke(type, - getMethodString("getVoExtendInfos"),Lcm_SU,params,null); + Type type = getViewModelListType(); + List voExtendInfos = (List) client.invoke(type, + getMethodString("getVoExtendInfos"), Lcm_SU, params, null); return voExtendInfos; } @Override public void saveGspVoExtendInfos(List infos) { infos.stream().forEach(item -> { - if(item.getId() == null ||"".equals(item.getId())) + if (item.getId() == null || "".equals(item.getId())) throw new RuntimeException("id不允许为空"); }); - RpcClient client= SpringBeanUtils.getBean(RpcClient.class); + RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); - params.put("infos",infos); + params.put("infos", infos); client.invoke(Void.class, - getMethodString("saveGspVoExtendInfos"),Lcm_SU,params,null); + getMethodString("saveGspVoExtendInfos"), Lcm_SU, params, null); } @Override @@ -109,12 +115,12 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { if (!extendInfoRepository.existsById(id)) { return; } - RpcClient client= SpringBeanUtils.getBean(RpcClient.class); + RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); - params.put("id",id); + params.put("id", id); client.invoke(Void.class, - getMethodString("deleteVoExtendInfo"),Lcm_SU,params,null); - if(id != null) + getMethodString("deleteVoExtendInfo"), Lcm_SU, params, null); + if (id != null) idGspVoExtendInfo.remove(id); if (id == null || configIdGspVoExtendInfo == null || configIdGspVoExtendInfo.values().size() == 0) { @@ -134,25 +140,26 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { @Override public List getVoId(String beId) { - if(beId==null || "".equals(beId)){ + if (beId == null || "".equals(beId)) { throw new RuntimeException("beId不能为空!"); } - RpcClient client= SpringBeanUtils.getBean(RpcClient.class); + RpcClient client = SpringBeanUtils.getBean(RpcClient.class); LinkedHashMap params = new LinkedHashMap<>(); - params.put("beId",beId); - Type type=getViewModelListType(); - List voExtendInfos=(List) client.invoke(type, - getMethodString("getVoId"),Lcm_SU,params,null); + params.put("beId", beId); + Type type = getViewModelListType(); + List voExtendInfos = (List) client.invoke(type, + getMethodString("getVoId"), Lcm_SU, params, null); return voExtendInfos; } - private boolean putConfigIdGspVoExtendInfo(String id, GspVoExtendInfo info){ - if(id == null || info == null) + private boolean putConfigIdGspVoExtendInfo(String id, GspVoExtendInfo info) { + if (id == null || info == null) return false; - configIdGspVoExtendInfo.put(id,info); + configIdGspVoExtendInfo.put(id, info); return true; } + private String getMethodString(String methodName) { return VIEWWMODEL_SERVICE + "." + methodName; } -- Gitee From 27c21fd6acfc2077a79beeb71e3f3c28f2ba2184 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Sat, 15 Oct 2022 15:45:15 +0800 Subject: [PATCH 06/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加代码注释 --- .../repository/GspVoExtendInfoRepository.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/repository/GspVoExtendInfoRepository.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/repository/GspVoExtendInfoRepository.java index e1e705c..d166c2d 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/repository/GspVoExtendInfoRepository.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/extendinfo/repository/GspVoExtendInfoRepository.java @@ -24,14 +24,26 @@ import java.util.List; public interface GspVoExtendInfoRepository extends DataRepository { /** - * 根据configId获取某条BE扩展信息 - * @param configId - * @return + * 根据configId获取某条VO扩展信息 + * @param configId config信息 + * @return 视图模型扩展信息 */ GspVoExtendInfo getVoExtendInfoByConfigId(String configId); + /** + * 根据configId获取某条VO扩展信息 + * + * @param configId config信息 + * @return 视图模型扩展信息 + */ List getVoExtendInfosByConfigId(String configId); + /** + * 根据beID获取某条VO扩展信息 + * + * @param beId beID + * @return 视图模型扩展信息 + */ List getVoExtendInfoByBeSourceId(String beId); } -- Gitee From 91b695631741f288072871fde6d9c51d791232f5 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Mon, 17 Oct 2022 09:17:17 +0800 Subject: [PATCH 07/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加代码注释、代码格式调整 --- .../vmmanager/lowcode/BSessionUtil.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/BSessionUtil.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/BSessionUtil.java index 333d3c8..8fe060b 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/BSessionUtil.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/BSessionUtil.java @@ -23,14 +23,20 @@ import io.iec.edp.caf.tenancy.api.entity.Tenant; import java.util.function.Consumer; import java.util.function.Function; +/** + * 业务实体Session工具类 + * + * @author haoxiaofei + */ public class BSessionUtil { - public static void wrapFirstTenantBSession(Consumer consumer) { - } - private static void clearSession() { - } + public static void wrapFirstTenantBSession(Consumer consumer) { + } + + private static void clearSession() { + } - public static void handleMdPkg(MetadataPackage metadataPackage, - Function getMetadata) { - } + public static void handleMdPkg(MetadataPackage metadataPackage, + Function getMetadata) { + } } -- Gitee From 4d0c1734e93c79d5603e5daec503e559c02b27c9 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Mon, 17 Oct 2022 09:29:12 +0800 Subject: [PATCH 08/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码格式调整 --- .../lowcode/MdPkgDeployListener.java | 151 +++++------------- 1 file changed, 36 insertions(+), 115 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgDeployListener.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgDeployListener.java index ad4e1ba..75f956f 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgDeployListener.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgDeployListener.java @@ -36,127 +36,48 @@ import java.util.stream.Collectors; */ public class MdPkgDeployListener implements MdPkgChangedEventListener { - CustomizationService metadataService; + CustomizationService metadataService; - public MdPkgDeployListener() { - this.metadataService = SpringBeanUtils.getBean(CustomizationService.class); - } - - @Override - public void fireMdPkgAddedEvent(MdPkgChangedArgs mdPkgChangedArgs) { -// if(metadataService == null) { -// this.metadataService = SpringBeanUtils.getBean(CustomizationService.class); -// } -// MetadataPackage metadataPackage = mdPkgChangedArgs.getMetadataPackage(); -// handleMdPkg(metadataPackage, var -> metadataService.getMetadata(var)); - } - - @Override - public void fireMdPkgChangedEvent(MdPkgChangedArgs mdPkgChangedArgs) { - if(metadataService == null) { - this.metadataService = SpringBeanUtils.getBean(CustomizationService.class); + public MdPkgDeployListener() { + this.metadataService = SpringBeanUtils.getBean(CustomizationService.class); } - MetadataPackage metadataPackage = mdPkgChangedArgs.getMetadataPackage(); - clearVoCache(metadataPackage,metadataService); - //handleMdPkg(metadataPackage, var -> metadataService.getMetadata(var)); - } - public void clearVoCache( MetadataPackage metadataPackage,CustomizationService metadataService){ - List packageMetadataList = metadataPackage.getMetadataList(); - if (packageMetadataList == null || packageMetadataList.isEmpty()) { - return; - } - List metadatas = packageMetadataList.stream() - .filter(item -> item.getHeader().getType().equals("GSPBusinessEntity")) - .collect(Collectors.toList()); - if (metadatas.isEmpty()) { - return; + @Override + public void fireMdPkgAddedEvent(MdPkgChangedArgs mdPkgChangedArgs) { } - ArrayList metadataLists=new ArrayList<>(); - GspVoExtendInfoService service = SpringBeanUtils.getBean(GspVoExtendInfoService.class); - for (GspMetadata metadata: metadatas){ - List voExtendInfos=service.getVoId(metadata.getHeader().getId()); - if(voExtendInfos==null || voExtendInfos.size()==0){ - continue; - } - voExtendInfos.forEach(info -> metadataLists.add(info.getId())); + + @Override + public void fireMdPkgChangedEvent(MdPkgChangedArgs mdPkgChangedArgs) { + if (metadataService == null) { + this.metadataService = SpringBeanUtils.getBean(CustomizationService.class); + } + MetadataPackage metadataPackage = mdPkgChangedArgs.getMetadataPackage(); + clearVoCache(metadataPackage, metadataService); } - metadataService.removeCacheByMetadataIds(metadataLists); + public void clearVoCache(MetadataPackage metadataPackage, CustomizationService metadataService) { + + List packageMetadataList = metadataPackage.getMetadataList(); + if (packageMetadataList == null || packageMetadataList.isEmpty()) { + return; + } + List metadatas = packageMetadataList.stream() + .filter(item -> item.getHeader().getType().equals("GSPBusinessEntity")) + .collect(Collectors.toList()); + if (metadatas.isEmpty()) { + return; + } + ArrayList metadataLists = new ArrayList<>(); + GspVoExtendInfoService service = SpringBeanUtils.getBean(GspVoExtendInfoService.class); + for (GspMetadata metadata : metadatas) { + List voExtendInfos = service.getVoId(metadata.getHeader().getId()); + if (voExtendInfos == null || voExtendInfos.size() == 0) { + continue; + } + voExtendInfos.forEach(info -> metadataLists.add(info.getId())); + } - } + metadataService.removeCacheByMetadataIds(metadataLists); -// void handleMdPkg(MetadataPackage metadataPackage, -// Function getMetadata) { -// try { -//// if (metadataPackage.getHeader().getProcessMode() != ProcessMode.interpretation) { -//// //如果不是无需生成代码的元数据包,直接忽略 -//// return; -//// } -// -// List packageMetadataList = metadataPackage.getMetadataList(); -// if (packageMetadataList == null || packageMetadataList.isEmpty()) { -// //如果元数据包下不存在元数据 -// return; -// } -// List metadatas = packageMetadataList.stream() -// .filter(item -> item.getHeader().getType().equals("GSPViewModel")) -// .collect(Collectors.toList()); -// if (metadatas.isEmpty()) { -// return; -// } -// ProcessMode processMode = Optional.ofNullable(metadataPackage.getHeader().getProcessMode()).orElse(ProcessMode.generation); -// BSessionUtil.wrapFirstTenantBSession(tenant -> { -// // 获取当前已部署的eapi版本,并移除未变动的Eapi元数据 -// GspVoExtendInfoService beInfoService = SpringBeanUtils -// .getBean(GspVoExtendInfoService.class); -// List infos = new ArrayList(metadatas.size()); -// for (GspMetadata metadata : metadatas) { -// GspViewModel be = (GspViewModel) getMetadata.apply(metadata.getHeader().getId()) -// .getContent(); -// ((GspViewModel) getMetadata.apply(metadata.getHeader().getId()).getContent()) -// .getCoreAssemblyInfo().getDefaultNamespace(); -// BffEngineCacheService.remove(be.getID()); -// if (be.getGeneratedConfigID() == null) { -// continue; -// } -// GspVoExtendInfo existing = beInfoService.getVoExtendInfo(be.getID()); -// GspVoExtendInfo info = buildVoExtendInfo(processMode, be, existing); -// infos.add(info); -// } -// if (!infos.isEmpty()) { -// beInfoService.saveGspVoExtendInfos(infos); -// } -// }); -// } catch (Exception e) { -// throw new RuntimeException("部署解析VO元数据出错:", e); -// } -// } -// -// private GspVoExtendInfo buildVoExtendInfo(ProcessMode processMode, GspViewModel be, GspVoExtendInfo existing) { -// GspVoExtendInfo info = new GspVoExtendInfo(); -// VoConfigCollectionInfo voConfigCollectionInfo = getBffConfigCollectionInfo(be); -// voConfigCollectionInfo.setProjectType(processMode); -// info.setVoConfigCollectionInfo(voConfigCollectionInfo); -// info.setId(be.getID()); -// info.setConfigId(be.getGeneratedConfigID());; -// info.setCreatedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); -// info.setLastChangedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); -// if (!be.getIsVirtual()) { -// info.setBeSourceId(be.getMapping().getTargetMetadataId()); -// } -// if (existing != null) { -// info.setLastChangedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); -// } -// return info; -// } -// -// private VoConfigCollectionInfo getBffConfigCollectionInfo(GspViewModel be) { -// CefConfig cefConfig = new CefConfig(); -// cefConfig.setID(be.getGeneratedConfigID()); -// cefConfig.setDefaultNamespace(be.getCoreAssemblyInfo().getDefaultNamespace().toLowerCase()); -// VoConfigCollectionInfo voConfigCollectionInfo = new VoConfigCollectionInfo(); -// voConfigCollectionInfo.setConfig(cefConfig); -// return voConfigCollectionInfo; -// } + } } -- Gitee From bf90b2e55a1b86700643838ef8993b00eb48f7d7 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Mon, 17 Oct 2022 09:32:54 +0800 Subject: [PATCH 09/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码格式调整 --- .../lowcode/MdPkgToolsDeployListener.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgToolsDeployListener.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgToolsDeployListener.java index 623f011..9ceab6d 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgToolsDeployListener.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/lowcode/MdPkgToolsDeployListener.java @@ -27,15 +27,14 @@ import com.inspur.edp.metadata.rtcustomization.spi.event.MdPkgDeployedEventArgs; */ public class MdPkgToolsDeployListener implements IMetadataDeployEventListener { + public MdPkgToolsDeployListener() { + } - public MdPkgToolsDeployListener() { - } + @Override + public void fireMdPkgDeployedEvent(MdPkgDeployedEventArgs mdPkgDeployedEventArgs) { + } - @Override - public void fireMdPkgDeployedEvent(MdPkgDeployedEventArgs mdPkgDeployedEventArgs) { - } - - @Override - public void fireExtMdSavedEvent(ExtMdSavedArgs extMdSavedArgs) { - } + @Override + public void fireExtMdSavedEvent(ExtMdSavedArgs extMdSavedArgs) { + } } -- Gitee From 5a1a83c03e0b2582addb5fe4dd62f79b9d94c631 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Tue, 18 Oct 2022 10:54:06 +0800 Subject: [PATCH 10/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码格式调整、简化拉姆达表达式 --- .../vmmanager/TransferSerializer.java | 188 +++++++++--------- 1 file changed, 91 insertions(+), 97 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/TransferSerializer.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/TransferSerializer.java index 17a8185..9578f1c 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/TransferSerializer.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/TransferSerializer.java @@ -44,119 +44,113 @@ import io.iec.edp.caf.commons.utils.SpringBeanUtils; public class TransferSerializer implements MetadataTransferSerializer { - //region getMapper - - private ObjectMapper getMapper() { - ObjectMapper mapper = new ObjectMapper(); - SimpleModule module = new SimpleModule(); - module.addDeserializer(IGspCommonModel.class, new ViewModelDeserializer()); - module.addSerializer(IGspCommonModel.class, new ViewModelSerializer()); - mapper.registerModule(module); - return mapper; - } - - //endregion - - //region 序列化 - public final String serialize(IMetadataContent metadataContent) { - GspViewModel viewModel = (GspViewModel) ((metadataContent instanceof GspViewModel) - ? metadataContent : null); -// dealContent(viewModel); - String modelJson = null; - try { - modelJson = getMapper().writeValueAsString(viewModel); - } catch (JsonProcessingException e) { - throw new RuntimeException("ViewModel序列化失败!"); + //region getMapper + + private ObjectMapper getMapper() { + ObjectMapper mapper = new ObjectMapper(); + SimpleModule module = new SimpleModule(); + module.addDeserializer(IGspCommonModel.class, new ViewModelDeserializer()); + module.addSerializer(IGspCommonModel.class, new ViewModelSerializer()); + mapper.registerModule(module); + return mapper; } - return modelJson; - } - private void dealContent(GspViewModel viewModel) { - dealObject(viewModel.getMainObject()); - } - - private void dealObject(GspViewObject viewObject) { - - ViewObjectCollection childObjs = viewObject.getContainChildObjects(); - if (childObjs != null && childObjs.size() > 0) { - childObjs.forEach((childObj) -> { - dealObject((GspViewObject) childObj); - }); + //endregion + + //region 序列化 + public final String serialize(IMetadataContent metadataContent) { + GspViewModel viewModel = (GspViewModel) ((metadataContent instanceof GspViewModel) + ? metadataContent : null); + String modelJson; + try { + modelJson = getMapper().writeValueAsString(viewModel); + } catch (JsonProcessingException e) { + throw new RuntimeException("ViewModel序列化失败!"); + } + return modelJson; } - VMElementCollection eles = viewObject.getContainElements(); - if (eles != null && eles.size() > 0) { - eles.forEach((ele) -> { - dealElement(ele); - }); + private void dealContent(GspViewModel viewModel) { + dealObject(viewModel.getMainObject()); } - } - private void dealElement(IGspCommonField element) { - if (element.getObjectType() != GspElementObjectType.Association) { - return; - } - - GspAssociationCollection assos = element.getChildAssociations(); - if (assos != null && assos.size() > 0) { - assos.forEach((asso) -> { - dealAssociation(asso); - }); - } - } + private void dealObject(GspViewObject viewObject) { - private void dealAssociation(GspAssociation association) { + ViewObjectCollection childObjs = viewObject.getContainChildObjects(); + if (childObjs != null && childObjs.size() > 0) { + childObjs.forEach((childObj) -> { + dealObject((GspViewObject) childObj); + }); + } - GspFieldCollection refEles = association.getRefElementCollection(); - if (refEles != null && refEles.size() > 0) { - refEles.forEach((refEle) -> { - dealRefElement(association, refEle); - }); + VMElementCollection eles = viewObject.getContainElements(); + if (eles != null && eles.size() > 0) { + eles.forEach(this::dealElement); + } } - } - private void dealRefElement(GspAssociation association, IGspCommonField refElement) { - if (refElement.getObjectType() != GspElementObjectType.Association) { - return; - } - RefCommonService service = SpringBeanUtils.getBean(RefCommonService.class); - GspMetadata refMetadata = service.getRefMetadata(association.getRefModelID()); - if (refMetadata == null) { - throw new VmManagerException("", "", - "关联be[" + association.getRefModelID() + "] [" + association.getRefModelCode() - + "]没有获取到。", - null, ExceptionLevel.Error, false); - } - GspBusinessEntity refBe = (GspBusinessEntity) refMetadata.getContent(); - IGspCommonObject refObj = refBe.findObjectById(association.getRefObjectID()); - if (refObj == null) { - throw new VmManagerException("", "", - "关联be[" + association.getRefModelCode() + "]中没有获取到节点[" + association.getRefObjectID() - + "] [" + association.getRefObjectCode() + "]。", null, ExceptionLevel.Error, - false); - } + private void dealElement(IGspCommonField element) { + if (element.getObjectType() != GspElementObjectType.Association) { + return; + } - IGspCommonElement element = refObj.findElement(refElement.getRefElementId()); - if (element == null) { - throw new VmManagerException("", "", - "关联be[" + association.getRefModelCode() + "]中没有获取到字段[" + refElement.getRefElementId() - + "] [" + refElement.getLabelID() + "]。", null, ExceptionLevel.Error, false); + GspAssociationCollection assos = element.getChildAssociations(); + if (assos != null && assos.size() > 0) { + assos.forEach(this::dealAssociation); + } } - refElement.getChildAssociations().addAll(element.getChildAssociations().clone()); + private void dealAssociation(GspAssociation association) { - dealElement(refElement); - } - //endregion + GspFieldCollection refEles = association.getRefElementCollection(); + if (refEles != null && refEles.size() > 0) { + refEles.forEach((refEle) -> { + dealRefElement(association, refEle); + }); + } + } + private void dealRefElement(GspAssociation association, IGspCommonField refElement) { + if (refElement.getObjectType() != GspElementObjectType.Association) { + return; + } + RefCommonService service = SpringBeanUtils.getBean(RefCommonService.class); + GspMetadata refMetadata = service.getRefMetadata(association.getRefModelID()); + if (refMetadata == null) { + throw new VmManagerException("", "", + "关联be[" + association.getRefModelID() + "] [" + association.getRefModelCode() + + "]没有获取到。", + null, ExceptionLevel.Error, false); + } + GspBusinessEntity refBe = (GspBusinessEntity) refMetadata.getContent(); + IGspCommonObject refObj = refBe.findObjectById(association.getRefObjectID()); + if (refObj == null) { + throw new VmManagerException("", "", + "关联be[" + association.getRefModelCode() + "]中没有获取到节点[" + association.getRefObjectID() + + "] [" + association.getRefObjectCode() + "]。", null, ExceptionLevel.Error, + false); + } + + IGspCommonElement element = refObj.findElement(refElement.getRefElementId()); + if (element == null) { + throw new VmManagerException("", "", + "关联be[" + association.getRefModelCode() + "]中没有获取到字段[" + refElement.getRefElementId() + + "] [" + refElement.getLabelID() + "]。", null, ExceptionLevel.Error, false); + } + + refElement.getChildAssociations().addAll(element.getChildAssociations().clone()); + + dealElement(refElement); + } + //endregion - public final IMetadataContent deserialize(String contentString) { - try { - return getMapper().readValue(contentString, GspViewModel.class); - } catch (JsonProcessingException e) { - throw new VmManagerException("", "", "vo反序列化失败" + contentString, null, ExceptionLevel.Error, - false); + public final IMetadataContent deserialize(String contentString) { + try { + return getMapper().readValue(contentString, GspViewModel.class); + } catch (JsonProcessingException e) { + throw new VmManagerException("", "", "vo反序列化失败" + contentString, null, ExceptionLevel.Error, + false); + } } - } } -- Gitee From db4f34b8d9440264924bed9ec350fae6bba2fa4a Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Tue, 18 Oct 2022 11:34:28 +0800 Subject: [PATCH 11/14] =?UTF-8?q?style(vo-model):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码格式调整,去除冗余代码 --- .../controlrule/ruledefine/VoControlRuleDef.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/view-object-model/src/main/java/com/inspur/edp/formserver/viewmodel/controlrule/ruledefine/VoControlRuleDef.java b/view-object-model/src/main/java/com/inspur/edp/formserver/viewmodel/controlrule/ruledefine/VoControlRuleDef.java index 8fb8f13..b7b090f 100644 --- a/view-object-model/src/main/java/com/inspur/edp/formserver/viewmodel/controlrule/ruledefine/VoControlRuleDef.java +++ b/view-object-model/src/main/java/com/inspur/edp/formserver/viewmodel/controlrule/ruledefine/VoControlRuleDef.java @@ -49,9 +49,7 @@ public class VoControlRuleDef extends CmControlRuleDef { }; setNameControlRule(nameRule); -// setUsingTimeStampControlRule(); - - ControlRuleDefItem addActionRule = new ControlRuleDefItem(){ + ControlRuleDefItem addActionRule = new ControlRuleDefItem() { { this.setRuleName(VoControlRuleDefNames.AddCustomAction); this.setRuleDisplayName("添加自定义动作"); @@ -61,7 +59,7 @@ public class VoControlRuleDef extends CmControlRuleDef { }; setAddCustomActonControlRule(addActionRule); - ControlRuleDefItem modifyActionRule = new ControlRuleDefItem(){ + ControlRuleDefItem modifyActionRule = new ControlRuleDefItem() { { this.setRuleName(VoControlRuleDefNames.ModifyCustomActions); this.setRuleDisplayName("修改自定义动作"); @@ -71,7 +69,7 @@ public class VoControlRuleDef extends CmControlRuleDef { }; setModifyCustomActonControlRule(modifyActionRule); - ControlRuleDefItem addVarRule = new ControlRuleDefItem(){ + ControlRuleDefItem addVarRule = new ControlRuleDefItem() { { this.setRuleName(VoControlRuleDefNames.AddVariableDtm); this.setRuleDisplayName("添加自定义变量"); @@ -81,7 +79,7 @@ public class VoControlRuleDef extends CmControlRuleDef { }; setAddVariableDtmControlRule(addVarRule); - ControlRuleDefItem modifyVarRule = new ControlRuleDefItem(){ + ControlRuleDefItem modifyVarRule = new ControlRuleDefItem() { { this.setRuleName(VoControlRuleDefNames.ModifyVariableDtm); this.setRuleDisplayName("修改自定义变量"); -- Gitee From d0e52ba2f340809c9f96436e979eb08ecb621063 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Wed, 19 Oct 2022 11:26:05 +0800 Subject: [PATCH 12/14] =?UTF-8?q?style(vo-manager):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码格式调整,增加类注释 --- .../vmmanager/BffMetadataEventListener.java | 101 +++++++++--------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/BffMetadataEventListener.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/BffMetadataEventListener.java index 0b0db26..a001581 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/BffMetadataEventListener.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/BffMetadataEventListener.java @@ -25,62 +25,67 @@ import com.inspur.edp.lcm.metadata.api.entity.GspMetadata; import com.inspur.edp.lcm.metadata.spi.event.MetadataEventArgs; import com.inspur.edp.lcm.metadata.spi.event.MetadataEventListener; +/** + * VO元数据监听事件 + * + * @author haoxiaofei + */ public class BffMetadataEventListener implements MetadataEventListener { - /** - * 业务实体元数据保存前事件 - * - * @param e - */ - public final void fireMetadataSavingEvent(MetadataEventArgs e) { - // 类型判断 - if (!(e.getMetadata().getContent() instanceof GspViewModel)) { - return; - } - - GspViewModel vm = (GspViewModel) ((e.getMetadata().getContent() instanceof GspViewModel) ? e - .getMetadata().getContent() : null); - - //保存前校验 - ViewModelValidator validator = new ViewModelValidator(); - validator.validate(e.getPath(), vm); - //国际化抽取 - ViewModelI18nService service = new ViewModelI18nService(); - service.getResourceItem(e.getMetadata()); - } + /** + * 业务实体元数据保存前事件 + * + * @param e + */ + public final void fireMetadataSavingEvent(MetadataEventArgs e) { + // 类型判断 + if (!(e.getMetadata().getContent() instanceof GspViewModel)) { + return; + } - /** - * 视图对象元数据保存后事件 - * - * @param e - */ - public final void fireMetadataSavedEvent(MetadataEventArgs e) { - } + GspViewModel vm = (GspViewModel) ((e.getMetadata().getContent() instanceof GspViewModel) ? e + .getMetadata().getContent() : null); - @Override - public void fireMetadataDeletingEvent(MetadataEventArgs metadataEventArgs) { - } + //保存前校验 + ViewModelValidator validator = new ViewModelValidator(); + validator.validate(e.getPath(), vm); + //国际化抽取 + ViewModelI18nService service = new ViewModelI18nService(); + service.getResourceItem(e.getMetadata()); + } - @Override - public void fireMetadataDeletedEvent(MetadataEventArgs metadataEventArgs) { - } + /** + * 视图对象元数据保存后事件 + * + * @param e + */ + public final void fireMetadataSavedEvent(MetadataEventArgs e) { + } - @Override - public void fireMetadataAchievedEvent(MetadataEventArgs args) { - GspMetadata metadata = args.getMetadata(); - if (!(metadata.getContent() instanceof GspViewModel)) { - return; + @Override + public void fireMetadataDeletingEvent(MetadataEventArgs metadataEventArgs) { } - GspViewModel viewModel = (GspViewModel) metadata.getContent(); - if (viewModel.getIsVirtual()) { - return; + @Override + public void fireMetadataDeletedEvent(MetadataEventArgs metadataEventArgs) { } - if (viewModel.getMainObject().getMapping() != null - && viewModel.getMainObject().getMapping().getSourceType() - == GspVoObjectSourceType.BeObject) { - LinkBeUtils utils = new LinkBeUtils(false); - utils.linkWithBe(viewModel); + + @Override + public void fireMetadataAchievedEvent(MetadataEventArgs args) { + GspMetadata metadata = args.getMetadata(); + if (!(metadata.getContent() instanceof GspViewModel)) { + return; + } + + GspViewModel viewModel = (GspViewModel) metadata.getContent(); + if (viewModel.getIsVirtual()) { + return; + } + if (viewModel.getMainObject().getMapping() != null + && viewModel.getMainObject().getMapping().getSourceType() + == GspVoObjectSourceType.BeObject) { + LinkBeUtils utils = new LinkBeUtils(false); + utils.linkWithBe(viewModel); + } } - } } -- Gitee From 82d4be6874087f2ee1a0355059bba181447b5fb5 Mon Sep 17 00:00:00 2001 From: zhangjintr <1234qwer> Date: Wed, 19 Oct 2022 19:06:17 +0800 Subject: [PATCH 13/14] =?UTF-8?q?style(view-object-manager):VOGuideUtil?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspur/edp/formserver/vmmanager/voguide/VoGuideUtil.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/voguide/VoGuideUtil.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/voguide/VoGuideUtil.java index bc2f851..74cfa7f 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/voguide/VoGuideUtil.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/voguide/VoGuideUtil.java @@ -232,10 +232,7 @@ public class VoGuideUtil { info.setCreatedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); info.setLastChangedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); return info; -// info.setCreatedBy(CAFContext.current.getCurrentSession().getUserName()); -// info.setLastChangedBy(CAFContext.current.getCurrentSession().getUserName()); } else{ -// infoTemp.setLastChangedBy(CAFContext.current.getCurrentSession().getUserName()); infoTemp.setLastChangedOn(Date.from(CAFContext.current.getCurrentDateTime().toInstant())); return infoTemp; -- Gitee From f4cb4ead0e8ca34f7f0978cef1f7a3b1ebbce19e Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Thu, 20 Oct 2022 11:36:41 +0800 Subject: [PATCH 14/14] =?UTF-8?q?style(vo-webapi):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去除冗余代码 --- .../formserver/viewmodel/rtwebapi/VMCodeGenController.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/rtwebapi/VMCodeGenController.java b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/rtwebapi/VMCodeGenController.java index 76ebfcb..15bbb6e 100644 --- a/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/rtwebapi/VMCodeGenController.java +++ b/view-object-webapi/src/main/java/com/inspur/edp/formserver/viewmodel/rtwebapi/VMCodeGenController.java @@ -169,13 +169,9 @@ public class VMCodeGenController { private String convertBizEntityToViewModel(String bizEntityJson, String bePkgName, String beId, String voGeneratingAssembly) { - GspBusinessEntity be = null; try { - be = new ObjectMapper().readValue(bizEntityJson, GspBusinessEntity.class); + GspBusinessEntity be = new ObjectMapper().readValue(bizEntityJson, GspBusinessEntity.class); GspViewModel vm = ConvertUtils.convertToViewModel(be, bePkgName, beId, voGeneratingAssembly); - // 联动vo的关联带出字段枚举信息 -// LinkBeUtils linkBeUtils = new LinkBeUtils(); -// linkBeUtils.LinkBeRefElements(vm); return new ObjectMapper().writeValueAsString(vm); } catch (JsonProcessingException e) { -- Gitee