ludc
2024-10-31 a756aed2072b98ed02967ddf2b013fc77be65f94
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -265,9 +265,15 @@
                if(column.contains(".")){
                    column = StringUtils.substringAfterLast(column, ".");
                }
                if(column.contains(" ")){
                    column = StringUtils.substringBefore(column, " ");
                }
                AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column);
                if(att == null || "".equals(att.oid)){
                    att = allSysAttr.get(column.toLowerCase());
                }
                if(att == null){
                    throw new PLException("500", new String[]{"属性字段:" + column + "在属性池中未查询到,请确认!!"});
                }
                leafInfoDTO.setClause(leafInfo.getClause());
@@ -321,6 +327,7 @@
                HashMap<String, String> data = new HashMap<>();
                data.put("column",child.getText().trim());
                data.put("type",att.vtDataType);
                childList.add(data);
            }
        }
        treeMap.put("child",childList);
@@ -998,34 +1005,6 @@
        return qt;
    }
//    /**
//     * 组装查询模板
//     * @return
//     */
//    public QueryTemplate getQT(HashMap<String,Object> dataMap){
//        QueryTemplate qt = new QueryTemplate();
//        qt.setType(QTConstants.TYPE_LINK);
//        //TODO String qtId =
//        qt.setLinkType((String) dataMap.get("linkTypeName"));
//        qt.setDirection( (Boolean)dataMap.get("rdPositive") ? QTConstants.DIRECTION_POSITIVE : QTConstants.DIRECTION_OPPOSITE);
//        qt.setBtmType((String) dataMap.get("btmName"));
//        if("所有类型".equals(dataMap.get("combRelaType"))){
//            qt.setBtmType("*");
//        }
//        qt.setVersion(getVersion((String) dataMap.get("versionValue")));
//        qt.setQueryISLeaf((Boolean) dataMap.get("isQueryIsLeaf"));
//        qt.setLevel(StringUtils.isBlank((CharSequence) dataMap.get("level")) ? 1 : Integer.valueOf(String.valueOf(dataMap.get("level"))));
//        List<String> clauseList = new ArrayList<String>();
//        //TODO 查询列 显示列
//        clauseList.add("*");
//        qt.setClauseList(clauseList);
//        Condition con = new Condition();
//        qt.setCondition(con);
//        HashMap<String, ConditionItem> ciMap = getCIMap();
//        con.setCIMap(ciMap);
//        con.setRootCIName(con.getRootCINameByCIMap(ciMap));
//        return qt;
//    }
    /**
     * 返回查询的版本
@@ -1074,11 +1053,12 @@
     * @return
     */
    @Override
    public void expLinkTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException {
    public void expLinkTemplate(String names, HttpServletResponse response) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String vciqtmfFileName = defaultTempFolder + File.separator + "LinkTemplateExp" + new Date().getTime() + ".vciqtf";
        LinkQTExportData exportData = new LinkQTExportData();
        for (String name : names) {
        String[] splits = names.split(",");
        for (String name : splits) {
            QTInfo qt = platformClientUtil.getQTDService().getQT(name);
            exportData.getAllQTs().put(qt.qtName,qt);
            LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(qt.btmName);
@@ -1464,8 +1444,13 @@
            throw new PLException("500", new String[]{checkInfo});
        }
        qt.setId("qt1");
        BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML());
        return BaseResult.dataList(Arrays.asList(result));
        try {
            BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML());
            return BaseResult.dataList(Arrays.asList(result));
        }catch (Exception e){
            String errorLog = "查询时出现问题,请检查配置的条件是否存在问题,具体原因:"+VciBaseUtil.getExceptionMessage(e);
            throw new VciBaseException(errorLog);
        }
    }
    /**
@@ -1499,6 +1484,7 @@
        if(!checkInfo.equals("OK")){
            throw new PLException("500", new String[]{checkInfo});
        }
        qt.setId(qtInfoDTO.getQtName());
        //设置排序信息
        qt.setOrderInfoList(qtInfoDTO.getQueryTemplate().getOrderInfoList());
        QTInfo qtWrapper = new QTInfo();
@@ -1579,9 +1565,10 @@
     * @return
     */
    @Override
    public String expBtmQTTemplate(List<String> names) throws PLException, IOException {
    public String expBtmQTTemplate(String qtNames) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String vciqtmfFileName = defaultTempFolder + File.separator + "BtmTemplateExp" + new Date().getTime() + ".vciqtf";
        String[] names = qtNames.split(",");
        BtmQTExportData exportData = new BtmQTExportData();
        for (String name : names) {
            QTInfo qt = platformClientUtil.getQTDService().getQT(name);
@@ -1703,12 +1690,14 @@
                if(direction != null) {
                    if (direction.equals(QTConstants.DIRECTION_POSITIVE)) {
                        if(att == null ){
                            throw new PLException("500",new String[]{"属性字段:"+ abName +"未查询到,请确认!"});
                            continue;
//                            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 +"未查询到,请确认!"});
                            continue;
//                            throw new PLException("500",new String[]{"属性字段:"+ abName +"未查询到,请确认!"});
                        }
                        att.name = "F_OID." + abName;
                    }