瀏覽代碼

试验相关bug

liuyc 2 年之前
父節點
當前提交
4707ca9e39

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/TableFileClient.java

@@ -25,4 +25,7 @@ public interface TableFileClient {
     @PostMapping(API_PREFIX + "/saveBatchFile")
     void saveBatchFile(@RequestBody List<TableFile> query,@RequestParam Long addTablePkeyId);
 
+    @PostMapping(API_PREFIX + "/saveBatch")
+    boolean saveBatch(@RequestBody List<TableFile> newFiles);
+
 }

+ 4 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreePrivateClient.java

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
+import java.util.Map;
 
 import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
 
@@ -56,4 +57,7 @@ public interface WbsTreePrivateClient {
     @PostMapping(API_PREFIX + "/updateInfo")
     void updateInfo(@RequestParam Long pkeyId);
 
+    @PostMapping(API_PREFIX + "/getTrialDataInfo")
+    List<Map<String, Object>> getTrialDataInfo(@RequestParam String pKeyId, @RequestParam Long id);
+
 }

+ 136 - 11
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.spire.xls.*;
 import io.swagger.models.auth.In;
+import jdk.nashorn.internal.scripts.JD;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.time.DateUtils;
 import org.springblade.business.dto.*;
@@ -317,14 +318,146 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 } else if (StringUtils.isNotEmpty(dto.getReportNo()) && StringUtils.isNotEmpty(dto.getRecordNo())) {
                     dto.setTableType("1,2");
                 }
+
                 //重构编号
                 this.buildNumber(dto);
+                this.reNumberNo(trialSelfInspectionRecord, dto);
+
+                dto.setCreateTime(new Date());
+                dto.setTaskStatus("未上报");
+                dto.setId(SnowFlakeUtil.getId());
                 this.save(dto);
+
+                //复制表数据、表附件文件
+                String tableIds = trialSelfInspectionRecord.getTableIds();
+                if (StringUtils.isNotEmpty(tableIds)) {
+                    //获取表的数据源
+                    List<String> pKeyIds = Func.toStrList(tableIds);
+                    for (String pKeyId : pKeyIds) {
+                        WbsTreePrivate tab = wbsTreePrivateClient.getNodeByPrimaryKeyId(pKeyId);
+                        //复制数据
+                        List<Map<String, Object>> oneTabData = wbsTreePrivateClient.getTrialDataInfo(pKeyId, trialSelfInspectionRecord.getId());
+                        if (oneTabData.size() >= 1) {
+                            Map<String, Object> dataMap2 = oneTabData.get(0);
+
+                            dataMap2.remove("id");
+                            dataMap2.remove("p_key_id");
+                            dataMap2.remove("group_id");
+
+                            //sql组装
+                            String sqlInfo = "";
+                            sqlInfo = "INSERT INTO " + tab.getInitTableName() + " (";
+                            StringBuilder keyStr = new StringBuilder("id,p_key_id,group_id,");
+                            StringBuilder valStr = new StringBuilder(SnowFlakeUtil.getId() + "," + pKeyId + "," + dto.getId() + ",");
+                            for (String keys : dataMap2.keySet()) {
+                                if (!(dataMap2.get(keys) + "").equals("null")) {
+                                    String keysResult = keys.split("__")[0];
+                                    String keysResult2 = keys.split("__")[1];
+                                    keyStr.append(keysResult).append(",");
+                                    Object value = dataMap2.get(keys);
+
+                                    //替换报告单号、记录编号
+                                    if (String.valueOf(value).contains("JL-")) {
+                                        value = StringUtils.isNotEmpty(dto.getRecordNo()) ? dto.getRecordNo() : null;
+                                    }
+                                    if (String.valueOf(value).contains("BG-")) {
+                                        value = StringUtils.isNotEmpty(dto.getReportNo()) ? dto.getReportNo() : null;
+                                    }
+
+                                    String values = value + "_^_" + keysResult2;
+                                    valStr.append("'").append(values).append("',");
+                                }
+                            }
+                            keyStr = new StringBuilder(keyStr.substring(0, keyStr.lastIndexOf(",")));
+                            valStr = new StringBuilder(valStr.substring(0, valStr.lastIndexOf(",")));
+                            sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
+                            //新增
+                            jdbcTemplate.execute(sqlInfo);
+                        }
+
+                        //复制附件文件
+                        List<TableFile> oldFiles = jdbcTemplate.query("select domain_url,name,extension,type,is_deleted,domain_pdf_url,status from m_table_file where is_deleted = 0 and tab_id = '" + pKeyId + "' and trial_record_id = " + trialSelfInspectionRecord.getId(), new BeanPropertyRowMapper<>(TableFile.class));
+                        List<TableFile> newFiles = new ArrayList<>();
+                        for (TableFile oldFile : oldFiles) {
+                            TableFile obj = BeanUtil.copyProperties(oldFile, TableFile.class);
+                            if (obj != null) {
+                                obj.setId(SnowFlakeUtil.getId());
+                                obj.setTabId(pKeyId + ""); //表pKeyId
+                                obj.setTrialRecordId(dto.getId()); //当前记录id
+                                newFiles.add(obj);
+                            }
+                        }
+                        tableFileClient.saveBatch(newFiles);
+                    }
+                }
+
+                //复制试验记录关联相关信息:工程部位、原材料检测报告、取样信息
+                //1、工程部位与projectPosition字段绑定,在审批时建立关联关系
+
+                //2、原材料检测报告
+                List<TrialRawMaterialSelfRecord> query = jdbcTemplate.query("select self_record_id,raw_material_record_id,old_pdf_url from u_trial_raw_material_self_record where self_record_id = " + trialSelfInspectionRecord.getId(), new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class));
+                for (TrialRawMaterialSelfRecord record : query) {
+                    //新增关系
+                    jdbcTemplate.execute("insert into u_trial_raw_material_self_record(id,self_record_id,raw_material_record_id,old_pdf_url) values (" + SnowFlakeUtil.getId() + "," + dto.getId() + "," + record.getRawMaterialRecordId() + "," + (StringUtils.isNotEmpty(record.getOldPdfUrl()) ? record.getOldPdfUrl() : null) + ")");
+                }
+
+                //3、取样信息
+                List<TrialSelfSample> qyInfo = jdbcTemplate.query("select sampling_id from u_trial_self_sample where self_id = " + trialSelfInspectionRecord.getId(), new BeanPropertyRowMapper<>(TrialSelfSample.class));
+                for (TrialSelfSample trialSelfSample : qyInfo) {
+                    //新增关系
+                    jdbcTemplate.execute("insert into u_trial_self_sample(id,self_id,sampling_id) values (" + SnowFlakeUtil.getId() + "," + dto.getId() + "," + trialSelfSample.getSamplingId() + ")");
+                }
             }
         }
         return true;
     }
 
+    private void reNumberNo(TrialSelfInspectionRecord trialSelfInspectionRecord, TrialSelfInspectionRecordDTO dto) {
+        StringSPUtils spUtils = new StringSPUtils();
+        List<TrialSelfInspectionRecord> recordList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
+                .select(TrialSelfInspectionRecord::getReportNo, TrialSelfInspectionRecord::getRecordNo)
+                .and(obj -> obj.like(TrialSelfInspectionRecord::getReportNo, "BG-").or().like(TrialSelfInspectionRecord::getRecordNo, "JL-"))
+                .eq(TrialSelfInspectionRecord::getContractId, trialSelfInspectionRecord.getContractId()).eq(TrialSelfInspectionRecord::getNodeId, trialSelfInspectionRecord.getNodeId()));
+
+        List<TrialSelfInspectionRecord> bg = recordList.stream().filter(f -> f.getReportNo().contains("BG-")).collect(Collectors.toList());
+        List<TrialSelfInspectionRecord> jl = recordList.stream().filter(f -> f.getRecordNo().contains("JL-")).collect(Collectors.toList());
+
+        if (jl.size() > 0) {
+            List<String> numberRecordNos = new ArrayList<>();
+            for (String recordNo : jl.stream().map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList())) {
+                String number = recordNo.split("-")[recordNo.split("-").length - 1];
+                numberRecordNos.add(number);
+            }
+            int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
+            if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
+                String recordNo = dto.getRecordNo();
+                String substring = recordNo.substring(recordNo.length() - 4);
+                String s = spUtils.buildSerial(maxRecordNo1, 4);
+                String replace = recordNo.replace(substring, s);
+                dto.setRecordNo(replace);
+            } else {
+                throw new ServiceException("当前编号已达到最大值9999,操作失败");
+            }
+        }
+        if (bg.size() > 0) {
+            List<String> numberReportNos = new ArrayList<>();
+            for (String reportNo : bg.stream().map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList())) {
+                String number = reportNo.split("-")[reportNo.split("-").length - 1];
+                numberReportNos.add(number);
+            }
+            int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNos)) + 1;
+            if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
+                String reportNo = dto.getReportNo();
+                String substring = reportNo.substring(reportNo.length() - 4);
+                String s = spUtils.buildSerial(maxReportNo1, 4);
+                String replace = reportNo.replace(substring, s);
+                dto.setReportNo(replace);
+            } else {
+                throw new ServiceException("当前编号已达到最大值9999,操作失败");
+            }
+        }
+    }
+
     @Override
     public List<TrialSelfInspectionRecordVO2> getRawMaterialInfo(String nodeId, String contractId, String id) {
         List<TrialSelfInspectionRecordVO2> recordVO2s;
@@ -538,8 +671,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
     }
 
     @Override
-    public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String
-            projectId, String classify, String id, String tableType) throws Exception {
+    public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception {
         R<BladeFile> bladeFile = iossClient.addFileInfo(file);
         BladeFile bladeFile1 = bladeFile.getData();
         TableFile tableFile = new TableFile();
@@ -685,7 +817,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             //------获取最新试验记录------
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
 
-            //------编辑时生成为Null的记录表编号或报告单编号------
+            //------编辑时记录表编号或报告单编号为Null的重新生成------
             this.reBuildNumber(obj, dto);
 
             //------保存实体表数据、试验记录信息、生成PDF------
@@ -697,7 +829,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             //------关联取样信息------
             this.recordSampleSubmit(dto, obj);
 
-            //------新增设备使用记录信息------
+            //------关联新增设备使用记录信息------
             this.trialDeviceUseService.addDeviceUseInfo(dto);
         }
         return dto.getId().toString();
@@ -881,13 +1013,6 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
 
-        //解决如果当前类型没有表,那么不生成编号
-        /*String tableIds = dto.getTableIds();
-        List<WbsTreePrivate> recordTab = jdbcTemplate.query("select table_type from m_wbs_tree_private where table_type is not null and p_key_id in (" + tableIds + ")", new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-        List<Integer> collect = recordTab.stream().map(WbsTreePrivate::getTableType).distinct().collect(Collectors.toList());
-        String tabType = org.apache.commons.lang.StringUtils.join(collect, ",");
-        dto.setTableType(tabType);*/
-
         //两种类型同时生成
         if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1")) {
             String maxRecordNo = "";

+ 3 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/TableFileClientImpl.java

@@ -29,5 +29,7 @@ public class TableFileClientImpl implements TableFileClient {
         this.tableFileService.saveBatch(query, 100);
     }
 
-
+    public boolean saveBatch(List<TableFile> newFiles) {
+        return tableFileService.saveBatch(newFiles, 100);
+    }
 }

+ 56 - 29
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java

@@ -12,9 +12,11 @@ import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.tool.node.ForestNodeMerger;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.TableFile;
 import org.springblade.manager.entity.TrialSelfDataRecord;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.IWbsTreePrivateService;
+import org.springblade.manager.service.impl.ExcelTabServiceImpl;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
@@ -31,6 +33,8 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
 
     private final IWbsTreePrivateService wbsTreePrivateService;
     private final JdbcTemplate jdbcTemplate;
+    private final TableFileClientImpl tableFileClient;
+    private final ExcelTabServiceImpl excelTabServiceImpl;
 
     @Override
     public List<WbsTreePrivate> queryAllNodeByProjectId(String projectId) {
@@ -68,21 +72,12 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
     @Override
     public boolean copyBussTab(Long pKeyId, Long id) {
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getPKeyId, pKeyId));
-
-        List<WbsTreePrivate> wbsTreePrivateList = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>query().lambda()
-                .eq(WbsTreePrivate::getId, wbsTreePrivate.getId())
-                .eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId())
-                .eq(WbsTreePrivate::getWbsType, wbsTreePrivate.getWbsType())
-                .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
-                .eq(WbsTreePrivate::getParentId, wbsTreePrivate.getParentId()));
-
+        List<WbsTreePrivate> wbsTreePrivateList = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getId, wbsTreePrivate.getId()).eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId()).eq(WbsTreePrivate::getWbsType, wbsTreePrivate.getWbsType()).eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId()).eq(WbsTreePrivate::getParentId, wbsTreePrivate.getParentId()));
         List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateList.stream().sorted(Comparator.comparing(WbsTreePrivate::getCreateTime).reversed()).collect(Collectors.toList());
-
         long newPkId = SnowFlakeUtil.getId();
         wbsTreePrivate.setPKeyId(newPkId);
         wbsTreePrivate.setCreateTime(new Date());
         String nodeName = wbsTreePrivates.get(0).getNodeName();
-
         if (nodeName.contains("__")) {
             String[] oldName = nodeName.split("__");
             nodeName = oldName[0] + "__" + (Integer.parseInt(oldName[1]) + 1);
@@ -90,50 +85,74 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
             nodeName = nodeName + "__" + 1;
         }
         wbsTreePrivate.setNodeName(nodeName);
-        wbsTreePrivate.setIsTabPdf(1); // pdf=不能预览
-        wbsTreePrivate.setIsBussShow(1); // 是否隐藏表=否
-        wbsTreePrivate.setTabFileType(1); // 是否上传文件=否
-        wbsTreePrivate.setPdfUrl("");
-
         String tabName = wbsTreePrivate.getInitTableName();
 
         //字段查询 并去掉公式字段
-        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
+        /*String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
-        colkeys = stringObjectMap.get("colkeys") + "";
+        colkeys = stringObjectMap.get("colkeys") + "";*/
+
+        //查询字段
+        String sql = "select COLUMN_NAME from information_schema.`COLUMNS` WHERE table_name = '" + tabName + "'";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        List<Object> filed = new ArrayList<>();
+        for (Map<String, Object> map : maps) {
+            Object column_name = map.get("COLUMN_NAME");
+            if (!(("id").equals(column_name) || ("group_id").equals(column_name) || ("p_key_id").equals(column_name))) {
+                filed.add(column_name);
+            }
+        }
+
         //复制表数据
-        String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pKeyId + " and group_id = " + id;
+        String querySql = "select " + org.apache.commons.lang3.StringUtils.join(filed, ",") + " from " + tabName + " where p_key_id=" + pKeyId + " and group_id = " + id;
         List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
-        if (dataList != null && dataList.size() >= 1) {
+        if (dataList.size() >= 1) {
             Map<String, Object> dataMap2 = dataList.get(0);
 
-            dataMap2.remove("p_key_id");
             dataMap2.remove("id");
+            dataMap2.remove("p_key_id");
+            dataMap2.remove("group_id");
 
             //sql组装
             String sqlInfo = "";
 
             sqlInfo = "INSERT INTO " + tabName + " ( ";
 
-            String keyStr = "id,p_key_id,group_id";
-            String valStr = SnowFlakeUtil.getId() + "," + wbsTreePrivate.getPKeyId() + "," + id + ",";
+            StringBuilder keyStr = new StringBuilder("id,p_key_id,group_id,");
+            StringBuilder valStr = new StringBuilder(SnowFlakeUtil.getId() + "," + wbsTreePrivate.getPKeyId() + "," + id + ",");
 
             for (String keys : dataMap2.keySet()) {
                 if (!(dataMap2.get(keys) + "").equals("null")) {
-                    keyStr += keys + ",";
-                    valStr += "'" + dataMap2.get(keys) + "',";
+                    keyStr.append(keys).append(",");
+                    valStr.append("'").append(dataMap2.get(keys)).append("',");
                 }
             }
-            keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
-            valStr = valStr.substring(0, valStr.lastIndexOf(","));
+            keyStr = new StringBuilder(keyStr.substring(0, keyStr.lastIndexOf(",")));
+            valStr = new StringBuilder(valStr.substring(0, valStr.lastIndexOf(",")));
 
             sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
 
             jdbcTemplate.execute(sqlInfo);
         }
-        wbsTreePrivateService.save(wbsTreePrivate);
 
-        return true;
+        //复制附件文件
+        List<TableFile> oldFiles = jdbcTemplate.query("select domain_url,name,extension,type,is_deleted,domain_pdf_url,status from m_table_file where is_deleted = 0 and tab_id = '" + pKeyId + "' and trial_record_id = " + id, new BeanPropertyRowMapper<>(TableFile.class));
+        List<TableFile> newFiles = new ArrayList<>();
+        for (TableFile oldFile : oldFiles) {
+            TableFile obj = BeanUtil.copyProperties(oldFile, TableFile.class);
+            if (obj != null) {
+                obj.setId(SnowFlakeUtil.getId());
+                obj.setTabId(newPkId + ""); //新表pKeyId
+                obj.setTrialRecordId(id);
+                newFiles.add(obj);
+            }
+        }
+        boolean result = tableFileClient.saveBatch(newFiles);
+        if (result) {
+            wbsTreePrivateService.save(wbsTreePrivate);
+            return true;
+        }
+        return false;
     }
 
     @Override
@@ -175,7 +194,10 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
 
     @Override
     public WbsTreePrivate getNodeByPrimaryKeyId(String primaryKeyId) {
-        return wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, primaryKeyId));
+        return wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                .select(WbsTreePrivate::getInitTableName)
+                .eq(WbsTreePrivate::getStatus, 1)
+                .eq(WbsTreePrivate::getPKeyId, primaryKeyId));
     }
 
     @Override
@@ -187,6 +209,11 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
         this.wbsTreePrivateService.update(updateWrapper);
     }
 
+    @Override
+    public List<Map<String, Object>> getTrialDataInfo(String pKeyId, Long id) {
+        return excelTabServiceImpl.getBussDataInfoTrial(id, Long.parseLong(pKeyId));
+    }
+
     private void foreachSetChildList(List<WbsTreeContractTreeVOS> vosResult, List<WbsTreePrivateVO> voList) {
         voList.forEach(wbsTreePrivateVO -> {
             WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -340,7 +340,7 @@
         FROM
         m_wbs_tree_private
         WHERE
-        parent_id = d.id and is_deleted = 0
+        parent_id = d.id and is_deleted = 0 and type != 2
         ) AS "has_children"
         FROM
         m_wbs_tree_private d

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -2065,8 +2065,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //获取有权限的节点信息
-        String sql = "select p_key_id,html_url,table_type from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";
+        //获取有权限的表的信息
+        String sql = "select p_key_id,html_url,table_type,sort,node_name,create_time from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ") order by sort,node_name,create_time";
         List<WbsTreePrivate> queryList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
         List<String> dataPdfUrls = new ArrayList<>();