wangting
2024-09-05 8f6576fd595f67a3b17ef2e5e8054e8f194078f7
Merge remote-tracking branch 'origin/master'
已修改18个文件
已添加13个文件
2605 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/AttributeDefDTO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTDDTO.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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-api/src/main/java/com/vci/pagemodel/RoleRightVO.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 172 ●●●●● 补丁 | 查看 | 原始文档 | 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/controller/WebPortalVIController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java 13 ●●●●● 补丁 | 查看 | 原始文档 | 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/OsQuereyTemplateServiceI.java 13 ●●●● 补丁 | 查看 | 原始文档 | 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 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java 136 ●●●●● 补丁 | 查看 | 原始文档 | 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/OsPortalVIServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java 324 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 591 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/AttributeDefDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.vci.dto;
import com.vci.corba.omd.atm.AttributeDef;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
 * å±žæ€§ä¼ è¾“对象
 * @author yuxc
 * @date 2024/09/02 10:15
 */
@Data
public class AttributeDefDTO implements java.io.Serializable {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2492852474710986720L;
    public String oid;
    public String name;
    public String label;
    public String vtDataType;
    public String defValue;
    public String ts;
    public String creator;
    public long createTime;
    public String modifier;
    public long modifyTime;
    public String description;
    public String rage;
    public String other;
    /**
     * å±‚æ•°
     */
    public int layersNum;
    public List<AttributeDefDTO> attrs = new ArrayList<>();
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
package com.vci.dto;
import com.vci.common.qt.object.ConditionItem;
import lombok.Data;
import java.util.Iterator;
import java.util.Map;
/**
 * æ¡ä»¶ä¼ è¾“对象
 * @author yuxc
 * @date 2024/9/4
 */
@Data
public class ConditionDTO {
    private String rootCIName;
    private Map<String, ConditionItemDTO> ciMap;
    public ConditionDTO() {
    }
    public String getRootCIName() {
        return this.rootCIName;
    }
    public void setRootCIName(String rootCIName) {
        this.rootCIName = rootCIName;
    }
    public String getRootCINameByCIMap(Map<String, ConditionItem> ciMap) {
        String rootCIName = "";
        if (ciMap != null) {
            Iterator<String> i = ciMap.keySet().iterator();
            while(i.hasNext()) {
                String ciName = (String)i.next();
                if (rootCIName.equals("")) {
                    rootCIName = ciName;
                } else {
                    int rootInt = Integer.valueOf(rootCIName.substring(2));
                    int ciInt = Integer.valueOf(ciName.substring(2));
                    if (ciInt > rootInt) {
                        rootCIName = ciName;
                    }
                }
            }
        }
        return rootCIName;
    }
    public Map<String, ConditionItemDTO> getCIMap() {
        return this.ciMap;
    }
    public void setCIMap(Map<String, ConditionItemDTO> cIMap) {
        this.ciMap = cIMap;
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/ConditionItemDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.vci.dto;
import com.vci.common.qt.object.ChildrenInfo;
import com.vci.common.qt.object.ConditionItem;
import com.vci.common.qt.object.LeafInfo;
import lombok.Data;
import java.util.Iterator;
import java.util.Map;
/**
 * æ¡ä»¶åˆ—表传输对象
 * @author yuxc
 * @date 2024/9/4
 */
@Data
public class ConditionItemDTO {
    private String id;
    private LeafInfoDTO leafInfo;
    private ChildrenInfo childrenInfo;
    private boolean leafFlag;
    public ConditionItemDTO() {
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public LeafInfoDTO getLeafInfo() {
        return this.leafInfo;
    }
    public void setLeafInfo(LeafInfoDTO leafInfo) {
        this.leafInfo = leafInfo;
    }
    public ChildrenInfo getChildrenInfo() {
        return this.childrenInfo;
    }
    public void setChildrenInfo(ChildrenInfo childrenInfo) {
        this.childrenInfo = childrenInfo;
    }
    public boolean isLeaf() {
        return this.leafFlag;
    }
    public void setLeafFlag(boolean leafFlag) {
        this.leafFlag = leafFlag;
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafInfoDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
package com.vci.dto;
import com.vci.common.qt.object.ConditionItem;
import com.vci.common.qt.object.LeafValue;
import lombok.Data;
import java.util.Iterator;
import java.util.Map;
/**
 * å¶å­æ¡ä»¶ä¼ è¾“对象
 * @author yuxc
 * @date 2024/9/4
 */
@Data
public class LeafInfoDTO {
    private String clause;
    private String operator;
    private String type;
    private LeafValueDto value;
    public LeafInfoDTO() {
    }
    public String getClause() {
        return this.clause;
    }
    public void setClause(String clause) {
        this.clause = clause;
    }
    public String getOperator() {
        return this.operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
    public LeafValueDto getValue() {
        return this.value;
    }
    public void setValue(LeafValueDto value) {
        this.value = value;
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LeafValueDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package com.vci.dto;
import lombok.Data;
/**
 * å¶å­å€¼ä¼ è¾“对象
 * @author yuxc
 * @date 2024/9/4
 */
@Data
public class LeafValueDto {
    private String ordinaryValue;
    private QueryTemplateDTO queryTemplate;
    public LeafValueDto() {
    }
    public String getOrdinaryValue() {
        return this.ordinaryValue;
    }
    public void setOrdinaryValue(String ordinaryValue) {
        this.ordinaryValue = ordinaryValue;
    }
    public QueryTemplateDTO getQueryTemplate() {
        return this.queryTemplate;
    }
    public void setQueryTemplate(QueryTemplateDTO queryTemplate) {
        this.queryTemplate = queryTemplate;
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTDDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.vci.dto;
import com.vci.corba.omd.atm.AttributeDef;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * æŸ¥è¯¢æ¨¡æ¿ä¼ è¾“对象
 * @author weidy
 * @date 2019/10/14 17:50
 */
@Data
public class QTDDTO implements java.io.Serializable {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2492852474710986720L;
    /**
     * æ¨¡æ¿åç§°
     */
    public String name;
    /**
     * åˆ›å»ºäºº
     */
    public String creator;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    public long createTime;
    /**
     * ä¸šåŠ¡ç±»åž‹
     */
    public String btmName;
    /**
     * é“¾æŽ¥ç±»åž‹
     */
    public String linkTypeName;
    /**
     * æ‰€é€‰æ‹©æŸ¥è¯¢çš„字段对象
     */
    public List<AttributeDefDTO> attrs = new ArrayList<>();
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java
@@ -31,7 +31,7 @@
    //查询模板名
    private String qtText;
    //查询模板信息
    private QueryTemplate queryTemplate;
    private QueryTemplateDTO queryTemplate;
    //查询条件,后端进行相关解析
    private List<HashMap<String,String>> condition;
    private HashMap<String,Object> tree = new HashMap<>();
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QueryTemplateDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
package com.vci.dto;
import com.vci.common.qt.object.Condition;
import com.vci.common.qt.object.OrderInfo;
import com.vci.common.qt.object.PageInfo;
import lombok.Data;
import java.util.List;
/**
 * æŸ¥è¯¢æ¨¡æ¿ä¼ è¾“对象
 * @author yuxc
 * @date 2024/8/7
 */
@Data
public class QueryTemplateDTO {
    private String id;
    private String type;
    private List<String> clauseList;
    private String linkType;
    private String btmType;
    private boolean queryChildrenFlag = false;
    private boolean queryISLeaf = false;
    private boolean rightFlag = true;
    private boolean secretFlag = true;
    private String direction = "positive";
    private ConditionDTO condition;
    private int version = 0;
    private PageInfo pageInfo;
    private List<OrderInfo> orderInfoList;
    private int level = 1;
    private int recReturnMode = 1;
    public QueryTemplateDTO() {
    }
    public String getLinkType() {
        return this.linkType;
    }
    public void setLinkType(String linkType) {
        this.linkType = linkType;
    }
    public String getBtmType() {
        return this.btmType;
    }
    public void setBtmType(String btmType) {
        this.btmType = btmType;
    }
    public boolean isQueryChildren() {
        return this.queryChildrenFlag;
    }
    public void setQueryChildrenFlag(boolean queryChildrenFlag) {
        this.queryChildrenFlag = queryChildrenFlag;
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getType() {
        return this.type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public List<String> getClauseList() {
        return this.clauseList;
    }
    public void setClauseList(List<String> clauseList) {
        this.clauseList = clauseList;
    }
    public ConditionDTO getCondition() {
        return this.condition;
    }
    public void setCondition(ConditionDTO condition) {
        this.condition = condition;
    }
    public int getVersion() {
        return this.version;
    }
    public void setVersion(int version) {
        this.version = version;
    }
    public String getDirection() {
        return this.direction;
    }
    public void setDirection(String direction) {
        this.direction = direction;
    }
    public PageInfo getPageInfo() {
        return this.pageInfo;
    }
    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }
    public List<OrderInfo> getOrderInfoList() {
        return this.orderInfoList;
    }
    public void setOrderInfoList(List<OrderInfo> orderInfoList) {
        this.orderInfoList = orderInfoList;
    }
    public int getLevel() {
        return this.level;
    }
    public void setLevel(int level) {
        this.level = level;
    }
    public int getRecReturnMode() {
        return this.recReturnMode;
    }
    public void setRecReturnMode(int recReturnMode) {
        this.recReturnMode = recReturnMode;
    }
    public boolean isQueryISLeaf() {
        return this.queryISLeaf;
    }
    public void setQueryISLeaf(boolean queryISLeaf) {
        this.queryISLeaf = queryISLeaf;
    }
    public boolean isRightFlag() {
        return this.rightFlag;
    }
    public void setRightFlag(boolean rightFlag) {
        this.rightFlag = rightFlag;
    }
    public boolean isSecretFlag() {
        return this.secretFlag;
    }
    public void setSecretFlag(boolean secretFlag) {
        this.secretFlag = secretFlag;
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/RoleRightDO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
package com.vci.model;
import com.vci.starter.web.annotation.Transient;
import com.vci.starter.web.annotation.VciBtmType;
import com.vci.starter.web.constant.FrameWorkLcStatusConstant;
import java.io.Serializable;
import java.util.Date;
/**
 * çŠ¶æ€æ± 
 * @author weidy
 * @date 2022-2-15
 */
@VciBtmType(name = "UIAuthor",text = "UI权限",tableName = "PLROLERIGHT",lifeCycle = FrameWorkLcStatusConstant.EMTYPE_LIFE_CYCLE)
@Transient
public class RoleRightDO implements Serializable {
    private static final long serialVersionUID = -5073244242126466800L;
    /**
     * ID
     */
    private String id = "";
    /**
     *角色ID
     */
    private String roleId = "";
    /**
     * æ¨¡å—ID
     */
    private String funcId = "";
    /**
     * æƒé™å€¼
     */
    private long rightValue = -1;
    /**
     * æƒé™ç±»åž‹ï¼Œè¶…级管理员给管理员授权为1,管理员给普通用户授权为2
     */
    private short rightType = -1;
    /**新增数据创建者,修改者,创建时间,修改时间,授权者***/
    private String createUser = "";
    private Date createTime = new Date();
    private String licensor = "";
    private String modifyUser = "";
    private Date modifyTime = new Date();
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getRoleId() {
        return roleId;
    }
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }
    public String getFuncId() {
        return funcId;
    }
    public void setFuncId(String funcId) {
        this.funcId = funcId;
    }
    public long getRightValue() {
        return rightValue;
    }
    public void setRightValue(long rightValue) {
        this.rightValue = rightValue;
    }
    public short getRightType() {
        return rightType;
    }
    public void setRightType(short rightType) {
        this.rightType = rightType;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getLicensor() {
        return licensor;
    }
    public void setLicensor(String licensor) {
        this.licensor = licensor;
    }
    public String getModifyUser() {
        return modifyUser;
    }
    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    @Override
    public String toString() {
        return "RoleRightDTO{" +
                "id='" + id + '\'' +
                ", roleId='" + roleId + '\'' +
                ", funcId='" + funcId + '\'' +
                ", rightValue=" + rightValue +
                ", rightType=" + rightType +
                ", createUser='" + createUser + '\'' +
                ", createTime=" + createTime +
                ", licensor='" + licensor + '\'' +
                ", modifyUser='" + modifyUser + '\'' +
                ", modifyTime=" + modifyTime +
                '}';
    }
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java
@@ -3,6 +3,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -27,7 +28,7 @@
    /**
     * å­å­™èŠ‚ç‚¹
     */
    private List<MenuVO> children;
    private List<MenuVO> children = new ArrayList<>();
    /**
     * æ˜¯å¦æœ‰å­å­™èŠ‚ç‚¹
@@ -143,6 +144,10 @@
     * æ¨¡å—下关联的操作类型id
     */
    private String operId;
    /**
     * æ˜¯å¦æœ‰æƒé™ï¼Œ0没有,1有
     */
    private Integer havePermission;
    /**
     * å‰ç«¯æ˜¯å¦éšè—
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-api/src/main/java/com/vci/pagemodel/RoleRightVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,137 @@
package com.vci.pagemodel;
import java.io.Serializable;
import java.util.Date;
public class RoleRightVO implements Serializable {
    private static final long serialVersionUID = 2030418807220108229L;
    /**
     * ID
     */
    private String id = "";
    /**
     *角色ID
     */
    private String roleId = "";
    /**
     * æ¨¡å—ID
     */
    private String funcId = "";
    /**
     * æƒé™å€¼
     */
    private long rightValue = -1;
    /**
     * æƒé™ç±»åž‹ï¼Œè¶…级管理员给管理员授权为1,管理员给普通用户授权为2
     */
    private short rightType = -1;
    /**
     * æƒé™ç±»åž‹
     */
    private String rigthTypeText="";
    /**新增数据创建者,修改者,创建时间,修改时间,授权者***/
    private String createUser = "";
    private String createTime = "";
    private String licensor = "";
    private String modifyUser = "";
    private String modifyTime ="";
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getRoleId() {
        return roleId;
    }
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }
    public String getFuncId() {
        return funcId;
    }
    public void setFuncId(String funcId) {
        this.funcId = funcId;
    }
    public long getRightValue() {
        return rightValue;
    }
    public void setRightValue(long rightValue) {
        this.rightValue = rightValue;
    }
    public short getRightType() {
        return rightType;
    }
    public void setRightType(short rightType) {
        this.rightType = rightType;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getLicensor() {
        return licensor;
    }
    public void setLicensor(String licensor) {
        this.licensor = licensor;
    }
    public String getModifyUser() {
        return modifyUser;
    }
    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }
    public String getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(String modifyTime) {
        this.modifyTime = modifyTime;
    }
    @Override
    public String toString() {
        return "RoleRightVO{" +
                "id='" + id + '\'' +
                ", roleId='" + roleId + '\'' +
                ", funcId='" + funcId + '\'' +
                ", rightValue=" + rightValue +
                ", rightType=" + rightType +
                ", createUser='" + createUser + '\'' +
                ", createTime=" + createTime +
                ", licensor='" + licensor + '\'' +
                ", modifyUser='" + modifyUser + '\'' +
                ", modifyTime=" + modifyTime +
                '}';
    }
}
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java
@@ -36,7 +36,19 @@
        setOid(oid);
        setText(text);
    }
    /**
     * æž„造函数
     * @param oid ä¸»é”®
     * @param text æ ‘节点文本
     */
    public Tree(String oid, String text,Object o){
        setOid(oid);
        setText(text);
        setData(o);
    }
    /**
     * ä¸»é”®
     */
@@ -63,6 +75,10 @@
     * å­èŠ‚ç‚¹
     */
    private List<Tree> children = new ArrayList<Tree>();
    /**
     * å±‚级
     */
    private  int level;
    /**
     * å›¾æ ‡
     */
@@ -99,6 +115,10 @@
     * æŽ’序索引
     */
    private String index;//排序索引
    /***
     * å½“前数据对象
     */
    private Object data;
    
    /**
     * å…¶ä»–的属性
@@ -383,6 +403,23 @@
        }
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    public int getLevel() {
        return level;
    }
    public void setLevel(int level) {
        this.level = level;
    }
    @Override
    public String toString() {
        return "Tree{" +
@@ -392,6 +429,7 @@
                ", showCheckbox=" + showCheckbox +
                ", checked=" + checked +
                ", children=" + children +
                ", level=" + level +
                ", icon='" + icon + '\'' +
                ", iconCls='" + iconCls + '\'' +
                ", parentId='" + parentId + '\'' +
@@ -400,6 +438,7 @@
                ", expanded=" + expanded +
                ", href='" + href + '\'' +
                ", index='" + index + '\'' +
                ", data=" + data +
                ", attributes=" + attributes +
                '}';
    }
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
@@ -62,6 +62,15 @@
     * @throws VciBaseException
     */
    List<MenuVO> getSysModelTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException;
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param modeType æ¨¡å—类型
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException;
    int checkChildObject(String moduleId) throws VciException;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -4,13 +4,11 @@
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONReader;
import com.vci.client.ClientSession;
import com.vci.client.common.objects.RoleObject;
import com.vci.common.exception.VciException;
import com.vci.common.locale.LocaleDisplay;
import com.vci.corba.common.PLException;
import com.vci.corba.framework.data.FuncOperationInfo;
import com.vci.corba.framework.data.FunctionInfo;
import com.vci.corba.framework.data.OperateInfo;
import com.vci.corba.framework.data.RoleRightInfo;
import com.vci.corba.framework.data.*;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.frameworkcore.compatibility.ISmFunctionQueryService;
@@ -510,6 +508,49 @@
        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
    public void findChildAuthFunctionVO(MenuVO functionVO, boolean isAll) throws PLException {
        //0表示没有模块也没有操作,1表示有模块,2表示有操作
        long type = platformClientUtil.getFrameworkService().checkChildObject(functionVO.getId());
        if(type == 1){
            FunctionInfo[] funcObjs = platformClientUtil.getFrameworkService().getModuleListByParentId(functionVO.getId(), isAll);
            for (FunctionInfo funcObj : funcObjs) {
                MenuVO menuVO = new MenuVO();
                menuVO.setId(funcObj.id);
                menuVO.setSource(funcObj.image);
                menuVO.setPath(funcObj.resourceB);
                menuVO.setCode(funcObj.aliasName);
                menuVO.setAlias(funcObj.aliasName);
                menuVO.setParentId(funcObj.parentId);
                menuVO.setChildType((int) type);
                menuVO.setName(funcObj.name);
                menuVO.getMeta().put("keepAlive",false);
                menuVO.setSort((int) funcObj.seq);
                findChildAuthFunctionVO(menuVO, isAll);
                functionVO.getChildren().add(menuVO);
            }
        }else if(type == 2){
            FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(functionVO.getId(), "", true);
            for (FuncOperationInfo info : infos) {
                MenuVO menuVO = new MenuVO();
                menuVO.setChildType((int) type);
                menuVO.setId(info.id);
                menuVO.setFuncId(info.funcId);
                menuVO.setCode(info.operIndentify);
                menuVO.setOperId(info.operId);
                menuVO.setName(info.operName);
                menuVO.setAlias(info.operAlias);
                menuVO.setRemark(info.operDesc);
                menuVO.setSort((int) info.number);
                menuVO.setModeType("FunctionObject");
                menuVO.setIsValid(info.isValid);
                menuVO.setHasChildren(false);
                functionVO.getChildren().add(menuVO);
            }
        }else{
            functionVO.setHasChildren(false);
        }
    }
    @Override
    public UIContentVO getUIContentByBtmTypeAndId(TreeQueryObject treeQueryObject, ResourceControlTypeEnum resourceControlTypeEnum) throws PLException {
        SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
@@ -858,4 +899,259 @@
    public void clearCache() {
    }
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param modeType æ¨¡å—类型
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    @Override
    public List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException {
        List<MenuVO> menuVOList = new ArrayList<>();
//        if(Func.isBlank(parentId)){
//            return menuVOList;
//        }
        SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
        boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId());
        if (adminOrDeveloperOrRoot) {
            //系统菜单
            parentId = SYSTEMMANAGMENTNODE;
        } else if (rightControlUtil.isThreeAdminCurUser()) {
            //三员返回管理功能模块相关的菜单
            parentId = SYSTEMMANAGMENTNODE;
        } else {
            //普通用户只返回业务功能模块相关的菜单
            parentId = ROOT_MENU_ID;
        }
        List<MenuVO> functionVOList = new ArrayList<>();
        FunctionInfo[] moduleListByParentId = getModuleListByParentId(parentId, false);
        for (FunctionInfo menu : moduleListByParentId) {
            if(!menu.isValid){
                continue;
            }
            MenuVO functionVO = new MenuVO();
            functionVO.setId(menu.id);
            functionVO.setSource(menu.image);
            functionVO.setPath(menu.resourceB);
            functionVO.setParentId(menu.parentId);
            functionVO.setCode(menu.aliasName);
            functionVO.setAlias(menu.aliasName);
            functionVO.setName(menu.name);
            functionVO.getMeta().put("keepAlive",false);
            functionVO.setSort((int) menu.seq);
            findChildAuthFunctionVO(functionVO, isAll);
//            try {
//                functionVO.setChildren(findChildAuthFunctionVO(menu.id));
//            } catch (PLException e) {
//                e.printStackTrace();
//                String errorMsg = "菜单查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
//                logger.error(errorMsg);
//                throw new VciBaseException(errorMsg);
//            }
            if(functionVO.getChildren().size() > 0){
                functionVO.setHasChildren(true);
            }else {
                functionVO.setHasChildren(false);
            }
            functionVOList.add(functionVO);
        }
        return functionVOList;
//        RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId());
//        Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName(
//                parentId, sessionInfo.getUserId(), userRoleRights);
//
//        if(Func.isEmpty(map.get(parentId))) {
//            return functionVOList;
//        }
//        for (FunctionInfo menu : map.get(parentId)) {
//            if(!menu.isValid){
//                continue;
//            }
//            MenuVO functionVO = new MenuVO();
//            functionVO.setId(menu.id);
//            functionVO.setSource(menu.image);
//            //if(StringUtils.isBlank(menu.resourceB)){
//            //    continue;
//            //}
//            functionVO.setPath(menu.resourceB);
//            functionVO.setParentId(menu.parentId);
//            functionVO.setCode(menu.aliasName);
//            functionVO.setAlias(menu.aliasName);
//            functionVO.setName(menu.name);
//            functionVO.getMeta().put("keepAlive",false);
//            functionVO.setSort((int) menu.seq);
////            try {
////                functionVO.setChildren(findChildAuthFunctionVO(menu.id, map));
////            } catch (PLException e) {
////                e.printStackTrace();
////                String errorMsg = "菜单查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
////                logger.error(errorMsg);
////                throw new VciBaseException(errorMsg);
////            }
//            if(functionVO.getChildren().size() > 0){
//                functionVO.setHasChildren(true);
//            }else {
//                functionVO.setHasChildren(false);
//            }
//            functionVOList.add(functionVO);
//        }
//        //如果是开发或者测试用户,需哟获取系统模块配置菜单
//        if(adminOrDeveloperOrRoot){
//            //获取首页系统模块配置菜单
//            MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode();
//            if(Func.isNotEmpty(menuVO)){
//                functionVOList.add(menuVO);
//            }
//        }
//        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
//
//
//
//
//        boolean isFunctionObject = Func.isNotBlank(modeType) && modeType.equalsIgnoreCase("FunctionObject");
//        if(parentId.equals("systemManagmentNode") || parentId.equals("modelManagmentNode") || isFunctionObject){
//            int childType = this.checkChildObject(parentId);
//            if(isFunctionObject){
//                try {
//                    /**判断该模块下子对象是模块还是操作,0表示无子节点,1表示是模块,2表示是操作**/
//                    if(childType == 2){
//                        try{
//                            FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false);
//                            if(Func.isNotEmpty(infos.length)){
//                                childType = this.checkChildObject(infos[0].id); //都是同一层所以取第一个即可查询是什么类型
//                                for(int i = 0;i < infos.length ;i++){
//                                    FuncOperationInfo info = infos[i];
//                                    MenuVO menuVO = new MenuVO();
//                                    menuVO.setChildType(childType);
//                                    menuVO.setId(info.id);
//                                    menuVO.setFuncId(info.funcId);
//                                    menuVO.setCode(info.operIndentify);
//                                    menuVO.setOperId(info.operId);
//                                    menuVO.setName(info.operName);
//                                    menuVO.setAlias(info.operAlias);
//                                    menuVO.setRemark(info.operDesc);
//                                    menuVO.setSort((int) info.number);
//                                    menuVO.setModeType("FunctionObject");
//                                    menuVO.setIsValid(info.isValid);
//                                    menuVO.setHasChildren(false);
//                                    menuVOList.add(menuVO);
//                                }
//                            }
//                        }catch (PLException e) {
//                            e.printStackTrace();
//                            throw new VciBaseException(String.valueOf(e.code), e.messages);
//                        }
//                    }else if(childType == 1){
//                        try{
//                            FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
//                            if(Func.isNotEmpty(funcInfos.length)){
//                                childType = this.checkChildObject(funcInfos[0].id); //都是同一层所以取第一个即可查询是什么类型
//                                for(int i = 0;i < funcInfos.length; i++){
//                                    FunctionInfo funcInfo = funcInfos[i];
//                                    MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
//                                    menuVO.setChildType(childType);
//                                    menuVO.setModeType("FunctionObject");
//                                    menuVOList.add(menuVO);
//                                }
//                            }
//                        }catch (PLException e) {
//                            e.printStackTrace();
//                            throw new VciBaseException(String.valueOf(e.code),e.messages);
//                        }
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    throw new VciBaseException("模块查询时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e));
//                }
//            }else{
//                try{
//                    MenuVO parentNode = null;
//                    //将返回的节点外层套上当前父节点
//                    if("systemManagmentNode".equals(parentId)){
//                        parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode();
//                    }else if("modelManagmentNode".equals(parentId)){
//                        parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode();
//                    }
//                    //如果查询的是第一层节点就需要直接返回systemManagmentNode或modelManagmentNode节点
//                    if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){
//                        menuVOList.add(parentNode);
//                        return menuVOList;
//                    }
//                    //查询的三级节点
//                    FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
//                    for(int i = 0;i < funcInfos.length; i++){
//                        FunctionInfo funcInfo = funcInfos[i];
//                        MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
//                        menuVO.setModeType("FunctionObject");
//                        menuVO.setChildType(childType);
//                        menuVOList.add(menuVO);
//                    }
//                    return menuVOList;
//                }catch (PLException e) {
//                    e.printStackTrace();
//                    throw new VciBaseException(String.valueOf(e.code),e.messages);
//                }
//            }
//        }
//        else if(parentId.equals("operateNode")){
//            //加载所有操作
//            try{
//                //将返回的节点外层套上当前父节点
//                MenuVO parentNode = JsonConfigReader.getSysModuleConf().getOperateNode();
//                //如果查询的是第一层节点就需要直接返回sysOptionNode节点
//                if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){
//                    menuVOList.add(parentNode);
//                    return menuVOList;
//                }
//                OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId);
//                for(int i = 0; i < operateInfos.length;i++ ){
//                    OperateInfo operateInfo = operateInfos[i];
//                    MenuVO menuVO = new MenuVO();
//                    menuVO.setId(operateInfo.id);
//                    menuVO.setName(operateInfo.name);
//                    menuVO.setCode(operateInfo.identify);
//                    menuVO.setAlias(operateInfo.alias);
//                    menuVO.setCategory(2);
//                    menuVO.setChildType(0);
//                    menuVO.setRemark(operateInfo.desc);
//                    menuVO.getMeta().put("keepAlive",false);
//                    menuVO.setSort((int) operateInfo.seq);
//                    menuVO.setModeType("operateObject");
//                    menuVO.setHasChildren(false);
//                    menuVOList.add(menuVO);
//                }
//            }catch (PLException e) {
//                e.printStackTrace();
//                throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)});
//            }
//        }
//        return null;
//        return menuVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciException
     */
    public FunctionInfo[] getModuleListByParentId(String parentId,boolean isAll) throws PLException {
        FunctionInfo[] funcInfos = null;
        funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
        return funcInfos;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
@@ -72,6 +72,25 @@
        }
    }
    /**
     * èŽ·å–å½“å‰æ¨¡å—ä¸‹çš„å­æ¨¡å—
     * @param parentId
     * @param modeType
     * @return
     */
    @GetMapping("/getSysModelAuthTreeMenuByPID")
    public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID(String parentId, String modeType) {
        try {
            return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(parentId,modeType,true));
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询子模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * æ·»åŠ æ¨¡å—
     * @param menuVO
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -8,6 +8,8 @@
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.starter.web.pagemodel.Tree;
import com.vci.starter.web.pagemodel.TreeQueryObject;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
@@ -46,6 +48,28 @@
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * èŽ·å–æ‰€æœ‰ä¸šåŠ¡ç±»åž‹ï¼ˆæ ‘å½¢ç»“æž„ï¼‰
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @GetMapping( "/getTreeAttributes")
    @VciBusinessLog(operateName = "获取属性(树形结构)")
    public BaseResult<List<Tree>> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject){
        try {
            List<Tree>  trees=   attributeService.getTreeAttributesByBtmName(treeQueryObject);
            return BaseResult.dataList(trees);
          //  return BaseResult.tree(trees);
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "查询业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * å±žæ€§åˆ—表
     * @param baseQueryObject æŸ¥è¯¢å¯¹è±¡
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
@@ -1,37 +1,23 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.qtm.QTD;
import com.vci.dto.QTInfoDTO;
import com.vci.pagemodel.OsBtmTypeAttributeVO;
import com.vci.pagemodel.OsBtmTypeVO;
import com.vci.pagemodel.OsLinkTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
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.VciBaseUtil;
import com.vci.web.service.OsLinkTypeServiceI;
import com.vci.web.service.OsQuereyTemplateServiceI;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.DocumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
 * æŸ¥è¯¢æ¨¡æ¿çš„æŽ§åˆ¶å™¨
@@ -63,6 +49,26 @@
    public BaseResult queryTemplateList(String btmName,Boolean linkFlag){
        try {
            return quereyTemplateServiceI.queryTemplateList(btmName,linkFlag);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * æŸ¥è¯¢æ¨¡æ¿çš„列表添加了字段的相关属性
     * @param btmName ç±»åž‹
     * @param linkFlag æ˜¯å¦é“¾æŽ¥ç±»åž‹ ï¼štrue é“¾æŽ¥ç±»åž‹ ï¼Œfalse ä¸šåŠ¡ç±»åž‹
     * @param direction æ­£åæ–¹å‘
     * @return æŸ¥è¯¢æ¨¡æ¿çš„列表
     */
    @GetMapping("/queryTemplateListByAttr")
    public BaseResult queryTemplateListByAttr(String btmName,Boolean linkFlag, String direction){
        try {
            return quereyTemplateServiceI.queryTemplateListByAttr(btmName,linkFlag,direction);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
@@ -277,13 +283,13 @@
    /**
     * æŸ¥è¯¢æ–¹æ¡ˆåˆ é™¤
     * @param templateNames æŸ¥è¯¢æ–¹æ¡ˆå
     * @param names æŸ¥è¯¢æ–¹æ¡ˆå
     * @return æ“ä½œç»“æžœ
     */
    @DeleteMapping("/deleteLinkTemplate")
    public BaseResult deleteLinkTemplate(@RequestBody List<String> templateNames){
    public BaseResult deleteLinkTemplate(String names){
        try {
            return quereyTemplateServiceI.deleteLinkTemplate(templateNames);
            return quereyTemplateServiceI.deleteLinkTemplate(names);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,172 @@
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.pagemodel.Tree;
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;
import java.util.List;
/**
 * 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);
        }
    }
    /**
     * æ ¹æ®è§’色获取UI/表单/按钮的权限.
     * @param baseQueryObject
     * @return
     */
    @GetMapping( "/getUIAuthor")
    @VciBusinessLog(operateName = "UI授权(树形结构)")
    public BaseResult getUIAuthor(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataList( uiManagerService.getUIAuthor(baseQueryObject));
        }catch (Throwable 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/controller/WebPortalVIController.java
@@ -32,10 +32,11 @@
import java.util.List;
/**
 * å…¬å¼æŽ§åˆ¶å™¨
 * è¡¨å•/表格控制器
 * @author weidy
 * @date 2022-2-11
 */
@VciBusinessLog(modelName="表单/表格控制器",notStore=true)
@RestController
@RequestMapping("/portalVIController")
public class WebPortalVIController {
@@ -95,7 +96,7 @@
    }
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ é™¤
     * è¡¨å•/table删除
     * btmTypeDTO ä¸šåŠ¡ç±»åž‹å¯¹è±¡
     * @return åˆ é™¤ç»“æžœ
     */
@@ -112,7 +113,7 @@
        }
    }
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ é™¤
     * è¡¨å•/table删除
     * btmTypeDTO ä¸šåŠ¡ç±»åž‹å¯¹è±¡
     * @return åˆ é™¤ç»“æžœ
     */
@@ -128,8 +129,11 @@
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     *
     * è¡¨å•/table克隆
     * @param portalVIDTOList clong对象
     * @return
     */
    @PostMapping("/clone")
    @VciBusinessLog(operateName = "克隆表单/表格")
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java
@@ -3,9 +3,7 @@
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.dto.OsAttributeDTO;
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.*;
import com.vci.pagemodel.OsAttributeVO;
import org.springframework.web.multipart.MultipartFile;
@@ -21,6 +19,12 @@
 */
public interface OsAttributeServiceI extends OsBaseServiceI{
    /**
     * èŽ·å–æ ‘çŠ¶
     * @param treeQueryObject
     * @return
     */
    List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject);
    /**
     * èŽ·å–é»˜è®¤çš„å±žæ€§
     * @return é»˜è®¤çš„属性列表
@@ -182,8 +186,9 @@
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹/链接类型获取属性信息
     * @param btName ä¸šåŠ¡ç±»åž‹/链接类型
     * @param typeFlag 0:业务类型,1:链接类型
     * @param isDefault æ˜¯å¦åŒ…含默认属性 true:包含,false ä¸åŒ…含
     * @return
     */
    List<OsAttributeVO> getOsAttributeVOSByBtName(String btName,int typeFlag)throws Exception;
    List<OsAttributeVO> getOsAttributeVOSByBtName(String btName,int typeFlag,boolean isDefault)throws Exception;
}
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/OsQuereyTemplateServiceI.java
@@ -102,10 +102,10 @@
    BaseResult impLinkTemplate(MultipartFile file) throws IOException, ClassNotFoundException;
    /**
     * æŸ¥è¯¢æ–¹æ¡ˆåˆ é™¤
     * @param templateNames æŸ¥è¯¢æ–¹æ¡ˆå
     * @param names æŸ¥è¯¢æ–¹æ¡ˆå
     * @return æ“ä½œç»“æžœ
     */
    BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException;
    BaseResult deleteLinkTemplate(String names) throws PLException;
    /**
     * æŸ¥è¯¢æ¡ä»¶ä¸‹çš„æŸ¥è¯¢æŒ‰é’®
@@ -153,5 +153,12 @@
     * @return å¯¼å…¥ç»“æžœ
     */
    BaseResult impBtmTemplate(MultipartFile file) throws IOException, ClassNotFoundException;
    /**
     * æŸ¥è¯¢æ¨¡æ¿çš„列表添加了字段的相关属性
     * @param btmName ç±»åž‹
     * @param linkFlag æ˜¯å¦é“¾æŽ¥ç±»åž‹ ï¼štrue é“¾æŽ¥ç±»åž‹ ï¼Œfalse ä¸šåŠ¡ç±»åž‹
     * @param direction æ­£åæ–¹å‘
     * @return æŸ¥è¯¢æ¨¡æ¿çš„列表
     */
    BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException;
}
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,73 @@
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.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.pagemodel.Tree;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
 * @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;
    /**
     * èŽ·å–UI权限树
     * @param baseQueryObject
     * @return
     * @throws VciBaseException
     */
     List<Tree> getUIAuthor(BaseQueryObject baseQueryObject)throws Exception;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -7,14 +7,14 @@
import com.vci.client.mw.ClientSessionUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsAttributeDTO;
import com.vci.dto.OsEnumDTO;
import com.vci.dto.OsEnumItemDTO;
import com.vci.omd.dataType.VTDataType;
import com.vci.pagemodel.OsEnumItemVO;
import com.vci.pagemodel.OsEnumVO;
import com.vci.pagemodel.OsUsedAttributeVO;
import com.vci.omd.objects.OtherInfo;
import com.vci.pagemodel.*;
import com.vci.po.OsAttributePO;
import com.vci.po.OsEnumPO;
import com.vci.starter.poi.bo.ReadExcelOption;
@@ -25,12 +25,10 @@
import com.vci.starter.web.annotation.log.VciUnLog;
import com.vci.starter.web.enumpck.VciFieldTypeEnum;
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.pagemodel.*;
import com.vci.starter.web.util.*;
import com.vci.model.OsAttributeDO;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.properties.UsedNames;
import com.vci.web.service.OsAttributeServiceI;
import com.vci.web.service.OsBaseServiceI;
@@ -135,6 +133,101 @@
     * é»˜è®¤å±žæ€§çš„æ˜ å°„,key是小写
     */
    private static Map<String,OsAttributeVO> defaultAttributeVOMap = new HashMap<>();
    @Override
    public List<Tree> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject) {
        List<Tree> rootTreeList=new ArrayList<>();
        Map<String, String> conditionMap = treeQueryObject.getConditionMap();
        if (conditionMap == null) {
            conditionMap = new HashMap<>();
        }
        String typeName = StringUtils.isBlank(conditionMap.get("typeName")) ? "" : conditionMap.get("typeName");
        if (StringUtils.isBlank(typeName)) {
            VciBaseUtil.alertNotNull(typeName,"业务类型名称");
        }
        try {
            String typeFlag=StringUtils.isBlank(conditionMap.get("typeFlag"))?"":conditionMap.get("typeFlag");
            PortalVITypeFlag portalVITypeFlag= PortalVITypeFlag.getByName(typeFlag);
            Short viTypeFlag=-1;
            if(portalVITypeFlag!=null){
                viTypeFlag=portalVITypeFlag.getIntVal();
            }
            boolean isDefault =Boolean.parseBoolean(conditionMap.get("isDefault"));
            Tree tree = new Tree("root", "【" + typeName + "】属性信息", "root");
            tree.setLevel(0);
            rootTreeList.add(tree);
            getChildTree(rootTreeList,typeName, viTypeFlag,isDefault);
        }catch (Throwable e){
         e.printStackTrace();
        }
        return rootTreeList;
    }
    /**
     * å¤Ÿç€å±žæ€§æ ‘节点
     * @param parentTreeList
     * @param refTypeName
     * @param refFlag
     * @param isDefault
     * @throws Exception
     */
    private void getChildTree(List<Tree> parentTreeList,String refTypeName,int refFlag,boolean isDefault) throws Exception {
        for (Tree pTree : parentTreeList) {
            if (pTree.getLevel()>= 3) {
                continue;
            }
            Object o= pTree.getData();
            String pName=pTree.getText();
            boolean isOsAttributeVO=false;
            if(o instanceof OsAttributeVO){
                isOsAttributeVO=true;
                OsAttributeVO osAttributeVO=(OsAttributeVO)o;
                String other = osAttributeVO.getOther();
                OtherInfo otherInfo = OtherInfo.getOtherInfoByText(other);
                refFlag = otherInfo.getRefFlag();
                refTypeName = otherInfo.getRefTypeName();
            }
            List<OsAttributeVO> childOsAttributeVOList=new ArrayList<>();
            if (refFlag != -1) {
                // pName: ä¸ºå‚照属性名加上路径
                childOsAttributeVOList=getOsAttributeVOSByBtName(refTypeName,refFlag,isDefault);
                if(!CollectionUtils.isEmpty(childOsAttributeVOList)) {
                    List<Tree> childTreeList= new ArrayList<>();
                    boolean finalIsOsAttributeVO = isOsAttributeVO;
                    childOsAttributeVOList.stream().forEach(childOsAttributeVO->{
                        Tree childTree = new Tree(childOsAttributeVO.getOid(), childOsAttributeVO.getId(), childOsAttributeVO);
                        childTree.setOid(childOsAttributeVO.getOid());
                        childTree.setParentName(pTree.getText());
                        childTree.setParentId(pTree.getOid());
                        childTree.setLevel(pTree.getLevel()+1);
                        childTree.setLeaf(true);
                        if(finalIsOsAttributeVO) {
                            childTree.setText(pName + "." + childOsAttributeVO.getId());
                        }else{
                            childTree.setText(childOsAttributeVO.getId());
                        }
                        if (childTree.getLevel()>= 3) {
                            childTree.setLeaf(true);
                        }
                        childTreeList.add(childTree);
                    });
                    if(childTreeList.size()>0){
                        pTree.setChildren(childTreeList);
                        pTree.setExpanded(false);
                        getChildTree(childTreeList,refTypeName,refFlag,isDefault);
                    }else{
                        pTree.setLeaf(true);
                        pTree.setExpanded(true);
                    }
                }
            }else{
                pTree.setExpanded(true);
            }
        }
    }
    /**
     * èŽ·å–é»˜è®¤çš„å±žæ€§
@@ -1142,17 +1235,36 @@
     * @return
     */
    @Override
    public List<OsAttributeVO> getOsAttributeVOSByBtName(String btName, int typeFlag) throws Exception{
    public List<OsAttributeVO> getOsAttributeVOSByBtName(String btName, int typeFlag,boolean isDefault) throws Exception{
        VciBaseUtil.alertNotNull(btName,"参数不允许为空",typeFlag,"参数不允许为空");
        List<OsAttributeVO> attributeVOS=new ArrayList<>();
        try {
            AttributeDef[] attributeDefs=new AttributeDef[]{};
            List<AttributeDef> attributeDefList=new ArrayList<>();
            if(typeFlag==0){
                attributeDefs=    platformClientUtil.getBtmService().getAttributeDefs(btName);
                AttributeDef [] attributeDefs=    platformClientUtil.getBtmService().getAttributeDefs(btName);
                if(attributeDefs!=null){
                    attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList()));
                }
                if(isDefault){
                    AttributeDef [] sysAttributeDefs=platformClientUtil.getBtmService().getSysAttributeDefs();
                    if(sysAttributeDefs!=null){
                        attributeDefList.addAll(Arrays.stream(sysAttributeDefs).collect(Collectors.toList()));
                    }
                }
            }else{
                attributeDefs=platformClientUtil.getLinkTypeService().getAttributes(btName);
                AttributeDef []    attributeDefs=platformClientUtil.getLinkTypeService().getAttributes(btName);
                if(attributeDefs!=null){
                    attributeDefList.addAll(Arrays.stream(attributeDefs).collect(Collectors.toList()));
                }
                if(isDefault){
                    AttributeDef[] sysAbItems = platformClientUtil.getLinkTypeService().getSysAttributeDefs();
                    if(sysAbItems!=null){
                        attributeDefList.addAll(Arrays.stream(sysAbItems).collect(Collectors.toList()));
                    }
                }
            }
            attributeVOS=attributeDO2VOs(Arrays.asList(attributeDefs));
            attributeVOS=attributeDO2VOs(attributeDefList);
        }catch (PLException e){
            throw new Exception("根据业务类型获取属性异常"+e.getMessage());
        }
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/OsPortalVIServiceImpl.java
@@ -168,6 +168,9 @@
        }
        PortalVIVO portalVIVO=new PortalVIVO();
        PortalVI portalVI=  platformClientUtil.getPortalService().getPortalVIById(id);
        if(portalVI==null||StringUtils.isBlank(portalVI.id)){
            throw new VciBaseException("根据主键未查询到数据");
        }
        portalVIVO=portalVIDOO2VO(portalVI);
        return portalVIVO;
    }
@@ -381,7 +384,7 @@
                }
                String attributeStr="";
                try {
                    List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag());
                    List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag(),false);
                    if(!CollectionUtils.isEmpty(osAttributeVOList)){
                      List<String> filedList= osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
                        attributeStr=VciBaseUtil.array2String(filedList.toArray(new String[]{}));
@@ -521,7 +524,7 @@
                            });
                        }
                        //校验属性是否正确
                        List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag);
                        List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag,false);
                        if (!CollectionUtils.isEmpty(osAttributeVOList)) {
                            List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
                            List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey());
@@ -640,7 +643,7 @@
        boolean flag = false;
        String labelName=PortalVIType.Form.getName();
        try {
            VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"名称不能为空!");
            VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"名称");
            if(portalVIDTO.getPrm()==null||portalVIDTO.getPrm().getPrmItemList()==null||portalVIDTO.getPrm().getPrmItemList().size()==0){
                throw  new Throwable(labelName+",未设置");
            }
@@ -1258,7 +1261,6 @@
    private List<String> getRefFormVIName(String refFormOid){
        List<String> keyList=new ArrayList<>();
        try {
            PortalVI refFormVI = UITools.getService().getPortalVIById(refFormOid);
            PortalVIVO portalVIVO= portalVIDOO2VO(refFormVI);
            if(portalVIVO!=null&&portalVIVO.getPrm().getPrmItemList().size()>0){
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -16,7 +16,8 @@
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.qtm.QTD;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.dto.QTInfoDTO;
import com.vci.dto.*;
import com.vci.omd.constants.SystemAttribute;
import com.vci.omd.objects.OtherInfo;
import com.vci.po.OsLinkTypePO;
import com.vci.starter.poi.bo.ReadExcelOption;
@@ -193,6 +194,9 @@
        VciBaseUtil.alertNotNull(btName,"类型名");
        QTInfo[] objTypeQTs = platformClientUtil.getQTDService().getObjTypeQTs(btName);
        List<QTInfoDTO> dtos = new ArrayList<>();
        Map<String, AttributeDef> allSysAttr = Arrays.stream(platformClientUtil.getBtmService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e));
        allSysAttr.putAll(Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)));
        for (QTInfo obj : objTypeQTs) {
            QTInfoDTO qtInfoDTO = new QTInfoDTO();
            qtInfoDTO.setCreator(obj.creator);
@@ -203,13 +207,84 @@
            qtInfoDTO.setQtUIText(obj.qtUIText);
            if(StringUtils.isNotBlank(obj.qtUIText)){
                //将给定的String文本解析为XML文档并返回新创建的document
                qtInfoDTO.setTree(analysisXml(obj));
                qtInfoDTO.setTree(analysisXml(obj, allSysAttr));
            }
            qtInfoDTO.setQueryTemplate(OQTool.getQTByDoc(DocumentHelper.parseText(obj.qtText), obj.qtName));
            QueryTemplate qtByDoc = OQTool.getQTByDoc(DocumentHelper.parseText(obj.qtText), obj.qtName);
            qtInfoDTO.setQueryTemplate(queryTemplateToDto(qtByDoc, allSysAttr));
            qtInfoDTO.setCreateTimeText(DateFormatUtils.format(new Date(obj.createTime), DateUtil.PATTERN_DATETIME));
            dtos.add(qtInfoDTO);
        }
        return BaseResult.dataList(dtos);
    }
    /**
     * å¯¹è±¡è½¬æ¢
     * @param qtByDoc æ¨¡æ¿å¯¹è±¡
     * @param allSysAttr æ‰€æœ‰ç³»ç»Ÿå±žæ€§
     * @return æ¨¡æ¿ä¼ è¾“对象
     * @throws PLException
     */
    private QueryTemplateDTO queryTemplateToDto(QueryTemplate qtByDoc, Map<String, AttributeDef> allSysAttr) throws PLException {
        QueryTemplateDTO dto = new QueryTemplateDTO();
        dto.setId(qtByDoc.getId());
        dto.setBtmType(qtByDoc.getBtmType());
        dto.setDirection(qtByDoc.getDirection());
        dto.setLevel(qtByDoc.getLevel());
        dto.setQueryChildrenFlag(qtByDoc.isQueryChildren());
        dto.setQueryISLeaf(qtByDoc.isQueryISLeaf());
        dto.setClauseList(qtByDoc.getClauseList());
        dto.setPageInfo(qtByDoc.getPageInfo());
        dto.setLinkType(qtByDoc.getLinkType());
        dto.setVersion(qtByDoc.getVersion());
        dto.setType(qtByDoc.getType());
        dto.setSecretFlag(qtByDoc.isSecretFlag());
        dto.setRightFlag(qtByDoc.isRightFlag());
        dto.setOrderInfoList(qtByDoc.getOrderInfoList());
        dto.setRecReturnMode(qtByDoc.getRecReturnMode());
        Condition con = qtByDoc.getCondition();
        if(con != null){
            ConditionDTO conDto = new ConditionDTO();
            conDto.setRootCIName(con.getRootCIName());
            Map<String, ConditionItem> ciMap = con.getCIMap();
            Map<String, ConditionItemDTO> ciMapDto = new HashMap<>();
            for (String key : ciMap.keySet()) {
                ConditionItem item = ciMap.get(key);
                LeafInfo leafInfo = item.getLeafInfo();
                ConditionItemDTO itemDTO = new ConditionItemDTO();
                itemDTO.setChildrenInfo(item.getChildrenInfo());
                itemDTO.setId(item.getId());
                itemDTO.setLeafFlag(item.isLeaf());
                ciMapDto.put(key, itemDTO);
                if(leafInfo == null){
                    continue;
                }
                LeafInfoDTO leafInfoDTO = new LeafInfoDTO();
                itemDTO.setLeafInfo(leafInfoDTO);
                //处理查询字段类型
                String column = leafInfo.getClause();
                if(column.contains(".")){
                    column = StringUtils.substringAfterLast(column, ".");
                }
                AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column);
                if(att == null || "".equals(att.oid)){
                    att = allSysAttr.get(column.toLowerCase());
                }
                leafInfoDTO.setClause(leafInfo.getClause());
                leafInfoDTO.setOperator(leafInfo.getOperator());
                leafInfoDTO.setType(att.vtDataType);
                if(leafInfo.getValue() != null ){
                    LeafValueDto valueDto = new LeafValueDto();
                    valueDto.setOrdinaryValue(leafInfo.getValue().getOrdinaryValue());
                    valueDto.setQueryTemplate(leafInfo.getValue().getQueryTemplate() != null ? queryTemplateToDto(leafInfo.getValue().getQueryTemplate(),allSysAttr) : null);
                    leafInfoDTO.setValue(valueDto);
                }
            }
            conDto.setCIMap(ciMapDto);
            dto.setCondition(conDto);
        }
        return dto;
    }
    /**
@@ -218,14 +293,13 @@
     * @return
     * @throws DocumentException
     */
    private HashMap<String,Object> analysisXml(QTInfo obj) throws DocumentException {
    private HashMap<String,Object> analysisXml(QTInfo obj, Map<String, AttributeDef> allSysAttr) throws DocumentException, PLException {
        org.dom4j.Document document = DocumentHelper.parseText(obj.qtUIText);
        if(document == null){
            return null;
        }
        //获取根节点,在例子中就是responsedata节点
        Element root = document.getRootElement();
        List<HashMap<String,Object>> treeList = new ArrayList<>();
        HashMap<String,Object> treeMap = new HashMap<>();
        treeMap.put("connector",root.getText());
        List<Element> children = root.elements();
@@ -233,9 +307,20 @@
        for(Iterator<Element> i = children.iterator(); i.hasNext();){
            Element child = i.next();
            if(AND.equals(child.getText()) || OR.equals(child.getText())){
                childList.add(addDefaultMutableTree(child));
                childList.add(addDefaultMutableTree(child, allSysAttr));
            }else {
                childList.add(child.getText().trim());
                String column = StringUtils.substringBefore(child.getText().trim(), " ");
                if(column.contains(".")){
                    column = StringUtils.substringAfterLast(column, ".");
                }
                AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column);
                if(att == null || "".equals(att.oid)){
                    att = allSysAttr.get(column.toLowerCase());
                }
                HashMap<String, String> data = new HashMap<>();
                data.put("column",child.getText().trim());
                data.put("type",att.vtDataType);
            }
        }
        treeMap.put("child",childList);
@@ -246,7 +331,7 @@
     * å°†å­èŠ‚ç‚¹è½¬ä¸ºmap结构
     * @param element
     */
    public Map<String, Object> addDefaultMutableTree(Element element){
    public Map<String, Object> addDefaultMutableTree(Element element, Map<String, AttributeDef> allSysAttr) throws PLException {
        List<Object> childList = new ArrayList<>();
        List<Element> children = element.elements();
        HashMap<String,Object> treeMap = new HashMap<>();
@@ -254,9 +339,21 @@
        for(Iterator<Element> i = children.iterator(); i.hasNext();){
            Element child = i.next();
            if(AND.equals(child.getText()) || OR.equals(child.getText())){
                childList.add(addDefaultMutableTree(child));
                childList.add(addDefaultMutableTree(child, allSysAttr));
            }else {
                childList.add(child.getText().trim());
                String column = StringUtils.substringBefore(child.getText().trim(), " ");
                if(column.contains(".")){
                    column = StringUtils.substringAfterLast(column, ".");
                }
                AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column);
                if(att == null || "".equals(att.oid)){
                    att = allSysAttr.get(column.toLowerCase());
                }
                HashMap<String, String> data = new HashMap<>();
                data.put("column",child.getText().trim());
                data.put("type",att.vtDataType);
                childList.add(data);
            }
        }
        treeMap.put("child",childList);
@@ -1332,12 +1429,16 @@
    }
    /**
     * æŸ¥è¯¢æ–¹æ¡ˆåˆ é™¤
     * @param templateNames æŸ¥è¯¢æ–¹æ¡ˆå
     * @param names æŸ¥è¯¢æ–¹æ¡ˆå
     * @return æ“ä½œç»“æžœ
     */
    @Override
    public BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException {
        boolean b = platformClientUtil.getQTDService().deleteQTs(templateNames.toArray(new String[0]));
    public BaseResult deleteLinkTemplate(String names) throws PLException {
        if(StringUtils.isBlank(names)){
            return BaseResult.fail("请选择查询方案!");
        }
        String[] nameSplit = names.split(",");
        boolean b = platformClientUtil.getQTDService().deleteQTs(nameSplit);
        if(!b){
            return BaseResult.fail("删除失败!!!");
        }
@@ -1564,7 +1665,204 @@
        tree.put("children", childList);
        return BaseResult.success(tree);
    }
    /**
     * æŸ¥è¯¢æ¨¡æ¿çš„列表添加了字段的相关属性
     * @param btmName ç±»åž‹
     * @param linkFlag æ˜¯å¦é“¾æŽ¥ç±»åž‹ ï¼štrue é“¾æŽ¥ç±»åž‹ ï¼Œfalse ä¸šåŠ¡ç±»åž‹
     * @param direction æ­£åæ–¹å‘
     * @return æŸ¥è¯¢æ¨¡æ¿çš„列表
     */
    @Override
    public BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException {
        //返回的界面下拉框显示树
        List<QTDDTO> qtddtos = new ArrayList<>();
        //将链接类型与业务类型的所有默认字段查询出来放到map里面方便后续调用
        Map<String, AttributeDef> allSysAttr = Arrays.stream(platformClientUtil.getBtmService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e));
        allSysAttr.putAll(Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)));
        QTD[] qtdArray = null;
        //查询相关类型的查询模板进行处理
        if(linkFlag){
            qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(btmName);
        }else {
            qtdArray = platformClientUtil.getQTDService().getBizTypeQTDs(btmName);
        }
        for (QTD qtd : qtdArray) {
            QTDDTO qtddto = new QTDDTO();
            qtddto.setName(qtd.name);
            qtddto.setCreateTime(qtd.createTime);
            qtddto.setLinkTypeName(qtd.linkTypeName);
            qtddto.setBtmName(qtd.btmName);
            qtddto.setCreator(qtd.creator);
            for (String abName : qtd.abNames) {
                AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName);
                //如果在属性接口中没有查到相关字段应该就在默认字段中
                if(att == null || "".equals(att.oid)){
                    att = allSysAttr.get(abName.toLowerCase());
                }
                if(direction != null) {
                    if (direction.equals(QTConstants.DIRECTION_POSITIVE)) {
                        if(att == null ){
                            throw new PLException("500",new String[]{"属性字段:"+ abName +"未查询到,请确认!"});
                        }
                        att.name = "T_OID." + abName;
                    } else if (direction.equals(QTConstants.DIRECTION_OPPOSITE)) {
                        if(att == null ){
                            throw new PLException("500",new String[]{"属性字段:"+ abName +"未查询到,请确认!"});
                        }
                        att.name = "F_OID." + abName;
                    }
                }else{
                    att.name = abName;
                }
                AttributeDefDTO attrDto = new AttributeDefDTO();
                attrDto.setDescription(att.description);
                attrDto.setLabel(att.label);
                attrDto.setOid(att.oid);
                attrDto.setCreator(att.creator);
                attrDto.setName(att.name);
                attrDto.setDefValue(att.defValue);
                attrDto.setLayersNum(1);
                attrDto.setRage(att.rage);
                attrDto.setVtDataType(att.vtDataType);
                attrDto.setOther(att.other);
                qtddto.getAttrs().add(attrDto);
                addNode(attrDto, allSysAttr);
            }
            qtddtos.add(qtddto);
        }
        return BaseResult.dataList(qtddtos);
    }
    /**
     * å­èŠ‚ç‚¹å¤„ç†
     * @param attributeDefByName çˆ¶èŠ‚ç‚¹çš„å±žæ€§ä¿¡æ¯
     * @param allSysAttr æ‰€æœ‰é»˜è®¤å­—段
     */
    private void addNode(AttributeDefDTO attributeDefByName, Map<String, AttributeDef> allSysAttr){
        if(attributeDefByName.getLayersNum() >= 3){
            return;
        }
        String abName = attributeDefByName.name;
        //取node上的最后一个属性名
        if(abName.contains(".")){
            abName = abName.substring(abName.lastIndexOf(".") + 1);
        }
        if(SystemAttribute.sysAttList().contains(abName.toUpperCase())){
            return;
        }
        AttributeDef abItem = null;
        try {
            abItem = platformClientUtil.getAttributeService().getAttributeDefByName(abName);
            String other = abItem.other;
//            String btmName = ApProvider.getInstance().getOtherValueByType(other, BTM);
            OtherInfo otherInfo = OtherInfo.getOtherInfoByText(other);
            int refFlag = otherInfo.getRefFlag();
            String refTypeName = otherInfo.getRefTypeName();
            if(refFlag != -1){
                //参照业务类型
                if(refFlag == 0){
                    //pName: ä¸ºå‚照属性名加上路径
                    String pName = attributeDefByName.name + ".";
                    String[] abNames = platformClientUtil.getBtmService().getAttributeNames(refTypeName);
                    for(int i = 0; i < abNames.length; i++){
                        String abName_ = abNames[i];
                        AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_);
                        if(att == null || "".equals(att.oid)){
                            att = allSysAttr.get(abName_.toLowerCase());
                        }
                        att.name = pName + abName_ ;
                        AttributeDefDTO attrDto = new AttributeDefDTO();
                        attrDto.setDescription(att.description);
                        attrDto.setLabel(att.label);
                        attrDto.setOid(att.oid);
                        attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1);
                        attrDto.setCreator(att.creator);
                        attrDto.setName(att.name);
                        attrDto.setDefValue(att.defValue);
                        attrDto.setRage(att.rage);
                        attrDto.setVtDataType(att.vtDataType);
                        attrDto.setOther(att.other);
                        attributeDefByName.getAttrs().add(attrDto);
                        addNode(attrDto, allSysAttr);
                    }
                    //系统属性ID,NAME,DESCRIPTION
                    for (int i = 0; i < SystemAttribute.bosysAttList().size(); i++) {
                        AttributeDef attributeDef = allSysAttr.get(SystemAttribute.bosysAttList().get(i).toLowerCase());
                        AttributeDefDTO attrDto = new AttributeDefDTO();
                        attrDto.setDescription(attributeDef.description);
                        attrDto.setLabel(attributeDef.label);
                        attrDto.setOid(attributeDef.oid);
                        attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1);
                        attrDto.setCreator(attributeDef.creator);
                        attrDto.setName(pName + SystemAttribute.bosysAttList().get(i));
                        attrDto.setDefValue(attributeDef.defValue);
                        attrDto.setRage(attributeDef.rage);
                        attrDto.setVtDataType(attributeDef.vtDataType);
                        attrDto.setOther(attributeDef.other);
                        attributeDefByName.getAttrs().add(attrDto);
                        addNode(attrDto, allSysAttr);
                    }
                    //参照链接类型
                }else if(refFlag == 1){
                    //pName: ä¸ºå‚照属性名加上路径
                    String pName = attributeDefByName.name + ".";
                    LinkType link = null;
                    try {
                        link = platformClientUtil.getLinkTypeService().getLinkType(refTypeName);
                    } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } catch (Throwable e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    if(link != null){
                        String[] abNames = link.attributes;
                        for(int i = 0; i < abNames.length; i++){
                            String abName_ = abNames[i];
                            AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_);
                            if(att == null || att.oid.equals("")){
                                att = allSysAttr.get(abName_.toLowerCase());
                            }
                            AttributeDefDTO attrDto = new AttributeDefDTO();
                            attrDto.setDescription(att.description);
                            attrDto.setLabel(att.label);
                            attrDto.setOid(att.oid);
                            attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1);
                            attrDto.setCreator(att.creator);
                            attrDto.setName(pName + abName_);
                            attrDto.setDefValue(att.defValue);
                            attrDto.setRage(att.rage);
                            attrDto.setVtDataType(att.vtDataType);
                            attrDto.setOther(att.other);
                            attributeDefByName.getAttrs().add(attrDto);
                            addNode(attrDto, allSysAttr);
                        }
                        //系统属性ID,NAME,DESCRIPTION
                        for (int i = 0; i < SystemAttribute.losysAttList().size(); i++) {
                            AttributeDef sysAttributeDefs = allSysAttr.get(SystemAttribute.losysAttList().get(i).toLowerCase());
                            AttributeDefDTO attrDto = new AttributeDefDTO();
                            attrDto.setDescription(sysAttributeDefs.description);
                            attrDto.setLabel(sysAttributeDefs.label);
                            attrDto.setOid(sysAttributeDefs.oid);
                            attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1);
                            attrDto.setCreator(sysAttributeDefs.creator);
                            attrDto.setName(pName + SystemAttribute.losysAttList().get(i));
                            attrDto.setDefValue(sysAttributeDefs.defValue);
                            attrDto.setRage(sysAttributeDefs.rage);
                            attrDto.setVtDataType(sysAttributeDefs.vtDataType);
                            attrDto.setOther(sysAttributeDefs.other);
                            attributeDefByName.getAttrs().add(attrDto);
                            addNode(attrDto, allSysAttr);
                        }
                    }
                }
            }
        } catch (PLException e) {
            e.printStackTrace();
        }
    }
    // æ•°æ®è¿‡æ»¤
    private void addImportBtmData(BtmQTExportData qtExportData, List<BizType> ltsNew, List<QTInfo> qTWrapperNew,
                               Map<String/* ç±»åž‹åç§° */, QTD[]/* æŸ¥è¯¢æ¨¡æ¿å®šä¹‰ */> norepQTDs) {
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,591 @@
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.framework.data.RoleRightInfo;
import com.vci.corba.omd.btm.BizType;
import com.vci.corba.portal.PortalService;
import com.vci.corba.portal.data.*;
import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI;
import com.vci.pagemodel.OsBtmTypeVO;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.pagemodel.RoleRightVO;
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.pagemodel.Tree;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.VciDateUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import com.vci.web.service.OsBtmServiceI;
import com.vci.web.service.UIManagerServiceI;
import com.vci.web.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
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.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
 * UI定义服务界面相关接口
 * @author ludc
 * @date 2024/8/28 17:05
 */
@Service
public class UIManagerServiceImpl implements UIManagerServiceI {
    /**
     * å¹³å°çš„调用工具类
     */
    @Resource
    private PlatformClientUtil platformClientUtil;
    /**
     * è§’色
     */
    @Resource
    private SmRoleQueryServiceI smRoleQueryServiceI;
    /**
     * ä¸šåŠ¡ç±»åž‹
     */
    @Resource
    private OsBtmServiceI osBtmServiceI;
    /**
     * æ—¥å¿—
     */
    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;
    }
    /**
     * ton通过业务类型和名称查询
     * @param btemName
     * @param code
     * @return
     * @throws PLException
     */
    public List<PLUILayout> getUIContextDataByBtName(String btemName,String code) throws PLException {
        List<PLUILayout> pluiLayoutList=new ArrayList<>();
        PLUILayout[]  pluiLayouts=   platformClientUtil.getUIService().getPLUILayoutEntityByTypeAndCode(btemName,code);
        if(pluiLayouts!=null&&pluiLayouts.length>0){
            pluiLayoutList= Stream.of(pluiLayouts).collect(Collectors.toList());
        }
        return pluiLayoutList;
    }
    /**
     * ç»™ä¸šåŠ¡ç±»åž‹ä¸‹æ·»åŠ 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 {
    }
    /**
     * èŽ·å–UI授权树
     * @param treeQueryObject
     * @return
     * @throws Exception
     */
    @Override
    public List<Tree> getUIAuthor(BaseQueryObject treeQueryObject) throws Exception {
        Map<String, String> conditionMap = treeQueryObject.getConditionMap();
        if (conditionMap == null) {
            conditionMap = new HashMap<>();
        }
        String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId");
        String type = StringUtils.isBlank(conditionMap.get("type")) ? "" : conditionMap.get("type");
        String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context");
        boolean showCheckBox = Boolean.parseBoolean(conditionMap.get("showCheckBox"));
       Map<String,RoleRightVO> roleRightVOMap=new HashMap<>();
        if(StringUtils.isNotBlank(roleId)){
          String userName= WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
            RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
            List<RoleRightVO>  roleRightVOList=roleRightDOO2VOS(Arrays.asList(rightInfos));
            roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO));
        }
        BizType[] bizTypes=osBtmServiceI.getBizTypes(type);
        List<Tree> treeList=new ArrayList<>();
        Tree   rootNode =new Tree("root","功能模块","root");
        rootNode.setLevel(0);
        rootNode.setShowCheckbox(true);
        rootNode.setExpanded(true);
        List<Tree> childList=new ArrayList<>();
        for (int i = 0; i < bizTypes.length; i++) {
            Tree bizTypeTree = new Tree(bizTypes[i].oid,bizTypes[i].name,bizTypes[i]);//(btmItems[i].label+" ["+ btmItems[i].name+"]", btmItems[i]);
            bizTypeTree.setLevel(1);
            bizTypeTree.setShowCheckbox(true);
            bizTypeTree.setParentId(rootNode.getOid());
            bizTypeTree.setParentName(rootNode.getText());
            bizTypeTree.setShowCheckbox(true);
            childList.add(bizTypeTree);
            List<PLUILayout>contextList=getUIContextDataByBtName(bizTypes[i].name,context);
            List<Tree> btmChildList=new ArrayList<>();
            btmChildList.add(bizTypeTree);
            setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox);
        }
        rootNode.setChildren(childList);
        treeList.add(rootNode);
        return treeList;
    }
    private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap,boolean isShowCheckBox){
        Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<Tree>()).stream().forEach(pTree -> {
            Object funcObj=  pTree.getData();
            List<Tree> chiledTreeList=new ArrayList<>();
            if (funcObj instanceof BizType) {//业务类型
                BizType bizType = (BizType) funcObj;
                if(!CollectionUtil.isEmpty(contextList)) {
                    contextList.stream().forEach(context->{
                        Tree childTree=new Tree(context.plOId,context.plName+"("+context.plCode+")",context);
                        childTree.setParentName(pTree.getText());
                        childTree.setParentId(pTree.getOid());
                        childTree.setLevel(pTree.getLevel()+1);
                        childTree.setShowCheckbox(isShowCheckBox);
                        chiledTreeList.add(childTree);
                    });
                    pTree.setChildren(chiledTreeList);
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox);
                }
            }else  if (funcObj instanceof PLUILayout){//UI
                PLUILayout context = (PLUILayout) funcObj;
                PLTabPage[] pages = new PLTabPage[0];
                try {
                    pages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(context.plOId);
                } catch (PLException e) {
                    e.printStackTrace();
                }
                if(pages!=null&&pages.length>0){
                    List<PLTabPage> plTabPageList= Arrays.stream(pages).collect(Collectors.toList());
                    plTabPageList.stream().forEach(plTabPage -> {
                        Tree childTree=new Tree(plTabPage.plOId,plTabPage.plName,plTabPage);
                        childTree.setParentName(pTree.getText());
                        childTree.setParentId(pTree.getOid());
                        childTree.setLevel(pTree.getLevel()+1);
                        childTree.setShowCheckbox(isShowCheckBox);
                        chiledTreeList.add(childTree);
                    });
                    pTree.setChildren(chiledTreeList);
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox);
                }
            }else if (funcObj instanceof PLTabPage) {//上下文
                PLTabPage plTabPage = (PLTabPage) funcObj;
                List<PLPageDefination>plPageDefinationList=new ArrayList<>();
                try {
                    PLPageDefination[] pLPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(plTabPage.plOId);
                    if(pLPageDefinations!=null&&pLPageDefinations.length>0){
                        plPageDefinationList= Arrays.stream(pLPageDefinations).collect(Collectors.toList());
                        plPageDefinationList.stream().forEach(plPageDefination -> {
                            Tree childTree=new Tree(plPageDefination.plOId,plPageDefination.name,plPageDefination);
                            childTree.setParentName(pTree.getText());
                            childTree.setParentId(pTree.getOid());
                            childTree.setLevel(pTree.getLevel()+1);
                            childTree.setShowCheckbox(isShowCheckBox);
                            chiledTreeList.add(childTree);
                        });
                        pTree.setChildren(chiledTreeList);
                    }
                    if(!CollectionUtil.isEmpty(chiledTreeList)) {
                        setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox);
                    }
                } catch (PLException e) {
                    e.printStackTrace();
                }
            }else if (funcObj instanceof PLPageDefination) {//
                PLPageDefination plPageDefination = (PLPageDefination) funcObj;
                try {
                    List<PLTabButton>plTabButtonList=new ArrayList<>();
                    PLTabButton[] pLTabButtons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(plPageDefination.plOId);
                    if(pLTabButtons!=null&&pLTabButtons.length>0){
                        plTabButtonList= Arrays.stream(pLTabButtons).collect(Collectors.toList());
                        plTabButtonList.stream().forEach(plTabButton -> {
                            Tree childTree=new Tree(plTabButton.plOId,plTabButton.plLabel,plTabButton);
                            childTree.setParentName(pTree.getText());
                            childTree.setParentId(pTree.getOid());
                            childTree.setLevel(pTree.getLevel()+1);
                            childTree.setShowCheckbox(isShowCheckBox);
                            childTree.setLeaf(true);
                            chiledTreeList.add(childTree);
                        });
                        pTree.setChildren(chiledTreeList);
                    }
                    if(!CollectionUtil.isEmpty(chiledTreeList)) {
                        setChildNode(chiledTreeList, contextList, roleRightVOMap, isShowCheckBox);
                    }
                } catch (PLException e) {
                    e.printStackTrace();
                }
            }else if (funcObj instanceof PLTabButton) {//按钮
                String id = ((PLTabButton) funcObj).plTableOId;
                if(roleRightVOMap.containsKey(id)){
                    pTree.setChecked(true);
                }else{
                    pTree.setChecked(false);
                }
            }
        });
    }
    /**
     * UI角色对象转换
     * @param infos
     * @return
     */
    private List<RoleRightVO> roleRightDOO2VOS(List<RoleRightInfo> infos){
        List<RoleRightVO> roleRightVOS=new ArrayList<>();
        Optional.ofNullable(infos).orElseGet(()->new ArrayList<>()).stream().forEach(info -> {
            RoleRightVO vo=roleRightDOO2VO(info);
            roleRightVOS.add(vo);
        });
        return roleRightVOS;
    }
    /**
     * UI角色对象转换
     * @param info
     * @return
     */
    private RoleRightVO roleRightDOO2VO(RoleRightInfo info){
        RoleRightVO vo=new RoleRightVO();
        vo.setId(info.id);
        vo.setCreateTime(VciDateUtil.date2Str(VciDateUtil.long2Date(info.createTime),""));
        vo.setCreateUser(info.createUser);
        vo.setRoleId(info.roleId);
        vo.setRightType(info.rightType);
        vo.setLicensor(info.licensor);
        vo.setRightValue(info.rightValue);
        vo.setFuncId(info.funcId);
        vo.setModifyTime(VciDateUtil.date2Str(VciDateUtil.long2Date(info.modifyTime),""));
        vo.setModifyUser(info.modifyUser);
        return vo;
    }
    /**
     * æŽ§åˆ¶åŒºèŠ‚ç‚¹åŠå…¶å­èŠ‚ç‚¹çš„å…‹éš†
     * @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;
    }
}