liuyc 2 سال پیش
والد
کامیت
5e5a21a710
15فایلهای تغییر یافته به همراه294 افزوده شده و 102 حذف شده
  1. 0 2
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TrialSelfInspectionRecordClient.java
  2. 5 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO.java
  3. 42 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO5.java
  4. 12 12
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  5. 28 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java
  6. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java
  7. 14 19
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  8. 4 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml
  9. 4 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java
  10. 26 12
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  11. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  12. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreePrivateService.java
  13. 51 36
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  14. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java
  15. 99 12
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

+ 0 - 2
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TrialSelfInspectionRecordClient.java

@@ -15,6 +15,4 @@ public interface TrialSelfInspectionRecordClient {
 
     @PostMapping(API_PREFIX + "/updateURL")
     void updateURL(@RequestParam String url, @RequestParam String pKeyId);
-
-
 }

+ 5 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO.java

@@ -63,4 +63,9 @@ public class WbsTreePrivateVO extends WbsTreePrivate implements INode<WbsTreePri
      */
     private String title;
 
+    /**
+     * 勾选状态 0=未勾选 1=已勾选
+     */
+    private Integer checkStatus = 0;
+
 }

+ 42 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO5.java

@@ -0,0 +1,42 @@
+package org.springblade.manager.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class WbsTreePrivateVO5 implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long parentId;
+
+    private String title;
+
+    private Integer checkStatus = 0;
+
+    private Integer nodeType;
+
+    private Integer wbsType;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List<WbsTreePrivateVO5> children;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private Boolean hasChildren;
+
+    public List<WbsTreePrivateVO5> getChildren() {
+        if (this.children == null) {
+            this.children = new ArrayList<>();
+        }
+        return this.children;
+    }
+
+}

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

@@ -872,7 +872,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         return dto.getId().toString();
     }
 
-    private void initBuildNumber(TrialSelfInspectionRecordDTO dto) {
+    public void initBuildNumber(TrialSelfInspectionRecordDTO dto) {
         if (ObjectUtil.isEmpty(dto.getId()) && StringUtils.isNotEmpty(dto.getTableType())) {
             //构建记录表编号、报告单编号
             this.buildNumber(dto);
@@ -880,7 +880,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         }
     }
 
-    private void initTrialTabIds(TrialSelfInspectionRecordDTO dto) {
+    public void initTrialTabIds(TrialSelfInspectionRecordDTO dto) {
         JSONArray dataArray = dto.getDataInfo().getJSONArray("orderList");
         List<String> tableIds = new ArrayList<>();
         for (int i = 0; i < dataArray.size(); i++) {
@@ -892,11 +892,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         dto.setTableIds(join);
     }
 
-    private void reBuildNumber(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
-        if (StringUtils.isEmpty(obj.getRecordNo()) && dto.getTableType().contains("1")) {
+    public void reBuildNumber(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
+        if (StringUtils.isEmpty(obj.getRecordNo()) && (dto.getTableType().contains("1") || dto.getTableType().contains("9"))) {
             this.buildNumber(dto);
             this.saveOrUpdate(dto);
-        } else if (StringUtils.isEmpty(obj.getReportNo()) && dto.getTableType().contains("2")) {
+        } else if (StringUtils.isEmpty(obj.getReportNo()) && (dto.getTableType().contains("2") || dto.getTableType().contains("10"))) {
             this.buildNumber(dto);
             this.saveOrUpdate(dto);
         }
@@ -1028,11 +1028,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
 
         //两种类型同时生成
-        if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1")) {
+        if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1") || dto.getTableType().contains("9,10") || dto.getTableType().contains("10,9")) {
             String maxRecordNo = "";
             if (StringUtils.isEmpty(dto.getRecordNo())) {
                 //获取记录表最大编号
-                List<String> recordNos = trialSelfInspectionRecords.stream().filter(f -> ObjectUtils.isNotEmpty(f.getRecordNo())).map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList());
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
                 if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
                     maxRecordNo = "0001";
                 } else {
@@ -1053,7 +1053,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             String maxReportNo = "";
             if (StringUtils.isEmpty(dto.getReportNo())) {
                 //获取报告单最大编号
-                List<String> reportNos = trialSelfInspectionRecords.stream().filter(f -> ObjectUtils.isNotEmpty(f.getReportNo())).map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList());
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
                 if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
                     maxReportNo = "0001";
                 } else {
@@ -1101,10 +1101,10 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         }
 
         //记录表
-        if (("1").equals(dto.getTableType())) {
+        if (("1").equals(dto.getTableType()) || ("9").equals(dto.getTableType())) {
             if (StringUtils.isEmpty(dto.getRecordNo())) {
                 //获取记录表最大编号
-                List<String> recordNos = trialSelfInspectionRecords.stream().filter(f -> ObjectUtils.isNotEmpty(f.getRecordNo())).map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList());
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
                 String maxRecordNo;
                 if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
                     maxRecordNo = "0001";
@@ -1141,10 +1141,10 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         }
 
         //报告单
-        if (("2").equals(dto.getTableType())) {
+        if (("2").equals(dto.getTableType()) || ("10").equals(dto.getTableType())) {
             if (StringUtils.isEmpty(dto.getReportNo())) {
                 //获取报告单最大编号
-                List<String> reportNos = trialSelfInspectionRecords.stream().filter(f -> ObjectUtils.isNotEmpty(f.getReportNo())).map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList());
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).filter(ObjectUtils::isNotEmpty).collect(Collectors.toList());
                 String maxReportNo;
                 if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
                     maxReportNo = "0001";

+ 28 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java

@@ -1,6 +1,8 @@
 package org.springblade.manager.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
@@ -10,9 +12,12 @@ import javax.validation.Valid;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.dto.WbsTreeContractDTO;
 import org.springblade.manager.dto.ProjectInfoDTO;
 import org.springblade.manager.entity.ContractInfo;
+import org.springblade.manager.entity.WbsInfo;
+import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.*;
 import org.springblade.manager.vo.*;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
@@ -23,8 +28,11 @@ import org.springblade.manager.entity.ProjectInfo;
 import org.springblade.manager.wrapper.ProjectInfoWrapper;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @RestController
 @AllArgsConstructor
@@ -198,7 +206,7 @@ public class ProjectInfoController extends BladeController {
      */
     @GetMapping("/tree")
     @ApiOperationSupport(order = 11)
-    @ApiOperation(value = "查询项目私有wbs节点树形结构(多个接口复用)", notes = "wbsId、项目id")
+    @ApiOperation(value = "查询项目私有wbs节点树形结构", notes = "wbsId、项目id")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
             @ApiImplicitParam(name = "wbsId", value = "wbsId", required = true)
@@ -211,6 +219,25 @@ public class ProjectInfoController extends BladeController {
         return R.fail(200, "未查询到信息");
     }
 
+    /**
+     * 后管-试验-新增or编辑勾选相关联试验-获取试验配合比树
+     */
+    @GetMapping("/tree-record-trial")
+    @ApiOperationSupport(order = 11)
+    @ApiOperation(value = "后管-试验-新增or编辑勾选相关联试验-获取试验配合比树", notes = "wbsId、项目id、节点pKeyId")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "wbsId", value = "wbsId", required = true),
+            @ApiImplicitParam(name = "pKeyId", value = "节点pKeyId", required = true)
+    })
+    public R<Map<String, List<Object>>> treeRecordTrial(String wbsId, String projectId, String pKeyId) {
+        Map<String, List<Object>> map = wbsTreePrivateService.treeRecordTrial(wbsId, projectId, pKeyId);
+        if (map != null && map.size() > 0) {
+            return R.data(map);
+        }
+        return R.fail(200, "未查询到信息");
+    }
+
     /**
      * 保存或修改分配项目级wbs树
      */

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java

@@ -130,7 +130,7 @@ public class TableFileController extends BladeController {
 
         Long pkeyId = Long.parseLong(tableFile.getTabId() + "");
         //单pdf
-        excelTabService.getBussPDFTrial(pkeyId, contractId, id, 0, 0);
+        excelTabService.getBussPDFTrial(pkeyId, contractId, id, 0, 0, null);
 
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
@@ -154,7 +154,7 @@ public class TableFileController extends BladeController {
         List<String> collect = query.stream().map(TrialSelfInspectionRecord::getTableIds).collect(Collectors.toList());
 
         //合并pdf
-        String bussPDFSTrial = excelTabService.getBussPDFSTrial(wbsTreePrivate1.getPKeyId() + "", tableType, classify, contractId, wbsTreePrivate.getProjectId(), id, org.apache.commons.lang.StringUtils.join(collect, ","));
+        String bussPDFSTrial = excelTabService.getBussPDFSTrial(wbsTreePrivate1.getPKeyId() + "", tableType, classify, contractId, wbsTreePrivate.getProjectId(), id, org.apache.commons.lang.StringUtils.join(collect, ","), null);
 
         if (StringUtils.isNotEmpty(bussPDFSTrial)) {
             //修改合并pdf

+ 14 - 19
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -76,14 +76,12 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         if (isBatchSave == 0) {
             //------单表PDF保存------
             TableInfo tableInfo = tableInfoList.stream().findAny().orElse(null);
-            assert tableInfo != null;
-            if (tabIds.contains(tableInfo.getPkeyId())) {
+            if (tableInfo != null && tabIds.contains(tableInfo.getPkeyId())) {
                 //构造pdf
-                excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id, 0, 0);
+                excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id, 0, 0, dto);
 
                 //重新合并pdf
-                String sql = "select pdf_url from u_trial_self_data_record where record_id = " + id;
-                List<TrialSelfDataRecord> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
+                List<TrialSelfDataRecord> query = jdbcTemplate.query("select pdf_url from u_trial_self_data_record where record_id = " + id, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
                 List<String> pdfList = query.stream().map(TrialSelfDataRecord::getPdfUrl).collect(Collectors.toList());
 
                 String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
@@ -95,20 +93,17 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                 FileUtils.mergePdfPublicMethods(pdfList, pdfPath);
                 BladeFile bladeFile = newIOSSClient.uploadFile(id + "2.pdf", pdfPath);
 
-                String sqlUpdate = "update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "' where id = " + id;
-                jdbcTemplate.execute(sqlUpdate);
+                jdbcTemplate.execute("update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "' where id = " + id);
 
                 //获取试验记录id的试验项目名称,重新合并pdf集合(解决单表保存后上报找不到题名问题)
-                String sql2 = "select trial_project_name from u_trial_self_inspection_record where id = " + id;
-                TrialSelfInspectionRecord obj = jdbcTemplate.query(sql2, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
-                assert obj != null;
-                String querySql = "select id from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
-                List<InformationQuery> query2 = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
-                if (query2.size() > 0) {
-                    String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + obj.getTrialProjectName() + "'  where classify='" + type + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
-                    jdbcTemplate.execute(updateSql);
+                TrialSelfInspectionRecord obj = jdbcTemplate.query("select trial_project_name from u_trial_self_inspection_record where id = " + id, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
+                List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
+                if (obj != null && query2.size() > 0) {
+                    jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + obj.getTrialProjectName() + "'  where classify='" + type + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'");
                 } else {
-                    informationQueryClient.saveData(id.toString(), projectId, contractId, type.toString(), bladeFile.getLink(), obj.getTrialProjectName());
+                    if (obj != null) {
+                        informationQueryClient.saveData(id.toString(), projectId, contractId, type.toString(), bladeFile.getLink(), obj.getTrialProjectName());
+                    }
                 }
             }
 
@@ -122,7 +117,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
              * id=记录id
              * tabIds=表的pKeyIds
              */
-            pdfUrl = excelTabService.getBussPDFSTrial(nodeId, tableType, String.valueOf(type), contractId, projectId, id, tabIds);
+            pdfUrl = excelTabService.getBussPDFSTrial(nodeId, tableType, String.valueOf(type), contractId, projectId, id, tabIds,dto);
 
         }
         return pdfUrl;
@@ -130,12 +125,12 @@ public class ExcelTabClientImpl implements ExcelTabClient {
 
     @Override
     public void getBussPDFTrial(Long pkeyId, String contractId, String id) throws Exception {
-        excelTabService.getBussPDFTrial(pkeyId, contractId, Long.parseLong(id), 0, 0);
+        excelTabService.getBussPDFTrial(pkeyId, contractId, Long.parseLong(id), 0, 0, null);
     }
 
     @Override
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, String id, String tabIds) throws Exception {
-        return excelTabService.getBussPDFSTrial(nodeId, tableType, classify, contractId, projectId, Long.parseLong(id), tabIds);
+        return excelTabService.getBussPDFSTrial(nodeId, tableType, classify, contractId, projectId, Long.parseLong(id), tabIds,null);
     }
 
 

+ 4 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml

@@ -347,7 +347,9 @@
             wt.id AS id,
             wt.node_name AS tableName,
             wt.sort AS sort,
-            wt.table_type AS tableType,
+            case when wt.table_type = 9 then 1
+                 when wt.table_type = 10 then 2
+                    end as tableType,
             wt.`status` AS isCreateTable ,
             wt.table_owner as tableOwner,
             wt.is_link_table,
@@ -356,7 +358,7 @@
             wt.wbs_id AS "wbsId",
             wt.fill_rate AS "fillRate",
             wt.init_table_id AS initTableId,
-            (SELECT count(*) FROM m_wbs_form_element WHERE f_id = wt.init_table_id and is_deleted = 0 and status = 1) AS "elementTotal"
+            (SELECT count(1) FROM m_wbs_form_element WHERE f_id = wt.init_table_id and is_deleted = 0 and status = 1) AS "elementTotal"
         FROM
             m_wbs_tree AS wt
         WHERE

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

@@ -83,7 +83,7 @@ public interface WbsTreePrivateMapper extends EasyBaseMapper<WbsTreePrivate> {
 
     void delTabProjectById(String pKeyId, String projectId);
 
-    List<WbsTreePrivateVO4> selectWbsTreeTrialTabList(List<String> roleAndTabOwners, String tableType, String projectId, String wbsId, Long parentId, List<String> tableOwnerList, String contractId);
+    List<WbsTreePrivateVO4> selectWbsTreeTrialTabList(String tableType, String projectId, String wbsId, Long parentId, String contractId);
 
     //删除表单信息
     void delTableById(String pKeyId);
@@ -91,4 +91,7 @@ public interface WbsTreePrivateMapper extends EasyBaseMapper<WbsTreePrivate> {
     List<TableInfo> selectTabInfoAll();
 
     void updateBatchByPKeyId(@Param("list") List<WbsTreePrivate> wbsTreePrivateList);
+
+    List<WbsTreePrivateVO5> treeRecordTrial(String wbsId, String projectId, Integer wbsType);
+
 }

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

@@ -452,7 +452,9 @@
         SELECT wt.p_key_id AS "pKeyId",
                wt.id AS id,
                wt.node_name AS tableName,
-               wt.table_type AS tableType,
+               case when wt.table_type = 9 then 1
+                    when wt.table_type = 10 then 2
+                    end as tableType,
                wt.`status` AS isCreateTable,
                wt.table_owner AS tableOwner,
                wt.is_link_table,
@@ -701,7 +703,9 @@
             excel_id,
             project_id,
             type,
-            table_type,
+            case when table_type = 9 then 1
+                 when table_type = 10 then 2
+                 end as tableType,
             table_owner,
             init_table_name,
             init_table_id,
@@ -716,19 +720,11 @@
             AND wbs_id = #{wbsId}
             AND parent_id = #{parentId}
             AND table_type = #{tableType}
-            AND table_owner in
-        <foreach item="roleAndTabOwners" collection="roleAndTabOwners" open="(" close=")" separator=",">
-            #{roleAndTabOwners}
-        </foreach>
             AND type = 2
             AND status = 1
             AND is_deleted = 0
-        <if test="tableOwnerList != null and tableOwnerList!= ''">
-            AND table_owner in
-            <foreach item="tableOwnerList" collection="tableOwnerList" open="(" close=")" separator=",">
-                #{tableOwnerList}
-            </foreach>
-        </if>
+            /*试验所属方=7*/
+            AND table_owner = 7
         /*解决不同合同段中复制表问题*/
         <if test="contractId == null">
             -- 后管加载原始表
@@ -745,6 +741,24 @@
         select * from m_table_info
     </select>
 
+    <select id="treeRecordTrial" resultType="org.springblade.manager.vo.WbsTreePrivateVO5">
+        select  id, parent_id,
+                node_name as title,
+                node_type AS "nodeType",
+                wbs_type as "wbsType"
+        from m_wbs_tree_private
+        where
+        is_deleted = 0
+        and status = 1
+        and `type` = 1
+        and project_id = #{projectId}
+        and wbs_id = #{wbsId}
+        <if test="wbsType != null and wbsType != ''">
+            and wbs_type = #{wbsType}
+        </if>
+        ORDER BY sort
+    </select>
+
     <delete id="delTabProjectById">
         delete from m_wbs_tree_private WHERE p_key_id = #{pKeyId} and project_id=#{projectId}AND type = 10
     </delete>

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

@@ -139,12 +139,12 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 单PDF 生成 - 试验
      */
-    String getBussPDFTrial(Long pKeyId, String contractId, Long id, int pageNumber, int pageNumberCount) throws Exception;
+    String getBussPDFTrial(Long pKeyId, String contractId, Long id, int pageNumber, int pageNumberCount, TrialSelfInspectionRecordDTO dto) throws Exception;
 
     /**
      * 多PDF 合并 - 试验
      */
-    String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception;
+    String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds, TrialSelfInspectionRecordDTO dto) throws Exception;
 
     /**
      * 保存 首件数据

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreePrivateService.java

@@ -12,10 +12,12 @@ import org.springblade.manager.vo.*;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 public interface IWbsTreePrivateService extends BaseService<WbsTreePrivate> {
 
     List<WbsTreePrivateVO> tree(String wbsId, String projectId);
+
     List<WbsTreeVO2> tree2(String wbsId, String projectId);
 
     boolean submit(WbsTreePrivate wbsTreePrivate);
@@ -84,4 +86,6 @@ public interface IWbsTreePrivateService extends BaseService<WbsTreePrivate> {
 
     List<WbsTreePrivateVO> getMixRatioTestTree(String pKeyId);
 
+    Map<String, List<Object>> treeRecordTrial(String wbsId, String projectId, String pKeyId);
+
 }

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

@@ -1,24 +1,7 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
 package org.springblade.manager.service.impl;
 
 import cn.hutool.core.date.StopWatch;
 import cn.hutool.log.StaticLog;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -27,9 +10,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.mixsmart.utils.ListUtils;
 import com.mixsmart.utils.RegexUtils;
-import com.spire.xls.CellRange;
-import com.spire.xls.Workbook;
-import com.spire.xls.*;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
@@ -43,6 +23,7 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
@@ -90,7 +71,6 @@ import java.util.*;
 import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 /**
  * 清表基础数据表 服务实现类
@@ -363,7 +343,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     tec.before();
                     this.formulaService.execute(tec);
                     tec.after();
-                }else{
+                } else {
                     tec.getLog().append("【").append("没有执行任何公式").append("】");
                 }
                 stopWatch.stop();
@@ -376,7 +356,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             "INSERT INTO m_formula_log (id,content) VALUES (" + wtc.getPKeyId() + ", '" + log + "')"
                     };
                     this.jdbcTemplate.batchUpdate(sql);
-                }catch (Exception e){
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -1168,7 +1148,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
-       // String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        // String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String file_path = "/Users/hongchuangyanfa/Desktop/";
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1950,8 +1930,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 单pdf
      */
     @Override
-    public String getBussPDFTrial(Long pkeyId, String contractId, Long id, int pageNumber, int pageNumberCount) throws
-            Exception {
+    public String getBussPDFTrial(Long pkeyId, String contractId, Long id, int pageNumber, int pageNumberCount, TrialSelfInspectionRecordDTO dto) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
@@ -1978,7 +1957,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
         //获取数据信息info
         List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId, Long.parseLong(contractId));
-        Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
+        Map<String, Object> DataInfo = new HashMap<>();
+        if (bussDataInfoTrial.size() > 0) {
+            DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
+        }
 
         org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
         Sheet sheet = workbook.getSheetAt(0);
@@ -2031,6 +2013,26 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 Document doc = Jsoup.parse(htmlString);
                 Element table = doc.select("table").first();
                 Elements trs = table.select("tr");
+
+                Elements bgHB = doc.select("el-input[placeholder~=报告编号.*]");
+                Elements jlBH = doc.select("el-input[placeholder~=记录编号.*]");
+                if (dto != null) {
+                    //报告编号
+                    if (bgHB.size() >= 1 && StringUtils.isNotEmpty(dto.getReportNo())) {
+                        for (Element element : bgHB) {
+                            DataInfo.put(element.attr("keyname"), "NUMBER-" + dto.getReportNo());
+                            break;
+                        }
+                    }
+                    //记录编号
+                    if (jlBH.size() >= 1 && StringUtils.isNotEmpty(dto.getRecordNo())) {
+                        for (Element element : jlBH) {
+                            DataInfo.put(element.attr("keyname"), "NUMBER-" + dto.getRecordNo());
+                            break;
+                        }
+                    }
+                }
+
                 if (ObjectUtil.isNotEmpty(DataInfo)) {
                     for (String val : Objects.requireNonNull(DataInfo).keySet()) {
                         if (val.contains("__")) {
@@ -2118,6 +2120,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                                             ObjectUtils.isNotEmpty(cell);
                                                         }
                                                     }
+                                                } else if (myData.contains("NUMBER-JL-") || myData.contains("NUMBER-BG-")) {
+                                                    //记录表号、报告单号
+                                                    Row row = sheet.getRow(y1 - 1);
+                                                    if (row != null) {
+                                                        Cell cell = row.getCell(x1 - 1);
+                                                        if (cell != null) {
+                                                            String replace = myData.replace("NUMBER-", "");
+                                                            cell.setCellValue(replace);
+                                                        } else {
+                                                            ObjectUtils.isNotEmpty(cell);
+                                                        }
+                                                    }
                                                 } else {
                                                     Row row = sheet.getRow(y1 - 1);
                                                     if (row != null) {
@@ -2156,7 +2170,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                 Elements tdsx = ytzData.select("td");
                                 if (Integer.parseInt(trtd[1]) < tdsx.size()) {
                                     Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
-                                    if (data.html().indexOf("el-tooltip") >= 0) {
+                                    if (data.html().contains("el-tooltip")) {
                                         data = data.children().get(0);
                                     }
 
@@ -2169,7 +2183,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     Row row = sheet.getRow(y1 - 1);
                                     if (row != null) {
                                         Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                        if (cell != null || ObjectUtils.isNotEmpty(cell)) {
+                                        if (cell != null) {
                                             short fontIndex = cell.getCellStyle().getFontIndex();
                                             Font oldfontAt = workbook.getFontAt(fontIndex);
 
@@ -2183,6 +2197,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                             newStyle.setFont(redFont);
                                             cell.setCellStyle(newStyle);
                                             cell.setCellValue(e.getId() + "");
+                                        } else {
+                                            ObjectUtils.isNotEmpty(cell);
                                         }
                                     }
                                 }
@@ -2262,17 +2278,16 @@ 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 {
+            projectId, Long id, String tabIds, TrialSelfInspectionRecordDTO dto) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //获取有权限的表的信息
-        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<WbsTreePrivate> queryList = jdbcTemplate.query("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", new BeanPropertyRowMapper<>(WbsTreePrivate.class));
         List<String> dataPdfUrls = new ArrayList<>();
 
         //报告单
-        List<WbsTreePrivate> reportTable = queryList.stream().filter(f -> f.getTableType() == 2).collect(Collectors.toList());
+        List<WbsTreePrivate> reportTable = queryList.stream().filter(f -> f.getTableType() == 10 || f.getTableType() == 2).collect(Collectors.toList());
         //记录表
-        List<WbsTreePrivate> recordTable = queryList.stream().filter(f -> f.getTableType() == 1).collect(Collectors.toList());
+        List<WbsTreePrivate> recordTable = queryList.stream().filter(f -> f.getTableType() == 9 || f.getTableType() == 1).collect(Collectors.toList());
 
         if (queryList.size() > 0) {
             int reportPageNumber = 1;
@@ -2282,7 +2297,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     //没有excel表单的不生成pdf
                     if (StringUtils.isNotEmpty(report.getHtmlUrl())) {
                         //生成报告单pdf
-                        String bussPdfInfo = this.getBussPDFTrial(report.getPKeyId(), contractId, id, reportPageNumber++, reportPageNumberCount);
+                        String bussPdfInfo = this.getBussPDFTrial(report.getPKeyId(), contractId, id, reportPageNumber++, reportPageNumberCount, dto);
                         if (StringUtils.isNotEmpty(bussPdfInfo)) {
                             dataPdfUrls.add(bussPdfInfo);
                         }
@@ -2297,7 +2312,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     //没有excel表单的不生成pdf
                     if (StringUtils.isNotEmpty(record.getHtmlUrl())) {
                         //生成记录表pdf
-                        String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount);
+                        String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount, dto);
                         if (StringUtils.isNotEmpty(bussPdfInfo)) {
                             dataPdfUrls.add(bussPdfInfo);
                         }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java

@@ -413,7 +413,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean submitExcelRelationWbsTreeAndElement(FormElementDTO2 formElementDTO) {
-        //新增元素表、实体表 2表示 创建 并关联 wbs 树节点信息   3 表示只创建
+        //1新增元素表、实体表 2表示 创建 并关联 wbs 树节点信息   3 表示只创建
         if (formElementDTO.getSubmitStatus() == 2 || formElementDTO.getSubmitStatus() == 3) {//
             this.saveFormElement(formElementDTO);
         } else if (formElementDTO.getSubmitStatus() == 1) { // 修改实体信息

+ 99 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -77,6 +77,10 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         WbsInfo wbsInfo = wbsInfoMapper.selectOne(Wrappers.<WbsInfo>query().lambda().eq(WbsInfo::getId, wbsId));
         if (wbsInfo != null) {
             //公有引用
+            List<WbsTreePrivateVO> tree = baseMapper.tree(wbsId, projectId, wbsInfo.getWbsType());
+            for (WbsTreePrivateVO wbsTreePrivateVO : tree) {
+
+            }
             return ForestNodeMerger.merge(baseMapper.tree(wbsId, projectId, wbsInfo.getWbsType()));
         } else {
             //私有引用
@@ -1560,6 +1564,91 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         }
     }
 
+    @Override
+    public Map<String, List<Object>> treeRecordTrial(String wbsId, String projectId, String pKeyId) {
+        WbsInfo wbsInfo = wbsInfoMapper.selectOne(Wrappers.<WbsInfo>query().lambda().select(WbsInfo::getWbsType).eq(WbsInfo::getId, wbsId));
+        if (wbsInfo != null) {
+            WbsTreePrivate wbsTreePrivate = this.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                    .select(WbsTreePrivate::getMixRatioTestIds)
+                    .eq(WbsTreePrivate::getPKeyId, pKeyId));
+            if (wbsTreePrivate != null && StringUtils.isNotEmpty(wbsTreePrivate.getMixRatioTestIds())) {
+                //公有引用
+                List<WbsTreePrivateVO5> wbsTreePrivateVO5s = baseMapper.treeRecordTrial(wbsId, projectId, wbsInfo.getWbsType());
+                List<String> strings = Func.toStrList(wbsTreePrivate.getMixRatioTestIds());
+                for (WbsTreePrivateVO5 wbsTreePrivateVO5 : wbsTreePrivateVO5s) {
+                    for (String id : strings) {
+                        if (id.equals(wbsTreePrivateVO5.getId().toString())) {
+                            wbsTreePrivateVO5.setCheckStatus(1);
+                            break;
+                        }
+                    }
+                }
+
+                List<Long> allStatusIds = wbsTreePrivateVO5s.stream().filter(f -> new Integer(1).equals(f.getCheckStatus())).map(WbsTreePrivateVO5::getId).collect(Collectors.toList());
+                List<Long> halfStatusIds = wbsTreePrivateVO5s.stream().filter(f -> !new Integer(1).equals(f.getCheckStatus())).map(WbsTreePrivateVO5::getId).collect(Collectors.toList());
+
+                Map<String, List<Object>> map = new HashMap<>();
+                map.put("allTree", Collections.singletonList(this.buildWbsTreeByStreamTrial(wbsTreePrivateVO5s)));
+                map.put("allStatusIds", Collections.singletonList(allStatusIds));
+                map.put("halfStatusIds", Collections.singletonList(halfStatusIds));
+                return map;
+            }
+
+        } else {
+            //私有引用
+            WbsTreePrivate nodeRoot = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                    .select(WbsTreePrivate::getWbsType)
+                    .eq(WbsTreePrivate::getWbsId, wbsId)
+                    .eq(WbsTreePrivate::getProjectId, projectId)
+                    .eq(WbsTreePrivate::getParentId, 0L));
+            if (nodeRoot != null) {
+                WbsTreePrivate wbsTreePrivate = this.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                        .select(WbsTreePrivate::getMixRatioTestIds)
+                        .eq(WbsTreePrivate::getPKeyId, pKeyId));
+                if (wbsTreePrivate != null && StringUtils.isNotEmpty(wbsTreePrivate.getMixRatioTestIds())) {
+                    List<WbsTreePrivateVO5> wbsTreePrivateVO5s = baseMapper.treeRecordTrial(wbsId, projectId, Integer.valueOf(nodeRoot.getWbsType()));
+                    List<String> strings = Func.toStrList(wbsTreePrivate.getMixRatioTestIds());
+                    for (WbsTreePrivateVO5 wbsTreePrivateVO5 : wbsTreePrivateVO5s) {
+                        for (String id : strings) {
+                            if (id.equals(wbsTreePrivateVO5.getId().toString())) {
+                                wbsTreePrivateVO5.setCheckStatus(1);
+                                break;
+                            }
+                        }
+                    }
+
+                    List<Long> allStatusIds = wbsTreePrivateVO5s.stream().filter(f -> new Integer(1).equals(f.getCheckStatus())).map(WbsTreePrivateVO5::getId).collect(Collectors.toList());
+                    List<Long> halfStatusIds = wbsTreePrivateVO5s.stream().filter(f -> !new Integer(1).equals(f.getCheckStatus())).map(WbsTreePrivateVO5::getId).collect(Collectors.toList());
+
+                    Map<String, List<Object>> map = new HashMap<>();
+                    map.put("allTree", Collections.singletonList(this.buildWbsTreeByStreamTrial(wbsTreePrivateVO5s)));
+                    map.put("allStatusIds", Collections.singletonList(allStatusIds));
+                    map.put("halfStatusIds", Collections.singletonList(halfStatusIds));
+                    return map;
+                }
+            }
+        }
+        return null;
+    }
+
+    private List<WbsTreePrivateVO5> buildWbsTreeByStreamTrial(List<WbsTreePrivateVO5> wbsTreeVO2s) {
+        List<WbsTreePrivateVO5> list = wbsTreeVO2s.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
+        Map<Long, List<WbsTreePrivateVO5>> map = wbsTreeVO2s.stream().collect(Collectors.groupingBy(WbsTreePrivateVO5::getParentId));
+        this.recursionFnTreeTrial(list, map);
+        return list;
+    }
+
+    private void recursionFnTreeTrial(List<WbsTreePrivateVO5> list, Map<Long, List<WbsTreePrivateVO5>> map) {
+        for (WbsTreePrivateVO5 wbsTreeVO2 : list) {
+            List<WbsTreePrivateVO5> childrenList = map.get(wbsTreeVO2.getId());
+            wbsTreeVO2.setChildren(childrenList);
+            if (childrenList != null && childrenList.size() > 0) {
+                wbsTreeVO2.setHasChildren(true);
+                recursionFnTreeTrial(childrenList, map);
+            }
+        }
+    }
+
     private List<WbsTreePrivateVO> buildWbsTreeByStream(List<WbsTreePrivateVO> wbsTreePrivateVOS) {
         List<WbsTreePrivateVO> list = wbsTreePrivateVOS.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
         Map<Long, List<WbsTreePrivateVO>> map = wbsTreePrivateVOS.stream().collect(Collectors.groupingBy(WbsTreePrivateVO::getParentId));
@@ -1823,20 +1912,18 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         }
         //角色权限
         List<String> roleAndTabOwners = wbsTableOwnerRoleList.stream().map(WbsTableOwnerRole::getTableOwnerNumber).collect(Collectors.toList());
-
-        //表单权限
-        List<String> tableOwnerList = null;
-        if (org.apache.commons.lang.StringUtils.isNotEmpty(tableOwner)) {
-            String tableOwners = "";
-            if (tableOwner.equals("1")) {
-                tableOwners = "1,2,3";
-            } else if (tableOwner.equals("2")) {
-                tableOwners = "4,5,6";
+        String roleAndTabOwner = roleAndTabOwners.stream().filter(("7")::equals).findAny().orElse(null);
+        if (StringUtils.isNotEmpty(roleAndTabOwner)) {
+            //试验tabOwner=7,默认加载全部tabOwner=7的表
+            if ("1".equals(tableType)) {
+                tableType = "9"; //记录表
+            } else if ("2".equals(tableType)) {
+                tableType = "10";  //报告单
             }
-            tableOwnerList = Func.toStrList(tableOwners);
+            return baseMapper.selectWbsTreeTrialTabList(tableType, wbsTreePrivate.getProjectId(), wbsTreePrivate.getWbsId(), wbsTreePrivate.getId(), contractId);
+        } else {
+            throw new ServiceException("当前用户角色未授权,请先分配角色查看元素表相对应的权限");
         }
-
-        return baseMapper.selectWbsTreeTrialTabList(roleAndTabOwners, tableType, wbsTreePrivate.getProjectId(), wbsTreePrivate.getWbsId(), wbsTreePrivate.getId(), tableOwnerList, contractId);
     }
 
     @Override