From 756268aae2b8931a1c968e2f721cd66a3b140b15 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Tue, 25 Oct 2022 11:02:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?style(vo-Manager):=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 合并重复代码,提取公共方法。 --- .../HelpConfigFilterSortHandler.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) 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 15b3297..ebae3c6 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 @@ -219,25 +219,22 @@ public class HelpConfigFilterSortHandler { mappedCdpAction.setComponentEntityId(SORT_FILTER_CMPID); mappedCdpAction.setComponentName("VO帮助前支持过滤筛选构件"); - MappedCdpActionParameter filterParameter = getPara(FILTER_CONDITION_PROPERTY, - FILTER_CONDITION_PROPERTY); + dealValue(filterCondition, mappedCdpAction, FILTER_CONDITION_PROPERTY); + + dealValue(sortCondition, mappedCdpAction, SORT_CONDITION_PROPERTY); + + return mappedCdpAction; + } + + private void dealValue(String filterCondition, MappedCdpAction mappedCdpAction, String property) { + MappedCdpActionParameter filterParameter = getPara(property, + property); ViewModelParActualValue filterValue = new ViewModelParActualValue(); filterValue.setHasValue(true); filterValue.setEnable(true); filterValue.setValue(filterCondition); filterParameter.setActualValue(filterValue); mappedCdpAction.getParameterCollection().add(filterParameter); - - MappedCdpActionParameter orderByParameter = getPara(SORT_CONDITION_PROPERTY, - SORT_CONDITION_PROPERTY); - ViewModelParActualValue orderByValue = new ViewModelParActualValue(); - orderByValue.setHasValue(true); - orderByValue.setEnable(true); - orderByValue.setValue(sortCondition); - orderByParameter.setActualValue(orderByValue); - mappedCdpAction.getParameterCollection().add(orderByParameter); - - return mappedCdpAction; } private MappedCdpActionParameter getPara(String code, String name) { -- Gitee From e0312166be478e57b218d2e133c0157711fc8974 Mon Sep 17 00:00:00 2001 From: haoxiaofei Date: Tue, 25 Oct 2022 11:31:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style(vo-Manager):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=86=97=E4=BD=99=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去除无效逻辑,优化方法 --- .../vmmanager/extendinfo/GspVoExtendInfoServiceImpl.java | 9 +++------ 1 file changed, 3 insertions(+), 6 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 e470682..7921e17 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 @@ -120,10 +120,8 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { params.put("id", id); client.invoke(Void.class, getMethodString("deleteVoExtendInfo"), Lcm_SU, params, null); - if (id != null) - idGspVoExtendInfo.remove(id); - if (id == null || configIdGspVoExtendInfo == null - || configIdGspVoExtendInfo.values().size() == 0) { + idGspVoExtendInfo.remove(id); + if (configIdGspVoExtendInfo == null || configIdGspVoExtendInfo.values().size() == 0) { return; } String deleteConfigId = null; @@ -165,7 +163,6 @@ public class GspVoExtendInfoServiceImpl implements GspVoExtendInfoService { } private Type getViewModelListType() { - Type type = new Type<>(List.class, GspVoExtendInfo.class); - return type; + return new Type<>(List.class, GspVoExtendInfo.class); } } -- Gitee