From c528dc5a1ce4d08768c37eaaa84559cceea5ea64 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 22 十一月 2024 15:10:19 +0800 Subject: [PATCH] 业务类型树查询接口,返回的attributes集合中增加链接表的属性。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java index ee21299..5497ddb 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java @@ -31,6 +31,7 @@ import com.vci.web.query.UILinkTypeDataQuery; import com.vci.web.query.UITreeQuery; import com.vci.web.service.*; +import com.vci.web.util.Func; import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; @@ -707,10 +708,28 @@ clo = boAndLO.lo; Map<String,String> cloMap = loService.clo2Map(clo); Map<String,String> cbo2Map = boService.cbo2Map(cbo); + //灏嗛摼鎺ョ被鍨嬬殑灞炴�т篃鏀捐繘杩涜杩斿洖 + String linkName = Func.isNotBlank(cloMap.get("linktypename")) ? cloMap.get("linktypename"):parentFieldName; + Map<String, String> returnMap = new HashMap<>(); + cloMap.forEach((key,value)->{ + //杩囨护鎺夌┖鍊� + if(!returnMap.containsKey(linkName + key) && Func.isNotBlank(key) || Func.isNotBlank(value)){ + returnMap.put(linkName + key,value); + } + }); + //杩囨护鎺夌┖鍊硷紝鐢ㄤ綔杩斿洖鐨刴ap + cbo2Map.entrySet().stream().forEach(entry -> { + String key = entry.getKey(); + String value = entry.getValue(); + if (!returnMap.containsKey(key) && Func.isNotBlank(key) && Func.isNotBlank(value)) { + returnMap.put(key,value); + } + }); + if(!CollectionUtils.isEmpty(cbo2Map)){ cbo2Map.forEach((key,value)->{ //TODO: 杩欏効涓哄暐瑕佹嫾鎺ヤ笂parentFieldName锛屽鑷村悗闈reemarker琛ㄨ揪寮忔棤娉曟纭浛鎹� - cloMap.put(parentFieldName + "." + key,value); + cloMap.put(/*parentFieldName + "." +*/ key,value); }); } tree.setOid(getValueByExpressForBOAndLO(cloMap,cbo2Map,valueField)); @@ -725,7 +744,7 @@ } } - tree.setAttributes(cloMap/*cbo2Map*/); + tree.setAttributes(returnMap); tree.setIndex(i[0] + ""); i[0]++; tree.setChecked(showCheckBox); -- Gitblit v1.9.3