From c8f873c85f86c50c479900abea194dc6bb46a2e4 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 27 九月 2024 18:10:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 45 insertions(+), 7 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 319777c..73a4fac 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
@@ -152,7 +152,22 @@
     @VciUnLog
     public List<OsBtmTypeVO> selectAllBtm() {
         try {
-            return btmDO2VOs(Arrays.stream(platformClientUtil.getBtmService().getBizTypes("")).collect(Collectors.toList()));
+            return btmDO2VOs(Arrays.stream(platformClientUtil.getBtmService().getBizTypes("")).collect(Collectors.toList()),null);
+        } catch (PLException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 鏌ヨ鎵�鏈夌殑涓氬姟绫诲瀷
+     *
+     * @return 涓氬姟绫诲瀷瀵硅薄
+     */
+    @Override
+    @VciUnLog
+    public List<OsBtmTypeVO> selectAllBtm(Map<String, OsAttributeVO> attributeVOMap) {
+        try {
+            return btmDO2VOs(Arrays.stream(platformClientUtil.getBtmService().getBizTypes("")).collect(Collectors.toList()),attributeVOMap);
         } catch (PLException e) {
             throw new RuntimeException(e);
         }
@@ -168,6 +183,16 @@
     public Map<String, OsBtmTypeVO> selectAllBtmMap() {
         return Optional.ofNullable(self.selectAllBtm()).orElseGet(() -> new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(), t -> t, (o1, o2) -> o1));
     }
+    /**
+     * 鏌ヨ鎵�鏈夌殑涓氬姟绫诲瀷鏄犲皠
+     *
+     * @return key 鏄笟鍔$殑鑻辨枃鍚嶇О鐨勫皬鍐�
+     */
+    @Override
+    @VciUnLog
+    public Map<String, OsBtmTypeVO> selectAllBtmMap(Map<String, OsAttributeVO> attributeVOMap) {
+        return Optional.ofNullable(self.selectAllBtm(attributeVOMap)).orElseGet(() -> new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(), t -> t, (o1, o2) -> o1));
+    }
 
     /**
      * 鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞�
@@ -176,10 +201,10 @@
      * @return 鏄剧ず瀵硅薄
      */
     @Override
-    public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems) {
+    public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems,Map<String, OsAttributeVO> attributeVOMap) {
         List<OsBtmTypeVO> VOS = new ArrayList<>();
         Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).stream().forEach(btmItem -> {
-            OsBtmTypeVO vo = btmDO2VO(btmItem);
+            OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap);
             VOS.add(vo);
         });
         return VOS;
@@ -192,7 +217,7 @@
      * @return 鏄剧ず瀵硅薄
      */
     @Override
-    public OsBtmTypeVO btmDO2VO(BizType btmItem) {
+    public OsBtmTypeVO btmDO2VO(BizType btmItem, Map<String, OsAttributeVO> attributeVOMap) {
         OsBtmTypeVO vo = new OsBtmTypeVO();
         if (btmItem != null) {
             vo.setOid(btmItem.oid);
@@ -226,7 +251,7 @@
             }
             vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(",")));
             vo.setApNameArray(btmItem.apNameArray);
-            List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList()));
+            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 -> {
                 OsBtmTypeAttributeVO btmTypeAttributeVO = new OsBtmTypeAttributeVO();
@@ -287,6 +312,19 @@
             return null;
         }
         return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null);
+    }
+    /**
+     * 浣跨敤缂栧彿鑾峰彇涓氬姟绫诲瀷
+     *
+     * @param id 缂栧彿
+     * @return 涓氬姟绫诲瀷
+     */
+    @Override
+    public OsBtmTypeVO getBtmById(String id,Map<String, OsAttributeVO> attributeVOMap) {
+        if (StringUtils.isBlank(id)) {
+            return null;
+        }
+        return self.selectAllBtmMap(attributeVOMap).getOrDefault(id.toLowerCase(), null);
     }
 
     /**
@@ -366,7 +404,7 @@
             return new ArrayList<>();
         }
         BizType bizType = bizTypes[0];
-        OsBtmTypeVO btmTypeVO = btmDO2VO(bizType);
+        OsBtmTypeVO btmTypeVO = btmDO2VO(bizType,null);
         List<OsBtmTypeAttributeVO> attributes = btmTypeVO.getAttributes();
         if (attributes == null) {
             attributes = new ArrayList<>();
@@ -646,7 +684,7 @@
         List<Tree> rootTreeList = new ArrayList<>();
         BizType[] bizTypes = getBizTypes("");
         OsBtmTypeVO osBtmTypeVO = null;
-        List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes));
+        List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes),null);
         for (int i = 0; i < osBtmTypeVOS.size(); i++) {
             osBtmTypeVO = osBtmTypeVOS.get(i);
 

--
Gitblit v1.9.3