ludc
2024-09-02 e45b445e2145dbd83864eb28417ae02bffc1a900
ui定义:UI上下文区域查询、增加、修改、删除、克隆接口上传
已修改4个文件
已添加4个文件
673 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLUILayoutCloneVO.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIEngineServiceI.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 369 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLUILayoutCloneVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package com.vci.pagemodel;
import com.vci.corba.portal.data.PLUILayout;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * ui上下文克隆对象
 * @author ludc
 * @date 2024/9/2 12:58
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PLUILayoutCloneVO {
    /**
     * å…‹éš†ç›®æ ‡ä¸»é”®
     */
    private String cloneTargetOid;
    /**
     * å…‹éš†çš„æºå¯¹è±¡çš„信息
     */
    private PLUILayout sourcePLUILayout;
    /**
     * å…‹éš†åç§°
     */
    private String cloneName;
    /**
     * å…‹éš†ä¸Šä¸‹æ–‡ç¼–码
     */
    private String cloneContextCode;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,154 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.dto.OsBtmTypeDTO;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsBtmServiceI;
import com.vci.web.service.UIManagerServiceI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
/**
 * UI定义控制层
 * @author ludc
 * @date 2024/8/28 17:09
 */
@RestController
@RequestMapping("/uiManagerController")
public class UIManagerController {
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * ä¸šåŠ¡ç±»åž‹çš„æœåŠ¡
     */
    @Autowired
    private OsBtmServiceI btmService;
    /**
     * UI定义服务
     */
    @Autowired
    private UIManagerServiceI uiManagerService;
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ—è¡¨æŸ¥è¯¢ï¼Œéžæ ‘ç»“æž„ï¼šç”¨äºŽUI定义左侧业务类型查询
     * @param btmName
     * @return
     * @throws PLException
     */
    @GetMapping( "/getBizTree")
    @VciBusinessLog(operateName = "业务类型列表(主要用于UI定义业务类型树查询使用)")
    public BaseResult getBizTree(String btmName){
        try {
            return BaseResult.success(btmService.getBizTree(btmName));
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "获取UI定义业务类型列表时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * é€šè¿‡ä¸šåŠ¡ç±»åž‹name查询ui上下文,支持分页
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    @GetMapping( "/gridUIContextData")
    @VciBusinessLog(operateName = "通过业务类型name查询出ui上下文")
    public BaseResult gridUIContextData(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataGrid(uiManagerService.gridUIContextData(baseQueryObject));
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "通过业务类型name查询出ui上下文时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * åˆ›å»ºUI上下文
     * btmTypeDTO é“¾æŽ¥ç±»åž‹çš„保存对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/saveUIContextData")
    public BaseResult saveUIContextData(@RequestBody PLUILayout pluiLayout){
        try {
            return uiManagerService.saveUIContextData(pluiLayout) ? BaseResult.success("UI上下文创建成功!"):BaseResult.fail("UI上下文创建失败!");
        } catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "创建UI上下文时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * ä¿®æ”¹UI上下文
     * btmTypeDTO
     * @return ä¿®æ”¹ç»“æžœ
     */
    @PutMapping("/updateUIContextData")
    public BaseResult updateUIContextData(@RequestBody PLUILayout pluiLayout){
        try {
            return uiManagerService.updateUIContextData(pluiLayout) ? BaseResult.success("UI上下文修改成功!"):BaseResult.fail("UI上下文修改失败!");
        } catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "修改UI上下文时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * åˆ é™¤UI上下文数据
     * oids åˆ é™¤çš„oid信息
     * @return åˆ é™¤ç»“æžœ
     */
    @DeleteMapping("/delUIContextData")
    public BaseResult delUIContextData(String[] oids){
        try {
            return uiManagerService.delUIContextData(oids) ? BaseResult.success("UI上下文删除成功!"):BaseResult.fail("UI上下文删除失败!");
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "删除UI上下文时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * UI上下文克隆
     * pluiLayoutCloneVO å…‹éš†å‚数对象
     * @return å…‹éš†ç»“æž„
     */
    @PostMapping("/cloneUiContextData")
    public BaseResult cloneUiContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){
        try {
            return uiManagerService.cloneUiContextData(pluiLayoutCloneVO) ? BaseResult.success("UI上下文克隆成功!"):BaseResult.fail("UI上下文克隆失败!");
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "UI上下文克隆时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
@@ -104,7 +104,6 @@
     */
    @GetMapping( "/getBizTypes")
    @VciBusinessLog(operateName = "业务类型列表(主要用于对话框使用)")
    @VciUnCheckRight
    public BaseResult getBizTypes(String btmName){
        try {
            return BaseResult.dataList(Arrays.asList(btmService.getBizTypes(btmName)));
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java
@@ -60,6 +60,14 @@
    BizType[] getBizTypes(String btmName) throws PLException;
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ—è¡¨æŸ¥è¯¢ï¼Œéžæ ‘ç»“æž„ï¼šç”¨äºŽUI定义左侧业务类型查询,只返回name和lable
     * @param btmName
     * @return
     * @throws PLException
     */
    Tree getBizTree(String btmName) throws PLException;
    /**
     * æŸ¥è¯¢æ‰€æœ‰çš„业务类型映射
     * @return key æ˜¯ä¸šåŠ¡çš„è‹±æ–‡åç§°çš„å°å†™
     */
@@ -276,7 +284,7 @@
    /**
     * å¯¼å‡ºä¸šåŠ¡ç±»åž‹
     * oid ä¸šåŠ¡ç±»åž‹åç§°
     * @return åˆ›å»ºç»“æžœ
     * @return
     */
    void expData(String oid, HttpServletResponse response) throws PLException, IOException;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIEngineServiceI.java
@@ -134,7 +134,6 @@
     */
    UIActionVO actionDO2VO(PLAction action);
    /**
     * æŸ¥è¯¢æ‰€æœ‰çš„UI上下文
     * @return æ˜¾ç¤ºå¯¹è±¡
@@ -209,5 +208,5 @@
//    UIContentVO UIContentDO2VO(PLPageLayoutDefination pageLayoutDefination, boolean queryDetail);
    UIContentVO UIContentDO2VO(PLUILayout pageLayoutDefination, boolean queryDetail);
;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.DataGrid;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * @author ludc
 * @date 2024/8/28 17:05
 */
public interface UIManagerServiceI {
    /**
     * é€šè¿‡ä¸šåŠ¡ç±»åž‹name查询ui上下文,支持分页
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    DataGrid gridUIContextData(BaseQueryObject baseQueryObject) throws PLException;
    /**
     * ç»™ä¸šåŠ¡ç±»åž‹ä¸‹æ·»åŠ ui上下文
     * @param pluiLayout
     * @return
     * @throws PLException
     */
    boolean saveUIContextData(PLUILayout pluiLayout) throws PLException;
    /**
     * ä¿®æ”¹ä¸šåŠ¡ç±»åž‹ä¸‹æ·»åŠ ui上下文
     * @param pluiLayout
     * @return
     * @throws PLException
     */
    boolean updateUIContextData(PLUILayout pluiLayout) throws PLException;
    /**
     * æ ¹æ®ä¸»é”®å’Œä¸šåŠ¡ç±»åž‹oid删除ui上下文数据
     * @return
     */
    boolean delUIContextData(String[] oids) throws PLException;
    /**
     * å…‹éš†ui上下文
     * @param pluiLayoutCloneVO
     * @return
     */
    boolean cloneUiContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException;
    /**
     * å¯¼å‡ºui上下文(勾选的要导出的控制区的数据)
     * oids
     * @return
     */
    void expUiContextData(String[] oids, HttpServletResponse response) throws PLException, IOException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -493,6 +493,42 @@
    }
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ—è¡¨æŸ¥è¯¢ï¼Œéžæ ‘ç»“æž„ï¼šç”¨äºŽUI定义左侧业务类型查询,只返回name和lable
     * @param btmName
     * @return
     * @throws PLException
     */
    @Override
    public Tree getBizTree(String btmName) throws PLException {
        if(null == btmName){
            btmName = "";
        }
        Tree returnTree = new Tree();
        BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmName);
        if(Func.isEmpty(bizTypes)){
            return returnTree;
        }
        returnTree.setOid("");
        returnTree.setText("业务类型");
        returnTree.setLeaf(false);
        List<Tree> trees = new ArrayList<>();
        Arrays.stream(bizTypes).forEach(bizType -> {
            Tree tree = new Tree();
            tree.setText(bizType.name + " " +bizType.label);
            tree.setOid(bizType.oid);
            tree.setLeaf(true);
            tree.setParentName(bizType.fName);
            Map<String, String> atrrMap = new HashMap<>();
            atrrMap.put("name",bizType.name);
            atrrMap.put("lable",bizType.label);
            tree.setAttributes(atrrMap);
            trees.add(tree);
        });
        returnTree.setChildren(trees);
        return returnTree;
    }
    /**
     * å‚照业务类型
     *
     * @param conditionMap æŸ¥è¯¢æ¡ä»¶
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,369 @@
package com.vci.web.service.impl;
import com.sun.jnlp.ApiDialog;
import com.vci.client.mw.ClientContextVariable;
import com.vci.common.utility.ObjectUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.portal.PortalService;
import com.vci.corba.portal.data.*;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
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.WebThreadLocalUtil;
import com.vci.web.service.UIManagerServiceI;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.UITools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/**
 * UI定义服务界面相关接口
 * @author ludc
 * @date 2024/8/28 17:05
 */
@Service
public class UIManagerServiceImpl implements UIManagerServiceI {
    /**
     * å¹³å°çš„调用工具类
     */
    @Resource
    private PlatformClientUtil platformClientUtil;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * æŽ’序比较器
     */
    private Comparator<PLUILayout> pageLayoutComparator = new Comparator<PLUILayout>() {
        @Override
        public int compare(PLUILayout o1, PLUILayout o2) {
            return o1.plCode.compareTo(o2.plCode);
        }
    };
    /**
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹åæŸ¥è¯¢ui上下文数据
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    @Override
    public DataGrid gridUIContextData(BaseQueryObject baseQueryObject) throws PLException {
        VciBaseUtil.alertNotNull(baseQueryObject,"条件对象");
        int page = baseQueryObject.getPage();
        int limit = baseQueryObject.getLimit();
        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
        String btmName = conditionMap.getOrDefault("btmName","");
        if(Func.isEmpty(conditionMap) || Func.isBlank(btmName)){
            throw new PLException("500",new String[]{"未获取到业务类型名称!"});
        }
        String txtName = conditionMap.getOrDefault("txtName","").trim();
        String txtCode = conditionMap.getOrDefault("txtCode","").trim();
        PortalService.GetPLUILayoutsByRelatedTypeAndQueryInfoResult result = platformClientUtil.getUIService()
                .getPLUILayoutsByRelatedTypeAndQueryInfo(btmName, txtName, txtCode, page, limit);
        DataGrid<PLUILayout> dataGrid = new DataGrid<>();
        int total = (int)result.total;
        dataGrid.setTotal(total);
        dataGrid.setLimit(limit);
        dataGrid.setPage(page);
        PLUILayout[] res = result.returnValue;
        Arrays.sort(res,pageLayoutComparator);
        List<PLUILayout> pluiLayouts = Arrays.asList(res);
        dataGrid.setData(pluiLayouts);
        return dataGrid;
    }
    /**
     * ç»™ä¸šåŠ¡ç±»åž‹ä¸‹æ·»åŠ ui上下文
     * @param pluiLayout
     * @return
     * @throws PLException
     */
    @Override
    public boolean saveUIContextData(PLUILayout pluiLayout) throws VciBaseException {
        try {
            //ui上下文对象校验
            canContinue(pluiLayout);
            String code = pluiLayout.plCode;
            String name = pluiLayout.plName;
            boolean isExist = nameOrCodeIsExist(pluiLayout, false);
            //是否存在校验
            if (isExist){
                throw new VciBaseException("上下文编码或名称已经存在,请检查!");
            }
            PLUILayout pld = new PLUILayout();
            pld.plOId = ObjectUtility.getNewObjectID36();
            pld.plCode = code;
            pld.plName = name;
            pld.plRelatedType = pluiLayout.plRelatedType;
            pld.plDesc = pluiLayout.plDesc;
            SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
            pld.plCreateUser = sessionInfo.getUserId();
            pld.plModifyUser = sessionInfo.getUserId();
            //导航区
            pld.plIsShowForm = pluiLayout.plIsShowForm;
            //控制区
            pld.plIsShowNavigator = pluiLayout.plIsShowNavigator;
            //操作区
            pld.plIsShowTab = pluiLayout.plIsShowTab;
            //执行保存
            return platformClientUtil.getUIService().savePLUILayout(pld);
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    /**
     * ä¿®æ”¹ui上下文
     * @param pluiLayout
     * @return
     * @throws PLException
     */
    @Override
    public boolean updateUIContextData(PLUILayout pluiLayout) throws VciBaseException {
        this.canContinue(pluiLayout);
        try {
            String code = pluiLayout.plCode;
            String name = pluiLayout.plName;
            boolean isExist = nameOrCodeIsExist(pluiLayout, true);
            if (isExist){
                throw new VciBaseException("上下文编码或名称已经存在,请检查!");
            }
            PLUILayout pld = new PLUILayout();
            pld.plOId = pluiLayout.plOId;
            pld.plCode = code;
            pld.plName = name;
            pld.plRelatedType = pluiLayout.plRelatedType;
            pld.plDesc = pluiLayout.plDesc;
            pld.plCreateUser = pluiLayout.plCreateUser;
            pld.plModifyUser = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
            //导航区
            pld.plIsShowForm = pluiLayout.plIsShowForm;
            //控制区
            pld.plIsShowNavigator = pluiLayout.plIsShowNavigator;
            //操作区
            pld.plIsShowTab = pluiLayout.plIsShowTab;
            //执行修改
            return platformClientUtil.getUIService().updatePLUILayout(pld);
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    /**
     * æ ¹æ®ä¸»é”®å’Œä¸šåŠ¡ç±»åž‹oid删除ui上下文数据
     * @return
     */
    @Override
    public boolean delUIContextData(String[] oids) throws PLException {
        VciBaseUtil.alertNotNull(oids,"待删除的对象列表");
        //删除方法中有关联数据删除的操作逻辑
        return platformClientUtil.getUIService().deletePLUILayoutByOidsForCascade(oids);
    }
    /**
     * å…‹éš†ui上下文(具备关联数据的克隆)
     * @param pluiLayoutCloneVO
     * @return
     */
    @Override
    public boolean cloneUiContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException {
        VciBaseUtil.alertNotNull(
            pluiLayoutCloneVO,"克隆参数对象",
            pluiLayoutCloneVO.getSourcePLUILayout(),"克隆的源对象信息",
            pluiLayoutCloneVO.getCloneName(),"克隆的对象名称",
            pluiLayoutCloneVO.getCloneContextCode(),"克隆的对象上下文编码"
        );
        PLUILayout pluiLayout = new PLUILayout();
        PLUILayout sourcePLUILayout = pluiLayoutCloneVO.getSourcePLUILayout();
        //如果选择克隆目标,则克隆到选择的类型下,如果没有选择克隆目标,则克隆到当前类型下
        if(Func.isBlank(pluiLayoutCloneVO.getCloneTargetOid())){
            pluiLayout.plRelatedType = sourcePLUILayout.plRelatedType;
        }
        //克隆的名称和ui上下文编号查重
        String cloneName = pluiLayoutCloneVO.getCloneName();
        String cloneContextCode = pluiLayoutCloneVO.getCloneContextCode();
        pluiLayout.plOId = ObjectUtility.getNewObjectID36();
        pluiLayout.plName = cloneName;
        pluiLayout.plCode = cloneContextCode;
        pluiLayout.plIsShowTab = sourcePLUILayout.plIsShowTab;
        pluiLayout.plIsShowNavigator = sourcePLUILayout.plIsShowNavigator;
        pluiLayout.plIsShowForm = sourcePLUILayout.plIsShowForm;
        pluiLayout.plDesc = sourcePLUILayout.plDesc;
        SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
        pluiLayout.plCreateUser = sessionInfo.getUserId();
        pluiLayout.plModifyUser = sessionInfo.getUserId();
        //克隆目标下ui名称和编号查重
        this.checkCodeName(pluiLayout);
        //1、先保存ui上下文
        boolean res = platformClientUtil.getUIService().savePLUILayout(pluiLayout);
        //2、再考虑子节点的克隆
        PLTabPage[] pages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(sourcePLUILayout.plOId); //控制区节点及其子节点的克隆
        if(pages == null){
            return true;
        }
        try {
            for (PLTabPage page : pages) {
                savePlpageLayoutDefinationRelation(page,pluiLayout.plOId);
            }
            return true;
        }catch (Exception e){
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    @Override
    public void expUiContextData(String[] oids, HttpServletResponse response) throws PLException, IOException {
    }
    /**
     * æŽ§åˆ¶åŒºèŠ‚ç‚¹åŠå…¶å­èŠ‚ç‚¹çš„å…‹éš†
     * @param obj
     */
    private void savePlpageLayoutDefinationRelation(Object obj,String plUILayoutId) {
        PLTabPage tabPage = (PLTabPage)obj;
        try {
            PLPageDefination[] pLPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(tabPage.plOId);
            tabPage.plOId = ObjectUtility.getNewObjectID36();
            tabPage.plContextOId = plUILayoutId;
            //add by caill start 2016.8.15 å¯¼èˆªåŒºã€æŽ§åˆ¶åŒºã€æ“ä½œåŒºåœ¨æ²¡æœ‰å­èŠ‚ç‚¹çš„æƒ…å†µä¸‹çš„å…‹éš†
            if(pLPageDefinations.length==0){
                platformClientUtil.getUIService().savePLTabPage(tabPage);
            }
            //add by caill end
            for(int j=0;j<pLPageDefinations.length;j++){
                PLPageDefination plPageDef = pLPageDefinations[j];
                platformClientUtil.getUIService().savePLTabPage(tabPage);
                PLTabButton[] pLTabButtons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(plPageDef.plOId);
                plPageDef.plOId = ObjectUtility.getNewObjectID36();
                plPageDef.plTabPageOId = tabPage.plOId;
                platformClientUtil.getUIService().savePLPageDefination(plPageDef);
                for(int b=0;b<pLTabButtons.length;b++){
                    PLTabButton plTabButton = pLTabButtons[b];
                    PLCommandParameter[] pLCommandParameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(plTabButton.plOId);
                    plTabButton.plOId = ObjectUtility.getNewObjectID36();
                    plTabButton.plTableOId = plPageDef.plOId;
                    platformClientUtil.getUIService().savePLTabButton(plTabButton);
                    for(int c=0;c<pLCommandParameters.length;c++){
                        final PLCommandParameter plCommandParameter = pLCommandParameters[c];
                        plCommandParameter.plOId = ObjectUtility.getNewObjectID36();
                        plCommandParameter.plCommandOId = plTabButton.plOId;
                        platformClientUtil.getUIService().savePLCommandParameter(plCommandParameter);
                    }
                }
            }
        } catch (PLException e) {
            e.printStackTrace();
        }
    }
    /**
     * æœªåšåˆ¤ç©ºå¤„理,调用前请保证obj不为空
     * @param obj
     * @throws PLException
     */
    public void checkCodeName(PLUILayout obj) throws PLException {
        PLUILayout[] plUILayouts = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(obj.plRelatedType);
        int length = plUILayouts.length;
        String code = obj.plCode;
        String name = obj.plName;
        if (Func.isNotBlank(name) || Func.isNotBlank(code)){
            for (int i =0;i<length;i++){//循环节点的UI上文和名称
                if (plUILayouts[i].plCode.equalsIgnoreCase(code) || plUILayouts[i].plName.equals(name)){
                    throw new VciBaseException("业务类型下UI名称或UI上下文编码已存在!");
                }
            }
        }
    }
    /**
     * ui上下文新增修改前检查
     * @param pluiLayout
     */
    private void canContinue(PLUILayout pluiLayout){
        String code = pluiLayout.plCode;
        String name = pluiLayout.plName;
        if(Func.isBlank(code)){
            throw new VciBaseException("上下文编码不能为空!");
        }
        if(Func.isBlank(name)){
            throw new VciBaseException("名称不能为空!");
        }
        if((pluiLayout.plIsShowNavigator == 0) && (pluiLayout.plIsShowForm == 0) && (pluiLayout.plIsShowTab == 0)){
            throw new VciBaseException("上下文至少要包含一个区域!");
        }
    }
    /**
     * æ£€æŸ¥åç§°æˆ–者编码是否已存在
     * @param pluiLayout
     * @param isEdit
     * @return
     * @throws VciBaseException
     */
    private boolean nameOrCodeIsExist(PLUILayout pluiLayout, boolean isEdit) throws PLException {
        boolean res = false;
        //查询同一业务类型下的ui上下文,然后查重
        PLUILayout[] plpagelayoutdefinations = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(pluiLayout.plRelatedType);
        int length = plpagelayoutdefinations.length;
        for (int i =0;i<length;i++){
            String code = plpagelayoutdefinations[i].plCode;
            String name = plpagelayoutdefinations[i].plName;
            String ids = plpagelayoutdefinations[i].plOId;
            if(isEdit){
                if(!ids.equals(pluiLayout.plOId)){
                    if (pluiLayout.plCode.equalsIgnoreCase(code) || pluiLayout.plName.equals(name)){
                        res = true;
                        break;
                    }
                }
            }
            else {
                if (code.equalsIgnoreCase(code) || name.equals(name)){
                    res = true;
                    break;
                }
            }
        }
        return res;
    }
}