Forráskód Böngészése

试验自检相关

liuyc 2 éve
szülő
commit
c285d9a00f
13 módosított fájl, 378 hozzáadás és 73 törlés
  1. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java
  2. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  3. 21 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/TableFileClient.java
  4. 10 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreePrivateClient.java
  5. 55 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  6. 38 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java
  7. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  8. 57 5
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  9. 112 65
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java
  10. 17 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  11. 21 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/TableFileClientImpl.java
  12. 31 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java
  13. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

+ 6 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java

@@ -205,5 +205,11 @@ public class WbsTreePrivate extends BaseEntity {
     @ApiModelProperty(value = "客户端户端是否隐藏 ")
     private Integer isBussShow;
 
+    /**
+     * 表单是否上传附件1否
+     */
+    @ApiModelProperty(value = "表单是否上传附件1否 2是")
+    private Integer tabFileType;
+
 
 }

+ 6 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java

@@ -24,4 +24,10 @@ public interface ExcelTabClient {
     @PostMapping(API_PREFIX + "/saveTabData")
     String saveTabData(@RequestBody JSONObject dataInfo, @RequestParam Integer type, @RequestParam Integer tableType, @RequestParam Long id) throws Exception;
 
+    @PostMapping(API_PREFIX + "/getBussPDFTrial")
+    void getBussPDFTrial(@RequestParam Long pkeyId) throws Exception;
+
+    @PostMapping(API_PREFIX + "/getBussPDFSTrial")
+    void getBussPDFSTrial(@RequestParam String nodeId, @RequestParam String tableType, @RequestParam String classify, @RequestParam String contractId, @RequestParam String projectId, @RequestParam String id) throws Exception;
+
 }

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

@@ -0,0 +1,21 @@
+package org.springblade.manager.feign;
+
+import org.springblade.manager.entity.TableFile;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
+
+@FeignClient(value = APPLICATION_NAME_PREFIX + "manager")
+public interface TableFileClient {
+
+
+    /**
+     * 接口前缀
+     */
+    String API_PREFIX = "/api/manager/tableFile";
+
+    @PostMapping(API_PREFIX + "/saveFile")
+    void saveFile(TableFile tableFile);
+
+}

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

@@ -1,5 +1,6 @@
 package org.springblade.manager.feign;
 
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.manager.vo.WbsTreePrivateVO;
@@ -50,4 +51,13 @@ public interface WbsTreePrivateClient {
     @PostMapping(API_PREFIX + "/getRawMaterialTree")
     List<WbsTreePrivateVO> getRawMaterialTree(@RequestParam Long pKeyId);
 
+    @PostMapping(API_PREFIX + "/queryChildByParent")
+    List<WbsTreePrivate> queryChildByParent(@RequestBody WbsTreePrivate nodeObj, @RequestParam String queryTable, @RequestParam String classify);
+
+    @PostMapping(API_PREFIX + "/getNodeByPrimaryKeyId")
+    WbsTreePrivate getNodeByPrimaryKeyId(@RequestParam String primaryKeyId);
+
+    @PostMapping(API_PREFIX + "/updateInfo")
+    void updateInfo(@RequestParam Long pkeyId);
+
 }

+ 55 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -541,6 +541,61 @@ public class InformationWriteQueryController extends BladeController {
         return R.data(status);
     }
 
+    /**
+     * 查询节点状态-试验
+     */
+    @PostMapping("/queryNodeStatus-trial")
+    @ApiOperationSupport(order = 23)
+    @ApiOperation(value = "/查询节点状态-试验")
+    public R<String> queryNodeStatusTrial(@RequestParam String primaryKeyId, @RequestParam String classify) {
+        //记录状态
+        String status = "1";
+        //查询填报状态
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).ne(InformationQuery::getType, 3));
+        if (businessData != null) {
+            switch (businessData.getStatus()) {
+                case 0:
+                case 3:
+                    //0属于未上报,3属于已废除,统一为待上报
+                    status = "2";
+                    break;
+                case 1:
+                case 2:
+                    //1属于待审批,2属于已审批,统一为已上报
+                    status = "3";
+                    break;
+                default:
+                    //如果不匹配,默认为未填报
+                    status = "1";
+                    //查询表格
+                    List<WbsTreePrivate> tableList = this.wbsTreePrivateClient.queryChildByParent(this.wbsTreePrivateClient.getNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
+                    if (tableList != null && tableList.size() > 0) {
+                        for (WbsTreePrivate table : tableList) {
+                            if (new Integer("2").equals(table.getIsTabPdf())) {
+                                //这些表格中,但凡有一个能够预览,就开放预览
+                                status = "2";
+                                break;
+                            }
+                        }
+                    }
+                    break;
+            }
+        } else {
+            //查询表格
+            List<WbsTreePrivate> tableList = this.wbsTreePrivateClient.queryChildByParent(this.wbsTreePrivateClient.getNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
+            if (tableList != null && tableList.size() > 0) {
+                for (WbsTreePrivate table : tableList) {
+                    if (new Integer("2").equals(table.getIsTabPdf())) {
+                        //这些表格中,但凡有一个能够预览,就开放预览
+                        status = "2";
+                        break;
+                    }
+                }
+            }
+        }
+        return R.data(status);
+    }
+
     /**
      * 填报页单个上报
      */

+ 38 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java

@@ -1,26 +1,40 @@
 package org.springblade.business.controller;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import lombok.SneakyThrows;
 import org.springblade.business.dto.*;
+import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialDetectionData;
 import org.springblade.business.service.ITrialDetectionDataService;
 import org.springblade.business.service.ITrialSampleInfoService;
 import org.springblade.business.service.ITrialSelfInspectionRecordService;
 import org.springblade.business.vo.*;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.FileUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.TableFile;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.feign.WbsTreePrivateClient;
 import org.springblade.manager.vo.WbsTreePrivateVO;
+import org.springblade.resource.vo.NewBladeFile;
+import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.io.FileNotFoundException;
@@ -168,9 +182,12 @@ public class TrialDetectionController extends BladeController {
     public R<Object> getPDFs(String nodeId, String classify, String contractId, String projectId) {
         String sql = "select pdf_url, e_visa_pdf_url from u_information_query  where project_id ='" + projectId + "' and classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
-        Object pdfUrl = stringObjectMap.get("pdf_url");
-        if (stringObjectMap.get("e_visa_pdf_url") != null) {
-            pdfUrl = stringObjectMap.get("e_visa_pdf_url"); //优先使用电签的PDF
+        Object pdfUrl = "";
+        if (stringObjectMap.size() > 0) {
+            pdfUrl = stringObjectMap.get("pdf_url");
+            if (stringObjectMap.get("e_visa_pdf_url") != null) {
+                pdfUrl = stringObjectMap.get("e_visa_pdf_url"); //优先使用电签的PDF
+            }
         }
         return R.data(pdfUrl);
     }
@@ -212,4 +229,22 @@ public class TrialDetectionController extends BladeController {
         return R.data(iTrialSelfInspectionRecordService.selfPrintNullPdf(ids));
     }
 
+    @SneakyThrows
+    @PostMapping("/self/add-buss-file")
+    @ApiOperationSupport(order = 24)
+    @ApiOperation(value = "元素表附件上传", notes = "元素表附件上传")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "file", value = "file", required = true),
+            @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true),
+            @ApiImplicitParam(name = "nodeId", value = "nodeId", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同段id", required = true),
+            @ApiImplicitParam(name = "classify", value = "所属方", required = true),
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "id", value = "当前自检记录id", required = true),
+            @ApiImplicitParam(name = "tableType", value = "表单类型", required = true)
+    })
+    public R<String> addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) {
+        return R.data(iTrialSelfInspectionRecordService.addBussFile(file, pkeyId, nodeId, contractId, projectId, classify, id, tableType));
+    }
+
 }

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java

@@ -7,6 +7,7 @@ import org.springblade.business.dto.TrialSelfInspectionRecordPageDTO;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.vo.*;
 import org.springblade.core.mp.base.BaseService;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.FileNotFoundException;
 import java.util.List;
@@ -35,4 +36,6 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
 
     void updateTrialSelfInspectionRecordStatus(List<TaskApprovalVO> obj) throws FileNotFoundException;
 
+    String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception;
+
 }

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

@@ -33,13 +33,14 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.entity.*;
-import org.springblade.manager.feign.ContractClient;
-import org.springblade.manager.feign.ExcelTabClient;
-import org.springblade.manager.feign.WbsTreeContractClient;
-import org.springblade.manager.feign.WbsTreePrivateClient;
+import org.springblade.manager.feign.*;
+import org.springblade.resource.feign.CommonFileClient;
+import org.springblade.resource.feign.IOSSClient;
 import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.resource.vo.NewBladeFile;
 import org.springblade.system.cache.ParamCache;
 import org.springblade.system.entity.Dict;
 import org.springblade.system.feign.IDictClient;
@@ -48,6 +49,7 @@ import org.springblade.system.user.feign.IUserClient;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -72,6 +74,9 @@ public class TrialSelfInspectionRecordServiceImpl
     private JdbcTemplate jdbcTemplate;
     private NewIOSSClient newIOSSClient;
     private InformationQueryClient informationQueryClient;
+    private IOSSClient iossClient;
+    private CommonFileClient commonFileClient;
+    private TableFileClient tableFileClient;
 
     @Override
     public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) {
@@ -368,6 +373,53 @@ public class TrialSelfInspectionRecordServiceImpl
         }
     }
 
+    @Override
+    public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+
+        R<BladeFile> bladeFile = iossClient.addFileInfo(file);
+        BladeFile bladeFile1 = bladeFile.getData();
+        TableFile tableFile = new TableFile();
+        String fileExtension = FileUtil.getFileExtension(bladeFile1.getName());
+        tableFile.setTabId(pkeyId + "");
+        tableFile.setName(file.getOriginalFilename());
+        tableFile.setType(2);
+        tableFile.setDomainUrl(bladeFile1.getLink());
+        tableFile.setIsDeleted(0);
+        tableFile.setExtension(fileExtension);
+
+        NewBladeFile newBladeFile;
+        if (fileExtension.contains("xlsx")) {
+            newBladeFile = this.commonFileClient.excelToPdf(file);
+            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
+        } else if (fileExtension.contains("xls")) {
+            newBladeFile = this.commonFileClient.excelToPdf(file);
+            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
+        } else if (fileExtension.contains("docx")) {
+            newBladeFile = this.commonFileClient.wordToPdf(file);
+            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
+        } else if (fileExtension.contains("png") || Objects.requireNonNull(file.getOriginalFilename()).contains("jpg")) {
+            newBladeFile = this.commonFileClient.pngOrJpgToPdf(file);
+            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
+        } else if (fileExtension.contains("pdf")) {
+            tableFile.setDomainPdfUrl(bladeFile1.getLink());
+        }
+
+        tableFile.setStatus("finished");
+        tableFileClient.saveFile(tableFile);
+
+        //单个pdf
+        excelTabClient.getBussPDFTrial(pkeyId);
+
+        //修改tab_file_type = 2 、is_tab_pdf = 2
+        wbsTreePrivateClient.updateInfo(pkeyId);
+
+        //合并pdf
+        excelTabClient.getBussPDFSTrial(nodeId, tableType, classify, contractId, projectId, id);
+
+        return String.valueOf(tableFile.getId());
+    }
+
     private String getTrialPdfUrl(WbsTreePrivate wbsTreePrivate) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         if (wbsTreePrivate == null) {
@@ -420,7 +472,7 @@ public class TrialSelfInspectionRecordServiceImpl
         if (sampleIds.size() > 0) {
             List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectBatchIds(sampleIds);
             List<User> users = iUserClient.selectUserAll();
-            if (trialSampleInfos.size() > 0){
+            if (trialSampleInfos.size() > 0) {
                 for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
                     for (User user : users) {
                         if (trialSampleInfo.getUserId().equals(user.getId())) {

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

@@ -27,8 +27,10 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.TableFile;
 import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.IExcelTabService;
 import org.springblade.manager.service.IWbsTreeContractService;
+import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springblade.manager.vo.TableFileVO;
@@ -49,69 +51,114 @@ import java.util.List;
 @Api(value = "表单附件信息", tags = "表单附件信息接口")
 public class TableFileController extends BladeController {
 
-	private final ITableFileService tableFileService;
-
-	private final IWbsTreeContractService wbsTreeContractService;
-
-	// excel 基本信息表
-	private final IExcelTabService excelTabService;
-	/**
-	 * 删除 表单附件信息
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) throws Exception {
-		// 查出基本信息
-		TableFile tableFile = tableFileService.getById(ids);
-
-		// 删除数据
-		tableFileService.delDataById(ids);
-
-		List<TableFileVO> fileVOList = tableFileService.selectTableFileList(Long.parseLong(tableFile.getTabId()));
-		// 该文本无附件
-		if(fileVOList==null || fileVOList.size()<=0){
-			UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
-			updateWrapper.in("p_key_id",tableFile.getTabId());
-			updateWrapper.set("tab_file_type",1);
-			wbsTreeContractService.update(updateWrapper);
-		}
-		Long pkeyId = Long.parseLong(tableFile.getTabId()+"");
-		excelTabService.getBussPdfInfo(pkeyId);
-
-		WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-				.eq(WbsTreeContract::getPKeyId, pkeyId));
-
-		WbsTreeContract wbsTreeContractP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-				.eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
-				.eq(WbsTreeContract::getProjectId, wbsTreeContract.getProjectId())
-				.eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
-		);
-		String classfy ="1";
-		String dataInfo = wbsTreeContract.getTableOwner();
-		if (dataInfo.equals("1")||dataInfo.equals("2")||dataInfo.equals("3")) {
-			classfy = "1";
-		} else if (dataInfo.equals("4")||dataInfo.equals("5")||dataInfo.equals("6")) {
-			classfy = "2";
-		}
-		excelTabService.getBussPdfs(wbsTreeContractP.getPKeyId()+"",classfy,wbsTreeContract.getContractId(),wbsTreeContract.getProjectId());
-		return R.status(true);
-	}
-
-	/**
-	 * 获取附件列表
-	 */
-	@GetMapping("/get-buss-fileList")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "获取附件列表", notes = "获取附件列表")
-	@ApiImplicitParams(value = {
-			@ApiImplicitParam(name = "pkeyid", value = "表单pkid", required = true)
-	})
-	public R getBussFileList(Long pkeyid) {
-		List<TableFileVO> fileVOList = tableFileService.selectTableFileList(pkeyid);
-		if (fileVOList.size() > 0) {
-			return R.data(fileVOList);
-		}
-		return R.fail(200, "未查询到数据");
-	}
+    private final ITableFileService tableFileService;
+
+    private final IWbsTreeContractService wbsTreeContractService;
+    private final IWbsTreePrivateService wbsTreePrivateService;
+
+    // excel 基本信息表
+    private final IExcelTabService excelTabService;
+
+    /**
+     * 删除 表单附件信息
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) throws Exception {
+        // 查出基本信息
+        TableFile tableFile = tableFileService.getById(ids);
+
+        // 删除数据
+        tableFileService.delDataById(ids);
+
+        List<TableFileVO> fileVOList = tableFileService.selectTableFileList(Long.parseLong(tableFile.getTabId()));
+        // 该文本无附件
+        if (fileVOList == null || fileVOList.size() <= 0) {
+            UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.in("p_key_id", tableFile.getTabId());
+            updateWrapper.set("tab_file_type", 1);
+            wbsTreeContractService.update(updateWrapper);
+        }
+        Long pkeyId = Long.parseLong(tableFile.getTabId() + "");
+        excelTabService.getBussPdfInfo(pkeyId);
+
+        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                .eq(WbsTreeContract::getPKeyId, pkeyId));
+
+        WbsTreeContract wbsTreeContractP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
+                .eq(WbsTreeContract::getProjectId, wbsTreeContract.getProjectId())
+                .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
+        );
+        String classfy = "1";
+        String dataInfo = wbsTreeContract.getTableOwner();
+        if (dataInfo.equals("1") || dataInfo.equals("2") || dataInfo.equals("3")) {
+            classfy = "1";
+        } else if (dataInfo.equals("4") || dataInfo.equals("5") || dataInfo.equals("6")) {
+            classfy = "2";
+        }
+        excelTabService.getBussPdfs(wbsTreeContractP.getPKeyId() + "", classfy, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
+        return R.status(true);
+    }
+
+    /**
+     * 删除 表单附件信息 - 试验
+     */
+    @PostMapping("/remove-trial")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "逻辑删除", notes = "传入当前文件ids、tableType、合同段Id、当前自检记录id")
+    public R removeTrial(@RequestParam String ids, @RequestParam Integer tableType, @RequestParam String contractId, @RequestParam Long id) throws Exception {
+        // 查出基本信息
+        TableFile tableFile = tableFileService.getById(ids);
+
+        // 删除数据
+        tableFileService.delDataById(ids);
+
+        List<TableFileVO> fileVOList = tableFileService.selectTableFileList(Long.parseLong(tableFile.getTabId()));
+        // 该文本无附件
+        if (fileVOList == null || fileVOList.size() <= 0) {
+            UpdateWrapper<WbsTreePrivate> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.in("p_key_id", tableFile.getTabId());
+            updateWrapper.set("tab_file_type", 1);
+            wbsTreePrivateService.update(updateWrapper);
+        }
+        Long pkeyId = Long.parseLong(tableFile.getTabId() + "");
+        excelTabService.getBussPDFTrial(null, pkeyId, null);
+
+        WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                .eq(WbsTreePrivate::getPKeyId, pkeyId));
+
+        WbsTreePrivate wbsTreePrivate1 = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
+                .eq(WbsTreePrivate::getId, wbsTreePrivate.getParentId())
+        );
+        String classify = "1";
+        String dataInfo = wbsTreePrivate.getTableOwner();
+        if (dataInfo.equals("1") || dataInfo.equals("2") || dataInfo.equals("3")) {
+            classify = "1";
+        } else if (dataInfo.equals("4") || dataInfo.equals("5") || dataInfo.equals("6")) {
+            classify = "2";
+        }
+        excelTabService.getBussPDFSTrial(wbsTreePrivate1.getPKeyId() + "", tableType, classify, contractId, wbsTreePrivate.getProjectId(), id);
+        return R.status(true);
+    }
+
+    /**
+     * 获取附件列表
+     */
+    @GetMapping("/get-buss-fileList")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "获取附件列表", notes = "获取附件列表")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "pkeyid", value = "表单pkeyid", required = true)
+    })
+    public R getBussFileList(Long pkeyid) {
+        List<TableFileVO> fileVOList = tableFileService.selectTableFileList(pkeyid);
+        if (fileVOList.size() > 0) {
+            return R.data(fileVOList);
+        }
+        return R.fail(200, "未查询到数据");
+    }
+
 }

+ 17 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -70,4 +70,21 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         return pdfUrl;
     }
 
+    @Override
+    public void getBussPDFTrial(Long pkeyId) throws Exception {
+        excelTabService.getBussPDFTrial(null, pkeyId, null);
+    }
+
+    @Override
+    public void getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, String id) throws Exception {
+        //合并PDF加载
+        excelTabService.getBussPDFSTrial(nodeId,
+                Integer.parseInt(tableType), //tableType = 表类型 1=记录表 2=报告单
+                classify, //type = 所属方 1=施工质检 2=监理抽检
+                contractId,
+                projectId,
+                Long.parseLong(id)); //记录id
+    }
+
+
 }

+ 21 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/TableFileClientImpl.java

@@ -0,0 +1,21 @@
+package org.springblade.manager.feign;
+
+import lombok.AllArgsConstructor;
+import org.springblade.manager.entity.TableFile;
+import org.springblade.manager.service.ITableFileService;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@AllArgsConstructor
+public class TableFileClientImpl implements TableFileClient {
+
+    private ITableFileService tableFileService;
+
+    @Override
+    public void saveFile(TableFile tableFile) {
+        tableFileService.save(tableFile);
+    }
+
+
+}

+ 31 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java

@@ -2,8 +2,10 @@ package org.springblade.manager.feign;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
@@ -170,6 +172,35 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
         return ForestNodeMerger.merge(wbsTreePrivateVOS);
     }
 
+    @Override
+    public List<WbsTreePrivate> queryChildByParent(WbsTreePrivate nodeObj , String queryTable, String classify) {
+        if ("queryTable".equals(queryTable)) {
+            LambdaQueryWrapper<WbsTreePrivate> wrapper = Wrappers.lambdaQuery();
+            wrapper.eq(WbsTreePrivate::getParentId, nodeObj.getId()).eq(WbsTreePrivate::getProjectId, nodeObj.getProjectId()).eq(WbsTreePrivate::getType, "2");
+            if (StringUtils.isNotEmpty(classify)) {
+                wrapper.in(WbsTreePrivate::getTableOwner, "1".equals(classify) ? Arrays.asList("1,2,3".split(",")) : Arrays.asList("4,5,6".split(",")));
+            }
+            //查询表格
+            return this.wbsTreePrivateService.list(wrapper);
+        } else {
+            return this.wbsTreePrivateService.list(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getParentId, nodeObj.getId()).eq(WbsTreePrivate::getProjectId, nodeObj.getProjectId()).eq(WbsTreePrivate::getType, "1"));
+        }
+    }
+
+    @Override
+    public WbsTreePrivate getNodeByPrimaryKeyId(String primaryKeyId) {
+        return wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, primaryKeyId));
+    }
+
+    @Override
+    public void updateInfo(Long pkeyId) {
+        UpdateWrapper<WbsTreePrivate> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("p_key_id", pkeyId);
+        updateWrapper.set("tab_file_type", 2);
+        updateWrapper.set("is_tab_pdf", 2);
+        this.wbsTreePrivateService.update(updateWrapper);
+    }
+
     private void foreachSetChildList(List<WbsTreeContractTreeVOS> vosResult, List<WbsTreePrivateVO> voList) {
         voList.forEach(wbsTreePrivateVO -> {
             WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();

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

@@ -35,6 +35,7 @@
         <result column="init_table_id" property="initTableId"/>
         <result column="is_link_table" property="isLinkTable"/>
         <result column="import_matching_info" property="importMatchingInfo"/>
+        <result column="tab_file_type" property="tabFileType"/>
     </resultMap>
 
     <resultMap id="resultMap2" type="org.springblade.manager.vo.WbsTreePrivateVO2">