1、模板查询列表增加属性字段的类型。
2、权限管理树的查询接口。
已修改7个文件
已添加5个文件
789 ■■■■ 文件已修改
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/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/pagemodel/MenuVO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java 214 ●●●●● 补丁 | 查看 | 原始文档 | 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/OsQueryTemplateController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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/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/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<>();
    /**
     * æ˜¯å¦æœ‰å­å­™èŠ‚ç‚¹
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -508,78 +508,47 @@
        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
    public List<MenuVO> findChildAuthFunctionVO(String parentId,MenuVO functionVO) throws PLException {
//        List<FunctionInfo> menus = map.get(parentOid);
    public void findChildAuthFunctionVO(MenuVO functionVO, boolean isAll) throws PLException {
        //0表示没有模块也没有操作,1表示有模块,2表示有操作
        long l = platformClientUtil.getFrameworkService().checkChildObject(parentId);
//        funcObj.setFuncType(funcType);
//
//        if(funcType == 1){
//            FunctionObject[] funcObjs = new FunctionClientDelegate().getModuleListByParentId(funcObj.getId(),false);
//            for(int i=0;i<funcObjs.length;i++){
//                VCIBaseTreeNode curNode  = new VCIBaseTreeNode(funcObjs[i].getName(), funcObjs[i]);
//                treeModel.insertNodeInto(curNode, node,node.getChildCount());
//                setChildNode(curNode,funcObjs[i]);
//            }
//        }else if(funcType == 2){
//            FuncOperationObject[] funcOperateObjs = new FuncOperationClientDelegate().getFuncOperationByModuleId(funcObj.getId(), "", true);
//            for (int j = 0; j < funcOperateObjs.length; j++) {
//                VCIBaseTreeNode childNode = new VCIBaseTreeNode(funcOperateObjs[j].getOperAlias(),funcOperateObjs[j]);
//                UserObject user = rightManagementClient.fetchUserInfoByName(PLTApplication.getUserEntityObject().getUserName());
////                    if(user.getUserType() == 0 || childNode.toString().equals("查看")){
////                        treeModel.insertNodeInto(childNode, node,node.getChildCount());
////                        childNode.setLeaf(true);
////                    }else{
////                        boolean res = initRoleRightByType(childNode);
////                        if(res){
//                treeModel.insertNodeInto(childNode, node,node.getChildCount());
//                childNode.setLeaf(true);
////                        }
////                    }
//            }
//        }else{
//            functionVO.setHasChildren(false);
//        }
//
//
//
//
//
//        int funcType = funcDel.checkChildObject(funcObj.getId());
//        funcObj.setFuncType(funcType);
//
//
        List<MenuVO> functionVOList = new ArrayList<>();
//        if(menus == null){
//            return functionVOList;
//        }
//        for (FunctionInfo menu : menus) {
//            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.setCode(menu.aliasName);
//            functionVO.setAlias(menu.aliasName);
//            functionVO.setParentId(menu.parentId);
//            functionVO.setName(menu.name);
//            functionVO.getMeta().put("keepAlive",false);
//            functionVO.setSort((int) menu.seq);
//            functionVO.setChildren(findChildAuthFunctionVO(menu.id,functionVO));
//            if(functionVO.getChildren().size() > 0){
//                functionVO.setHasChildren(true);
//            }else {
//                functionVO.setHasChildren(false);
//            }
//            functionVOList.add(functionVO);
//        }
        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
        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
@@ -943,9 +912,9 @@
    @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;
        }
//        if(Func.isBlank(parentId)){
//            return menuVOList;
//        }
        SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
        boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId());
        if (adminOrDeveloperOrRoot) {
@@ -974,6 +943,7 @@
            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) {
@@ -989,58 +959,58 @@
            }
            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);
//        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;
//            }
            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());
//            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());
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/OsQueryTemplateController.java
@@ -62,6 +62,7 @@
     * æŸ¥è¯¢æ¨¡æ¿çš„列表添加了字段的相关属性
     * @param btmName ç±»åž‹
     * @param linkFlag æ˜¯å¦é“¾æŽ¥ç±»åž‹ ï¼štrue é“¾æŽ¥ç±»åž‹ ï¼Œfalse ä¸šåŠ¡ç±»åž‹
     * @param direction æ­£åæ–¹å‘
     * @return æŸ¥è¯¢æ¨¡æ¿çš„列表
     */
    @GetMapping("/queryTemplateListByAttr")
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
@@ -157,6 +157,7 @@
     * æŸ¥è¯¢æ¨¡æ¿çš„列表添加了字段的相关属性
     * @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/impl/OsQueryTemplateImpl.java
@@ -16,9 +16,7 @@
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.AttributeDefDTO;
import com.vci.dto.QTDDTO;
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;
@@ -196,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);
@@ -206,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;
    }
    /**
@@ -221,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();
@@ -236,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);
@@ -249,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<>();
@@ -257,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);
@@ -1571,51 +1665,27 @@
        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));
//        if(linkFlag){
//            QTD[] qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(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);
//                    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.setRage(att.rage);
//                    attrDto.setVtDataType(att.vtDataType);
//                    attrDto.setOther(att.other);
//                    qtddto.getAttrs().add(attrDto);
//                }
//                qtddtos.add(qtddto);
//            }
//
//        }else {
//            Map<String, AttributeDef> lSysAttr = Arrays.stream(platformClientUtil.getLinkTypeService().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);
        }
//        QTD[]
        for (QTD qtd : qtdArray) {
            QTDDTO qtddto = new QTDDTO();
            qtddto.setName(qtd.name);
@@ -1625,13 +1695,20 @@
            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{
@@ -1653,9 +1730,14 @@
            }
            qtddtos.add(qtddto);
        }
//        }
        return BaseResult.dataList(Arrays.asList(qtddtos));
        return BaseResult.dataList(qtddtos);
    }
    /**
     * å­èŠ‚ç‚¹å¤„ç†
     * @param attributeDefByName çˆ¶èŠ‚ç‚¹çš„å±žæ€§ä¿¡æ¯
     * @param allSysAttr æ‰€æœ‰é»˜è®¤å­—段
     */
    private void addNode(AttributeDefDTO attributeDefByName, Map<String, AttributeDef> allSysAttr){
        if(attributeDefByName.getLayersNum() >= 3){
@@ -1666,7 +1748,6 @@
        if(abName.contains(".")){
            abName = abName.substring(abName.lastIndexOf(".") + 1);
        }
//        qtddto.getAttrs().add(attributeDefByName);
        if(SystemAttribute.sysAttList().contains(abName.toUpperCase())){
            return;
        }
@@ -1706,10 +1787,7 @@
                        addNode(attrDto, allSysAttr);
                    }
                    //系统属性ID,NAME,DESCRIPTION
//                    AttributeDef[] sysAttributeDefs = platformClientUtil.getBtmService().getSysAttributeDefs();
//                    for (int i = 0; i < sysAttributeDefs.length; i++) {
                    for (int i = 0; i < SystemAttribute.bosysAttList().size(); i++) {
//                        addNode(node,  new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i)));
                        AttributeDef attributeDef = allSysAttr.get(SystemAttribute.bosysAttList().get(i).toLowerCase());
                        AttributeDefDTO attrDto = new AttributeDefDTO();
                        attrDto.setDescription(attributeDef.description);
@@ -1743,7 +1821,6 @@
                        String[] abNames = link.attributes;
                        for(int i = 0; i < abNames.length; i++){
                            String abName_ = abNames[i];
//                            DefaultMutableTreeNode node_ = new DefaultMutableTreeNode(pName + abName_);
                            AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_);
                            if(att == null || att.oid.equals("")){
                                att = allSysAttr.get(abName_.toLowerCase());
@@ -1764,11 +1841,6 @@
                        }
                        //系统属性ID,NAME,DESCRIPTION
                        for (int i = 0; i < SystemAttribute.losysAttList().size(); i++) {
//                            addNode(node,  new DefaultMutableTreeNode(pName + SystemAttribute.losysAttList().get(i)));
//                        }
//                        AttributeDef[] sysAttributeDefs = platformClientUtil.getLinkTypeService().getSysAttributeDefs();
//                        for (int i = 0; i < sysAttributeDefs.length; i++) {
//                        addNode(node,  new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i)));
                            AttributeDef sysAttributeDefs = allSysAttr.get(SystemAttribute.losysAttList().get(i).toLowerCase());
                            AttributeDefDTO attrDto = new AttributeDefDTO();
                            attrDto.setDescription(sysAttributeDefs.description);