ludc
2024-09-13 5056af07922b451b6edaaff615e34d88ce77dd16
ui上下文导出接口修改
已修改2个文件
111 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
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解析类",
                "扩展属性", "描述","页面设计信息","页面下配置的按钮"
        );
        );*/
        //写excel
        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存放的ui上下文的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中存放的多个以逗号间隔的页签id,通过这个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;
    }