Browse Source

Merge remote-tracking branch 'origin/master' into master

yangyj 2 years ago
parent
commit
6e74250da9
27 changed files with 470 additions and 200 deletions
  1. 2 2
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSelfInspectionRecordDTO.java
  2. 3 2
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTreeContract.java
  3. 1 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  4. 32 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ArchiveTreeContractVO2.java
  5. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTableVO.java
  6. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  7. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  8. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java
  9. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  10. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml
  11. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  12. 11 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ImageClassificationFileServiceImpl.java
  13. 169 61
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  14. 8 6
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeContractController.java
  15. 2 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  16. 4 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java
  17. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  18. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  19. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml
  20. 5 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsFormElementMapper.xml
  21. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  22. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeContractService.java
  23. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  24. 114 8
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArTreeContractInitServiceImpl.java
  25. 42 10
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java
  26. 54 84
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  27. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

+ 2 - 2
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSelfInspectionRecordDTO.java

@@ -14,8 +14,8 @@ public class TrialSelfInspectionRecordDTO extends TrialSelfInspectionRecord {
     @ApiModelProperty("样品信息ids")
     @ApiModelProperty("样品信息ids")
     private String sampleIds;
     private String sampleIds;
 
 
-    @ApiModelProperty(value = "表类型 1=记录表 2=报告单")
-    private Integer tableType;
+    @ApiModelProperty(value = "表类型 1=记录表 2=报告单 ,字符串拼接")
+    private String tableType;
 
 
     @ApiModelProperty(value = "引用设备仪器ids")
     @ApiModelProperty(value = "引用设备仪器ids")
     private String deviceUseIds;
     private String deviceUseIds;

+ 3 - 2
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTreeContract.java

@@ -47,9 +47,10 @@ public class ArchiveTreeContract extends BaseEntity {
 	@ApiModelProperty(value = "租户id")
 	@ApiModelProperty(value = "租户id")
 	private String tenantId;
 	private String tenantId;
 
 
+
 	/**
 	/**
-	* 项目ID
-	*/
+	 *  项目ID
+	 */
 	private Long projectId;
 	private Long projectId;
 	/**
 	/**
 	* 合同段ID
 	* 合同段ID

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

@@ -24,7 +24,7 @@ public interface ExcelTabClient {
     String saveTabData(@RequestParam Integer isBatchSave,
     String saveTabData(@RequestParam Integer isBatchSave,
                        @RequestBody JSONObject dataInfo,
                        @RequestBody JSONObject dataInfo,
                        @RequestParam Integer type,
                        @RequestParam Integer type,
-                       @RequestParam Integer tableType,
+                       @RequestParam String tableType,
                        @RequestParam Long id,
                        @RequestParam Long id,
                        @RequestParam String tabIds) throws Exception;
                        @RequestParam String tabIds) throws Exception;
 
 

+ 32 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ArchiveTreeContractVO2.java

@@ -24,6 +24,8 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import org.springblade.core.tool.node.INode;
 import org.springblade.core.tool.node.INode;
 import org.springblade.manager.entity.ArchiveTreeContract;
 import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
@@ -44,7 +46,14 @@ public class ArchiveTreeContractVO2 implements INode<ArchiveTreeContractVO2> {
 	@JsonSerialize(using = ToStringSerializer.class)
 	@JsonSerialize(using = ToStringSerializer.class)
 	@ApiModelProperty(value = "主键id")
 	@ApiModelProperty(value = "主键id")
 	private Long id;
 	private Long id;
-
+	/**
+	 * 项目ID
+	 */
+	private Long projectId;
+	/**
+	 * 合同段ID
+	 */
+	private Long contractId;
 	/**
 	/**
 	 * 父节点ID
 	 * 父节点ID
 	 */
 	 */
@@ -73,6 +82,11 @@ public class ArchiveTreeContractVO2 implements INode<ArchiveTreeContractVO2> {
 	@ApiModelProperty(value = "是否有子孙节点")
 	@ApiModelProperty(value = "是否有子孙节点")
 	private Boolean hasChildren;
 	private Boolean hasChildren;
 
 
+	/**
+	 * 关联类型
+	 */
+	private Integer associationType;
+
 	@Override
 	@Override
 	public List<ArchiveTreeContractVO2> getChildren() {
 	public List<ArchiveTreeContractVO2> getChildren() {
 		if (this.children == null) {
 		if (this.children == null) {
@@ -182,4 +196,21 @@ public class ArchiveTreeContractVO2 implements INode<ArchiveTreeContractVO2> {
 				+ ")";
 				+ ")";
 	}
 	}
 
 
+	public ArchiveTreeContractVO2() {
+	}
+
+	public ArchiveTreeContractVO2(ArchiveTreeContract archiveTree) {
+		if (archiveTree == null) {
+			return;
+		}
+
+		try {
+			BeanUtils.copyProperties(archiveTree,this);
+			this.setTitle(archiveTree.getNodeName());
+
+		} catch (BeansException e) {
+			e.printStackTrace();
+		}
+	}
+
 }
 }

+ 2 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsNodeTableVO.java

@@ -89,4 +89,6 @@ public class WbsNodeTableVO implements Serializable {
      */
      */
     private String fillRate;
     private String fillRate;
 
 
+    private String htmlUrl;
+
 }
 }

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1402,7 +1402,7 @@ public class InformationWriteQueryController extends BladeController {
                             newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
                             newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
 
 
                             //划分编号
                             //划分编号
-                            newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
+                            newData.setPartitionCode(StringUtils.isNotEmpty(copyBatch.getPartitionCode()) ? copyBatch.getPartitionCode() : null);
                         }
                         }
                         //设置父节点ID
                         //设置父节点ID
                         if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
                         if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
@@ -1727,6 +1727,7 @@ public class InformationWriteQueryController extends BladeController {
         if (queryProcess != null && queryProcess.size() > 0) {
         if (queryProcess != null && queryProcess.size() > 0) {
             //检查这些填报节点是否存在已经审批或已经上报的节点,如果存在则不允许删除
             //检查这些填报节点是否存在已经审批或已经上报的节点,如果存在则不允许删除
             List<QueryProcessDataVO> approvalList = queryProcess.stream().filter(vo -> new Integer("2").equals(vo.getStatus())).collect(Collectors.toList());
             List<QueryProcessDataVO> approvalList = queryProcess.stream().filter(vo -> new Integer("2").equals(vo.getStatus())).collect(Collectors.toList());
+            //
             List<QueryProcessDataVO> runTaskList = queryProcess.stream().filter(vo -> new Integer("1").equals(vo.getStatus())).collect(Collectors.toList());
             List<QueryProcessDataVO> runTaskList = queryProcess.stream().filter(vo -> new Integer("1").equals(vo.getStatus())).collect(Collectors.toList());
             if (approvalList.size() > 0 || runTaskList.size() > 0) {
             if (approvalList.size() > 0 || runTaskList.size() > 0) {
                 //说明存在已经审批或已经上报的节点,不允许删除
                 //说明存在已经审批或已经上报的节点,不允许删除

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -560,7 +560,7 @@ public class TaskController extends BladeController {
 	@ApiOperation(value = "完成/审批任务")
 	@ApiOperation(value = "完成/审批任务")
 	public R<Boolean> completeApprovalTask(@RequestBody TaskApprovalVO taskApprovalVO) throws FileNotFoundException {
 	public R<Boolean> completeApprovalTask(@RequestBody TaskApprovalVO taskApprovalVO) throws FileNotFoundException {
 		//检查当前用户是否存在等待批次
 		//检查当前用户是否存在等待批次
-		System.out.println(AuthUtil.getUserId());
+		//System.out.println(AuthUtil.getUserId());
 		long batchCount = this.taskBatchService.count(Wrappers.<TaskBatch>lambdaQuery().eq(TaskBatch::getCreateUser, AuthUtil.getUserId()));
 		long batchCount = this.taskBatchService.count(Wrappers.<TaskBatch>lambdaQuery().eq(TaskBatch::getCreateUser, AuthUtil.getUserId()));
 
 
 		if(batchCount > 0){
 		if(batchCount > 0){

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

@@ -124,7 +124,7 @@ public class TrialDetectionController extends BladeController {
     @PostMapping("/self/submit")
     @PostMapping("/self/submit")
     @ApiOperationSupport(order = 11)
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "自检记录新增或修改", notes = "传入TrialSelfInspectionRecordDTO")
     @ApiOperation(value = "自检记录新增或修改", notes = "传入TrialSelfInspectionRecordDTO")
-    public R<Object> selfSubmit(@Valid @RequestBody TrialSelfInspectionRecordDTO dto) throws Exception {
+    public R<Object> selfSubmit(@Valid @RequestBody TrialSelfInspectionRecordDTO dto) {
         return R.data(iTrialSelfInspectionRecordService.selfSubmit(dto));
         return R.data(iTrialSelfInspectionRecordService.selfSubmit(dto));
     }
     }
 
 

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -511,7 +511,8 @@
         iq.e_visa_pdf_url,
         iq.e_visa_pdf_url,
         iq.wbs_id,
         iq.wbs_id,
         iq.sj_record_ids
         iq.sj_record_ids
-        from u_information_query iq left join (select  * from u_task k where k.status!=3 and k.contract_id = #{query.contractId}) t on iq.id = t.form_data_id  and t.is_deleted = 0
+        from u_information_query iq left join (select  * from u_task k where k.status!=3 and k.contract_id = #{query.contractId} group by
+        form_data_id) t on iq.id = t.form_data_id  and t.is_deleted = 0
         where
         where
         iq.is_deleted = 0
         iq.is_deleted = 0
         and iq.classify = #{query.classify}
         and iq.classify = #{query.classify}

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSelfInspectionRecordMapper.xml

@@ -64,7 +64,7 @@
     </delete>
     </delete>
 
 
     <select id="selectAll" resultType="org.springblade.business.entity.TrialSelfInspectionRecord">
     <select id="selectAll" resultType="org.springblade.business.entity.TrialSelfInspectionRecord">
-        select * from u_trial_self_inspection_record where node_id = #{nodeId} and contract_id = #{contractId}
+        select record_no,report_no from u_trial_self_inspection_record where node_id = #{nodeId} and contract_id = #{contractId}
     </select>
     </select>
 
 
     <select id="selectSelfSampleRecord" resultType="java.lang.String">
     <select id="selectSelfSampleRecord" resultType="java.lang.String">

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

@@ -15,7 +15,7 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
 
 
     IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto);
     IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto);
 
 
-    String selfSubmit(TrialSelfInspectionRecordDTO dto) throws Exception;
+    String selfSubmit(TrialSelfInspectionRecordDTO dto) ;
 
 
     List<TrialSampleInfoVO> selfSampleList(String id);
     List<TrialSampleInfoVO> selfSampleList(String id);
 
 

+ 11 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ImageClassificationFileServiceImpl.java

@@ -19,6 +19,7 @@ package org.springblade.business.service.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.nacos.common.utils.DateFormatUtils;
 import com.alibaba.nacos.common.utils.DateFormatUtils;
+import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.entity.ImageClassificationFile;
 import org.springblade.business.entity.ImageClassificationFile;
@@ -29,10 +30,13 @@ import org.springblade.business.service.IImageClassificationFileService;
 import org.springblade.business.vo.TreeVo;
 import org.springblade.business.vo.TreeVo;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 
 import java.util.*;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  *  服务实现类
  *  服务实现类
@@ -41,8 +45,9 @@ import java.util.*;
  * @since 2022-05-24
  * @since 2022-05-24
  */
  */
 @Service
 @Service
+@AllArgsConstructor
 public class ImageClassificationFileServiceImpl extends BaseServiceImpl<ImageClassificationFileMapper, ImageClassificationFile> implements IImageClassificationFileService {
 public class ImageClassificationFileServiceImpl extends BaseServiceImpl<ImageClassificationFileMapper, ImageClassificationFile> implements IImageClassificationFileService {
-
+	private final WbsTreeContractClient wbsTreeContractClient;
 	@Override
 	@Override
 	public List<Integer> queryCurrentContractImageFileType(String contractId) {
 	public List<Integer> queryCurrentContractImageFileType(String contractId) {
 		return this.baseMapper.queryCurrentContractImageFileType(contractId);
 		return this.baseMapper.queryCurrentContractImageFileType(contractId);
@@ -69,7 +74,11 @@ public class ImageClassificationFileServiceImpl extends BaseServiceImpl<ImageCla
 		long current = (page.getCurrent() - 1L) * page.getSize();
 		long current = (page.getCurrent() - 1L) * page.getSize();
 		if(StringUtils.isNotEmpty(imageClassificationFile.getWbsIdsStr())){
 		if(StringUtils.isNotEmpty(imageClassificationFile.getWbsIdsStr())){
 			//查询下级节点信息
 			//查询下级节点信息
-			imageClassificationFile.setWbsIds(JSONArray.parseArray(JSONObject.toJSONString(imageClassificationFile.getWbsIdsStr().split(",")), String.class));
+//			imageClassificationFile.setWbsIds(JSONArray.parseArray(JSONObject.toJSONString(imageClassificationFile.getWbsIdsStr().split(",")), String.class));
+			WbsTreeContract node = wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(imageClassificationFile.getWbsIdsStr()));
+			List<WbsTreeContract> wbsTreeContracts = wbsTreeContractClient.queryCurrentNodeAllChild(imageClassificationFile.getContractId(), node.getId());
+			wbsTreeContracts.add(node);
+			imageClassificationFile.setWbsIds(wbsTreeContracts.stream().map(wtc->wtc.getPKeyId()+"").collect(Collectors.toList()));
 		}
 		}
 		//获取数据
 		//获取数据
 		List<ImageClassificationFile> fileVOS = this.baseMapper.selectImageClassificationFilePage(current, page.getSize(), imageClassificationFile);
 		List<ImageClassificationFile> fileVOS = this.baseMapper.selectImageClassificationFilePage(current, page.getSize(), imageClassificationFile);

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

@@ -204,11 +204,19 @@ public class TrialSelfInspectionRecordServiceImpl
     public boolean selfCopy(List<Long> ids) {
     public boolean selfCopy(List<Long> ids) {
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectBatchIds(ids);
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectBatchIds(ids);
         for (TrialSelfInspectionRecord trialSelfInspectionRecord : trialSelfInspectionRecords) {
         for (TrialSelfInspectionRecord trialSelfInspectionRecord : trialSelfInspectionRecords) {
-            TrialSelfInspectionRecordDTO trialSelfInspectionRecordDTO = BeanUtil.copyProperties(trialSelfInspectionRecord, TrialSelfInspectionRecordDTO.class);
-            assert trialSelfInspectionRecordDTO != null;
-            trialSelfInspectionRecordDTO.setId(SnowFlakeUtil.getId()); //主键id
-            this.buildNumber(trialSelfInspectionRecordDTO); //重构编号
-            this.save(trialSelfInspectionRecordDTO); //复制新增
+            TrialSelfInspectionRecordDTO dto = BeanUtil.copyProperties(trialSelfInspectionRecord, TrialSelfInspectionRecordDTO.class);
+            assert dto != null;
+            dto.setId(SnowFlakeUtil.getId());
+            if (StringUtils.isNotEmpty(dto.getRecordNo())) {
+                dto.setTableType("1");
+            } else if (StringUtils.isNotEmpty(dto.getReportNo())) {
+                dto.setTableType("2");
+            } else if (StringUtils.isNotEmpty(dto.getReportNo()) && StringUtils.isNotEmpty(dto.getRecordNo())) {
+                dto.setTableType("1,2");
+            }
+            //重构编号
+            this.buildNumber(dto);
+            this.save(dto);
         }
         }
         return true;
         return true;
     }
     }
@@ -642,8 +650,8 @@ public class TrialSelfInspectionRecordServiceImpl
     }
     }
 
 
     @Override
     @Override
-    public String selfSubmit(TrialSelfInspectionRecordDTO dto) throws Exception {
-        if (ObjectUtil.isEmpty(dto.getId())) {
+    public String selfSubmit(TrialSelfInspectionRecordDTO dto) {
+        if (ObjectUtil.isEmpty(dto.getId()) && StringUtils.isNotEmpty(dto.getTableType())) {
             //构建记录表编号、报告单编号
             //构建记录表编号、报告单编号
             this.buildNumber(dto);
             this.buildNumber(dto);
 
 
@@ -667,9 +675,17 @@ public class TrialSelfInspectionRecordServiceImpl
             //获取当前最新的试验记录信息
             //获取当前最新的试验记录信息
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
 
 
+            //如果新增时不是两种类型表都填报过,那么有一项编号为Null,所以编辑时生成记录表编号或报告单编号
+            if (StringUtils.isEmpty(obj.getRecordNo()) && dto.getTableType().contains("1")) {
+                this.buildNumber(dto);
+                this.saveOrUpdate(dto);
+            } else if (StringUtils.isEmpty(obj.getReportNo()) && dto.getTableType().contains("2")) {
+                this.buildNumber(dto);
+                this.saveOrUpdate(dto);
+            }
+
             try {
             try {
-                //保存实体表数据、记录信息、生成pdf
-                assert obj != null;
+                //保存实体表数据、试验记录信息、生成pdf
                 String pdfURL = excelTabClient.saveTabData(dto.getIsBatchSave(), dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
                 String pdfURL = excelTabClient.saveTabData(dto.getIsBatchSave(), dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), obj.getTableIds());
                 if (StringUtils.isNotEmpty(pdfURL)) {
                 if (StringUtils.isNotEmpty(pdfURL)) {
                     //修改合并pdf
                     //修改合并pdf
@@ -817,66 +833,158 @@ public class TrialSelfInspectionRecordServiceImpl
     private void buildNumber(TrialSelfInspectionRecordDTO dto) {
     private void buildNumber(TrialSelfInspectionRecordDTO dto) {
         StringSPUtils spUtils = new StringSPUtils();
         StringSPUtils spUtils = new StringSPUtils();
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
         List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
-        //获取记录表最大编号
-        List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList());
-        String maxRecordNo;
-        if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
-            maxRecordNo = "0001";
-        } else {
-            List<String> numberRecordNos = new ArrayList<>();
-            for (String recordNo : recordNos) {
-                String number = recordNo.split("-")[recordNo.split("-").length - 1];
-                numberRecordNos.add(number);
+
+        //两种类型同时生成
+        if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1")) {
+            String maxRecordNo = "";
+            if (StringUtils.isEmpty(dto.getRecordNo())) {
+                //获取记录表最大编号
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList());
+                if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
+                    maxRecordNo = "0001";
+                } else {
+                    List<String> numberRecordNos = new ArrayList<>();
+                    for (String recordNo : recordNos) {
+                        String number = recordNo.split("-")[recordNo.split("-").length - 1];
+                        numberRecordNos.add(number);
+                    }
+                    int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
+                    if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
+                        maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }
+                }
             }
             }
-            int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
-            if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
-                maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
+
+            String maxReportNo = "";
+            if (StringUtils.isEmpty(dto.getReportNo())) {
+                //获取报告单最大编号
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList());
+                if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
+                    maxReportNo = "0001";
+                } else {
+                    List<String> numberReportNo = new ArrayList<>();
+                    for (String reportNo : reportNos) {
+                        String number = reportNo.split("-")[reportNo.split("-").length - 1];
+                        numberReportNo.add(number);
+                    }
+                    int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNo)) + 1;
+                    if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
+                        maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }
+                }
+            }
+
+            List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId())));
+            WbsTreePrivate wbsTreePrivate = wbsTreePrivates.stream().findAny().orElse(null);
+            ContractInfo contract = contractClient.getContractById(dto.getContractId());
+            int year = LocalDateTimeUtil.now().getYear();
+            if (wbsTreePrivate == null) {
+                throw new ServiceException("未找到当前节点信息,操作失败!");
             } else {
             } else {
-                throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                //记录表
+                if (StringUtils.isNotEmpty(maxRecordNo)) {
+                    String str1 = "JL" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxRecordNo;
+                    dto.setRecordNo(str1);
+                }
+
+                //报告单
+                if (StringUtils.isNotEmpty(maxReportNo)) {
+                    String str2 = "BG" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxReportNo;
+                    dto.setReportNo(str2);
+                }
             }
             }
         }
         }
 
 
-        //获取报告单最大编号
-        List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList());
-        String maxReportNo;
-        if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
-            maxReportNo = "0001";
-        } else {
-            List<String> numberReportNo = new ArrayList<>();
-            for (String reportNo : reportNos) {
-                String number = reportNo.split("-")[reportNo.split("-").length - 1];
-                numberReportNo.add(number);
-            }
-            int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNo)) + 1;
-            if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
-                maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
-            } else {
-                throw new ServiceException("当前编号已达到最大值9999,操作失败");
+        //记录表
+        if (("1").equals(dto.getTableType())) {
+            if (StringUtils.isEmpty(dto.getRecordNo())) {
+                //获取记录表最大编号
+                List<String> recordNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getRecordNo).collect(Collectors.toList());
+                String maxRecordNo;
+                if (recordNos.size() == 0 || ObjectUtil.isEmpty(recordNos)) {
+                    maxRecordNo = "0001";
+                } else {
+                    List<String> numberRecordNos = new ArrayList<>();
+                    for (String recordNo : recordNos) {
+                        String number = recordNo.split("-")[recordNo.split("-").length - 1];
+                        numberRecordNos.add(number);
+                    }
+                    int maxRecordNo1 = Integer.parseInt(Collections.max(numberRecordNos)) + 1;
+                    if (maxRecordNo1 < 9999 && maxRecordNo1 > 0) {
+                        maxRecordNo = spUtils.buildSerial(maxRecordNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }
+                }
+
+                List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId())));
+                WbsTreePrivate wbsTreePrivate = wbsTreePrivates.stream().findAny().orElse(null);
+                ContractInfo contract = contractClient.getContractById(dto.getContractId());
+                int year = LocalDateTimeUtil.now().getYear();
+                if (wbsTreePrivate == null) {
+                    throw new ServiceException("未找到当前节点信息,操作失败!");
+                } else {
+                    //记录表
+                    String str1 = "JL" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxRecordNo;
+                    dto.setRecordNo(str1);
+                }
             }
             }
         }
         }
 
 
-        List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId())));
-        WbsTreePrivate wbsTreePrivate = wbsTreePrivates.stream().findAny().orElse(null);
-        ContractInfo contract = contractClient.getContractById(dto.getContractId());
-        int year = LocalDateTimeUtil.now().getYear();
-        if (wbsTreePrivate == null) {
-            throw new ServiceException("未找到当前节点信息,操作失败!");
-        } else {
-            //记录表
-            String str1 = "JL" +
-                    "-" + contract.getContractNumber() +
-                    "-" + year +
-                    "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
-                    "-" + maxRecordNo;
-            dto.setRecordNo(str1);
-
-            //报告单
-            String str2 = "BG" +
-                    "-" + contract.getContractNumber() +
-                    "-" + year +
-                    "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
-                    "-" + maxReportNo;
-            dto.setReportNo(str2);
+        //报告单
+        if (("2").equals(dto.getTableType())) {
+            if (StringUtils.isEmpty(dto.getReportNo())) {
+                //获取报告单最大编号
+                List<String> reportNos = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getReportNo).collect(Collectors.toList());
+                String maxReportNo;
+                if (reportNos.size() == 0 || ObjectUtil.isEmpty(reportNos)) {
+                    maxReportNo = "0001";
+                } else {
+                    List<String> numberReportNo = new ArrayList<>();
+                    for (String reportNo : reportNos) {
+                        String number = reportNo.split("-")[reportNo.split("-").length - 1];
+                        numberReportNo.add(number);
+                    }
+                    int maxReportNo1 = Integer.parseInt(Collections.max(numberReportNo)) + 1;
+                    if (maxReportNo1 < 9999 && maxReportNo1 > 0) {
+                        maxReportNo = spUtils.buildSerial(maxReportNo1, 4);
+                    } else {
+                        throw new ServiceException("当前编号已达到最大值9999,操作失败");
+                    }
+                }
+
+                List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId())));
+                WbsTreePrivate wbsTreePrivate = wbsTreePrivates.stream().findAny().orElse(null);
+                ContractInfo contract = contractClient.getContractById(dto.getContractId());
+                int year = LocalDateTimeUtil.now().getYear();
+                if (wbsTreePrivate == null) {
+                    throw new ServiceException("未找到当前节点信息,操作失败!");
+                } else {
+                    //报告单
+                    String str2 = "BG" +
+                            "-" + contract.getContractNumber() +
+                            "-" + year +
+                            "-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
+                            "-" + maxReportNo;
+                    dto.setReportNo(str2);
+                }
+            }
         }
         }
     }
     }
 
 

+ 8 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeContractController.java

@@ -175,13 +175,14 @@ public class ArchiveTreeContractController extends BladeController {
 	@ApiOperation(value = "懒加载树形结构", notes = "传入父级id")
 	@ApiOperation(value = "懒加载树形结构", notes = "传入父级id")
 	@ApiImplicitParams(value = {
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "parentId", value = "父级id", required = true),
 			@ApiImplicitParam(name = "parentId", value = "父级id", required = true),
-			@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+			@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+			@ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
 	})
 	})
-	public R<List<ArchiveTreeContractVO2>> lazyTree(Long parentId,Long projectId) {
+	public R<List<ArchiveTreeContractVO2>> lazyTree(Long parentId,Long projectId,Long contractId) {
 //		if (projectId == null) {
 //		if (projectId == null) {
 //			projectId = 1578599210897772545L;
 //			projectId = 1578599210897772545L;
 //		}
 //		}
-		List<ArchiveTreeContractVO2> tree = archiveTreeContractService.lazyTree2(AuthUtil.getTenantId(), parentId,projectId);
+		List<ArchiveTreeContractVO2> tree = archiveTreeContractService.lazyTree2(AuthUtil.getTenantId(), parentId,projectId,contractId);
 		if (tree != null && tree.size() > 0) {
 		if (tree != null && tree.size() > 0) {
 			return R.data(tree);
 			return R.data(tree);
 		}
 		}
@@ -198,12 +199,13 @@ public class ArchiveTreeContractController extends BladeController {
 	@ApiImplicitParams(value = {
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "disPlayTree", value = "是否加载显示树 'null'=不加载 '1'=加载"),
 			@ApiImplicitParam(name = "disPlayTree", value = "是否加载显示树 'null'=不加载 '1'=加载"),
 			@ApiImplicitParam(name = "nodeType", value = "'null'=全加载 '1'=关联电子原生文件类型树 '2'=文件上传类型树"),
 			@ApiImplicitParam(name = "nodeType", value = "'null'=全加载 '1'=关联电子原生文件类型树 '2'=文件上传类型树"),
-			@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+			@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+			@ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
 	})
 	})
-	public R<List<ArchiveTreeContractVO2>> tree(Integer disPlayTree, Integer nodeType,Long projectId){
+	public R<List<ArchiveTreeContractVO2>> tree(Integer disPlayTree, Integer nodeType,Long projectId,Long contractId){
 
 
 
 
-		List<ArchiveTreeContractVO2> tree = archiveTreeContractService.tree2(AuthUtil.getTenantId(), disPlayTree, nodeType,projectId);
+		List<ArchiveTreeContractVO2> tree = archiveTreeContractService.tree2(AuthUtil.getTenantId(), disPlayTree, nodeType,projectId,contractId);
 		if (tree != null && tree.size() > 0) {
 		if (tree != null && tree.size() > 0) {
 			return R.data(tree);
 			return R.data(tree);
 		}
 		}

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

@@ -1076,7 +1076,7 @@ public class ExcelTabController extends BladeController {
                         ExctabCell exctabCell = new ExctabCell();
                         ExctabCell exctabCell = new ExctabCell();
                         if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
                         if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
                             if (inputText.indexOf("日期") >= 0) {
                             if (inputText.indexOf("日期") >= 0) {
-                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
+                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
                             } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
                             } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
                                 if (inputText.indexOf("专业监理工程师") >= 0) {
                                 if (inputText.indexOf("专业监理工程师") >= 0) {
                                     inputText = "专业监理工程师_年月日";
                                     inputText = "专业监理工程师_年月日";
@@ -1086,7 +1086,7 @@ public class ExcelTabController extends BladeController {
                                     inputText = "年月日";
                                     inputText = "年月日";
                                 }
                                 }
                             }
                             }
-                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
                             exctabCell.setTextInfo(inputText);
                             exctabCell.setTextInfo(inputText);
                             exctabCell.setExctabId(excelId);
                             exctabCell.setExctabId(excelId);
                             exctabCell.setIsDeleted(0);
                             exctabCell.setIsDeleted(0);
@@ -1326,8 +1326,6 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "id", value = "id", required = true)
             @ApiImplicitParam(name = "id", value = "id", required = true)
     })
     })
     public R getExcelHtmlByCol(Long id) throws IOException, InterruptedException {
     public R getExcelHtmlByCol(Long id) throws IOException, InterruptedException {
-
-        Thread.sleep(200);
         ExcelTab detail = excelTabService.getById(id);
         ExcelTab detail = excelTabService.getById(id);
         if (detail == null) {
         if (detail == null) {
             return R.fail("该数据下无此节点!");
             return R.fail("该数据下无此节点!");

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

@@ -117,7 +117,7 @@ public class TableFileController extends BladeController {
     @PostMapping("/remove-trial")
     @PostMapping("/remove-trial")
     @ApiOperationSupport(order = 2)
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "逻辑删除", notes = "传入当前文件ids、tableType、合同段Id、当前自检记录id")
     @ApiOperation(value = "逻辑删除", notes = "传入当前文件ids、tableType、合同段Id、当前自检记录id")
-    public R removeTrial(@RequestParam String ids, @RequestParam Integer tableType, @RequestParam String contractId, @RequestParam Long id) throws Exception {
+    public R removeTrial(@RequestParam String ids, @RequestParam String tableType, @RequestParam String contractId, @RequestParam Long id) throws Exception {
         //基本信息
         //基本信息
         TableFile tableFile = tableFileService.getById(ids);
         TableFile tableFile = tableFileService.getById(ids);
 
 
@@ -136,6 +136,7 @@ public class TableFileController extends BladeController {
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
 
 
         WbsTreePrivate wbsTreePrivate1 = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
         WbsTreePrivate wbsTreePrivate1 = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                .select(WbsTreePrivate::getPKeyId)
                 .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
                 .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
                 .eq(WbsTreePrivate::getId, wbsTreePrivate.getParentId())
                 .eq(WbsTreePrivate::getId, wbsTreePrivate.getParentId())
         );
         );
@@ -162,7 +163,7 @@ public class TableFileController extends BladeController {
         }
         }
 
 
         //获取当前记录下的文本元素表的附件文件信息
         //获取当前记录下的文本元素表的附件文件信息
-        List<TableFile> fileList = this.tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>lambdaQuery()
+        Long row = this.tableFileService.getBaseMapper().selectCount(Wrappers.<TableFile>lambdaQuery()
                 .eq(TableFile::getType, 2)
                 .eq(TableFile::getType, 2)
                 .eq(TableFile::getTabId, pkeyId)
                 .eq(TableFile::getTabId, pkeyId)
                 .eq(TableFile::getTrialRecordId, id)
                 .eq(TableFile::getTrialRecordId, id)
@@ -170,7 +171,7 @@ public class TableFileController extends BladeController {
 
 
         //修改按钮状态
         //修改按钮状态
         String updateSql;
         String updateSql;
-        if (fileList.size() == 0) {
+        if (row == 0) {
             //无附件
             //无附件
             updateSql = "update u_trial_self_data_record set is_tab_file_type = 1 where tab_id = " + pkeyId + " and record_id = " + id;
             updateSql = "update u_trial_self_data_record set is_tab_file_type = 1 where tab_id = " + pkeyId + " and record_id = " + id;
         } else {
         } else {

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -317,6 +317,9 @@ public class WbsTreePrivateController extends BladeController {
         List<WbsNodeTableVO> rs = wbsTreePrivateService.selectByNodeTable(parentId, wbsId, projectId);
         List<WbsNodeTableVO> rs = wbsTreePrivateService.selectByNodeTable(parentId, wbsId, projectId);
         if (rs.size() > 0) {
         if (rs.size() > 0) {
             for (WbsNodeTableVO r : rs) {
             for (WbsNodeTableVO r : rs) {
+                if (StringUtil.isBlank(r.getHtmlUrl())){
+                    r.setIsLinkTable(1);
+                }
                 if (StringUtil.isBlank(r.getInitTableId())) {
                 if (StringUtil.isBlank(r.getInitTableId())) {
                     WbsTree wbsTree = wbsTreeService.getById(r.getId());
                     WbsTree wbsTree = wbsTreeService.getById(r.getId());
                     if (wbsTree != null) {
                     if (wbsTree != null) {

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

@@ -44,7 +44,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     }
     }
 
 
     @Override
     @Override
-    public String saveTabData(Integer isBatchSave, JSONObject dataInfo, Integer type, Integer tableType, Long id, String tabIds) throws Exception {
+    public String saveTabData(Integer isBatchSave, JSONObject dataInfo, Integer type, String tableType, Long id, String tabIds) throws Exception {
         //通用参数
         //通用参数
         JSONArray dataArray = dataInfo.getJSONArray("orderList");
         JSONArray dataArray = dataInfo.getJSONArray("orderList");
         JSONObject table = dataArray.getJSONObject(0);
         JSONObject table = dataArray.getJSONObject(0);
@@ -143,7 +143,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, String id, String tabIds) throws Exception {
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, String id, String tabIds) throws Exception {
         //合并PDF加载
         //合并PDF加载
         return excelTabService.getBussPDFSTrial(nodeId,
         return excelTabService.getBussPDFSTrial(nodeId,
-                Integer.parseInt(tableType), //tableType=表类型 1=记录表 2=报告单
+                tableType, //tableType=表类型 1=记录表 2=报告单
                 classify, //type=所属方 1=施工质检 2=监理抽检
                 classify, //type=所属方 1=施工质检 2=监理抽检
                 contractId, //合同段id
                 contractId, //合同段id
                 projectId, //项目id
                 projectId, //项目id

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -77,6 +77,7 @@
         <result column="title" property="title"/>
         <result column="title" property="title"/>
         <result column="value" property="value"/>
         <result column="value" property="value"/>
         <result column="key" property="key"/>
         <result column="key" property="key"/>
+        <result column="contract_id" property="contractId"/>
         <result column="has_children" property="hasChildren"/>
         <result column="has_children" property="hasChildren"/>
         <result column="displayHierarchy" property="displayHierarchy"/>
         <result column="displayHierarchy" property="displayHierarchy"/>
         <result column="majorDataType" property="majorDataType"/>
         <result column="majorDataType" property="majorDataType"/>
@@ -203,6 +204,7 @@
         SELECT
         SELECT
         id,
         id,
         parent_id,
         parent_id,
+        contract_id,
         node_name AS title,
         node_name AS title,
         id AS "value",
         id AS "value",
         id AS "key",
         id AS "key",

+ 5 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsFormElementMapper.xml

@@ -125,12 +125,12 @@
     </select>
     </select>
 
 
     <select id="selectDetailById" resultType="org.springblade.manager.vo.WbsFormElementVO">
     <select id="selectDetailById" resultType="org.springblade.manager.vo.WbsFormElementVO">
-        SELECT *,
-               (SELECT concat(init_table_name, "_", t.e_key) FROM m_wbs_tree WHERE id = t.f_id) AS "tableElementKey"
-        FROM m_wbs_form_element t
+        SELECT t.*,
+               concat(c.tab_en_name, "_", t.e_key)  AS "tableElementKey",c.tab_ch_name as "initTableName"
+        FROM m_wbs_form_element t LEFT JOIN m_table_info c on t.f_id=c.id
         WHERE t.id = #{id}
         WHERE t.id = #{id}
-          AND status = 1
-          AND is_deleted = 0
+          AND t.status = 1
+          AND t.is_deleted = 0
     </select>
     </select>
 
 
     <select id="selectElementInTableByFid" resultType="org.springblade.manager.entity.WbsTree">
     <select id="selectElementInTableByFid" resultType="org.springblade.manager.entity.WbsTree">

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

@@ -461,6 +461,7 @@
                wt.sort,
                wt.sort,
                wt.status,
                wt.status,
                wt.fill_rate AS "fillRate",
                wt.fill_rate AS "fillRate",
+               wt.html_url AS htmlUrl,
                (SELECT count(1) FROM m_wbs_form_element WHERE f_id = wt.init_table_id and is_deleted=0) AS "elementTotal"
                (SELECT count(1) FROM m_wbs_form_element WHERE f_id = wt.init_table_id and is_deleted=0) AS "elementTotal"
         FROM m_wbs_tree_private AS wt
         FROM m_wbs_tree_private AS wt
         WHERE wt.type = 2
         WHERE wt.type = 2

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

@@ -63,9 +63,9 @@ public interface IArchiveTreeContractService extends BaseService<ArchiveTreeCont
 
 
 	List<ArchiveTreeContractVO> tree(String tenantI,Integer disPlayTree,Integer nodeType,Long projectId);
 	List<ArchiveTreeContractVO> tree(String tenantI,Integer disPlayTree,Integer nodeType,Long projectId);
 
 
-	List<ArchiveTreeContractVO2> lazyTree2(String tenantId, Long parentId, Long projectId);
+	List<ArchiveTreeContractVO2> lazyTree2(String tenantId, Long parentId, Long projectId, Long contractId);
 
 
-	List<ArchiveTreeContractVO2> tree2(String tenantI,Integer disPlayTree,Integer nodeType,Long projectId);
+	List<ArchiveTreeContractVO2> tree2(String tenantI,Integer disPlayTree,Integer nodeType,Long projectId, Long contractId);
 
 
 
 
 
 

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

@@ -134,7 +134,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
     /**
      * 多PDF 合并 - 试验
      * 多PDF 合并 - 试验
      */
      */
-    String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception;
+    String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception;
 
 
 
 
     /**
     /**

+ 114 - 8
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArTreeContractInitServiceImpl.java

@@ -265,28 +265,134 @@ public class ArTreeContractInitServiceImpl {
     }
     }
 
 
 
 
+    public ArchiveTreeContractVO2 getTree(List<ArchiveTreeContract> archiveTreeContracts) {
+        List<ArchiveTreeContractVO2> archiveTreeContractVO2List = new ArrayList<>();
 
 
+        for (ArchiveTreeContract archiveTreeContract:archiveTreeContracts) {
+            ArchiveTreeContractVO2 treeContractVO2 = new ArchiveTreeContractVO2(archiveTreeContract);
+            archiveTreeContractVO2List.add(treeContractVO2);
+        }
 
 
+        List<ArchiveTreeContractVO2> trees = ForestNodeMerger.merge(archiveTreeContractVO2List);
 
 
+        if (trees != null && trees.size() > 0) {
+           return trees.get(0);
+        }else {
+            return null;
+        }
+    }
 
 
-    public List<ArchiveTreeContract> getTreeContractFromWbs(String tenantId, Long projectId, Long wbsId, Long contractId,Long level,ArchiveTreeContractVO2 subTree){
+    /**
+     *
+     * @param tenantId
+     * @param projectId
+     * @param wbsId
+     * @param tree
+     * @return
+     */
+    public List<ArchiveTreeContract> getContractProcExtNodes(String tenantId, Long projectId,Long wbsId, ArchiveTreeContractVO2 tree) {
+
+        List<ArchiveTreeContract> addNodes = new ArrayList<>();
+        List<ArchiveTreeContractVO2> archiveTreeContractVO2s = new ArrayList<>();
+        ForestNodeMerger.getTreeList(tree,archiveTreeContractVO2s);
+
+        for (ArchiveTreeContractVO2 ar : archiveTreeContractVO2s) {
+            //关联质检资料
+            if (ar.getAssociationType()!= null
+                    &&  ar.getAssociationType() == 1
+                    && ar.getDisplayHierarchy() != null ) {
+                List<ArchiveTreeContract> tmpList  = getTreeContractFromWbs(tenantId,projectId,wbsId,ar);
+                addNodes.addAll(tmpList);
+            }
+        }
+        return addNodes;
+    }
+
+
+
+
+    public List<ArchiveTreeContract> getTreeContractFromWbs(String tenantId, Long projectId, Long wbsId, ArchiveTreeContractVO2 subTree){
         List<ArchiveTreeContract> archiveTreeContracts = new ArrayList<>();
         List<ArchiveTreeContract> archiveTreeContracts = new ArrayList<>();
 
 
+        Long contractId = subTree.getContractId();
+        Long level = Long.parseLong(subTree.getDisplayHierarchy());
+
         //1. 获取子树链表
         //1. 获取子树链表
         List<ArchiveTreeContractVO2> treeContractVO2s = new ArrayList<>();
         List<ArchiveTreeContractVO2> treeContractVO2s = new ArrayList<>();
         ForestNodeMerger.getTreeList(subTree,treeContractVO2s);
         ForestNodeMerger.getTreeList(subTree,treeContractVO2s);
 
 
         //2. 获取对应合同的树
         //2. 获取对应合同的树
-        List<WbsTreeContractVO6> wbsTreeContractVO6s =  contractInfoService.tree6List(wbsId.toString(),projectId.toString(),contractId.toString());
-        Iterator<WbsTreeContractVO6> iterator = wbsTreeContractVO6s.iterator();
-        while (iterator.hasNext()) {
-            WbsTreeContractVO6 treeContractVO6 = iterator.next();
-            if (treeContractVO6.getNodeType() > level) {
-                iterator.remove();
+        List<WbsTreeContractVO6> wbsTreeContractVO6s =  contractInfoService.tree6List(wbsId.toString(),subTree.toString(),contractId.toString());
+
+        List<WbsTreeContractVO6> addWbsNodes = new ArrayList<>();
+
+        //获取已经存在的
+        Map<Long,ArchiveTreeContractVO2> extMap = new LinkedHashMap<>();
+        Map<Long,Long> oldNewMap = new LinkedHashMap<>();
+        for (ArchiveTreeContractVO2 ar :treeContractVO2s) {
+            if (ar.getExtId() !=null ) {
+                extMap.put(ar.getExtId(),ar);
+                oldNewMap.put(ar.getExtId(),ar.getId());
+            }
+        }
+
+        for (WbsTreeContractVO6 wbsTreeVO2:wbsTreeContractVO6s) {
+            //不要中间交工,质量评定和开工报告作为目录节点
+            if (wbsTreeVO2.getMajorDataType() != null ) {
+                if (wbsTreeVO2.getMajorDataType() == 1
+                        || wbsTreeVO2.getMajorDataType() == 2
+                        || wbsTreeVO2.getMajorDataType() == 3){
+                    continue;
+                }
+            }
+            //只展示指定层级之上的
+            if (wbsTreeVO2.getNodeType() > level){
+                continue;
+            }
+
+            //排除已经有的
+            if (extMap.get(wbsTreeVO2.getId())!= null) {
+                continue;
             }
             }
+
+            addWbsNodes.add(wbsTreeVO2);
+        }
+
+        for (WbsTreeContractVO6 wbsTreeVO2:addWbsNodes) {
+            oldNewMap.put(wbsTreeVO2.getId(),SnowFlakeUtil.getId());
+        }
+
+        //遍历构建
+        for (WbsTreeContractVO6 wbsTreeVO2:addWbsNodes) {
+            //只展示指定层级之上的
+            ArchiveTreeContract archiveTree = new ArchiveTreeContract();
+            archiveTree.setTenantId(tenantId);
+            archiveTree.setProjectId(projectId);
+            archiveTree.setContractId(contractId);
+            archiveTree.setId(oldNewMap.get(wbsTreeVO2.getId()));
+            if (wbsTreeVO2.getParentId() == 0) {
+                wbsTreeVO2.setParentId(subTree.getId());
+            }else {
+                archiveTree.setParentId(oldNewMap.get(wbsTreeVO2.getParentId()));
+            }
+
+            archiveTree.setNodeName(wbsTreeVO2.getTitle());
+
+            //设置关联
+            archiveTree.setExtType(1);
+            archiveTree.setExtId(wbsTreeVO2.getId());
+            archiveTree.setExtAttachId(subTree.getId());
+            archiveTree.setDisplayHierarchy(level.toString());
+            archiveTree.setIsDeleted(0);
+            //上传节点
+            if (wbsTreeVO2.getNodeType().longValue() ==  level) {
+                archiveTree.setIsStorageNode(1);
+            }
+            archiveTreeContracts.add(archiveTree);
+
         }
         }
 
 
-         return archiveTreeContracts;
+        return archiveTreeContracts;
     }
     }
 
 
 }
 }

+ 42 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java

@@ -17,9 +17,9 @@
 package org.springblade.manager.service.impl;
 package org.springblade.manager.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.log.exception.ServiceException;
@@ -95,7 +95,21 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 
 
 		arTreeContractInitService.copyTree(tenantId,projectId,projectInfo.getProjectName(),tree.get(0),archiveTreeContracts,contractInfoVOS);
 		arTreeContractInitService.copyTree(tenantId,projectId,projectInfo.getProjectName(),tree.get(0),archiveTreeContracts,contractInfoVOS);
 
 
-	    //todo 同步质检资料动态节点,处理文件提名
+		//是否获取扩展的wbs节点
+
+		Long wbsId = null;
+		if (projectInfo!= null) {
+			Long lWbsId = projectInfo.getReferenceWbsTemplateId();
+			if (lWbsId != null) {
+				wbsId = projectInfo.getReferenceWbsTemplateId();
+			}
+		}
+
+		ArchiveTreeContractVO2 newTree = arTreeContractInitService.getTree(archiveTreeContracts);
+
+		List<ArchiveTreeContract> addNodes = arTreeContractInitService.getContractProcExtNodes(tenantId,projectId,wbsId,newTree);
+		archiveTreeContracts.addAll(addNodes);
+		//todo 同步质检资料动态节点,处理文件提名
 
 
 		//todo 同步立卷规则
 		//todo 同步立卷规则
 
 
@@ -120,17 +134,17 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 	}
 	}
 
 
 	@Override
 	@Override
-	public List<ArchiveTreeContractVO2> lazyTree2(String tenantId, Long parentId, Long projectId) {
+	public List<ArchiveTreeContractVO2> lazyTree2(String tenantId, Long parentId, Long projectId, Long contractId) {
 		if (AuthUtil.isAdministrator()) {
 		if (AuthUtil.isAdministrator()) {
 			tenantId = StringPool.EMPTY;
 			tenantId = StringPool.EMPTY;
 		}
 		}
-		return ForestNodeMerger.merge(baseMapper.lazyTree2(tenantId, parentId,projectId,getAuthCode(),getAuthContractId()));
+		return ForestNodeMerger.merge(baseMapper.lazyTree2(tenantId, parentId,projectId,getAuthCode(contractId),getAuthContractId(contractId)));
 	}
 	}
 
 
 	@Override
 	@Override
-	public List<ArchiveTreeContractVO2> tree2(String tenantId, Integer disPlayTree, Integer nodeType, Long projectId) {
+	public List<ArchiveTreeContractVO2> tree2(String tenantId, Integer disPlayTree, Integer nodeType, Long projectId, Long contractId) {
 
 
-		return ForestNodeMerger.merge(baseMapper.tree2(tenantId, disPlayTree, nodeType,projectId,getAuthCode(),getAuthContractId()));
+		return ForestNodeMerger.merge(baseMapper.tree2(tenantId, disPlayTree, nodeType,projectId,getAuthCode(contractId),getAuthContractId(contractId)));
 	}
 	}
 
 
 
 
@@ -241,20 +255,38 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 	 * 返回所属的合同段,没有则范围“”
 	 * 返回所属的合同段,没有则范围“”
 	 * @return
 	 * @return
 	 */
 	 */
-	public String getAuthContractId() {
-		String contractId ="";
+	public String getAuthContractId(Long contractId) {
+
 		BladeUser bladeUser = AuthUtil.getUser();
 		BladeUser bladeUser = AuthUtil.getUser();
 
 
-		return contractId;
+		return contractId == null?"":contractId.toString();
 	}
 	}
 
 
 	/**
 	/**
 	 * 施工则返回“C”,监理则返回“S”,其他返回“”
 	 * 施工则返回“C”,监理则返回“S”,其他返回“”
 	 * @return
 	 * @return
 	 */
 	 */
-	public String getAuthCode() {
+	public String getAuthCode(Long contractId) {
 		String code ="";
 		String code ="";
 		BladeUser bladeUser = AuthUtil.getUser();
 		BladeUser bladeUser = AuthUtil.getUser();
+		if (AuthUtil.isAdministrator() || contractId == null) {
+			return code;
+		}
+
+		//查询合同段信息
+		ContractInfo contractInfo = contractInfoService.getById(contractId);
+		switch (contractInfo.getContractType()){
+			case 2:
+				code = "S";
+				break;
+			case 3:
+				code = "";
+				break;
+			default:
+				code = "C";
+				break;
+		}
+
 		return code;
 		return code;
 	}
 	}
 
 

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

@@ -552,6 +552,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 excelTab.setStatus(3);
                 excelTab.setStatus(3);
                 baseMapper.updateById(excelTab);
                 baseMapper.updateById(excelTab);
                 connection.disconnect();
                 connection.disconnect();
+                System.out.println("123456");
             } catch (Exception e) {
             } catch (Exception e) {
                 editCallback.setError(1);
                 editCallback.setError(1);
                 e.printStackTrace();
                 e.printStackTrace();
@@ -1048,7 +1049,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "C:\\Users\\泓创开发\\Desktop";
+       // String file_path = "/Users/hongchuangyanfa/Desktop/";
 
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1089,7 +1090,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
 
         int all = sheet.getRow(0).getLastCellNum();
         int all = sheet.getRow(0).getLastCellNum();
         int mergedCellCnt = sheet.getNumMergedRegions();
         int mergedCellCnt = sheet.getNumMergedRegions();
-        List<Map<String, Integer>> titleList = new ArrayList<>();
         for (int i = 0; i < mergedCellCnt - 1; i++) {
         for (int i = 0; i < mergedCellCnt - 1; i++) {
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             int xx = mergedCell.getNumberOfCells();
             int xx = mergedCell.getNumberOfCells();
@@ -1100,39 +1100,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 short fontIndex = cell.getCellStyle().getFontIndex();
                 short fontIndex = cell.getCellStyle().getFontIndex();
                 Font fontAt = workbook.getFontAt(fontIndex);
                 Font fontAt = workbook.getFontAt(fontIndex);
                 short fontHeightInPoints = fontAt.getFontHeightInPoints();
                 short fontHeightInPoints = fontAt.getFontHeightInPoints();
-                if (fontHeightInPoints >= 14) {
-                    Map<String, Integer> titleMap = new HashMap<>();
-                    titleMap.put("index", i);
-                    titleMap.put("x", firsrCol);
-                    titleMap.put("y", fisRow);
-                    String data = cell.getStringCellValue();
-                    if (StringUtils.isNotEmpty(data)) {
-                        titleMap.put("val", 2);
-                    } else {
-                        titleMap.put("val", 1);
-                    }
-                    titleList.add(titleMap);
-                }
-            }
-        }
-
-        //添加标题
-        System.out.println(titleList.size());
-        if (titleList != null) {
-            if (titleList.size() == 1) {
-                Map<String, Integer> titData = titleList.get(0);
-                if (titData.get("val") == 1) {
-                    Cell cell = sheet.getRow(titData.get("y")).getCell(titData.get("x"));
+                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
                     cell.setCellValue(projectInfo.getProjectName());
                     cell.setCellValue(projectInfo.getProjectName());
-                }
-            } else if (titleList.size() >= 2) {
-                for (int i = 0; i < titleList.size(); i++) {
-                    Map<String, Integer> titData = titleList.get(i);
-                    if (titData.get("val") == 2) {
-                        Map<String, Integer> titData2 = titleList.get(i - 1);
-                        Cell cell = sheet.getRow(titData2.get("y")).getCell(titData2.get("x"));
-                        cell.setCellValue(projectInfo.getProjectName());
-                    }
+                    break;
                 }
                 }
             }
             }
         }
         }
@@ -1219,17 +1189,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
                                     FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
 
 
                                 } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
                                 } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
-                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                    String exceVal = cell.getStringCellValue().replaceAll(" ", "");
-                                    short fontIndex = cell.getCellStyle().getFontIndex();
-                                    Font fontAt = workbook.getFontAt(fontIndex);
-                                    fontAt.setFontName("EUDC");
-                                    cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                    Row row = sheet.getRow(y1 - 1);
+                                    if(row!=null){
+                                        Cell cell = row.getCell(x1 - 1);
+                                        if(cell!=null || ObjectUtils.isNotEmpty(cell)) {
+                                            String exceVal = cell.getStringCellValue().replaceAll(" ", "");
+                                            short fontIndex = cell.getCellStyle().getFontIndex();
+                                            Font fontAt = workbook.getFontAt(fontIndex);
+                                            fontAt.setFontName("EUDC");
+                                            cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                        }
+                                    }
                                 } else {
                                 } else {
-                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                                    cell.setCellValue(myData);
-
-
+                                    Row row = sheet.getRow(y1 - 1);
+                                    if(row!=null){
+                                        Cell cell = row.getCell(x1 - 1);
+                                        if(cell!=null || ObjectUtils.isNotEmpty(cell)){
+                                            cell.setCellValue(myData);
+                                        }
+                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }
@@ -1254,18 +1232,26 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
                         }
                         int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
                         int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
 
 
-                        Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
-                        cell.setCellValue(e.getId() + "");
-                        short fontIndex = cell.getCellStyle().getFontIndex();
-                        Font oldfontAt = workbook.getFontAt(fontIndex);
-
-                        Font redFont = workbook.createFont();
-                        redFont.setColor(IndexedColors.WHITE.getIndex());
-                        redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());
-                        redFont.setFontName(oldfontAt.getFontName());
-                        CellStyle cellStyle = workbook.createCellStyle();
-                        cellStyle.setFont(redFont);
-                        cell.setCellStyle(cellStyle);
+                        Row row = sheet.getRow(y1 - 1);
+                        if(row!=null){
+                            Cell cell = sheet.getRow(y1-1).getCell(x1-1);
+                            if(cell!=null || ObjectUtils.isNotEmpty(cell)){
+                                short fontIndex = cell.getCellStyle().getFontIndex();
+                                Font oldfontAt = workbook.getFontAt(fontIndex);
+
+                                Font redFont = workbook.createFont();
+                                redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
+                                redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
+                                redFont.setFontName(oldfontAt.getFontName());//设置字体
+
+                                CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
+                                newStyle.cloneStyleFrom(cell.getCellStyle());
+                                newStyle.setFont(redFont);
+                                cell.setCellStyle(newStyle);
+                                cell.setCellValue(e.getId() + "");
+                            }
+
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -1330,7 +1316,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "/Users/hongchuangyanfa/Desktop/";
+       // String file_path = "/Users/hongchuangyanfa/Desktop/";
         // 获取有权限的节点信息
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();
         List<String> data = new ArrayList<>();
@@ -1361,8 +1347,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         //获取当前填报节点sort
         //获取当前填报节点sort
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
 
 
-        // 合并pdf集合
-        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + (ObjectUtil.isNotEmpty(wbsTreeContract) ? wbsTreeContract.getSort() : 0) + " where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
+        // 获取顺序
+        int sort =0;
+        if(ObjectUtil.isNotEmpty(wbsTreeContract)){
+            if(wbsTreeContract.getSort()!=null){
+                sort = wbsTreeContract.getSort();
+            }
+        }
+        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = "+ sort +" where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         jdbcTemplate.execute(sql);
         jdbcTemplate.execute(sql);
     }
     }
 
 
@@ -1547,7 +1539,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 Element table = doc.select("table").first();
                 Element table = doc.select("table").first();
                 Elements trs = table.select("tr");
                 Elements trs = table.select("tr");
                 Elements cols = table.select("col");
                 Elements cols = table.select("col");
-
                 if (ObjectUtil.isNotEmpty(DataInfo)) {
                 if (ObjectUtil.isNotEmpty(DataInfo)) {
                     for (String val : DataInfo.keySet()) {
                     for (String val : DataInfo.keySet()) {
                         if (val.contains("__")) {
                         if (val.contains("__")) {
@@ -1559,7 +1550,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             if (data.html().contains("x1") && data.html().contains("y1")) {
                             if (data.html().contains("x1") && data.html().contains("y1")) {
                                 int x1 = 0;
                                 int x1 = 0;
                                 int y1 = 0;
                                 int y1 = 0;
-
                                 if (data.html().contains("el-tooltip")) {
                                 if (data.html().contains("el-tooltip")) {
                                     x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
                                     x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
                                     y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
                                     y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
@@ -1591,11 +1581,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                         myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
                                         myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
                                     }
                                     }
                                 }
                                 }
-                                //https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
                                 if (myData.contains("https") && myData.contains("aliyuncs")) {
                                 if (myData.contains("https") && myData.contains("aliyuncs")) {
-
                                     BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
                                     BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
-
                                     int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
                                     int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
                                     int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
                                     int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
                                     int picHeight = 0;
                                     int picHeight = 0;
@@ -1635,23 +1622,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
                                     ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
                                     pic.setAutoSize(true);
                                     pic.setAutoSize(true);
                                     pic.setWidth(picWidth - 10);
                                     pic.setWidth(picWidth - 10);
-
-                                    //System.out.println(sheet.get(y1, x1).getRowHeight());
-                                    //System.out.println(sheet.get(y1, x1).getRows());
                                     pic.setHeight(picHeight);
                                     pic.setHeight(picHeight);
                                     pic.setLeft(5);
                                     pic.setLeft(5);
                                 } else {
                                 } else {
                                     CellRange cellRange = sheet.getCellRange(y1, x1);
                                     CellRange cellRange = sheet.getCellRange(y1, x1);
                                     cellRange.getCellStyle().getExcelFont().setFontName("EUDC");
                                     cellRange.getCellStyle().getExcelFont().setFontName("EUDC");
                                     cellRange.setText(myData);
                                     cellRange.setText(myData);
-                                    //System.out.println(cellRange.getStyle().getFont().getFontName());
-                                    //System.out.println("后" + cellRange.getText());
                                 }
                                 }
                             }
                             }
                         }
                         }
                     }
                     }
                 }
                 }
-
                 // 组装电签设置
                 // 组装电签设置
                 QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
                 QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
                 queryWrapper.eq("type", 2);
                 queryWrapper.eq("type", 2);
@@ -1681,11 +1662,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         wb.saveToFile(excelPath, ExcelVersion.Version2010);
         wb.saveToFile(excelPath, ExcelVersion.Version2010);
         FileUtils.excelToPdf(excelPath, pdfPath);
         FileUtils.excelToPdf(excelPath, pdfPath);
         BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
         BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
-        TableFile tableFile1 = tableFileService.getBaseMapper().selectOne(Wrappers.<TableFile>query().lambda()
-                .eq(TableFile::getTabId, pkeyId + "")
-                .eq(TableFile::getType, 1)
-                .eq(TableFile::getTrialRecordId, id));
-
+        TableFile tableFile1 = tableFileService.getBaseMapper().selectOne(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1).eq(TableFile::getTrialRecordId, id));
         if (tableFile1 != null) {
         if (tableFile1 != null) {
             tableFile1.setDomainPdfUrl(bladeFile.getLink());
             tableFile1.setDomainPdfUrl(bladeFile.getLink());
             tableFileService.saveOrUpdate(tableFile1);
             tableFileService.saveOrUpdate(tableFile1);
@@ -1699,22 +1676,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             tableFile.setIsDeleted(0);
             tableFile.setIsDeleted(0);
             tableFile.setExtension(fileExtension);
             tableFile.setExtension(fileExtension);
             tableFile.setDomainPdfUrl(bladeFile.getLink());
             tableFile.setDomainPdfUrl(bladeFile.getLink());
-
             tableFile.setTrialRecordId(id);
             tableFile.setTrialRecordId(id);
-
             tableFileService.saveOrUpdate(tableFile);
             tableFileService.saveOrUpdate(tableFile);
         }
         }
 
 
         //获取当前试验记录的中的元素表的附件文件
         //获取当前试验记录的中的元素表的附件文件
-        List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda()
-                .eq(TableFile::getTabId, pkeyId + "")
-                .eq(TableFile::getTrialRecordId, id)
-        );
+        List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getTrialRecordId, id));
 
 
         if (tableFileList.size() > 0) {
         if (tableFileList.size() > 0) {
-
             tableFileList.sort(Comparator.comparing(TableFile::getType));
             tableFileList.sort(Comparator.comparing(TableFile::getType));
-
             List<String> dataListPdf = tableFileList.stream().filter(tableFile ->
             List<String> dataListPdf = tableFileList.stream().filter(tableFile ->
                     tableFile.getDomainPdfUrl() != null
                     tableFile.getDomainPdfUrl() != null
                             && (tableFile.getType() == 1 || tableFile.getType() == 2)
                             && (tableFile.getType() == 1 || tableFile.getType() == 2)
@@ -1755,7 +1725,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 多pdf
      * 试验 多pdf
      */
      */
     @Override
     @Override
-    public String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception {
+    public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //获取有权限的节点信息
         //获取有权限的节点信息
         String sql = "select * from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";
         String sql = "select * from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ")";

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

@@ -323,6 +323,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                 tableOwners = "1,2,3";
                 tableOwners = "1,2,3";
             } else if (tableOwner.equals("2")) {
             } else if (tableOwner.equals("2")) {
                 tableOwners = "4,5,6";
                 tableOwners = "4,5,6";
+            }else {
+                tableOwners = "7,8,9";
             }
             }
             tableOwnerList = Func.toStrList(tableOwners);
             tableOwnerList = Func.toStrList(tableOwners);
         }
         }