From 370b26066c560f15f6a84caca2be149e48e86556 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期二, 07 一月 2025 15:52:05 +0800
Subject: [PATCH] 系统菜单 默认显示&&系统配置、对象建模按钮权限以及按钮图标
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
index 201d4fb..92fe590 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -44,6 +44,7 @@
import com.vci.starter.web.util.Lcm.ConcurrentDateFormat;
import com.vci.starter.web.util.Lcm.DateUtil;
import com.vci.starter.web.util.Lcm.Func;
+import com.vci.web.other.AllOsEnumVOMapThreadLocal;
import com.vci.web.service.*;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
@@ -200,10 +201,14 @@
@Override
public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems,Map<String, OsAttributeVO> attributeVOMap) {
List<OsBtmTypeVO> VOS = new ArrayList<>();
- Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).parallelStream().forEach(btmItem -> {
+// Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).parallelStream().forEach(btmItem -> {
+// OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap);
+// VOS.add(vo);
+// });
+ for (BizType btmItem : btmItems) {
OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap);
VOS.add(vo);
- });
+ }
return VOS;
}
@@ -251,7 +256,8 @@
vo.setApNameArray(btmItem.apNameArray);
List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList()),attributeVOMap);
List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>();
- Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> {
+// Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> {
+ for (OsAttributeVO attributeVO : attributeVOS) {
OsBtmTypeAttributeVO btmTypeAttributeVO = new OsBtmTypeAttributeVO();
BeanUtilForVCI.convert(attributeVO, btmTypeAttributeVO);
btmTypeAttributeVO.setPkBtmType(vo.getOid());
@@ -271,7 +277,8 @@
btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId()));
}
btmTypeAttributeVOS.add(btmTypeAttributeVO);
- });
+// });
+ }
vo.setAttributes(btmTypeAttributeVOS);
}
return vo;
@@ -456,7 +463,7 @@
});
attrVOs = finalAttrVOs;
}
- //// TODO: 2024/12/2 Ludc 杩斿洖鍊兼帓搴�
+ // TODO: 2024/12/2 Ludc 杩斿洖鍊兼帓搴�
return attrVOs.stream().sorted(Comparator.comparing(o->o.getId(),String.CASE_INSENSITIVE_ORDER)).collect(Collectors.toList());
}
@@ -579,9 +586,10 @@
tree.setOid(bizType.oid);
tree.setLeaf(true);
tree.setParentName(bizType.fName);
+ tree.setIcon(bizType.imageName);
Map<String, String> atrrMap = new HashMap<>();
atrrMap.put("name", bizType.name);
- atrrMap.put("lable", bizType.label);
+ atrrMap.put("label", bizType.label);
tree.setAttributes(atrrMap);
trees.add(tree);
});
@@ -703,7 +711,13 @@
List<Tree> rootTreeList = new ArrayList<>();
BizType[] bizTypes = getBizTypes("");
OsBtmTypeVO osBtmTypeVO = null;
- List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes),null);
+ Map<String, OsAttributeVO> attributeVOMap = null;
+ if(bizTypes.length > 0){
+ //鍏堝皢鎵�闇�瑕佺殑灞炴�с�佹灇涓炬暟鎹叏閮ㄥ姞杞藉嚭鏉ワ紝閬垮厤鍚庣画杩涜閲嶅鍔犺浇
+ attributeVOMap = attributeService.selectAllAttributeMap();
+ AllOsEnumVOMapThreadLocal.set(enumService.selectAllEnumMap());
+ }
+ List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes),attributeVOMap);
for (int i = 0; i < osBtmTypeVOS.size(); i++) {
osBtmTypeVO = osBtmTypeVOS.get(i);
@@ -721,6 +735,7 @@
rootTreeList.add(tree);
}
}
+ AllOsEnumVOMapThreadLocal.remove();
rootTreeList = rootTreeList.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).collect(Collectors.toList());
return rootTreeList;
}
@@ -1536,7 +1551,7 @@
excelReapeat.put(osBtmTypePO.getName(), osBtmTypePO.getRowIndex());
BizType bizType = new BizType();
bizType.name = osBtmTypePO.getName();
- bizType.label = osBtmTypePO.getLable();
+ bizType.label = osBtmTypePO.getLabel();
bizType.description = osBtmTypePO.getDescription();
bizType.fName = osBtmTypePO.getFName();
bizType.implClass = osBtmTypePO.getImplClass();
--
Gitblit v1.9.3