浏览代码

试验相关bug

liuyc 2 年之前
父节点
当前提交
e2ab4edd72
共有 17 个文件被更改,包括 414 次插入302 次删除
  1. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSelfInspectionRecord.java
  2. 3 3
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  3. 1 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreePrivateClient.java
  4. 35 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialRecordZJTreeVO.java
  5. 3 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java
  6. 5 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  7. 7 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  8. 187 153
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  9. 20 15
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  10. 1 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  11. 7 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  12. 6 7
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java
  13. 15 39
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.java
  14. 18 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml
  15. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  16. 31 22
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java
  17. 72 47
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSelfInspectionRecord.java

@@ -37,7 +37,7 @@ public class TrialSelfInspectionRecord extends BaseEntity {
     @ApiModelProperty(value = "检测类别")
     @ApiModelProperty(value = "检测类别")
     private Integer detectionCategory;
     private Integer detectionCategory;
 
 
-    @ApiModelProperty(value = "是否上传合格证 '0'=是 ‘1’=否")
+    @ApiModelProperty(value = "是否上传合格证 '1'=是 '0'=否")
     private Integer isUploadCertificate;
     private Integer isUploadCertificate;
 
 
     @ApiModelProperty(value = "合同段id")
     @ApiModelProperty(value = "合同段id")

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

@@ -1,6 +1,6 @@
 package org.springblade.manager.feign;
 package org.springblade.manager.feign;
 
 
-import com.alibaba.fastjson.JSONObject;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.ExcelTab;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -21,8 +21,8 @@ public interface ExcelTabClient {
     ExcelTab getById(@RequestParam String id);
     ExcelTab getById(@RequestParam String id);
 
 
     @PostMapping(API_PREFIX + "/saveTabData")
     @PostMapping(API_PREFIX + "/saveTabData")
-    String saveTabData(@RequestParam Integer isBatchSave,
-                       @RequestBody JSONObject dataInfo,
+    String saveTabData(@RequestBody TrialSelfInspectionRecordDTO dto,
+                       @RequestParam Integer isBatchSave,
                        @RequestParam Integer type,
                        @RequestParam Integer type,
                        @RequestParam String tableType,
                        @RequestParam String tableType,
                        @RequestParam Long id,
                        @RequestParam Long id,

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

@@ -39,7 +39,7 @@ public interface WbsTreePrivateClient {
     List<WbsTreeContractTreeVOS> queryWbsTreePrivateByProjectIdAndId(@RequestParam String projectId, @RequestParam Long id);
     List<WbsTreeContractTreeVOS> queryWbsTreePrivateByProjectIdAndId(@RequestParam String projectId, @RequestParam Long id);
 
 
     @PostMapping(API_PREFIX + "/copyBussTab")
     @PostMapping(API_PREFIX + "/copyBussTab")
-    boolean copyBussTab(@RequestParam Long pKeyId);
+    boolean copyBussTab(@RequestParam Long pKeyId, @RequestParam Long id);
 
 
     @PostMapping(API_PREFIX + "/removeBussTabInfoById")
     @PostMapping(API_PREFIX + "/removeBussTabInfoById")
     boolean removeBussTabInfoById(@RequestParam Long pKeyId);
     boolean removeBussTabInfoById(@RequestParam Long pKeyId);

+ 35 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialRecordZJTreeVO.java

@@ -0,0 +1,35 @@
+package org.springblade.manager.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import org.springblade.core.tool.node.INode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class TrialRecordZJTreeVO implements INode<TrialRecordZJTreeVO> {
+
+    private Long id;
+
+    private String primaryKeyId;
+
+    private String fullName;
+
+    private Long parentId;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private Boolean hasChildren;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List<TrialRecordZJTreeVO> children;
+
+    @Override
+    public List<TrialRecordZJTreeVO> getChildren() {
+        if (this.children == null) {
+            this.children = new ArrayList<>();
+        }
+        return this.children;
+    }
+
+}

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

@@ -203,9 +203,9 @@ public class TrialDetectionController extends BladeController {
 
 
     @GetMapping("/self/copy-buss-tab")
     @GetMapping("/self/copy-buss-tab")
     @ApiOperationSupport(order = 15)
     @ApiOperationSupport(order = 15)
-    @ApiOperation(value = "自检表单复制", notes = "传入节点pKeyId")
-    public R<Object> copyBussTab(@RequestParam Long pKeyId) {
-        return R.status(wbsTreePrivateClient.copyBussTab(pKeyId));
+    @ApiOperation(value = "自检表单复制", notes = "传入节点pKeyId,当前记录id")
+    public R<Object> copyBussTab(@RequestParam Long pKeyId, @RequestParam Long id) {
+        return R.status(wbsTreePrivateClient.copyBussTab(pKeyId, id));
     }
     }
 
 
     @PostMapping("/self/remove-buss-tabInfo")
     @PostMapping("/self/remove-buss-tabInfo")

+ 5 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java

@@ -32,7 +32,10 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
     String selfPrintNullPdf(String ids) throws Exception;
     String selfPrintNullPdf(String ids) throws Exception;
 
 
     @Async
     @Async
-    void updateTrialSelfInspectionRecordStatus(String pdfUrlEVisa, List<TaskApprovalVO> obj) throws FileNotFoundException;
+    void updateTrialSelfInspectionRecordStatus(String pdfUrlEVisa, TaskApprovalVO obj) throws FileNotFoundException;
+
+    @Async
+    void updateTrialSelfInspectionRecordStatusFC(TaskApprovalVO obj);
 
 
     String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception;
     String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify, String id, String tableType) throws Exception;
 
 
@@ -40,4 +43,5 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
 
 
     boolean fileSubmit(TrialFileSubmitDTO dto) throws FileNotFoundException;
     boolean fileSubmit(TrialFileSubmitDTO dto) throws FileNotFoundException;
 
 
+
 }
 }

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -451,8 +451,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 String pdfUrlEVisa = this.completeApprovalTask(taskApprovalVO);
                 String pdfUrlEVisa = this.completeApprovalTask(taskApprovalVO);
 
 
                 //TODO ============== 电签成功,修改试验状态,关联工程部位信息pdf(只有电签成功,才修改) liuYc 2023-03-16 ==============
                 //TODO ============== 电签成功,修改试验状态,关联工程部位信息pdf(只有电签成功,才修改) liuYc 2023-03-16 ==============
-                if (StringUtils.isNotEmpty(pdfUrlEVisa)){
-                    this.iTrialSelfInspectionRecordService.updateTrialSelfInspectionRecordStatus(pdfUrlEVisa, taskApprovalVOS);
+                if ("OK".equals(taskApprovalVO.getFlag()) && StringUtils.isNotEmpty(pdfUrlEVisa)) {
+                    //已审批
+                    this.iTrialSelfInspectionRecordService.updateTrialSelfInspectionRecordStatus(pdfUrlEVisa, taskApprovalVO);
+                }
+                if (!"OK".equals(taskApprovalVO.getFlag())) {
+                    //已废除
+                    this.iTrialSelfInspectionRecordService.updateTrialSelfInspectionRecordStatusFC(taskApprovalVO);
                 }
                 }
 
 
             }
             }

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

@@ -59,9 +59,7 @@ import java.util.stream.Collectors;
 
 
 @Service
 @Service
 @AllArgsConstructor
 @AllArgsConstructor
-public class TrialSelfInspectionRecordServiceImpl
-        extends BaseServiceImpl<TrialSelfInspectionRecordMapper, TrialSelfInspectionRecord>
-        implements ITrialSelfInspectionRecordService {
+public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialSelfInspectionRecordMapper, TrialSelfInspectionRecord> implements ITrialSelfInspectionRecordService {
 
 
     private final TrialSampleInfoMapper trialSampleInfoMapper;
     private final TrialSampleInfoMapper trialSampleInfoMapper;
     private final TrialMaterialMobilizationMapper trialMaterialMobilizationMapper;
     private final TrialMaterialMobilizationMapper trialMaterialMobilizationMapper;
@@ -81,70 +79,109 @@ public class TrialSelfInspectionRecordServiceImpl
 
 
     @Override
     @Override
     public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
     public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
-        QueryWrapper<TrialSelfInspectionRecord> queryWrapper = Condition.getQueryWrapper(dto);
-        if (StringUtils.isNotEmpty(dto.getQueryValue())) {
-            queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue());
-        }
-        if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
-            String endTime = dto.getEndTime();
-            endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd"), 1), "yyyy-MM-dd");
-            queryWrapper.lambda().between(TrialSelfInspectionRecord::getReportDate, dto.getStartTime(), endTime);
-        }
-        if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryName())) {
-            queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialUserName, dto.getQueryName());
-        }
-        if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryStatus())) {
-            queryWrapper.lambda().eq(TrialSelfInspectionRecord::getDetectionResult, dto.getQueryStatus());
-        }
-        IPage<TrialSelfInspectionRecord> pages = this.page(page, queryWrapper.lambda().orderByDesc(true, TrialSelfInspectionRecord::getCreateTime));
-        IPage<TrialSelfInspectionRecordVO> trialSelfInspectionRecordVOIPage = TrialSelfInspectionRecordWarpper.build().pageVO(pages);
-        List<TrialSelfInspectionRecordVO> records = trialSelfInspectionRecordVOIPage.getRecords();
-        Map<String, Dict> map = iDictClient.getList("trial_detection_category").getData().stream().collect(Collectors.toMap(Dict::getDictKey, Function.identity()));
+        //获取当前选择节点所有的子级节点pKeyIds
+        WbsTreePrivate selectedNode = jdbcTemplate.query("select id,project_id from m_wbs_tree_private where p_key_id = " + dto.getNodeId(), new BeanPropertyRowMapper<>(WbsTreePrivate.class)).stream().findAny().orElse(null);
+        if (selectedNode != null) {
+            List<WbsTreePrivate> ziNodePKeyIds = jdbcTemplate.query("select p_key_id from m_wbs_tree_private where type = 1 and is_deleted = 0 and project_id = " + selectedNode.getProjectId() + " and find_in_set('" + selectedNode.getId() + "',ancestors)", new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+            QueryWrapper<TrialSelfInspectionRecord> queryWrapper = Condition.getQueryWrapper(dto);
+            if (ziNodePKeyIds.size() > 0) {
+                dto.setNodeId(null);
+                List<Long> pIds = ziNodePKeyIds.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
+                queryWrapper.lambda().in(TrialSelfInspectionRecord::getNodeId, pIds);
+            }
+            if (StringUtils.isNotEmpty(dto.getQueryValue())) {
+                queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue());
+            }
+            if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
+                String endTime = dto.getEndTime();
+                endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd"), 1), "yyyy-MM-dd");
+                queryWrapper.lambda().between(TrialSelfInspectionRecord::getReportDate, dto.getStartTime(), endTime);
+            }
+            if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryName())) {
+                queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialUserName, dto.getQueryName());
+            }
+            if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryStatus())) {
+                queryWrapper.lambda().eq(TrialSelfInspectionRecord::getDetectionResult, dto.getQueryStatus());
+            }
+
+            IPage<TrialSelfInspectionRecord> pages = this.page(page, queryWrapper.lambda().orderByDesc(true, TrialSelfInspectionRecord::getCreateTime));
+            IPage<TrialSelfInspectionRecordVO> trialSelfInspectionRecordVOIPage = TrialSelfInspectionRecordWarpper.build().pageVO(pages);
+            List<TrialSelfInspectionRecordVO> records = trialSelfInspectionRecordVOIPage.getRecords();
+            Map<String, Dict> map = iDictClient.getList("trial_detection_category").getData().stream().collect(Collectors.toMap(Dict::getDictKey, Function.identity()));
+
+            for (TrialSelfInspectionRecordVO record : records) {
+                record.setDetectionResultName((new Integer(1)).equals(record.getDetectionResult()) ? "合格" : "");
+                if (StringUtils.isNotEmpty(record.getDetectionResultName())) {
+                    record.setDetectionResult(1);
+                } else {
+                    record.setDetectionResult(0);
+                }
 
 
-        for (TrialSelfInspectionRecordVO record : records) {
-            record.setIsUploadCertificateName((new Integer(1)).equals(record.getIsUploadCertificate()) ? "是" : "否");
-            record.setDetectionResultName((new Integer(1)).equals(record.getDetectionResult()) ? "合格" : "不合格");
+                if (ObjectUtils.isNotEmpty(record.getDetectionCategory())) {
+                    Dict dict = map.get(String.valueOf(record.getDetectionCategory()));
+                    if (dict != null) {
+                        record.setDetectionCategoryName(dict.getDictValue());
+                    }
+                }
 
 
-            if (ObjectUtils.isNotEmpty(record.getDetectionCategory())) {
-                Dict dict = map.get(String.valueOf(record.getDetectionCategory()));
-                if (dict != null) {
-                    record.setDetectionCategoryName(dict.getDictValue());
+                //工程部位及用途名称
+                if (ObjectUtil.isNotEmpty(record.getProjectPosition())) {
+                    List<String> ids = Func.toStrList(record.getProjectPosition()); //关联的工程部位ids
+                    List<WbsTreeContract> result = baseMapper.selectWbsTreeContractListByPKeyIds(ids); //查询工程部位节点名称信息
+                    List<String> projectPositionNames = result.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
+                    String name = projectPositionNames.stream().findAny().orElse(null);
+                    if (projectPositionNames.size() > 1) {
+                        record.setProjectPositionName(name + "等" + projectPositionNames.size() + "个工程部位信息");
+                    } else {
+                        record.setProjectPositionName(name);
+                    }
                 }
                 }
-            }
 
 
-            //工程部位及用途名称
-            if (ObjectUtil.isNotEmpty(record.getProjectPosition())) {
-                List<String> ids = Func.toStrList(record.getProjectPosition()); //关联的工程部位ids
-                List<WbsTreeContract> result = baseMapper.selectWbsTreeContractListByPKeyIds(ids); //查询工程部位节点名称信息
-                List<String> projectPositionNames = result.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
-                String name = projectPositionNames.stream().findAny().orElse(null);
-                if (projectPositionNames.size() > 1) {
-                    record.setProjectPositionName(name + "等" + projectPositionNames.size() + "个工程部位信息");
+                //关联取样ids
+                String sql = "select sampling_id from u_trial_self_sample where self_id = " + record.getId();
+                List<Long> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialSelfSample.class)).stream().map(TrialSelfSample::getSamplingId).collect(Collectors.toList());
+                if (query.size() > 0) {
+                    record.setSampleIds(org.apache.commons.lang.StringUtils.join(query, ","));
+                    this.getIsUploadCertificateStatus(record.getSampleIds(), record);
                 } else {
                 } else {
-                    record.setProjectPositionName(name);
+                    record.setIsUploadCertificate(-1);
+                    record.setIsUploadCertificateName(""); //没关联材料显示null
                 }
                 }
-            }
 
 
-            //关联取样ids
-            String sql = "select sampling_id from u_trial_self_sample where self_id = " + record.getId();
-            List<Long> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TrialSelfSample.class)).stream().map(TrialSelfSample::getSamplingId).collect(Collectors.toList());
-            if (query.size() > 0) {
-                record.setSampleIds(org.apache.commons.lang.StringUtils.join(query, ","));
-            }
+                //原材料检测报告ids
+                String sql1 = "select raw_material_record_id,old_pdf_url from u_trial_raw_material_self_record where self_record_id = " + record.getId();
+                List<TrialRawMaterialSelfRecord> query1 = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class));
+                if (query1.size() > 0) {
+                    List<Long> ids = query1.stream().map(TrialRawMaterialSelfRecord::getRawMaterialRecordId).collect(Collectors.toList());
+                    record.setRawMaterialIds(org.apache.commons.lang.StringUtils.join(ids, ","));
+                }
 
 
-            //原材料检测报告ids
-            String sql1 = "select raw_material_record_id,old_pdf_url from u_trial_raw_material_self_record where self_record_id = " + record.getId();
-            List<TrialRawMaterialSelfRecord> query1 = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class));
-            if (query1.size() > 0) {
-                List<Long> ids = query1.stream().map(TrialRawMaterialSelfRecord::getRawMaterialRecordId).collect(Collectors.toList());
-                record.setRawMaterialIds(org.apache.commons.lang.StringUtils.join(ids, ","));
+                //合并的pdfUrl
+                String pdf = this.getMergePdfToTrial(record.getContractId(), record.getId());
+                record.setPdfUrl(pdf);
             }
             }
 
 
-            //合并的pdfUrl
-            String pdf = this.getMergePdfToTrial(record.getContractId(), record.getId());
-            record.setPdfUrl(pdf);
+            return trialSelfInspectionRecordVOIPage.setRecords(records);
         }
         }
-        return trialSelfInspectionRecordVOIPage.setRecords(records);
+        return null;
+    }
+
+    private void getIsUploadCertificateStatus(String sampleIds, TrialSelfInspectionRecordVO record) {
+        List<TrialSamplingRecord> mobilizationIds = jdbcTemplate.query("select mobilization_id from u_trial_sampling_record where sample_info_id in(" + sampleIds + ")", new BeanPropertyRowMapper<>(TrialSamplingRecord.class));
+        if (mobilizationIds.size() > 0) {
+            List<Long> collect = mobilizationIds.stream().map(TrialSamplingRecord::getMobilizationId).collect(Collectors.toList());
+            String join = org.apache.commons.lang.StringUtils.join(collect, ",");
+            List<TrialMaterialMobilization> mobilizations = jdbcTemplate.query("select production_certificate from u_trial_material_mobilization where id in(" + join + ")", new BeanPropertyRowMapper<>(TrialMaterialMobilization.class));
+            List<TrialMaterialMobilization> notUpdate = mobilizations.stream().filter(f -> ObjectUtils.isEmpty(f.getProductionCertificate())).collect(Collectors.toList());
+            if (notUpdate.size() != 0) {
+                record.setIsUploadCertificate(1);
+                record.setIsUploadCertificateName("是");
+            } else {
+                record.setIsUploadCertificate(0);
+                record.setIsUploadCertificateName("否");
+            }
+        }
+
     }
     }
 
 
     private String getMergePdfToTrial(Long contractId, Long nodeId) throws FileNotFoundException {
     private String getMergePdfToTrial(Long contractId, Long nodeId) throws FileNotFoundException {
@@ -224,12 +261,20 @@ public class TrialSelfInspectionRecordServiceImpl
             for (Attach attach : query) {
             for (Attach attach : query) {
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getOtherAccessories()) && sampleAncillaryDocumentsVO.getOtherAccessories().equals(attach.getLink())) {
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getOtherAccessories()) && sampleAncillaryDocumentsVO.getOtherAccessories().equals(attach.getLink())) {
                     sampleAncillaryDocumentsVO.setOtherAccessoriesName(attach.getOriginalName());
                     sampleAncillaryDocumentsVO.setOtherAccessoriesName(attach.getOriginalName());
+                } else if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getOtherAccessories()) && !sampleAncillaryDocumentsVO.getOtherAccessories().equals(attach.getLink())) {
+                    sampleAncillaryDocumentsVO.setOtherAccessoriesName(sampleAncillaryDocumentsVO.getOtherAccessories());
                 }
                 }
+
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getProductionCertificate()) && sampleAncillaryDocumentsVO.getProductionCertificate().equals(attach.getLink())) {
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getProductionCertificate()) && sampleAncillaryDocumentsVO.getProductionCertificate().equals(attach.getLink())) {
                     sampleAncillaryDocumentsVO.setProductionCertificateName(attach.getOriginalName());
                     sampleAncillaryDocumentsVO.setProductionCertificateName(attach.getOriginalName());
+                } else if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getProductionCertificate()) && !sampleAncillaryDocumentsVO.getProductionCertificate().equals(attach.getLink())) {
+                    sampleAncillaryDocumentsVO.setProductionCertificateName(sampleAncillaryDocumentsVO.getProductionCertificate());
                 }
                 }
+
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getQualityInspectionReport()) && sampleAncillaryDocumentsVO.getQualityInspectionReport().equals(attach.getLink())) {
                 if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getQualityInspectionReport()) && sampleAncillaryDocumentsVO.getQualityInspectionReport().equals(attach.getLink())) {
                     sampleAncillaryDocumentsVO.setQualityInspectionReportName(attach.getOriginalName());
                     sampleAncillaryDocumentsVO.setQualityInspectionReportName(attach.getOriginalName());
+                } else if (StringUtils.isNotEmpty(sampleAncillaryDocumentsVO.getQualityInspectionReport()) && !sampleAncillaryDocumentsVO.getQualityInspectionReport().equals(attach.getLink())) {
+                    sampleAncillaryDocumentsVO.setQualityInspectionReportName(sampleAncillaryDocumentsVO.getQualityInspectionReport());
                 }
                 }
             }
             }
         }
         }
@@ -407,64 +452,62 @@ public class TrialSelfInspectionRecordServiceImpl
 
 
     @Override
     @Override
     @Async
     @Async
-    public void updateTrialSelfInspectionRecordStatus(String pdfUrlEVisa, List<TaskApprovalVO> obj) throws FileNotFoundException {
-        for (TaskApprovalVO taskApprovalVO : obj) {
-            if (ObjectUtil.isNotEmpty(taskApprovalVO.getParallelProcessInstanceId())) {
-                String sql = "select process_instance_id from u_task_parallel where parallel_process_instance_id = '" + taskApprovalVO.getParallelProcessInstanceId() + "'";
-                TaskParallel taskParallel = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskParallel.class)).stream().findAny().orElse(null);
-                if (taskParallel != null && ObjectUtil.isNotEmpty(taskParallel.getProcessInstanceId())) {
-                    String trialSelfInspectionRecordId = baseMapper.selectTaskByTaskId(taskParallel.getProcessInstanceId());
-                    if (StringUtils.isNotEmpty(trialSelfInspectionRecordId)) {
-                        this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
-                                .set(TrialSelfInspectionRecord::getTaskStatus, "OK".equals(taskApprovalVO.getFlag()) ? "已审批" : "已废除")
-                                .set(TrialSelfInspectionRecord::getPdfUrl, pdfUrlEVisa) //pdfUrlEVisa=电签后的pdf
-                                .eq(TrialSelfInspectionRecord::getId, trialSelfInspectionRecordId)
-                        );
-
-                        TrialSelfInspectionRecord record = baseMapper.selectById(trialSelfInspectionRecordId);
-                        //此时的record.getPdfUrl()为电签后的pdf信息
-                        if (("已审批").equals(record.getTaskStatus()) && (new Integer(1)).equals(record.getDetectionResult()) && (new Integer(1)).equals(record.getDetectionCategory())) {
-                            /**
-                             * 在资料填报工序-预览全部pdf时再拼接合并显示,当前只做储存(如果当前资料填报工序节点有其他多个试验记录pdf关联信息,那么合并存储,否则直接存储)
-                             */
-                            if (StringUtils.isNotEmpty(record.getProjectPosition())) {
-                                //有pdf的节点
-                                String sqlNodeAll = "select wbs_id from u_information_query where wbs_id in(" + record.getProjectPosition() + ") and contract_id = " + record.getContractId();
-                                List<Long> collect = jdbcTemplate.query(sqlNodeAll, new BeanPropertyRowMapper<>(InformationQuery.class)).stream().map(InformationQuery::getWbsId).collect(Collectors.toList());
-                                if (collect.size() > 0) {
-                                    //删除当前记录关联记录
-                                    baseMapper.delSelfQuality(record.getId());
-                                    for (Long pKeyId : collect) {
-                                        //新增当前记录关联信息
-                                        baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), record.getId(), pKeyId);
-
-                                        //获取当前工程部位节点最新的关联试验记录ids
-                                        List<String> trialRecordIds = baseMapper.selectTrialIdByNodeId(pKeyId);
-
-                                        //如果当前工程部位节点的关联试验记录id只有一条,且等于当前关联试验记录id,那么不合并,直接存储该条试验记录的pdf
-                                        if (trialRecordIds.size() == 1 && trialRecordIds.get(0).equals(record.getId().toString())) {
-                                            //修改当前试验pdf到质检树节点的pdf_trial_url_position上存储
-                                            baseMapper.updateInformationQuery(pKeyId, record.getContractId(), record.getPdfUrl());
-                                            continue;
-                                        }
-
-                                        //如果当前工程部位节点的关联试验记录id有多条,那么合并
-                                        List<TrialSelfInspectionRecord> pdfUrlList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().select(TrialSelfInspectionRecord::getPdfUrl).in(TrialSelfInspectionRecord::getId, trialRecordIds));
-                                        List<String> pdfS = pdfUrlList.stream().filter(f -> StringUtils.isNotEmpty(f.getPdfUrl())).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
-
-                                        String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-                                        String listPdf = filePath + "/pdf/" + pKeyId + ".pdf";
-                                        File tabPDF = ResourceUtil.getFile(listPdf);
-                                        if (tabPDF.exists()) {
-                                            tabPDF.delete();
-                                        }
-
-                                        FileUtils.mergePdfPublicMethods(pdfS, listPdf);
-                                        BladeFile bladeFile = this.newIOSSClient.uploadFile(pKeyId + ".pdf", listPdf);
-                                        if (bladeFile != null) {
-                                            //修改合并的试验pdf到质检树节点的pdf_trial_url_position上存储
-                                            baseMapper.updateInformationQuery(pKeyId, record.getContractId(), bladeFile.getLink());
-                                        }
+    public void updateTrialSelfInspectionRecordStatus(String pdfUrlEVisa, TaskApprovalVO obj) throws FileNotFoundException {
+        if (ObjectUtil.isNotEmpty(obj.getParallelProcessInstanceId())) {
+            String sql = "select process_instance_id from u_task_parallel where parallel_process_instance_id = '" + obj.getParallelProcessInstanceId() + "'";
+            TaskParallel taskParallel = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskParallel.class)).stream().findAny().orElse(null);
+            if (taskParallel != null && ObjectUtil.isNotEmpty(taskParallel.getProcessInstanceId())) {
+                String trialSelfInspectionRecordId = baseMapper.selectTaskByTaskId(taskParallel.getProcessInstanceId());
+                if (StringUtils.isNotEmpty(trialSelfInspectionRecordId)) {
+                    this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
+                            .set(TrialSelfInspectionRecord::getTaskStatus, "已审批")
+                            .set(TrialSelfInspectionRecord::getPdfUrl, pdfUrlEVisa) //pdfUrlEVisa=电签后的pdf
+                            .eq(TrialSelfInspectionRecord::getId, trialSelfInspectionRecordId)
+                    );
+
+                    TrialSelfInspectionRecord record = baseMapper.selectById(trialSelfInspectionRecordId);
+                    //此时的record.getPdfUrl()为电签后的pdf信息
+                    if (("已审批").equals(record.getTaskStatus()) && (new Integer(1)).equals(record.getDetectionResult()) && (new Integer(1)).equals(record.getDetectionCategory())) {
+                        /**
+                         * 在资料填报工序-预览全部pdf时再拼接合并显示,当前只做储存(如果当前资料填报工序节点有其他多个试验记录pdf关联信息,那么合并存储,否则直接存储)
+                         */
+                        if (StringUtils.isNotEmpty(record.getProjectPosition())) {
+                            //有pdf的节点
+                            String sqlNodeAll = "select wbs_id from u_information_query where wbs_id in(" + record.getProjectPosition() + ") and contract_id = " + record.getContractId();
+                            List<Long> collect = jdbcTemplate.query(sqlNodeAll, new BeanPropertyRowMapper<>(InformationQuery.class)).stream().map(InformationQuery::getWbsId).collect(Collectors.toList());
+                            if (collect.size() > 0) {
+                                //删除当前记录关联记录
+                                baseMapper.delSelfQuality(record.getId());
+                                for (Long pKeyId : collect) {
+                                    //新增当前记录关联信息
+                                    baseMapper.saveSelfQuality(SnowFlakeUtil.getId(), record.getId(), pKeyId);
+
+                                    //获取当前工程部位节点最新的关联试验记录ids
+                                    List<String> trialRecordIds = baseMapper.selectTrialIdByNodeId(pKeyId);
+
+                                    //如果当前工程部位节点的关联试验记录id只有一条,且等于当前关联试验记录id,那么不合并,直接存储该条试验记录的pdf
+                                    if (trialRecordIds.size() == 1 && trialRecordIds.get(0).equals(record.getId().toString())) {
+                                        //修改当前试验pdf到质检树节点的pdf_trial_url_position上存储
+                                        baseMapper.updateInformationQuery(pKeyId, record.getContractId(), record.getPdfUrl());
+                                        continue;
+                                    }
+
+                                    //如果当前工程部位节点的关联试验记录id有多条,那么合并
+                                    List<TrialSelfInspectionRecord> pdfUrlList = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery().select(TrialSelfInspectionRecord::getPdfUrl).in(TrialSelfInspectionRecord::getId, trialRecordIds));
+                                    List<String> pdfS = pdfUrlList.stream().filter(f -> StringUtils.isNotEmpty(f.getPdfUrl())).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
+
+                                    String filePath = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+                                    String listPdf = filePath + "/pdf/" + pKeyId + ".pdf";
+                                    File tabPDF = ResourceUtil.getFile(listPdf);
+                                    if (tabPDF.exists()) {
+                                        tabPDF.delete();
+                                    }
+
+                                    FileUtils.mergePdfPublicMethods(pdfS, listPdf);
+                                    BladeFile bladeFile = this.newIOSSClient.uploadFile(pKeyId + ".pdf", listPdf);
+                                    if (bladeFile != null) {
+                                        //修改合并的试验pdf到质检树节点的pdf_trial_url_position上存储
+                                        baseMapper.updateInformationQuery(pKeyId, record.getContractId(), bladeFile.getLink());
                                     }
                                     }
                                 }
                                 }
                             }
                             }
@@ -475,6 +518,25 @@ public class TrialSelfInspectionRecordServiceImpl
         }
         }
     }
     }
 
 
+    @Override
+    public void updateTrialSelfInspectionRecordStatusFC(TaskApprovalVO obj) {
+        if (ObjectUtil.isNotEmpty(obj.getParallelProcessInstanceId())) {
+            String sql = "select process_instance_id from u_task_parallel where parallel_process_instance_id = '" + obj.getParallelProcessInstanceId() + "'";
+            TaskParallel taskParallel = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TaskParallel.class)).stream().findAny().orElse(null);
+            if (taskParallel != null && ObjectUtil.isNotEmpty(taskParallel.getProcessInstanceId())) {
+                String trialSelfInspectionRecordId = baseMapper.selectTaskByTaskId(taskParallel.getProcessInstanceId());
+                if (StringUtils.isNotEmpty(trialSelfInspectionRecordId)) {
+                    this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
+                            .set(TrialSelfInspectionRecord::getTaskStatus, "已废除")
+                            .eq(TrialSelfInspectionRecord::getId, trialSelfInspectionRecordId)
+                    );
+                    //废除后修改电签为null
+                    jdbcTemplate.execute("update u_information_query set e_visa_pdf_url = null where wbs_id = " + trialSelfInspectionRecordId);
+                }
+            }
+        }
+    }
+
     @Override
     @Override
     public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String
     public String addBussFile(MultipartFile file, Long pkeyId, String nodeId, String contractId, String
             projectId, String classify, String id, String tableType) throws Exception {
             projectId, String classify, String id, String tableType) throws Exception {
@@ -610,12 +672,12 @@ public class TrialSelfInspectionRecordServiceImpl
 
 
     @Override
     @Override
     public String selfSubmit(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
     public String selfSubmit(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
+        //------初始当前填报的表pKeyIds------
+        this.initTrialTabIds(dto);
+
         //------初始编号信息------
         //------初始编号信息------
         this.initBuildNumber(dto);
         this.initBuildNumber(dto);
 
 
-        //------初始当前填报的表------
-        this.initTrialTabIds(dto);
-
         //------新增或编辑------
         //------新增或编辑------
         this.saveOrUpdate(dto);
         this.saveOrUpdate(dto);
 
 
@@ -659,41 +721,6 @@ public class TrialSelfInspectionRecordServiceImpl
         List<String> ids = tableIds.stream().distinct().collect(Collectors.toList());
         List<String> ids = tableIds.stream().distinct().collect(Collectors.toList());
         String join = org.apache.commons.lang.StringUtils.join(ids, ",");
         String join = org.apache.commons.lang.StringUtils.join(ids, ",");
         dto.setTableIds(join);
         dto.setTableIds(join);
-
-        // TODO 如果前端处理了隐藏表入参的情况(即:隐藏表单pKeyId不传),那么接口就不处理
-        /*//获取按钮状态,是否为隐藏表单,移除隐藏表单(编辑时)
-        if (ObjectUtils.isNotEmpty(dto.getId())) {
-            List<TrialSelfDataRecord> tabStatus = jdbcTemplate.query("select is_buss_show,tab_id from u_trial_self_data_record where record_id = " + dto.getId(), new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
-            if (tabStatus.size() > 0) {
-                Map<Long, TrialSelfDataRecord> collect = tabStatus.stream().collect(Collectors.toMap(TrialSelfDataRecord::getTabId, Function.identity()));
-                List<Long> pKeyIds = Func.toLongList(dto.getTableIds());
-                List<Long> addPkeyIds = new ArrayList<>();
-                for (Long pId : pKeyIds) {
-                    TrialSelfDataRecord record = collect.get(pId);
-                    if (record != null) {
-                        //隐藏的不添加
-                        if (!new Integer(2).equals(record.getIsBussShow())) {
-                            addPkeyIds.add(pId);
-                        }
-                    } else {
-                        //未生成记录的添加进去
-                        addPkeyIds.add(pId);
-                    }
-                }
-                //重新赋值
-                String joinNew = org.apache.commons.lang.StringUtils.join(addPkeyIds, ",");
-                dto.setTableIds(joinNew);
-            }
-        } else {
-            //获取按钮状态,是否为隐藏表单,移除隐藏表单(新增时)
-            String tablePkeyIds = dto.getTableIds();
-            List<WbsTreePrivate> tableList = jdbcTemplate.query("select is_buss_show,p_key_id from m_wbs_tree_private where status = 1 and p_key_id in(" + tablePkeyIds + ")", new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-            List<Long> addPkeyIds = tableList.stream().filter(f -> ObjectUtils.isNotEmpty(f.getIsBussShow()) && !(new Integer(2).equals(f.getIsBussShow()))).map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
-
-            //重新赋值
-            String joinNew = org.apache.commons.lang.StringUtils.join(addPkeyIds, ",");
-            dto.setTableIds(joinNew);
-        }*/
     }
     }
 
 
     private void reBuildNumber(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
     private void reBuildNumber(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
@@ -709,7 +736,7 @@ public class TrialSelfInspectionRecordServiceImpl
     @Async
     @Async
     public void submitTrialData(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
     public void submitTrialData(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
         try {
         try {
-            String pdfURL = excelTabClient.saveTabData(dto.getIsBatchSave(), dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
+            String pdfURL = excelTabClient.saveTabData(dto, dto.getIsBatchSave(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
             if (StringUtils.isNotEmpty(pdfURL)) {
             if (StringUtils.isNotEmpty(pdfURL)) {
                 this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).eq(TrialSelfInspectionRecord::getId, dto.getId()));
                 this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).eq(TrialSelfInspectionRecord::getId, dto.getId()));
             }
             }
@@ -854,6 +881,13 @@ public class TrialSelfInspectionRecordServiceImpl
         List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
         List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
         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")) {
         if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1")) {
             String maxRecordNo = "";
             String maxRecordNo = "";

+ 20 - 15
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -23,6 +23,8 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.jsoup.select.Elements;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.vo.SaveContractLogVO;
 import org.springblade.business.vo.SaveContractLogVO;
@@ -55,6 +57,7 @@ import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.vo.NewBladeFile;
 import org.springblade.resource.vo.NewBladeFile;
 import org.springblade.system.cache.ParamCache;
 import org.springblade.system.cache.ParamCache;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -1413,7 +1416,7 @@ public class ExcelTabController extends BladeController {
         String tabName = wbsTreeContract.getInitTableName();
         String tabName = wbsTreeContract.getInitTableName();
         // 字段查询 并去掉公式字段
         // 字段查询 并去掉公式字段
 
 
-        String colkeys = "SELECT GROUP_CONCAT(COLUMN_NAME) as colkeys from information_schema.COLUMNS c where c.table_name='"+tabName+"' and COLUMN_NAME not in('id','p_key_id')";
+        String colkeys = "SELECT GROUP_CONCAT(COLUMN_NAME) as colkeys from information_schema.COLUMNS c where c.table_name='" + tabName + "' and COLUMN_NAME not in('id','p_key_id')";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         colkeys = stringObjectMap.get("colkeys") + "";
         colkeys = stringObjectMap.get("colkeys") + "";
         // 复制表数据
         // 复制表数据
@@ -1621,22 +1624,24 @@ public class ExcelTabController extends BladeController {
         //
         //
         String pkeyIds = pkeyId;
         String pkeyIds = pkeyId;
         String groupIds = groupId;
         String groupIds = groupId;
-        for(int i=1;i<dataArray.size();i++){
+        for (int i = 1; i < dataArray.size(); i++) {
             JSONObject jsonObject = dataArray.getJSONObject(i);
             JSONObject jsonObject = dataArray.getJSONObject(i);
-            pkeyIds +=","+ jsonObject.getString("pkeyId");;
-            groupIds +=","+ jsonObject.getString("tabGroupId");;
+            pkeyIds += "," + jsonObject.getString("pkeyId");
+            ;
+            groupIds += "," + jsonObject.getString("tabGroupId");
+            ;
         }
         }
-        if(StringUtils.isNotEmpty(groupIds)){
+        if (StringUtils.isNotEmpty(groupIds)) {
             List<WbsTreeContract> wbsTreeContractList = this.wbsTreeContractService.getBaseMapper().selectList(
             List<WbsTreeContract> wbsTreeContractList = this.wbsTreeContractService.getBaseMapper().selectList(
                     Wrappers.<WbsTreeContract>lambdaQuery()
                     Wrappers.<WbsTreeContract>lambdaQuery()
                             .in(WbsTreeContract::getTabGroupId, groupIds)
                             .in(WbsTreeContract::getTabGroupId, groupIds)
-                            .notIn(WbsTreeContract::getPKeyId,pkeyIds)
-                            .eq(WbsTreeContract::getIsDeleted,BladeConstant.DB_NOT_DELETED)
+                            .notIn(WbsTreeContract::getPKeyId, pkeyIds)
+                            .eq(WbsTreeContract::getIsDeleted, BladeConstant.DB_NOT_DELETED)
             );
             );
-            if(wbsTreeContractList!=null && wbsTreeContractList.size()>=1){
-                for(WbsTreeContract data: wbsTreeContractList){
-                     R bussDataInfo = this.getBussDataInfo(data.getPKeyId());
-                     Object data1 = bussDataInfo.getData();
+            if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
+                for (WbsTreeContract data : wbsTreeContractList) {
+                    R bussDataInfo = this.getBussDataInfo(data.getPKeyId());
+                    Object data1 = bussDataInfo.getData();
                     dataArray.add(data1);
                     dataArray.add(data1);
                 }
                 }
             }
             }
@@ -1650,10 +1655,10 @@ public class ExcelTabController extends BladeController {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
 
 
-            R info = this.excelTabService.saveOrUpdateInfo(tableInfoList);
-            if (!info.isSuccess()) {
-                return info;
-            }
+        R info = this.excelTabService.saveOrUpdateInfo(tableInfoList);
+        if (!info.isSuccess()) {
+            return info;
+        }
 
 
         //单个 pdf加载
         //单个 pdf加载
         for (TableInfo tableInfo : tableInfoList) {
         for (TableInfo tableInfo : tableInfoList) {

+ 1 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -1,15 +1,13 @@
 package org.springblade.manager.controller;
 package org.springblade.manager.controller;
 
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.mixsmart.utils.StringUtils;
 import com.mixsmart.utils.StringUtils;
 import io.swagger.annotations.*;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.vo.SaveLogContractVO;
 import org.springblade.business.vo.SaveLogContractVO;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.boot.ctrl.BladeController;
@@ -20,10 +18,8 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.support.Kv;
-import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.core.tool.utils.StringUtil;
-import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.dto.WbsTreePrivateDTO2;
 import org.springblade.manager.dto.WbsTreePrivateDTO2;
 import org.springblade.manager.dto.WbsTreePrivateDTO3;
 import org.springblade.manager.dto.WbsTreePrivateDTO3;
 import org.springblade.manager.entity.*;
 import org.springblade.manager.entity.*;

+ 7 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.InformationQueryClient;
@@ -10,6 +11,8 @@ import org.springblade.business.vo.TrialRawMaterialSelfRecord;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.beans.BeanProperty;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
@@ -20,6 +23,7 @@ import org.springblade.manager.service.IExcelTabService;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
 import org.springblade.system.cache.ParamCache;
+import org.springframework.beans.BeanUtils;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,17 +51,17 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     }
     }
 
 
     @Override
     @Override
-    public String saveTabData(Integer isBatchSave, JSONObject dataInfo, Integer type, String tableType, Long id, String tabIds) throws Exception {
+    public String saveTabData(TrialSelfInspectionRecordDTO dto, Integer isBatchSave,Integer type, String tableType, Long id, String tabIds) throws Exception {
         //通用参数
         //通用参数
         String pdfUrl = "";
         String pdfUrl = "";
-        JSONArray dataArray = dataInfo.getJSONArray("orderList");
+        JSONArray dataArray = dto.getDataInfo().getJSONArray("orderList");
         JSONObject table = dataArray.getJSONObject(0);
         JSONObject table = dataArray.getJSONObject(0);
         String nodeId = table.getString("nodeId");
         String nodeId = table.getString("nodeId");
         String projectId = table.getString("projectId");
         String projectId = table.getString("projectId");
         String contractId = table.getString("contractId");
         String contractId = table.getString("contractId");
 
 
         //获取表模板,已处理隐藏表问题
         //获取表模板,已处理隐藏表问题
-        List<TableInfo> tableInfoList = this.excelTabService.getTableInfoListTrial(dataArray,tabIds);
+        List<TableInfo> tableInfoList = this.excelTabService.getTableInfoListTrial(dataArray, tabIds);
 
 
         //------试验填报数据保存,当前记录id作为groupId------
         //------试验填报数据保存,当前记录id作为groupId------
         this.excelTabService.saveOrUpdateInfoTrial(tableInfoList, id);
         this.excelTabService.saveOrUpdateInfoTrial(tableInfoList, id);

+ 6 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java

@@ -19,6 +19,7 @@ import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springblade.manager.vo.WbsTreePrivateVO;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.*;
 import java.util.*;
@@ -65,9 +66,8 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
     }
     }
 
 
     @Override
     @Override
-    public boolean copyBussTab(Long pKeyId) {
-        WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
-                .eq(WbsTreePrivate::getPKeyId, pKeyId));
+    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()
         List<WbsTreePrivate> wbsTreePrivateList = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getId, wbsTreePrivate.getId())
                 .eq(WbsTreePrivate::getId, wbsTreePrivate.getId())
@@ -102,7 +102,7 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         colkeys = stringObjectMap.get("colkeys") + "";
         colkeys = stringObjectMap.get("colkeys") + "";
         //复制表数据
         //复制表数据
-        String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pKeyId;
+        String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pKeyId + " and group_id = " + id;
         List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
         List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
         if (dataList != null && dataList.size() >= 1) {
         if (dataList != null && dataList.size() >= 1) {
             Map<String, Object> dataMap2 = dataList.get(0);
             Map<String, Object> dataMap2 = dataList.get(0);
@@ -115,8 +115,8 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
 
 
             sqlInfo = "INSERT INTO " + tabName + " ( ";
             sqlInfo = "INSERT INTO " + tabName + " ( ";
 
 
-            String keyStr = "id,p_key_id,";
-            String valStr = SnowFlakeUtil.getId() + "," + wbsTreePrivate.getPKeyId() + ",";
+            String keyStr = "id,p_key_id,group_id";
+            String valStr = SnowFlakeUtil.getId() + "," + wbsTreePrivate.getPKeyId() + "," + id + ",";
 
 
             for (String keys : dataMap2.keySet()) {
             for (String keys : dataMap2.keySet()) {
                 if (!(dataMap2.get(keys) + "").equals("null")) {
                 if (!(dataMap2.get(keys) + "").equals("null")) {
@@ -129,7 +129,6 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
 
 
             sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
             sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
 
 
-            //huangJN 保存成功后调用生成资料查询列表数据
             jdbcTemplate.execute(sqlInfo);
             jdbcTemplate.execute(sqlInfo);
         }
         }
         wbsTreePrivateService.save(wbsTreePrivate);
         wbsTreePrivateService.save(wbsTreePrivate);

+ 15 - 39
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.java

@@ -1,7 +1,6 @@
 package org.springblade.manager.mapper;
 package org.springblade.manager.mapper;
 
 
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 import org.springblade.manager.dto.FindAllUserByConditionDTO;
 import org.springblade.manager.dto.FindAllUserByConditionDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractRelationJlyz;
 import org.springblade.manager.entity.ContractRelationJlyz;
@@ -19,8 +18,7 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
 
     List<ContractInfo> selectContractByProjectIds(@Param("ids") List<Long> ids);
     List<ContractInfo> selectContractByProjectIds(@Param("ids") List<Long> ids);
 
 
-    List<ContractInfoVO> selectContractInfoPage(IPage page,
-                                                ContractInfoVO contractInfo);
+    List<ContractInfoVO> selectContractInfoPage(IPage page, ContractInfoVO contractInfo);
 
 
     List<ContractlnfoCountVO> selectContractInfoCount();
     List<ContractlnfoCountVO> selectContractInfoCount();
 
 
@@ -28,44 +26,31 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
 
     List<CRolePostVO> findJobByRoleId(@Param("id") String id);
     List<CRolePostVO> findJobByRoleId(@Param("id") String id);
 
 
-    List<UserVO2> findAllUserByCondition(IPage page,
-                                         @Param("Values") FindAllUserByConditionDTO values);
+    List<UserVO2> findAllUserByCondition(IPage page, @Param("Values") FindAllUserByConditionDTO values);
 
 
-    List<User> findUserListByCondition(IPage page,
-                                       @Param("Values") FindAllUserByConditionDTO values);
+    List<User> findUserListByCondition(IPage page, @Param("Values") FindAllUserByConditionDTO values);
 
 
-    List<User> findUserInfoByCondition(@Param("rId") String rId,
-                                       @Param("pId") String pId,
-                                       @Param("userName") String userName);
+    List<User> findUserInfoByCondition(@Param("rId") String rId, @Param("pId") String pId, @Param("userName") String userName);
 
 
     List<User> findUserList();
     List<User> findUserList();
 
 
-    Integer updatePasswordByUserId(@Param("userId") String userId,
-                                   @Param("password") String password);
+    Integer updatePasswordByUserId(@Param("userId") String userId, @Param("password") String password);
 
 
     Boolean deleteFile(@Param("url") String url);
     Boolean deleteFile(@Param("url") String url);
 
 
-    List<WbsTreeContractTreeVO> tree(@Param("wbsId") String wbsId,
-                                     @Param("projectId") String projectId,
-                                     @Param("contractId") String contractId,
-                                     @Param("wbsType") Integer wbsType,
-                                     @Param("parentId") String parentId);
+    List<WbsTreeContractTreeVO> tree(@Param("wbsId") String wbsId, @Param("projectId") String projectId, @Param("contractId") String contractId, @Param("wbsType") Integer wbsType, @Param("parentId") String parentId);
 
 
-    List<WbsTreeContractVO> tree2(@Param("wbsId") Long wbsId,
-                                  @Param("projectId") Long projectId,
-                                  @Param("contractId") Long contractId,
-                                  @Param("wbsType") Integer wbsType,
-                                  @Param("parentId") String parentId,
-                                  @Param("queryValue") String queryValue);
+    List<WbsTreeContractVO> tree2(@Param("wbsId") Long wbsId, @Param("projectId") Long projectId, @Param("contractId") Long contractId, @Param("wbsType") Integer wbsType, @Param("parentId") String parentId, @Param("queryValue") String queryValue);
 
 
-    List<WbsTreeContractVO> tree3(@Param("wbsId") String wbsId,
-                                  @Param("projectId") String projectId,
-                                  @Param("contractId") String contractId,
-                                  @Param("wbsType") Integer wbsType,
-                                  @Param("parentId") String parentId);
+    List<WbsTreeContractVO> tree3(@Param("wbsId") String wbsId, @Param("projectId") String projectId, @Param("contractId") String contractId, @Param("wbsType") Integer wbsType, @Param("parentId") String parentId);
 
 
-    List<WbsTreeContractVO> tree4(@Param("contractId") String contractId,
-                                  @Param("parentId") String parentId);
+    List<WbsTreeContractVO> tree4(@Param("contractId") String contractId, @Param("parentId") String parentId);
+
+    List<WbsTreeContractTreeAllVO> tree5(@Param("contractId") Long contractId);
+
+    List<WbsTreeContractVO6> tree6(@Param("wbsId") Long wbsId, @Param("projectId") Long projectId, @Param("contractId") Long contractId);
+
+    List<TrialRecordZJTreeVO> trialRelationTree(@Param("projectId") Long projectId, @Param("contractId") Long contractId, @Param("wbsId") Long wbsId);
 
 
     List<WbsTreeContractVO3> selectLists(@Param("contractInfo") ContractInfo contractInfo, @Param("contractType") Integer contractType);
     List<WbsTreeContractVO3> selectLists(@Param("contractInfo") ContractInfo contractInfo, @Param("contractType") Integer contractType);
 
 
@@ -81,13 +66,4 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
 
     List<UserContractInfoVO> userListByIds(@Param("ids") List<String> ids);
     List<UserContractInfoVO> userListByIds(@Param("ids") List<String> ids);
 
 
-    @Select("select quality_node_id from u_trial_self_quality_project where self_id = #{selfId}")
-    List<String> queryList(@Param("selfId") String selfId);
-
-    List<WbsTreeContractTreeAllVO> tree5(@Param("contractId") Long contractId);
-
-    List<WbsTreeContractVO6> tree6(@Param("wbsId") Long wbsId,
-                                  @Param("projectId") Long projectId,
-                                  @Param("contractId") Long contractId);
-
 }
 }

+ 18 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

@@ -464,4 +464,22 @@
         ORDER BY d.sort
         ORDER BY d.sort
     </select>
     </select>
 
 
+    <select id="trialRelationTree" resultType="org.springblade.manager.vo.TrialRecordZJTreeVO">
+        SELECT
+            d.p_key_id AS "primaryKeyId",
+            d.id AS id,
+            d.full_name AS fullName,
+            d.parent_id AS "parentId"
+        FROM m_wbs_tree_contract d
+        WHERE
+            d.is_deleted = 0
+        AND d.status = 1
+        AND d.type = 1
+        AND wbs_type = 1
+        AND project_id = #{projectId}
+        AND contract_id = #{contractId}
+        AND wbs_id = #{wbsId}
+        ORDER BY d.sort,d.create_time
+    </select>
+
 </mapper>
 </mapper>

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

@@ -17,6 +17,7 @@
 package org.springblade.manager.service;
 package org.springblade.manager.service;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.entity.ExcelEditCallback;
 import org.springblade.manager.entity.ExcelEditCallback;
@@ -114,6 +115,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception;
     void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception;
 
 
     // 试验
     // 试验
+
     /**
     /**
      * 表格数据封装 - 试验
      * 表格数据封装 - 试验
      */
      */

+ 31 - 22
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -194,15 +194,16 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     public List<WbsTreeContractVO6> tree6List(String wbsId, String projectId, String contractId) {
     public List<WbsTreeContractVO6> tree6List(String wbsId, String projectId, String contractId) {
         return baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
         return baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
     }
     }
+
     @Override
     @Override
     public List<WbsTreeContractVO6> tree6(String wbsId, String projectId, String contractId) {
     public List<WbsTreeContractVO6> tree6(String wbsId, String projectId, String contractId) {
-        List<WbsTreeContractVO6> wbsTreeContractVOS =  baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
+        List<WbsTreeContractVO6> wbsTreeContractVOS = baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
         return buildWbsTreeByStream6(wbsTreeContractVOS);
         return buildWbsTreeByStream6(wbsTreeContractVOS);
     }
     }
 
 
     @Override
     @Override
     public List<WbsTreeContractVO6> tree8(String wbsId, String projectId, String contractId) {
     public List<WbsTreeContractVO6> tree8(String wbsId, String projectId, String contractId) {
-        List<WbsTreeContractVO6> wbsTreeContractVOS =  baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
+        List<WbsTreeContractVO6> wbsTreeContractVOS = baseMapper.tree6(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId));
         List<WbsTreeContractVO6> wbsTreeVO2s = ForestNodeMerger.merge(wbsTreeContractVOS);
         List<WbsTreeContractVO6> wbsTreeVO2s = ForestNodeMerger.merge(wbsTreeContractVOS);
         List<WbsTreeContractVO6> list = wbsTreeVO2s.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
         List<WbsTreeContractVO6> list = wbsTreeVO2s.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
 
 
@@ -260,8 +261,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     }
     }
 
 
 
 
-
-
     public void recursionFnTreeAll(List<WbsTreeContractTreeAllVO> list, Map<Long, List<WbsTreeContractTreeAllVO>> map) {
     public void recursionFnTreeAll(List<WbsTreeContractTreeAllVO> list, Map<Long, List<WbsTreeContractTreeAllVO>> map) {
         for (WbsTreeContractTreeAllVO wbsTreeContractVO : list) {
         for (WbsTreeContractTreeAllVO wbsTreeContractVO : list) {
             List<WbsTreeContractTreeAllVO> childrenList = map.get(wbsTreeContractVO.getId());
             List<WbsTreeContractTreeAllVO> childrenList = map.get(wbsTreeContractVO.getId());
@@ -520,28 +519,38 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
 
 
     @Override
     @Override
     public Map<String, Object> trialRelationTree(String wbsId, String projectId, String contractId, String selfId) {
     public Map<String, Object> trialRelationTree(String wbsId, String projectId, String contractId, String selfId) {
-        //合同段树
-        List<WbsTreeContractVO> wbsTreeContractVOS = baseMapper.tree2(null, Long.parseLong(projectId), Long.parseLong(contractId), null, null, null);
-        List<WbsTreeContractVO> wbsTreeContractVOList = buildWbsTreeByStream(wbsTreeContractVOS);
-        //是否勾选-试验关联工程部位信息
-        /*List<String> listResult = new ArrayList<>();
-        if (StringUtils.isNotEmpty(selfId)) {
-            List<String> list = baseMapper.queryList(selfId);
-            if (list.size() > 0) {
-                for (WbsTreeContractVO wbsTreeContractVO : wbsTreeContractVOS) {
-                    for (String s : list) {
-                        if (wbsTreeContractVO.getPrimaryKeyId().equals(s)) {
-                            listResult.add(s);
-                        }
-                    }
-                }
+        //当前合同段施工质检树
+        List<TrialRecordZJTreeVO> wbsTreeContractVOS = baseMapper.trialRelationTree(Long.parseLong(projectId), Long.parseLong(contractId), Long.parseLong(wbsId));
+        List<TrialRecordZJTreeVO> trialRecordZJTreeVOS = buildWbsTreeByStreamTrialRecordZJTree(wbsTreeContractVOS);
+        ContractInfo contractInfo = jdbcTemplate.query("select contract_name from m_contract_info where id = " + contractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
+        for (TrialRecordZJTreeVO node : trialRecordZJTreeVOS) {
+            if (node.getParentId() == 0 && contractInfo != null) {
+                node.setFullName(contractInfo.getContractName());
+                break;
             }
             }
-        }*/
+        }
         Map<String, Object> maps = new HashMap<>();
         Map<String, Object> maps = new HashMap<>();
-        maps.put("treeContractAll", wbsTreeContractVOList);
-        //maps.put("isSelectedStatus", listResult.stream().distinct().collect(Collectors.toList()));
+        maps.put("treeContractAll", trialRecordZJTreeVOS);
         return maps;
         return maps;
     }
     }
 
 
+    private List<TrialRecordZJTreeVO> buildWbsTreeByStreamTrialRecordZJTree(List<TrialRecordZJTreeVO> wbsTreeVO2s) {
+        List<TrialRecordZJTreeVO> list = wbsTreeVO2s.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
+        Map<Long, List<TrialRecordZJTreeVO>> map = wbsTreeVO2s.stream().collect(Collectors.groupingBy(TrialRecordZJTreeVO::getParentId));
+        this.recursionFnTreeTrialRecordZJTree(list, map);
+        return list;
+    }
+
+    private void recursionFnTreeTrialRecordZJTree(List<TrialRecordZJTreeVO> list, Map<Long, List<TrialRecordZJTreeVO>> map) {
+        for (TrialRecordZJTreeVO trialRecordZJTreeVO : list) {
+            List<TrialRecordZJTreeVO> childrenList = map.get(trialRecordZJTreeVO.getId());
+            if (childrenList != null && childrenList.size() > 0) {
+                trialRecordZJTreeVO.setChildren(childrenList);
+                trialRecordZJTreeVO.setHasChildren(true);
+                recursionFnTreeTrialRecordZJTree(childrenList, map);
+            }
+        }
+    }
+
 
 
 }
 }

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

@@ -42,6 +42,7 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.jsoup.select.Elements;
+import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.ContractLogClient;
@@ -1543,39 +1544,75 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
             File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
             String htmlString = IoUtil.readToString(new FileInputStream(file1));
             String htmlString = IoUtil.readToString(new FileInputStream(file1));
             Document doc = Jsoup.parse(htmlString);
             Document doc = Jsoup.parse(htmlString);
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        }
+            //匹配
+            Elements bgHB = doc.select("el-input[placeholder~=报告编号.*]");
+            Elements jlBH = doc.select("el-input[placeholder~=记录编号.*]");
+
+            TrialSelfInspectionRecord record = jdbcTemplate.query("select record_no,report_no from u_trial_self_inspection_record where id = " + groupId, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
+            if (record != null) {
+                //报告编号
+                if (bgHB.size() >= 1) {
+                    for (Element element : bgHB) {
+                        int trIndex = Integer.parseInt(element.attr("trindex"));
+                        if (trIndex <= 6) {
+                            reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(record.getReportNo()) ? record.getReportNo() : "");
+                        }
+                    }
+                }
+                //记录编号
+                if (jlBH.size() >= 1) {
+                    for (Element element : jlBH) {
+                        int trIndex = Integer.parseInt(element.attr("trindex"));
+                        if (trIndex <= 6) {
+                            reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(record.getRecordNo()) ? record.getRecordNo() : "");
+                        }
+                    }
+                }
+            }
 
 
-        if (dataIn.size() >= 1) {
-            Map<String, Object> mysqlData = dataIn.get(0);
-            for (String key : mysqlData.keySet()) {
-                String tabVal = mysqlData.get(key) + "";
+            if (dataIn.size() >= 1) {
+                Map<String, Object> mysqlData = dataIn.get(0);
+                for (String key : mysqlData.keySet()) {
+                    String tabVal = mysqlData.get(key) + "";
 
 
-                // 时间段处理
-                if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
-                    if (tabVal.contains("T") && tabVal.contains(".000Z]")) {
-                        String[] tabData = tabVal.split("_\\^_");
+                    // 时间段处理
+                    if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
+                        if (tabVal.contains("T") && tabVal.contains(".000Z]")) {
+                            String[] tabData = tabVal.split("_\\^_");
 
 
-                        if (reData.containsKey("pickerKey")) {
-                            String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
-                            reData.put("pickerKey", pickerKey);
-                        } else {
-                            reData.put("pickerKey", key + "__" + tabData[1]);
-                        }
+                            if (reData.containsKey("pickerKey")) {
+                                String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
+                                reData.put("pickerKey", pickerKey);
+                            } else {
+                                reData.put("pickerKey", key + "__" + tabData[1]);
+                            }
 
 
-                        String sql = tabData[0];
-                        sql = sql.replaceAll("\\[", "['");
-                        sql = sql.replaceAll("]", "']");
-                        sql = sql.replaceAll("000Z,", "000Z',");
-                        sql = sql.replaceAll(", 20", ", '20");
-                        //   sql = sql.replaceAll("'", "");
-                        if (StringUtils.isNotEmpty(tabData[0])) {
-                            reData.put(key + "__" + tabData[1], sql);
-                        }
-                    } else if (tabVal.contains("T") && tabVal.contains(".000Z")) { //时间
-                        // 时间和字符串合作
-                        if (tabVal.contains("☆")) {
+                            String sql = tabData[0];
+                            sql = sql.replaceAll("\\[", "['");
+                            sql = sql.replaceAll("]", "']");
+                            sql = sql.replaceAll("000Z,", "000Z',");
+                            sql = sql.replaceAll(", 20", ", '20");
+                            //   sql = sql.replaceAll("'", "");
+                            if (StringUtils.isNotEmpty(tabData[0])) {
+                                reData.put(key + "__" + tabData[1], sql);
+                            }
+                        } else if (tabVal.contains("T") && tabVal.contains(".000Z")) { //时间
+                            // 时间和字符串合作
+                            if (tabVal.contains("☆")) {
+                                String[] mysql = tabVal.split("☆");
+                                for (String data : mysql) {
+                                    String[] tabData = data.split("_\\^_");
+                                    if (StringUtils.isNotEmpty(tabData[0])) {
+                                        reData.put(key + "__" + tabData[1], tabData[0]);
+                                    }
+                                }
+                            } else {
+                                String[] tabData = tabVal.split("_\\^_");
+                                if (StringUtils.isNotEmpty(tabData[0])) {
+                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                }
+                            }
+                        } else if (tabVal.contains("☆")) {
                             String[] mysql = tabVal.split("☆");
                             String[] mysql = tabVal.split("☆");
                             for (String data : mysql) {
                             for (String data : mysql) {
                                 String[] tabData = data.split("_\\^_");
                                 String[] tabData = data.split("_\\^_");
@@ -1583,30 +1620,19 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     reData.put(key + "__" + tabData[1], tabData[0]);
                                     reData.put(key + "__" + tabData[1], tabData[0]);
                                 }
                                 }
                             }
                             }
-                        } else {
+                        } else if (tabVal.contains("_^_")) {
                             String[] tabData = tabVal.split("_\\^_");
                             String[] tabData = tabVal.split("_\\^_");
                             if (StringUtils.isNotEmpty(tabData[0])) {
                             if (StringUtils.isNotEmpty(tabData[0])) {
                                 reData.put(key + "__" + tabData[1], tabData[0]);
                                 reData.put(key + "__" + tabData[1], tabData[0]);
                             }
                             }
+                        } else {
+                            reData.put(key, tabVal);
                         }
                         }
-                    } else if (tabVal.contains("☆")) {
-                        String[] mysql = tabVal.split("☆");
-                        for (String data : mysql) {
-                            String[] tabData = data.split("_\\^_");
-                            if (StringUtils.isNotEmpty(tabData[0])) {
-                                reData.put(key + "__" + tabData[1], tabData[0]);
-                            }
-                        }
-                    } else if (tabVal.contains("_^_")) {
-                        String[] tabData = tabVal.split("_\\^_");
-                        if (StringUtils.isNotEmpty(tabData[0])) {
-                            reData.put(key + "__" + tabData[1], tabData[0]);
-                        }
-                    } else {
-                        reData.put(key, tabVal);
                     }
                     }
                 }
                 }
             }
             }
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
         }
         }
 
 
         // 获取默认值
         // 获取默认值
@@ -1821,7 +1847,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId);
         List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId);
         Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
         Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
 
 
-        // 获取excel流 和 html流
+        //获取excel流 和 html流
         Workbook wb = new Workbook();
         Workbook wb = new Workbook();
         wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
         wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
         //获取工作表
         //获取工作表
@@ -2042,7 +2068,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         //获取有权限的节点信息
         //获取有权限的节点信息
         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 from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";
         List<WbsTreePrivate> queryList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
         List<WbsTreePrivate> queryList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
-
         List<String> dataPdfUrls = new ArrayList<>();
         List<String> dataPdfUrls = new ArrayList<>();
 
 
         //报告单
         //报告单