From 5056af07922b451b6edaaff615e34d88ce77dd16 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 13 九月 2024 10:59:34 +0800
Subject: [PATCH] ui上下文导出接口修改

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java |  110 +++++++++++++++++++++++++++++++++++++++++-------------
 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java           |    1 
 2 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
index 647c43b..8480dbe 100644
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
@@ -1,5 +1,6 @@
 package com.vci.pagemodel;
 
+import com.vci.corba.portal.data.PLCommandParameter;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
index d85f3ef..0faef25 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -372,11 +372,11 @@
         //鐣岄潰娌′紶鍚嶇О锛屼娇鐢ㄩ粯璁ゅ鍑哄悕绉�
         String exportFileName = "UI涓婁笅鏂囧鍑篲" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss");
         //璁剧疆鍒楀悕
-        List<String> columns = Arrays.asList(
+        /*List<String> columns = Arrays.asList(
                 "鎵�灞炰笟鍔$被鍨�","鍚嶇О", "UI涓婁笅鏂�", "瀵艰埅鍖�", "鎺у埗鍖�","鎿嶄綔鍖�",
                 "椤电搴忓彿","鍖哄煙缂栫爜","鍖哄煙鍚嶇О","鏄惁鍚敤","鏄剧ず琛ㄨ揪寮�", "UI瑙f瀽绫�",
                 "鎵╁睍灞炴��", "鎻忚堪","椤甸潰璁捐淇℃伅","椤甸潰涓嬮厤缃殑鎸夐挳"
-        );
+        );*/
 
         //鍐檈xcel
         String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
@@ -386,58 +386,114 @@
             throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
         }
         //璁剧疆鍒�
-        List<WriteExcelData> excelDataList = new ArrayList<>();
+        List<WriteExcelData> pldDataList = new ArrayList<>();
+        List<WriteExcelData> tpDataList = new ArrayList<>();
+        List<WriteExcelData> pdDataList = new ArrayList<>();
+        List<WriteExcelData> tbDataList = new ArrayList<>();
+        List<WriteExcelData> cpDataList = new ArrayList<>();
         //璁剧疆鍒楀ご
-        for (int index = 0; index < columns.size(); index++) {
+        /*for (int index = 0; index < columns.size(); index++) {
             excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
-        }
-        AtomicInteger row = new AtomicInteger(1);
+        }*/
+        AtomicInteger pldRow = new AtomicInteger(0);
+        AtomicInteger tpRow = new AtomicInteger(0);
+        AtomicInteger pdRow = new AtomicInteger(0);
+        AtomicInteger tbRow = new AtomicInteger(0);
+        AtomicInteger cpRow = new AtomicInteger(0);
+
         expConditionMap.entrySet().stream().forEach(item->{
             //key瀛樻斁鐨剈i涓婁笅鏂囩殑id
             try {
                 PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(item.getKey());
+                pldDataList.add(new WriteExcelData(pldRow.get(),0, pluiLayout.plOId));
+                pldDataList.add(new WriteExcelData(pldRow.get(),1, pluiLayout.plCode));
+                pldDataList.add(new WriteExcelData(pldRow.get(),2, pluiLayout.plName));
+                pldDataList.add(new WriteExcelData(pldRow.get(),3, pluiLayout.plRelatedType));
+                pldDataList.add(new WriteExcelData(pldRow.get(),4, pluiLayout.plIsShowForm));
+                pldDataList.add(new WriteExcelData(pldRow.get(),5, pluiLayout.plIsShowNavigator));
+                pldDataList.add(new WriteExcelData(pldRow.get(),6, pluiLayout.plIsShowTab));
+                pldRow.getAndIncrement();
+
                 //value涓瓨鏀剧殑澶氫釜浠ラ�楀彿闂撮殧鐨勯〉绛緄d,閫氳繃杩欎釜id鏌ヨ鍑哄叾涓嬬殑椤甸潰璁捐鍜屾寜閽厤缃�
                 List<String> plTabPageOIds = Arrays.asList(item.getValue().split(","));
                 if(Func.isNotEmpty(pluiLayout) && Func.isNotBlank(pluiLayout.plOId) && Func.isNotEmpty(plTabPageOIds)){
                     PLTabPage[] plTabPages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pluiLayout.plOId);
                     List<PLTabPage> filterTabPages = Arrays.stream(plTabPages).filter(plTabPage -> plTabPageOIds.contains(plTabPage.plOId)).collect(Collectors.toList());
                     filterTabPages.stream().forEach(tabPage->{
-                        excelDataList.add(new WriteExcelData(row.get(),0, pluiLayout.plRelatedType));
-                        excelDataList.add(new WriteExcelData(row.get(),1, pluiLayout.plName));
-                        excelDataList.add(new WriteExcelData(row.get(),2, pluiLayout.plCode));
-                        excelDataList.add(new WriteExcelData(row.get(),3, pluiLayout.plIsShowForm));
-                        excelDataList.add(new WriteExcelData(row.get(),4, pluiLayout.plIsShowNavigator));
-                        excelDataList.add(new WriteExcelData(row.get(),5, pluiLayout.plIsShowTab));
-                        excelDataList.add(new WriteExcelData(row.get(),6, tabPage.plSeq));
-                        excelDataList.add(new WriteExcelData(row.get(),7, tabPage.plLabel));
-                        excelDataList.add(new WriteExcelData(row.get(),8, tabPage.plName));
-                        excelDataList.add(new WriteExcelData(row.get(),9, tabPage.plIsOpen));
-                        excelDataList.add(new WriteExcelData(row.get(),10, tabPage.plOpenExpression));
-                        excelDataList.add(new WriteExcelData(row.get(),11, tabPage.plUIParser));
-                        excelDataList.add(new WriteExcelData(row.get(),12, tabPage.plExtAttr));
-                        excelDataList.add(new WriteExcelData(row.get(),13, tabPage.plDesc));
+                        //鍖哄煙瀹氫箟
+                        tpDataList.add(new WriteExcelData(tpRow.get(),0, tabPage.plOId));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),1, tabPage.plSeq));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),2, tabPage.plLabel));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),3, tabPage.plName));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),4, tabPage.plContextOId));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),5, tabPage.plIsOpen));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),6, tabPage.plOpenExpression));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),7, tabPage.plUIParser));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),8, tabPage.plExtAttr));
+                        tpDataList.add(new WriteExcelData(tpRow.get(),9, tabPage.plDesc));
+                        tpRow.getAndIncrement();
                         try {
                             PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(tabPage.plOId);
                             if(Func.isNotEmpty(plPageDefinations)){
-                                excelDataList.add(new WriteExcelData(row.get(),14, JSON.toJSONString(plPageDefinations)));
-                                List<PLTabButtonVO> tabButtonsTotal = new ArrayList<>();
+                                //List<PLTabButtonVO> tabButtonsTotal = new ArrayList<>();
                                 Arrays.stream(plPageDefinations).forEach(plPageDefination->{
-                                    List<PLTabButtonVO> tabButtons = this.getTabButtons(plPageDefination.plOId);
-                                    tabButtonsTotal.addAll(tabButtons);
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),0, plPageDefination.plOId));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),1, plPageDefination.plTabPageOId));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),2, plPageDefination.plType));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),3, plPageDefination.name));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),4, plPageDefination.desc));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),5, plPageDefination.seq));
+                                    pdDataList.add(new WriteExcelData(pdRow.get(),6, plPageDefination.plDefination));
+                                    pdRow.getAndIncrement();
+                                    //鏌ヨ鎸夐挳
+                                    try {
+                                        PLTabButton[] tabButtons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(plPageDefination.plOId);
+                                        for (PLTabButton tabButton:tabButtons){
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),0, tabButton.plOId));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),1, tabButton.plTableOId));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),2, tabButton.plPageOId));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),3, tabButton.plActionOId));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),4, tabButton.plLabel));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),5, tabButton.plAreaType));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),6, tabButton.plDesc));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),7, tabButton.plSeq));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),8, tabButton.plParentOid));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),9, tabButton.displayMode));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),10, tabButton.iconPath));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),11, tabButton.authorization));
+                                            tbDataList.add(new WriteExcelData(tbRow.get(),12, tabButton.show));
+                                            tbRow.getAndIncrement();
+                                            PLCommandParameter[] parameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(tabButton.plOId);
+                                            if(Func.isNotEmpty(parameters)){
+                                                Arrays.stream(parameters).forEach(param->{
+                                                    cpDataList.add(new WriteExcelData(cpRow.get(),0, param.plOId));
+                                                    cpDataList.add(new WriteExcelData(cpRow.get(),1, param.plCommandOId));
+                                                    cpDataList.add(new WriteExcelData(cpRow.get(),2, param.plKey));
+                                                    cpDataList.add(new WriteExcelData(cpRow.get(),3, param.plValue));
+                                                    cpRow.getAndIncrement();
+                                                });
+                                            }
+                                        }
+                                    } catch (PLException e) {
+                                        e.printStackTrace();
+                                    }
                                 });
-                                excelDataList.add(new WriteExcelData(row.get(),15, JSON.toJSONString(tabButtonsTotal)));
                             }
                         } catch (PLException e) {
                             e.printStackTrace();
                         }
-                        row.getAndIncrement();
                     });
                 }
             } catch (PLException e) {
                 e.printStackTrace();
             }
         });
-        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
+        WriteExcelOption excelOption = new WriteExcelOption();
+        excelOption.addSheetDataList("PlpageLayoutDefnation",pldDataList);
+        excelOption.addSheetDataList("Pltabpage",tpDataList);
+        excelOption.addSheetDataList("Plpagedefination",pdDataList);
+        excelOption.addSheetDataList("Pltabbutton",tbDataList);
+        excelOption.addSheetDataList("PlcommondParam",cpDataList);
         ExcelUtil.writeDataToFile(excelPath, excelOption);
         return excelPath;
     }

--
Gitblit v1.9.3