Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -345,7 +345,7 @@
     * @throws VciBaseException 查询出错的时候会抛出异常
     */
    @Override
    public List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException {
    public List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException, PLException {
        VciBaseUtil.alertNotNull(treeQuery,"表单的查询对象",treeQuery.getBtmname(),"业务类型的信息",treeQuery.getComponentOid(),"树所在的组件的主键");
        Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap();
        UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap);
@@ -391,7 +391,7 @@
        if(StringUtils.isBlank(treeDefineVO.getLinkType())){
            //这个是业务类型的自参照
            //以前的平台没有对自参照这种有全部查询的
            OsBtmTypeVO btmTypeVO = btmService.getBtmById(treeDefineVO.getBtmType(),attributeVOMap);
            OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType());
            queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
            queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values());
@@ -540,6 +540,62 @@
                return cloAndCbo2Trees(loService.queryCLOAndBoByLinkType(linkTypeDataQuery),valueField,textField,parentFieldName,treeQuery.isShowCheckBox(),treeQuery.getParentOid());
            }
        }
    }
    /**
     * 获取数据(根据查询模板查询对象,返回的结构按照ui定义,定义的模板类型返回)
     * @param treeQuery 树形查询条件
     * @return 树形数据
     * @throws VciBaseException 查询出错的时候会抛出异常
     */
    @Override
    public BaseResult getDataByTemp(UITreeQuery treeQuery) throws VciBaseException, PLException {
        VciBaseUtil.alertNotNull(treeQuery,"表单的查询对象",treeQuery.getComponentOid(),"当前组件的主键");
        //1、先查询页面定义组件
        Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap();
        UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap);
        if(componentVO == null || StringUtils.isBlank(componentVO.getOid())){
            throw new VciBaseException("未获取到界面配置信息!");
        }
        // 2、根据配置的查询模板查询数据(需要考虑全面一点),
        // 这儿根据当前类型来获取是什么类型的查询模板,然后做对应的查询处理
        UITreeDefineVO treeDefineVO = componentVO.getTreeDefineVO();
        String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())?treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()):treeDefineVO.getQueryTemplateName());
        Map<String, String> replaceMap = wrapperReplaceMap(treeQuery.getSourceData());
        List<String> queryFieldList = new ArrayList<>();
        String valueField = treeQuery.isLinkTypeFlag()?(!treeDefineVO.isOrientation()?"${oid}" + TREE_NODE_ID_SEP + "${t_oid}":"${oid}" + TREE_NODE_ID_SEP + "${f_oid}"):(StringUtils.isNotBlank(treeQuery.getValueField())?treeQuery.getValueField():"oid");
        String textField = StringUtils.isNotBlank(treeDefineVO.getTreeNodeExpression())?treeDefineVO.getTreeNodeExpression():(StringUtils.isNotBlank(treeQuery.getTextField())?treeQuery.getTextField():"name");
        String rootExpress = StringUtils.isNotBlank(treeQuery.getRootExpress())?treeQuery.getRootExpress():treeDefineVO.getRootContent();
        String parentFieldName = treeQuery.getParentFieldName();
        if(parentFieldName.contains(",")){
            parentFieldName = parentFieldName.split(",")[0];
        }
        queryFieldList.add("creator_name");
        queryFieldList.add("lastmodifier_name");
        OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType());
        queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
        queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values());
        addQueryField(queryFieldList,valueField);
        addQueryField(queryFieldList,textField);
        List<BusinessObject> rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap);
        //3、根据不同的组件返回不同的数据类型(树、列表、树表、自定义模板、表单等)
        List<Tree> rootTreeList = null;
        if(!CollectionUtils.isEmpty(rootCbos)){
            rootTreeList = cbo2Trees(rootCbos,valueField,StringUtils.isBlank(rootExpress)?textField:rootExpress,parentFieldName,treeQuery.isShowCheckBox(),null);
            TreeQueryObject treeQueryObject = new TreeQueryObject();
            treeQueryObject.setValueField(valueField);
            treeQueryObject.setTextField(textField);
            treeQueryObject.setParentFieldName(parentFieldName);
            treeQueryObject.setShowCheckBox(treeQuery.isShowCheckBox());
            if(UITreeLoadTypeEnum.ALL.getValue().equalsIgnoreCase(treeDefineVO.getLoadType())){
                treeQueryObject.setQueryAllLevel(false);
            }
            //queryTreeForBO(rootTreeList,treeDefineVO.getQueryTemplateName(),queryFieldList,treeQueryObject);
        }
        return BaseResult.tree(rootTreeList);
    }
    /**
@@ -1594,7 +1650,12 @@
                        conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")");
                        if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) {
                            if (boService.queryCount(usedAttributeVO.getPkBtmType(), conditionMap) > 0) {
                                OsBtmTypeVO btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType());
                                OsBtmTypeVO btmTypeVO = null;
                                try {
                                    btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType());
                                } catch (PLException e) {
                                    e.printStackTrace();
                                }
                                throw new VciBaseException("数据在【" + btmTypeVO.getName() + "】中的字段[" + usedAttributeVO.getName() + "]里被引用.不能删除");
                            }
                        }else{