ludc
2024-09-12 aed7f0e9be4e88a4ed632f9ca7aca05fa1e7f6b8
UI上下文导出树查询和导出接口
已修改4个文件
553 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLDefinationVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 371 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLDefinationVO.java
@@ -99,7 +99,7 @@
    /**
     * 业务类型
     */
    private String btmType = "";
    //private String btmType = "";
    /**
     * 链接类型
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -1,20 +1,25 @@
package com.vci.web.controller;
import cn.hutool.core.io.FileUtil;
import com.vci.corba.common.PLException;
import com.vci.corba.portal.data.PLPageDefination;
import com.vci.corba.portal.data.PLTabPage;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.dto.UIAuthorDTO;
import com.vci.pagemodel.PLDefinationVO;
import com.vci.pagemodel.PLTabButtonVO;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsBtmServiceI;
import com.vci.web.service.UIManagerServiceI;
import com.vci.web.util.Func;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,10 +27,12 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.xml.crypto.Data;
import java.io.File;
import java.io.IOException;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * UI定义控制层
@@ -160,13 +167,45 @@
    }
    /**
     * 查询要导出UI上下文树
     * @param expDatas
     * @return
     * @throws PLException
     */
    @GetMapping( "/getExpContextTree")
    @VciBusinessLog(operateName = "查询要导出UI上下文树")
    public BaseResult getExpContextTree(String[] expDatas){
        try {
            return BaseResult.success(uiManagerService.getExpContextTree(Arrays.asList(expDatas)),"Success");
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "查询要导出UI上下文树时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 导出UI上下文
     * name 链接类型名称
     * @return
     */
    @GetMapping("/expUIContextData")
    public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException {
        uiManagerService.expUIContextData(oids, response);
    @PostMapping("/expUIContextData")
    public void expUIContextData(@RequestBody Map<String,String> expConditionMap, HttpServletResponse response) throws PLException, IOException {
        try {
            String excelPath = uiManagerService.expUIContextData(expConditionMap);
            ControllerUtil.writeFileToResponse(response,excelPath);
            FileUtil.del(LocalFileUtil.getDefaultTempFolder() + File.separator);
        } catch (Exception e) {
            String msg = "导出UI上下文时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                //出错时
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
    /**
@@ -339,6 +378,110 @@
        }
    }
    //页面设计下配置按钮相关接口
    /**
     * 获取页签区域按钮配置信息
     * @param pageDefinationOid
     * @return
     */
    @GetMapping( "/getTabButtons")
    @VciBusinessLog(operateName = "获取页签区域按钮配置信息")
    public BaseResult getTabButtons(String pageDefinationOid){
        try {
            return BaseResult.dataList(uiManagerService.getTabButtons(pageDefinationOid));
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "获取页签区域按钮配置信息时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 添加按钮配置信息
     * @param tabButtonVO
     * @return 保存结果
     */
    @PostMapping("/addTapButton")
    public BaseResult addTapButton(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.addTapButton(tabButtonVO);
        } catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "按钮配置信息添加时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 修改按钮配置信息
     * @param  tabButtonVO
     * @return 修改结果
     */
    @PutMapping("/updateTapButton")
    public BaseResult updateTapButton(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.updateTapButton(tabButtonVO);
        } catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "修改按钮配置信息时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 删除单个按钮配置
     * @param tabButtonVO
     * @return
     */
    @DeleteMapping("/deleteTapButton")
    public BaseResult deleteTapButton(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.deleteTapButton(tabButtonVO) ? BaseResult.success("删除单个按钮配置成功!"):BaseResult.fail("删除单个按钮配置失败!");
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "删除单个按钮配置时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 调整为下级按钮
     * @param  tabButtonVO
     * @return 修改结果
     */
    @PutMapping("/joinBtn")
    public BaseResult joinBtn(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.joinBtn(tabButtonVO);
        } catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "调整为下级按钮时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 调整为上级按钮
     * @param  tabButtonVO
     * @return 修改结果
     */
    @PutMapping("/exitBtn")
    public BaseResult exitBtn(@RequestBody PLTabButtonVO tabButtonVO){
        try {
            return uiManagerService.exitBtn(tabButtonVO);
        } catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "调整为上级按钮时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * 根据角色获取UI/表单/按钮的权限.
     * @param baseQueryObject
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
@@ -1,9 +1,7 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.corba.portal.data.PLTabButton;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.corba.portal.data.PLPageDefination;
import com.vci.corba.portal.data.PLTabPage;
import com.vci.pagemodel.PLTabButtonVO;
import com.vci.pagemodel.PLUILayoutCloneVO;
@@ -18,6 +16,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
 * @author ludc
@@ -63,11 +62,18 @@
    boolean cloneUIContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException;
    /**
     * 根据勾选的条件获取需要导出的ui上下文树
     * @param expDatas
     * @return
     */
    Tree getExpContextTree(List<String> expDatas);
    /**
     * 导出ui上下文(勾选的要导出的控制区的数据)
     * oids
     * @return
     */
    void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException;
    String expUIContextData(Map<String,String> expConditionMap) throws PLException, IOException;
    /**
     * 导入UI上下文
@@ -170,24 +176,24 @@
    /**
     * 删除单个按钮配置
     * @param tabButton
     * @param tabButtonVO
     * @return
     */
    boolean deleteTapButton(PLTabButton tabButton) throws PLException;
    boolean deleteTapButton(PLTabButtonVO tabButtonVO) throws PLException;
    /**
     * 调整为下级按钮
     * @param plTabButton
     * @param tabButtonVO
     * @return
     */
    BaseResult joinBtn(PLTabButton plTabButton) throws PLException;
    BaseResult joinBtn(PLTabButtonVO tabButtonVO) throws PLException;
    /**
     * 调整为上级按钮
     * @param plTabButton
     * @param tabButtonVO
     * @return
     */
    BaseResult exitBtn(PLTabButton plTabButton) throws PLException;
    BaseResult exitBtn(PLTabButtonVO tabButtonVO) throws PLException;
    /**
     * 获取UI权限树
@@ -204,6 +210,5 @@
     * @throws Exception
     */
    boolean authorizedUI(UIAuthorDTO uiAuthorDTO)throws Exception;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -1,5 +1,6 @@
package com.vci.web.service.impl;
import com.alibaba.fastjson.JSON;
import com.vci.common.utility.ObjectUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.framework.data.RoleRightInfo;
@@ -8,21 +9,22 @@
import com.vci.corba.portal.data.*;
import com.vci.dto.RoleRightDTO;
import com.vci.dto.UIAuthorDTO;
import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI;
import com.vci.model.PLDefination;
import com.vci.pagemodel.*;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.*;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.SessionInfo;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.VciDateUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import com.vci.starter.web.util.*;
import com.vci.web.service.OsBtmServiceI;
import com.vci.web.service.UIManagerServiceI;
import com.vci.web.util.*;
import com.vci.web.util.BeanUtil;
import org.apache.commons.lang3.StringUtils;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
@@ -35,11 +37,9 @@
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.swing.*;
import javax.swing.tree.TreePath;
import java.io.IOException;
import java.io.File;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.regex.Pattern;
@@ -313,13 +313,133 @@
    }
    /**
     * 根据勾选的条件获取需要导出的ui上下文树
     * @param expDatas
     * @return
     */
    @Override
    public Tree getExpContextTree(List<String> expDatas) {
        VciBaseUtil.alertNotNull(expDatas,"导出查询列表");
        Tree tree = new Tree();
        String newObjectID36 = ObjectUtility.getNewObjectID36();
        tree.setOid(newObjectID36);
        tree.setText("区域");
        tree.setLevel(0);
        List<Tree> treeList = new ArrayList<>();
        expDatas.stream().forEach(oid->{
            try {
                PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(oid);
                if(Func.isNotEmpty(pluiLayout) &&  Func.isNotBlank(pluiLayout.plOId)){
                    Tree tree1 = new Tree();
                    tree1.setText(pluiLayout.plName);
                    tree1.setOid(pluiLayout.plOId);
                    tree1.setLevel(1);
                    tree1.setParentId(newObjectID36);
                    //查询
                    PLTabPage[] plTabPages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pluiLayout.plOId);
                    List<Tree> treeChildrens = new ArrayList<>();
                    Arrays.stream(plTabPages).forEach(item->{
                        Tree tree2 = new Tree();
                        tree2.setLeaf(true);
                        tree2.setOid(item.plOId);
                        tree2.setText(item.plName);
                        tree2.setLevel(2);
                        tree2.setParentId(item.plContextOId);
                        treeChildrens.add(tree2);
                    });
                    tree1.setChildren(treeChildrens);
                    treeList.add(tree1);
                }
            } catch (PLException e) {
                e.printStackTrace();
            }
        });
        tree.setChildren(treeList);
        return tree;
    }
    /**
     * 导出ui上下文(勾选的要导出的控制区的数据)
     * oids
     * @return
     */
    @Override
    public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException {
    public String expUIContextData(Map<String,String> expConditionMap) throws PLException {
        if(Func.isEmpty(expConditionMap)){
            throw new PLException("500",new String[]{"请勾选要导出的UI上下文数据!"});
        }
        //界面没传名称,使用默认导出名称
        String exportFileName = "UI上下文导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss");
        //设置列名
        List<String> columns = Arrays.asList(
                "所属业务类型","名称", "UI上下文", "导航区", "控制区","操作区",
                "页签序号","区域编码","区域名称","是否启用","显示表达式", "UI解析类",
                "扩展属性", "描述","页面设计信息","页面下配置的按钮"
        );
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
        try {
            new File(excelPath).createNewFile();
        } catch (Throwable e) {
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
        }
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>();
        //设置列头
        for (int index = 0; index < columns.size(); index++) {
            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
        }
        AtomicInteger row = new AtomicInteger(1);
        expConditionMap.entrySet().stream().forEach(item->{
            //key存放的ui上下文的id
            try {
                PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(item.getKey());
                //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));
                        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<>();
                                Arrays.stream(plPageDefinations).forEach(plPageDefination->{
                                    List<PLTabButtonVO> tabButtons = this.getTabButtons(plPageDefination.plOId);
                                    tabButtonsTotal.addAll(tabButtons);
                                });
                                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);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
@@ -329,6 +449,10 @@
     */
    @Override
    public BaseResult impUIContextData(MultipartFile file) {
        return null;
    }
@@ -436,6 +560,13 @@
                PLDefinationVO plDefinationVO = new PLDefinationVO();
                PLDefination plDefination = UITools.getPLDefination(item.plDefination);
                BeanUtil.copy(plDefination,plDefinationVO);
                plDefinationVO.setDescription(item.desc);
                plDefinationVO.setSeq(String.valueOf(item.seq));
                plDefinationVO.setTabPageOId(item.plTabPageOId);
                plDefinationVO.setId(item.plOId);
                plDefinationVO.setName(item.name);
                plDefinationVO.setType(item.plType);
                plDefinationVO.setTemplateType(String.valueOf(plDefination.getTemplateType()));
                plDefinationVOList.add(plDefinationVO);
            } catch (Throwable e) {
                e.printStackTrace();
@@ -460,14 +591,14 @@
        pd.plTabPageOId = pdVO.getTabPageOId();
        pd.plOId = ObjectUtility.getNewObjectID36();
        //不能为空属性检查
        if(!this.baseInfoIsOk(pd,false)){
        /*if(!this.baseInfoIsOk(pd,false)){
            return false;
        }
        }*/
        pd.name = pdVO.getName().trim();
        pd.seq = Short.valueOf(pdVO.getSeq().trim());
        pd.desc = pdVO.getDescription();
        pd.plType = Short.parseShort(pdVO.getTemplateType());
        pd.plType = (short) pdVO.getType();
        d.setName(pdVO.getName().trim());
        d.setUiParser(pdVO.getUiParser().trim());
@@ -478,15 +609,15 @@
        newPLDefinationIsOk(pdVO, false);
        // 检查各个类型下的数据是否输入或有效,一共6种类型按类型检验
        short plType = pd.plType;
        switch (plType){
        String templateType = pdVO.getTemplateType();
        switch (templateType){
            //Table(表格)
            case 1:
            case "1":
            //From(表单)
            case 4:
            case "4":
                TableComptCheckInput tci = new TableComptCheckInput(
                    pdVO.getSearchTarger()
                    ,pdVO.getBtmType()
                    ,pdVO.getShowType()
                    ,pdVO.getLinkType()
                    ,pdVO.getTemplateId()
                    ,pdVO.getQueryTemplateName()
@@ -497,7 +628,7 @@
                d = tci.getNewPLDefination(d);
                break;
            //Custom(自定义模板)
            case 2:
            case "2":
                //只检查控制路径不能为空,有问题会直接报错
                CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath());
                if(!ccci.checkInputIsOk()){
@@ -506,10 +637,10 @@
                d = ccci.getNewPLDefination(d);
                break;
            //TreeTable(树表)
            case 3:
            case "3":
                TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput(
                    pdVO.getSearchTarger()
                    ,pdVO.getBtmType()
                    ,pdVO.getShowType()
                    ,pdVO.getLinkType()
                    ,pdVO.getTemplateId()
                    ,pdVO.getQueryTemplateName()
@@ -522,9 +653,9 @@
                d = ttcci.getNewPLDefination(d);
                break;
            //Tree(树)
            case 5:
            case "5":
                TreeComptCheckInput tcci = new TreeComptCheckInput(
                    pdVO.getBtmType(),
                    pdVO.getShowType(),
                    pdVO.getLinkType(),
                    pdVO.getQueryTemplateName(),
                    pdVO.getShowExpressionRoot(),
@@ -539,10 +670,10 @@
                d = tcci.getNewPLDefination(d);
                break;
            //UILayout(UI定义)
            case 6:
            case "6":
                UILayoutComptCheckInput ulci = new UILayoutComptCheckInput(
                    pdVO.getSearchTarger(),
                    pdVO.getBtmType(),
                    pdVO.getShowType(),
                    pdVO.getUiLayout(),
                    pdVO.getQueryTemplateName(),
                    pdVO.getQryType()
@@ -576,14 +707,17 @@
        BeanUtil.copy(pdVO,d);
        //不能为空属性检查
        if(!this.baseInfoIsOk(pd,true)){
        /*if(!this.baseInfoIsOk(pd,true)){
            return false;
        }
        }*/
        pd.plOId = pdVO.getId();
        pd.plTabPageOId = pdVO.getTabPageOId();
        pd.name = pdVO.getName().trim();
        pd.seq = Short.valueOf(pdVO.getSeq().trim());
        pd.desc = pdVO.getDescription();
        pd.plType = Short.parseShort(pdVO.getTemplateType());
        pd.plType = (short) pdVO.getType();
        d.setId(pdVO.getId());
        d.setName(pdVO.getName().trim());
        d.setUiParser(pdVO.getUiParser().trim());
        d.setExtAttr(pdVO.getExtAttr().trim());
@@ -592,15 +726,15 @@
        this.newPLDefinationIsOk(pdVO, true);
        // 检查各个组件内部的数据是否有效
        int plType = pdVO.getType();
        switch (plType){
        String templateType = pdVO.getTemplateType();
        switch (templateType){
            //Table(表格)
            case 1:
            case "1":
                //From(表单)
            case 4:
            case "4":
                TableComptCheckInput tci = new TableComptCheckInput(
                        pdVO.getSearchTarger()
                        ,pdVO.getBtmType()
                        ,pdVO.getShowType()
                        ,pdVO.getLinkType()
                        ,pdVO.getTemplateId()
                        ,pdVO.getQueryTemplateName()
@@ -611,7 +745,7 @@
                d = tci.getNewPLDefination(d);
                break;
            //Custom(自定义模板)
            case 2:
            case "2":
                //只检查控制路径不能为空,有问题会直接报错
                CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath());
                if(!ccci.checkInputIsOk()){
@@ -620,10 +754,10 @@
                d = ccci.getNewPLDefination(d);
                break;
            //TreeTable(树表)
            case 3:
            case "3":
                TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput(
                        pdVO.getSearchTarger()
                        ,pdVO.getBtmType()
                        ,pdVO.getShowType()
                        ,pdVO.getLinkType()
                        ,pdVO.getTemplateId()
                        ,pdVO.getQueryTemplateName()
@@ -636,9 +770,9 @@
                d = ttcci.getNewPLDefination(d);
                break;
            //Tree(树)
            case 5:
            case "5":
                TreeComptCheckInput tcci = new TreeComptCheckInput(
                        pdVO.getBtmType(),
                        pdVO.getShowType(),
                        pdVO.getLinkType(),
                        pdVO.getQueryTemplateName(),
                        pdVO.getShowExpressionRoot(),
@@ -653,10 +787,10 @@
                d = tcci.getNewPLDefination(d);
                break;
            //UILayout(UI定义)
            case 6:
            case "6":
                UILayoutComptCheckInput ulci = new UILayoutComptCheckInput(
                        pdVO.getSearchTarger(),
                        pdVO.getBtmType(),
                        pdVO.getShowType(),
                        pdVO.getUiLayout(),
                        pdVO.getQueryTemplateName(),
                        pdVO.getQryType()
@@ -682,7 +816,7 @@
    @Override
    public boolean delPageDefination(String[] oids) throws PLException {
        VciBaseUtil.alertNotNull(oids,"删除的页面定义主键");
        boolean res = platformClientUtil.getUIService().deletePLUILayoutByOidsForCascade(oids);
        boolean res = platformClientUtil.getUIService().deletePLPageDefinationByOidsForCascade(oids);
        return res;
    }
@@ -734,7 +868,6 @@
                logger.error(errorLog);
                throw new VciBaseException(errorLog);
            }
        });
        return plTabButtonVOList;
    }
@@ -770,7 +903,13 @@
        //参数信息回填
        PLCommandParameter[] parameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(tabButtonDO.plOId);
        if(Func.isNotEmpty(parameters)){
            LinkedHashMap<String, String> parameterMap = (LinkedHashMap<String, String>)Arrays.stream(parameters).collect(Collectors.toMap(parm -> parm.plKey, parm -> parm.plValue));
            LinkedHashMap<String, String> parameterMap = Arrays.stream(parameters)
                .collect(Collectors.toMap(
                        parm -> parm.plKey,
                        parm -> parm.plValue,
                        (existing, replacement) -> existing, // 处理重复键的情况
                        LinkedHashMap::new // 指定使用 LinkedHashMap
                ));
            plTabButtonVO.setButtonParams(parameterMap);
        }
        return plTabButtonVO;
@@ -900,7 +1039,7 @@
        }
        LinkedHashMap<String, String> buttonParams = tabButtonVO.getButtonParams();
        if(!buttonParams.isEmpty()) {
        if(Func.isNotEmpty(buttonParams)) {
            Iterator<Map.Entry<String, String>> iterator = buttonParams.entrySet().iterator();
            while(iterator.hasNext()){
                Map.Entry<String, String> next = iterator.next();
@@ -908,23 +1047,21 @@
                    iterator.remove();
                }
            }
            if(!buttonParams.isEmpty()){
                Iterator<Map.Entry<String, String>> kvItor = buttonParams.entrySet().iterator();
                while(kvItor.hasNext()){
                    Map.Entry<String, String> next = kvItor.next();
                    PLCommandParameter plCommandParameter = new PLCommandParameter();
                    plCommandParameter.plOId = ObjectUtility.getNewObjectID36();
                    plCommandParameter.plCommandOId = plTabButton.plOId;
                    plCommandParameter.plKey = next.getKey();
                    plCommandParameter.plValue = next.getValue();
                    plCommandParameter.plCreateUser = sessionInfo.getUserId();
                    plCommandParameter.plModifyUser = sessionInfo.getUserId();
                    try {
                        platformClientUtil.getUIService().savePLCommandParameter(plCommandParameter);
                    } catch (PLException e) {
                        e.printStackTrace();
                        throw new VciBaseException("保存按钮信息时发生异常:"+ e.getMessage());
                    }
            Iterator<Map.Entry<String, String>> kvItor = buttonParams.entrySet().iterator();
            while(kvItor.hasNext()){
                Map.Entry<String, String> next = kvItor.next();
                PLCommandParameter plCommandParameter = new PLCommandParameter();
                plCommandParameter.plOId = ObjectUtility.getNewObjectID36();
                plCommandParameter.plCommandOId = plTabButton.plOId;
                plCommandParameter.plKey = next.getKey();
                plCommandParameter.plValue = next.getValue();
                plCommandParameter.plCreateUser = sessionInfo.getUserId();
                plCommandParameter.plModifyUser = sessionInfo.getUserId();
                try {
                    platformClientUtil.getUIService().savePLCommandParameter(plCommandParameter);
                } catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException("保存按钮信息时发生异常:"+ e.getMessage());
                }
            }
        }
@@ -933,36 +1070,36 @@
    /**
     * 删除单个按钮配置
     * @param tabButton
     * @param tabButtonVO
     * @return
     */
    @Override
    public boolean deleteTapButton(PLTabButton tabButton) throws PLException {
            VciBaseUtil.alertNotNull(tabButton,"删除的按钮配置对象");
            boolean success = UITools.getService().deletePLTabButton(tabButton);
            if(success == false){
                throw new VciBaseException("该有子级按钮,不能删除!");
            }
            return true;
    public boolean deleteTapButton(PLTabButtonVO tabButtonVO) throws PLException {
        VciBaseUtil.alertNotNull(tabButtonVO,"删除的按钮配置对象");
        boolean success = platformClientUtil.getUIService().deletePLTabButton(this.tabButtonVO2TabButton(new PLTabButton(),tabButtonVO));
        if(success == false){
            throw new VciBaseException("该有子级按钮,不能删除!");
        }
        return true;
    }
    /**
     * 调整为下级按钮
     * @param plTabButton
     * @param tabButtonVO
     * @return
     */
    @Override
    public BaseResult joinBtn(PLTabButton plTabButton) throws PLException {
        VciBaseUtil.alertNotNull(plTabButton,"需调整为下级按钮",plTabButton.plTableOId,"当前按钮配置所在的页面主键");
    public BaseResult joinBtn(PLTabButtonVO tabButtonVO) throws PLException {
        VciBaseUtil.alertNotNull(tabButtonVO,"需调整为下级按钮",tabButtonVO.getTableOId(),"当前按钮配置所在的页面主键");
        //同一页面下的按钮
        List<PLTabButtonVO> plTabButtons = this.getTabButtons(plTabButton.plTableOId);
        List<PLTabButtonVO> plTabButtons = this.getTabButtons(tabButtonVO.getTableOId());
        if(Func.isEmpty(plTabButtons)){
            return BaseResult.fail("未获取到按钮配置信息!");
        }
        //获取当前要移动的按钮的下标
        int index = 0;
        for (int i = 0; i < plTabButtons.size(); i++) {
            if (plTabButtons.get(i).getOId().equals(plTabButton.plOId)) {
            if (plTabButtons.get(i).getOId().equals(tabButtonVO.getOId())) {
                index = i; // 找到后记录下标
                break; // 找到后退出循环
            }
@@ -972,8 +1109,8 @@
            return BaseResult.fail("当前节点不存在兄节点,无法调整为下级按钮!");
        }
        //设置父id为上一个节点的
        plTabButton.plParentOid = plTabButtons.get(index-1).getOId();
        tabButtonVO.setParentOid(plTabButtons.get(index-1).getOId());
        PLTabButton plTabButton = this.tabButtonVO2TabButton(new PLTabButton(), tabButtonVO);
        boolean success = platformClientUtil.getUIService().updatePLTabButton(plTabButton);
        if(success == false) {
            return BaseResult.fail("修改失败!");
@@ -983,13 +1120,13 @@
    /**
     * 调整为上级按钮
     * @param plTabButton
     * @param tabButtonVO
     * @return
     */
    @Override
    public BaseResult exitBtn(PLTabButton plTabButton) throws PLException {
        plTabButton.plParentOid = "";
    public BaseResult exitBtn(PLTabButtonVO tabButtonVO) throws PLException {
        tabButtonVO.setParentOid("");
        PLTabButton plTabButton = this.tabButtonVO2TabButton(new PLTabButton(), tabButtonVO);
        boolean success = platformClientUtil.getUIService().updatePLTabButton(plTabButton);
        if(success == false) {
            BaseResult.fail("撤销失败!");
@@ -1047,7 +1184,6 @@
     * @throws PLException
     */
    private void newPLDefinationIsOk(PLDefinationVO pd, boolean isEdit) throws PLException{
        boolean res = false;
        boolean nameExist = false;
        boolean seqExist = false;
        PLPageDefination[] pds = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(pd.getTabPageOId());
@@ -1694,13 +1830,14 @@
        /**
         * 非空检查
         * @param tip
         * @param txt
         * @param tip 提示信息
         * @param txt 校验的内容
         * @param isRequired 是否必填
         * @return
         */
        protected boolean checkRequiredIsOk(String tip, String txt){
        protected boolean checkRequiredIsOk(String tip, String txt,boolean isRequired/*是否必填*/){
            boolean res = false;
            if(Func.isBlank(txt)){
            if(Func.isBlank(txt) && isRequired){
                throw new VciBaseException(tip + " 不能为空!");
            } else {
                res = true;
@@ -1714,11 +1851,11 @@
         * @param btmName 业务类型名
         * @return
         */
        protected boolean checkBtmTypeTxtIsOk(String tipName, String btmName) throws PLException {
        protected boolean checkBtmTypeTxtIsOk(String tipName, String btmName,boolean isRequired) throws PLException {
            boolean res = false;
            if(tipName == null) return true;
            if(btmName == null) return true;
            if(!checkRequiredIsOk(tipName, btmName)){
            if(!checkRequiredIsOk(tipName, btmName, isRequired)){
                res = false;
            } else if(!checkBtmNameIsExist(tipName, btmName)){
                res = false;
@@ -1770,11 +1907,11 @@
         * @param btmLinkType
         * @return
         */
        protected boolean checkPortalVITxtIsOk(String tip, String txtVIName, String btmLinkType) throws PLException {
        protected boolean checkPortalVITxtIsOk(String tip, String txtVIName, String btmLinkType, boolean isRequired) throws PLException {
            boolean res = false;
            if(tip == null) return true;
            if(txtVIName == null) return true;
            if(!checkRequiredIsOk(tip, txtVIName)){
            if(!checkRequiredIsOk(tip, txtVIName,isRequired)){
                res = false;
            } else if(!checkPortalVIIsExist(tip, txtVIName, btmLinkType)){
                res = false;
@@ -1813,13 +1950,13 @@
         * @param btmLinkType
         * @return
         */
        protected boolean checkQTNameTxtIsOk(String tip, String txtQTName, String btmLinkType) throws PLException {
        protected boolean checkQTNameTxtIsOk(String tip, String txtQTName, String btmLinkType, boolean isRequired) throws PLException {
            boolean res = false;
            if(tip == null) return true;
            if(txtQTName == null) return true;
            if(!checkRequiredIsOk(tip, txtQTName)){
            if(!checkRequiredIsOk(tip, txtQTName, isRequired)){
                res = false;
            } else if(Func.isBlank(txtQTName) && !checkQTIsExist(tip, txtQTName, btmLinkType)){
            } else if(Func.isNotBlank(txtQTName) && !checkQTIsExist(tip, txtQTName, btmLinkType)){
                res = false;
            } else {
                res = true;
@@ -1834,11 +1971,11 @@
         * @param btmLinkType
         * @return
         */
        protected boolean checkUILayoutTxtIsOk(String tip, String uiName, String btmLinkType) throws PLException {
        protected boolean checkUILayoutTxtIsOk(String tip, String uiName, String btmLinkType, boolean isRequired) throws PLException {
            boolean res = false;
            if(tip == null) return true;
            if(uiName == null) return true;
            if(!checkRequiredIsOk(tip, uiName)){
            if(!checkRequiredIsOk(tip, uiName,isRequired)){
                res = false;
            } else if(!checkUILayoutIsExist(tip, uiName, btmLinkType)){
                res = false;
@@ -1892,11 +2029,11 @@
         * @param linkTypeName
         * @return
         */
        protected boolean checkLinkTypeTxtIsOk(String tip, String linkTypeName) throws PLException {
        protected boolean checkLinkTypeTxtIsOk(String tip, String linkTypeName, boolean isRequired) throws PLException {
            boolean res = false;
            if(tip == null) return true;
            if(linkTypeName == null) return true;
            if(!checkRequiredIsOk(tip, linkTypeName)){
            if(!checkRequiredIsOk(tip, linkTypeName,isRequired)){
                res = false;
            } else if(!checkLinkTypeIsExist(tip, linkTypeName)){
                res = false;
@@ -2040,11 +2177,11 @@
         */
        private boolean checkBtmTypeInputIsOk(String btmType,String txtVIName/*选择模板*/,String txtQTName/*查询模板*/) throws PLException {
            boolean res = false;
            if(!super.checkBtmTypeTxtIsOk("业务类型", btmType)){
            if(!super.checkBtmTypeTxtIsOk("业务类型", btmType,true)){
                res = false;
            } else if(!super.checkPortalVITxtIsOk("选择模板", txtVIName, btmType)){
            } else if(!super.checkPortalVITxtIsOk("选择模板", txtVIName, btmType,true)){
                res = false;
            } else if(!super.checkQTNameTxtIsOk("查询模板", txtQTName, btmType)){
            } else if(!super.checkQTNameTxtIsOk("查询模板", txtQTName, btmType,false)){
                res = false;
            } else {
                res = true;
@@ -2061,11 +2198,11 @@
         */
        private boolean checkLinkTypeInputIsOk(String txtVIName/*选择的模板*/,String txtQTName/*查询模板*/,String btmType) throws PLException {
            boolean res = false;
            if(!(this.checkBtmTypeTxtIsOk("目标对象", linkType))){
            if(!(this.checkBtmTypeTxtIsOk("目标对象", linkType,true))){
                res = false;
            } else if(!(this.checkPortalVITxtIsOk("选择模板", txtVIName, linkType))){
            } else if(!(this.checkPortalVITxtIsOk("选择模板", txtVIName, linkType,true))){
                res = false;
            } else if(!(this.checkQTNameTxtIsOk("查询模板", txtQTName, linkType))){
            } else if(!(this.checkQTNameTxtIsOk("查询模板", txtQTName, linkType,false))){
                res = false;
            } else {
                res = true;
@@ -2145,11 +2282,11 @@
        private boolean checkBtmTypeInputIsOk() throws PLException {
            boolean res = false;
            if(!(super.checkBtmTypeTxtIsOk("顶级节点显示类型", btmType))){
            if(!(super.checkBtmTypeTxtIsOk("顶级节点显示类型", btmType,true))){
                res = false;
            } else if(!(super.checkPortalVITxtIsOk("选择模板", txtVIName, btmType))){
            } else if(!(super.checkPortalVITxtIsOk("选择模板", txtVIName, btmType,true))){
                res = false;
            } else if(!(super.checkQTNameTxtIsOk("查询模板", txtQTName , btmType))){
            } else if(!(super.checkQTNameTxtIsOk("查询模板", txtQTName , btmType,false))){
                res = false;
            } else {
                res = true;
@@ -2159,11 +2296,11 @@
        private boolean checkLinkTypeInputIsOk() throws PLException {
            boolean res = false;
            if(!(super.checkBtmTypeTxtIsOk("顶级节点显示类型", linkType))){
            if(!(super.checkBtmTypeTxtIsOk("顶级节点显示类型", linkType,true))){
                res = false;
            } else if(!(super.checkPortalVITxtIsOk("选择模板", txtVIName, linkType))){
            } else if(!(super.checkPortalVITxtIsOk("选择模板", txtVIName, linkType,true))){
                res = false;
            } else if(!(super.checkQTNameTxtIsOk("查询模板", txtQTName, linkType))){
            } else if(!(super.checkQTNameTxtIsOk("查询模板", txtQTName, linkType,false))){
                res = false;
            } else {
                res = true;
@@ -2241,34 +2378,34 @@
        private boolean checkBtmTypeInputIsOk() throws PLException {
            boolean res = false;
            if(!(super.checkBtmTypeTxtIsOk("业务类型", btmType))){
            if(!(super.checkBtmTypeTxtIsOk("业务类型", btmType,true))){
                res = false;
                return res;
            }
            // 链接类型不为空时,需要同时检查链接类型及链接类型下的查询模板是否有效
            if(Func.isBlank(linkType)){
                if(!(super.checkLinkTypeTxtIsOk("链接类型", linkType))){
                if(!(super.checkLinkTypeTxtIsOk("链接类型", linkType,false))){
                    res = false;
                    return res;
                } else if(!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, linkType))){
                } else if(!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, linkType,true))){
                    res = false;
                    return res;
                }
            } else {
                // 链接类型为空时,只需要检查业务类型下的查询模板是否有效
                if(!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, btmType))){
                if(!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, btmType,true))){
                    res = false;
                    return res;
                }
            }
            if(!super.checkRequiredIsOk("根节点显示表达式", showExpressionRoot)){
            if(!super.checkRequiredIsOk("根节点显示表达式", showExpressionRoot,true)){
                res = false;
            }
            else if(!super.checkRequiredIsOk("树节点显示表达式", showExpression)){
            else if(!super.checkRequiredIsOk("树节点显示表达式", showExpression,true)){
                res = false;
            }
            else if(!super.checkRequiredIsOk("参照树设置", refTreeSet)){
            else if(!super.checkRequiredIsOk("参照树设置", refTreeSet,true)){
                res = false;
            }
            else {
@@ -2336,11 +2473,11 @@
        private boolean checkUILayoutInputIsOk() throws PLException {
            boolean res = false;
            if (!(super.checkBtmTypeTxtIsOk("对象类型", uiBtmType))) {
            if (!(super.checkBtmTypeTxtIsOk("对象类型", uiBtmType,true))) {
                res = false;
            } else if (!(super.checkUILayoutTxtIsOk("UI定义", uiLayout, uiBtmType))) {
            } else if (!(super.checkUILayoutTxtIsOk("UI定义", uiLayout, uiBtmType,true))) {
                res = false;
            } else if (!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, qryType))) {
            } else if (!(super.checkQTNameTxtIsOk("查询模板", queryTemplateName, qryType,false))) {
                res = false;
            } else {
                res = true;