Bladeren bron

Merge branch 'dev' of http://219.151.181.73:3000/zhuwei/bladex into lihb

# Conflicts:
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
LHB 1 maand geleden
bovenliggende
commit
9089d411ab
61 gewijzigde bestanden met toevoegingen van 2703 en 347 verwijderingen
  1. 1 0
      blade-common/src/main/java/org/springblade/common/utils/FileUtils.java
  2. 6 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchivesAuto.java
  3. 21 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialMaterialMobilization.java
  4. 16 8
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/redissionUtil/DistributedRedisLock.java
  5. 54 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/SignConfigDTO.java
  6. 81 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfig.java
  7. 66 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfigRelation.java
  8. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ArchiveTreeContractClient.java
  9. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsParamClient.java
  10. 53 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigRelationVO.java
  11. 34 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigVO.java
  12. 4 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java
  13. 25 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsFormElementVO3.java
  14. 14 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractVO6.java
  15. 370 142
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/utils/TransUtil.java
  16. 3 3
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml
  17. 17 5
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java
  18. 329 4
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java
  19. 3 3
      blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FileUtils.java
  20. 17 8
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  21. 22 9
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  22. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.xml
  23. 9 8
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  24. 67 60
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  25. 4 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  26. 36 7
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java
  27. 8 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java
  28. 34 8
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  29. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeController.java
  30. 161 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  31. 178 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignConfigController.java
  32. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java
  33. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java
  34. 4 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  35. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ArchiveTreeContractImpl.java
  36. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsParamClientImpl.java
  37. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.java
  38. 15 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml
  39. 3 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml
  40. 44 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.java
  41. 90 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.xml
  42. 35 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.java
  43. 21 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.xml
  44. 6 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml
  45. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.java
  46. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml
  47. 12 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigRelationService.java
  48. 34 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigService.java
  49. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java
  50. 87 12
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractSyncImpl.java
  51. 63 22
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  52. 26 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  53. 38 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigRelationServiceImpl.java
  54. 381 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigServiceImpl.java
  55. 51 12
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
  56. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java
  57. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java
  58. 25 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java
  59. 48 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/SignConfigWrapper.java
  60. 1 1
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/InterimPayCertificateItemServiceImpl.java
  61. 53 14
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

+ 1 - 0
blade-common/src/main/java/org/springblade/common/utils/FileUtils.java

@@ -54,6 +54,7 @@ public class FileUtils {
                     Double fileLength = Double.parseDouble(contentLength + "");
                     file.setFileSize(Math.ceil(fileLength / 1024));
                 } catch (IOException e) {
+                    System.out.println("getOssFileSize errurl " + fileUrl);
                     e.printStackTrace();
                 }
                 reData.add(file);

+ 6 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchivesAuto.java

@@ -261,10 +261,16 @@ public class ArchivesAuto extends BaseEntity {
             this.setSecretLevel("4");
         }
 
+        //排序
+        if (autoVo.getOrderNum()!= null) {
+            this.setAutoFileSort(autoVo.getOrderNum());
+        }
 
         // 4. 设置默认值(根据业务需求)
         this.setIsAutoFile(0);
         this.setIsArchive(1);
         this.setIsDeleted(0);
     }
+
+    
 }

+ 21 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialMaterialMobilization.java

@@ -125,6 +125,13 @@ public class TrialMaterialMobilization extends BaseEntity {
     @Length(max = 255, message = "生产合格证最大长度255个字符")
     private String productionCertificate;
 
+    /**
+     * 生产合格证pdf url
+     */
+    @ApiModelProperty(value = "生产合格证 pdf url")
+    @Length(max = 255, message = "生产合格证pdf url最大长度255个字符")
+    private String productionCertificatePdfUrl;
+
     /**
      * 厂家质检报告
      */
@@ -132,6 +139,13 @@ public class TrialMaterialMobilization extends BaseEntity {
     @Length(max = 255, message = "厂家质检报告最大长度255个字符")
     private String qualityInspectionReport;
 
+    /**
+     * 厂家质检报告 pdf url
+     */
+    @ApiModelProperty(value = "厂家质检报告 pdf url")
+    @Length(max = 255, message = "厂家质检报告 pdf url最大长度255个字符")
+    private String qualityInspectionReportPdfUrl;
+
     /**
      * 其他附件
      */
@@ -139,6 +153,13 @@ public class TrialMaterialMobilization extends BaseEntity {
     @Length(max = 255, message = "其他附件最大长度255个字符")
     private String otherAccessories;
 
+    /**
+     * 其他附件 pdf url
+     */
+    @ApiModelProperty(value = "其他附件 pdf url")
+    @Length(max = 255, message = "其他附件 pdf url最大长度255个字符")
+    private String otherAccessoriesPdfUrl;
+
     /**
      * 排序
      */

+ 16 - 8
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/redissionUtil/DistributedRedisLock.java

@@ -14,8 +14,7 @@ import java.util.concurrent.TimeUnit;
 public class DistributedRedisLock {
 
     private static final Logger _log = Logger.getLogger(DistributedRedisLock.class);
-
-    private static final Config config = new Config();
+    private static volatile Redisson redisson;
 
     private static final String LOCK_TITLE = "redisLock_";
 
@@ -104,13 +103,22 @@ public class DistributedRedisLock {
     }
 
     private static Redisson getRedisson() {
-        config.useSingleServer()
-                .setAddress("redis://" + RedissonManager.SPRING_REDIS_HOST + ":" + RedissonManager.SPRING_REDIS_PORT)
-                .setConnectionPoolSize(500);
-        if (StringUtil.isNotEmpty(RedissonManager.SPRING_REDIS_PASSWORD)) {
-            config.useSingleServer().setPassword(RedissonManager.SPRING_REDIS_PASSWORD);
+        if (redisson == null) {
+            synchronized (DistributedRedisLock.class) {
+                if (redisson == null) {
+                    Config config = new Config();
+                    config.useSingleServer()
+                            .setAddress("redis://" + RedissonManager.SPRING_REDIS_HOST + ":" + RedissonManager.SPRING_REDIS_PORT)
+                            .setConnectionPoolSize(500);
+                    if (StringUtil.isNotEmpty(RedissonManager.SPRING_REDIS_PASSWORD)) {
+                        config.useSingleServer().setPassword(RedissonManager.SPRING_REDIS_PASSWORD);
+                    }
+                    redisson = (Redisson) Redisson.create(config);
+                    _log.info("Redisson instance created.");
+                }
+            }
         }
-        return (Redisson) Redisson.create(config);
+        return redisson;
     }
 
 }

+ 54 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/SignConfigDTO.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.TableInfo;
+
+import java.util.List;
+
+/**
+ * 实体主表信息数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-11-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigDTO extends SignConfig {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签元素id
+     */
+    @ApiModelProperty(value = "电签元素id")
+    private String elementId;
+    /**
+     * 元素表ids
+     */
+    @ApiModelProperty(value = "元素表ids")
+    private List<String> tableIds;
+    /**
+     * 角色ids
+     */
+    @ApiModelProperty(value = "角色ids")
+    private List<String> roleIds;
+
+}

+ 81 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfig.java

@@ -0,0 +1,81 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 电签配置表实体类
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@Data
+@TableName("m_sign_config")
+@EqualsAndHashCode(callSuper = true)
+public class SignConfig extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签元素名称
+     */
+    @ApiModelProperty(value = "电签元素名称")
+    @JsonProperty("eName")
+    private String eName;
+
+    /**
+     * 电签元素id
+     */
+    @ApiModelProperty(value = "电签元素id")
+    private Long eId;
+
+
+    /**
+     * 电签元素key
+     */
+    @ApiModelProperty(value = "电签元素key")
+    @JsonProperty("eKey")
+    private String eKey;
+
+    /**
+     * 元素类型,1:字符串、2:整数、3:小数、4:日期、5:数值、6:签名、7:文件、0:其他
+     */
+    @ApiModelProperty(value = "元素类型,1:字符串、2:整数、3:小数、4:日期、5:数值、6:签名、7:文件、0:其他")
+    private Integer elementType;
+
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty(value = "租户ID")
+    private String tenantId;
+
+
+    /**
+     * 元素表类型,0:所有、1:部分
+     */
+    @ApiModelProperty(value = "元素表类型,0:所有、1:部分")
+    private Integer tableType;
+
+
+}

+ 66 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignConfigRelation.java

@@ -0,0 +1,66 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 电签配置关联表实体类
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@Data
+@TableName("m_sign_config_relation")
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigRelation extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 电签配置id
+     */
+    @ApiModelProperty(value = "电签配置id")
+    private Long confId;
+    /**
+     * 关联的岗位/角色 id
+     */
+    @ApiModelProperty(value = "关联的岗位/角色 id")
+    private Long relationId;
+    /**
+     * 关联类型,0:元素表、1:角色
+     */
+    @ApiModelProperty(value = "关联类型,0:元素表、1:角色")
+    private Integer type;
+
+    /**
+     * 关联类型,0:元素表、1:角色
+     */
+    @ApiModelProperty(value = "关联的元素表、角色类型")
+    private Integer relationType;
+
+    /**
+     * 岗位/角色 名称
+     */
+    @ApiModelProperty(value = "关联的岗位/角色名称")
+    private String relationName;
+
+}

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

@@ -27,6 +27,9 @@ public interface ArchiveTreeContractClient {
     @PostMapping(API_PREFIX + "/getHavedFileNodeByProjectID")
     List<ArchiveTreeContract> getHavedFileNodeByProjectID(@RequestParam Long projectId);
 
+    @PostMapping(API_PREFIX + "/getTopAutoTypeNodeByProjectID")
+    List<ArchiveTreeContract> getTopAutoTypeNodeByProjectID(@RequestParam Long projectId);
+
     /**
      * 根据项目id获取所有数据
      */

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

@@ -2,6 +2,7 @@ package org.springblade.manager.feign;
 
 
 import org.springblade.manager.entity.WbsParam;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -23,4 +24,6 @@ public interface WbsParamClient {
     @GetMapping(API_PREFIX + "/getWbsParam")
     WbsParam getWbsParam(@RequestParam Long nodeId);
 
+    @PostMapping(API_PREFIX + "/createFileTitle")
+    String createFileTitle(@RequestBody WbsTreeContract contract);
 }

+ 53 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigRelationVO.java

@@ -0,0 +1,53 @@
+package org.springblade.manager.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Data
+public class SignConfigRelationVO  implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型")
+    private String type;
+
+    public static SignConfigRelationVO build(SignConfigRelation entity) {
+        SignConfigRelationVO vo = new SignConfigRelationVO();
+        vo.setId(entity.getRelationId());
+        vo.setName(entity.getRelationName());
+        if (entity.getType() == 1 &&  entity.getRelationType() != null) {
+            if (entity.getRelationType() == 1) {
+                vo.setType("施工方");
+            } else if (entity.getRelationType() == 2) {
+                vo.setType("监理方");
+            } else if (entity.getRelationType() == 3) {
+                vo.setType("业主方");
+            } else {
+                vo.setType("");
+            }
+        } else {
+            vo.setType(entity.getRelationType() + "");
+        }
+        return vo;
+    }
+    public static List<SignConfigRelationVO> build(List<SignConfigRelation> entityList) {
+        if (entityList == null) {
+            return new ArrayList<>();
+        }
+        return entityList.stream().map(SignConfigRelationVO::build).collect(Collectors.toList());
+    }
+}

+ 34 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignConfigVO.java

@@ -0,0 +1,34 @@
+package org.springblade.manager.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SignConfigVO extends SignConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "元素类型名称")
+    private String elementTypeName;
+
+    @ApiModelProperty(value = "岗位ids")
+    private List<String> roleIds;
+
+    @ApiModelProperty(value = "元素表ids")
+    private List<String> tableIds;
+
+    private List<SignConfigRelation> relations;
+}

+ 4 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.manager.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.springblade.manager.entity.TextdictInfo;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -34,4 +35,7 @@ public class TextdictInfoVO extends TextdictInfo {
     private String parentRoleId;
     //1.电签配置 2.系统识别
     private Integer showType;
+
+    @ApiModelProperty("是否引用系统级电签配置,1 系统级,0 项目级")
+    private Integer isSystem = 0;
 }

+ 25 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsFormElementVO3.java

@@ -0,0 +1,25 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.manager.entity.WbsFormElement;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class WbsFormElementVO3 implements Serializable {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 实体表名
+     */
+    private String eName;
+
+    private Integer eType;
+
+    private String eTypeName;
+}

+ 14 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractVO6.java

@@ -3,6 +3,7 @@ package org.springblade.manager.vo;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.core.tool.node.INode;
 import org.springblade.core.tool.node.TreeNode;
@@ -40,6 +41,10 @@ public class WbsTreeContractVO6 extends WbsTreeContract implements INode<WbsTree
 
     private Integer sort;
 
+    @ApiModelProperty(value = "1 水利工程 2是数字化")
+    private Integer nodeClass;
+
+
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     private Boolean hasChildren;
 
@@ -131,6 +136,15 @@ public class WbsTreeContractVO6 extends WbsTreeContract implements INode<WbsTree
         this.sort = sort;
     }
 
+    public Integer getNodeClass() {
+        return nodeClass;
+    }
+
+    public void setNodeClass(Integer nodeClass) {
+        this.nodeClass = nodeClass;
+    }
+
+
     @Override
     public String toString() {
         return "WbsTreeContractVO{" +

+ 370 - 142
blade-service/blade-archive/src/main/java/org/springblade/archive/external/utils/TransUtil.java

@@ -19,208 +19,431 @@ public class TransUtil {
     public static final Map<String, Long> EXTERNAL_TO_INTERNAL_NODE_ID_MAP = new LinkedHashMap<String, Long>() {{
         // 初始化默认映射关系(可按需添加)
 
-        //=================建设单位
+        //=================建设单位】====
         //军教工验收文件
-        put("3b843c05e00c4b65a1e666db80cf", 1892759789381877760L);
+//        put("3b843c05e00c4b65a1e666db80cf", 1892759789381877760L);
+//
+//        //征地拆迁
+//        put("ced7daa78cc040d1b731dfedd51f", 1892759789381877780L);
+//
+//        //工程文件
+//        put("e18bd5c3b1f7489b87d27594dee9", 1892759789381877794L);
+//
+//        //决算和审计文件
+//        put("442e7e595dce411abd984da1866d", 1892759789381877811L);
+
+        //====建设单位数字化扫描档案(第一部分 综合文件)
+        //三、征地拆迁资料
+        put("8d69b1589c8d47bcac6ee0579f21", 1927614316916244487L);
+
+        //=======建设单位数字化扫描档案(第二部分 决算和审计文件)
+        //一、支付报表及计算单
+        put("c3073682882249cb83fb87ef83d4", 1927614316916244492L);
 
-        //征地拆迁
-        put("ced7daa78cc040d1b731dfedd51f", 1892759789381877780L);
+        //====监理
+        //====================【第一总监】
 
-        //工程文件
-        put("e18bd5c3b1f7489b87d27594dee9", 1892759789381877794L);
+        //监理抽检资料
+        put("5d17cfbfcc134319b3bc2251d1cf", 1927992314584629254L);
+
+        //交工验收工程质量评定资料
+        put("e6189ff32e8c4b07ab2f89453a6a", 1927992314584629271L);
+
+        //NoJL1合同段数字化扫描档案
+        //一、监理管理文件
+        put("dfe39a7134c34aea833b51ecd889", 1927992314584629252L);
+        //一、监理管理文件
+        //(一)质量控制措施、规定
+        put("55fe4f6011294050b65210d814e0", 1927992314584629250L);
+        //(二)质量控制往来文件
+        put("f72d6d2c24564e01a456c8f49593", 1927992314584629253L);
+        //(三)监理独立抽检资料(试验)
+        put("972d06c557924952abaa8257dc71", 1927992314584629272L);
+        //(四)监理独立抽检报告
+        put("535f2dca3d4a4c6f84d3b154e961", 1927992314584629255L);
+        //三、工程进度计划管理文件
+        put("487c6416e2f34158838588773454", 1927992314584629286L);
+        //五、其它文件
+        put("5491ddc563e74ad4bbb4baddcb9f", 1927992314584629288L);
+        //六、其它资料
+        put("1817a9c924fc4a9686ab5b02e077", 1927992314584629296L);
+
+//        //印章启用文件、监理人员变更的函和批复文件
+//        put("465c2ebad85e44e9b4217d7ae415", 1892759789402849282L);
+//        //工程监理月报(2022年1月至2023年2月)
+//        put("ffce00c9bd7443d9b3d6ef63f885", 1902189729003851778L);
+//        //监理日志(张换丽)
+//        put("6e7ad41e5cd542f893a69ec7cebd", 1902189935200030722L);
+//        //监理日志(钟兆革)
+//        put("8d818ccbf39247cbb1f49ed3c7b0", 1902190429066743809L);
+//
+//        //原材料、设备及构件试验报告、记录 1902201113984880642
+//        put("89aaa0372cc24d14b3efdd788141", 1902200995105722370L);
+//
+//
+//        //试验检测汇总表
+//        put("0b023c2125664791a0511fc587f8", 1902205006567428097L);
+//        //原材料、半成品、成品报告
+//        put("bbc75d54e5d14b1f8368ce6fb51f", 1902206555712638977L);
+//        //机械连接、焊接报告
+//        put("402d59509f78443b88923f9c6876", 1902206715393986562L);
+//        //土工、配合比
+//        put("3650e321d07845e3b1a0a38bc1c2", 1902206873229840386L);
+//
+//
+//
+//        //就安全生产印发的实施方案
+//        put("eadf2038639446dcb40c4fe198c8", 1902198126172426241L);
+//        //2020年至2023年业主就安全生产检查的通报及整改回复
+//        put("9067f2889fbe42d0917f80d20978", 1902198303939612673L);
+
+
+        //=========【第二总监】======================
+
+        //监理抽检资料
+        put("216663852e784ba1a96a2980d663", 1927992314593017861L);
+
+        //交工验收工程质量评定资料
+        put("60c2a98a533842e09625ef74f728", 1927992314593017878L);
+
+        //原材料、设备及构件试验报告、记录
+        //put("6dec0a4c4a8e42a0a2b138e6e4ff", 1902200181465272322L);
+
+        //NoJL2合同段数字化扫描档案
+        //一、监理管理文件
+
+        //一、监理管理文件
+        //(一)质量控制措施、规定
+
+        //(二)质量控制往来文件
+
+        //(三)监理独立抽检资料(试验)
+
+        //(四)监理独立抽检报告
+
+        //三、工程进度计划管理文件
+        put("a341cabc10834e42836424489eb9", 1927992314593017893L);
+        //五、其它文件
+        put("1f452f1671cb4e188b3623924927", 1927992314593017895L);
+        //六、其它资料
+        put("8005d637346d4523b7af12fbaaaf", 1927992314593017903L);
 
-        //决算和审计文件
-        put("442e7e595dce411abd984da1866d", 1892759789381877811L);
 
-        //====监理
-        //=========第一总监
-        //印章启用文件、监理人员变更的函和批复文件
-        put("465c2ebad85e44e9b4217d7ae415", 1892759789402849282L);
-        //工程监理月报(2022年1月至2023年2月)
-        put("ffce00c9bd7443d9b3d6ef63f885", 1902189729003851778L);
-        //监理日志(张换丽)
-        put("6e7ad41e5cd542f893a69ec7cebd", 1902189935200030722L);
-        //监理日志(钟兆革)
-        put("8d818ccbf39247cbb1f49ed3c7b0", 1902190429066743809L);
-
-        //原材料、设备及构件试验报告、记录 1902201113984880642
-        put("89aaa0372cc24d14b3efdd788141", 1902200995105722370L);
-
-
-        //试验检测汇总表
-        put("0b023c2125664791a0511fc587f8", 1902205006567428097L);
-        //原材料、半成品、成品报告
-        put("bbc75d54e5d14b1f8368ce6fb51f", 1902206555712638977L);
-        //机械连接、焊接报告
-        put("402d59509f78443b88923f9c6876", 1902206715393986562L);
-        //土工、配合比
-        put("3650e321d07845e3b1a0a38bc1c2", 1902206873229840386L);
 
+        //=========【第三总监】
         //监理抽检资料
-        put("5d17cfbfcc134319b3bc2251d1cf", 1892759789402849302L);
+        put("91aee6c9b92e4a10806266fa9513", 1927992314593017914L);
+
+        //交工验收工程质量评定资料
+        put("a1029e86a1994ca0b7d6c4d5dbda", 1927992314593017931L);
+//        put("05ac2ef4857f468483924d51f90a", 1902638005113028610L);
+
+        //NoJL3合同段数字化扫描档案
+        //一、监理管理文件
+        put("26314b7d11c44533bea9ad8e277b", 1927992314593017910L);
+
+        //二、工程质量控制文件
+        //(一)质量控制措施、规定
+        put("02bcd9bcbdb044d1ba974bc5f24a", 1927992314593017912L);
+        //(二)质量控制往来文件
+        put("a749afe440a746e1b88594b8bb0b", 1927992314593017913L);
+        //(三)监理独立抽检资料(试验)
+        put("f1ed755800004c4cb46440bc7ecb", 1927992314593017932L);
+        //(四)监理独立抽检报告
+        put("7bb1ceb7d69941e5a22a3343c266", 1927992314593017915L);
+        //三、工程进度计划管理文件
+        put("0d73872e37a14328a667510da2b7", 1927992314593017946L);
+        //五、其它文件
+        put("633076005a33419b935261445a39", 1927992314593017948L);
+        //六、其它资料
+        put("863f42ce1acd4d60b157f6184ee2", 1927992314593017956L);
 
-        //就安全生产印发的实施方案
-        put("eadf2038639446dcb40c4fe198c8", 1902198126172426241L);
-        //2020年至2023年业主就安全生产检查的通报及整改回复
-        put("9067f2889fbe42d0917f80d20978", 1902198303939612673L);
 
 
-        //=========第二总监
 
-        //原材料、设备及构件试验报告、记录
-        put("6dec0a4c4a8e42a0a2b138e6e4ff", 1902200181465272322L);
 
+        //=========【第四总监】
+        //监理抽检资料
+        put("ad7896d5c0b74d988a02c342928c", 1927992314597212165L);
+
+        //交工验收质量评定
+        put("0679ddcea354420e893a00586737", 1927992314597212182L);
 
-        put("216663852e784ba1a96a2980d663", 1892759789407043606L);
 
-        //=========第三总监
-        put("05ac2ef4857f468483924d51f90a", 1902638005113028610L);
 
+        //NoJL4合同段数字化扫描档案
+        //一、监理管理文件
+        put("c46141f9c8dd4116b056a7db6a2d", 1927992314597212161L);
 
-        put("91aee6c9b92e4a10806266fa9513", 1892759789407043641L);
+        //二、工程质量控制文件
+        //(一)质量控制措施、规定
+        put("2dafbff0d0ae43bfa6bb64f35cab", 1927992314597212163L);
+        //(二)质量控制往来文件
+        put("67107bea233a4047a886bfd48014", 1927992314597212164L);
+        //(三)监理独立抽检资料(试验)
+        put("d1d5d934f6eb45eebb1616816cd5", 1927992314597212183L);
+        //(四)监理独立抽检报告
+        put("3a31de201c604f97a66c02836669", 1927992314597212166L);
+        //三、工程进度计划管理文件
+        put("ae9523597eac403ca8d7eb096840", 1927992314597212197L);
+        //五、其它文件
+        put("2ae858ae006443258446ebe892b9", 1927992314597212199L);
+        //六、其它资料
+        put("8c6913b1dacc45fe966a56d2ff56", 1927992314597212207L);
 
-        //=========第四总监
-        put("ad7896d5c0b74d988a02c342928c", 1892759789407043676L);
+
+
+        //=========【机电标总监】
+        //监理抽检资料
+        put("5b8da50309334dcbb8a02b3339bc", 1927992314597212218L);
 
         //交工验收质量评定
-        put("0679ddcea354420e893a00586737", 1892759789407043678L);
+        put("5831fc73d47a4f35b7df75e862df", 1927992314597212235L);
 
-        //管理文件
-        put("c46141f9c8dd4116b056a7db6a2d", 1892759789407043655L);
-        //计划文件
-        put("ae9523597eac403ca8d7eb096840", 1892759789407043679L);
 
 
-        //质量控制措施
-        put("2dafbff0d0ae43bfa6bb64f35cab", 1892759789407043671L);
-        //监理独立抽检
-        put("d1d5d934f6eb45eebb1616816cd5", 1892759789407043672L);
-        //监理独立报告
-        put("3a31de201c604f97a66c02836669", 1892759789407043673L);
+        //===========施工单位归档资料
 
-        //其他文件
-        put("2ae858ae006443258446ebe892b9", 1892759789407043686L);
 
-        //其他资料
-        put("8c6913b1dacc45fe966a56d2ff56", 1915963769346564097L);
 
 
-        //=========机电标总监
-        put("5b8da50309334dcbb8a02b3339bc", 1892759789407043711L);
 
 
 
 
+        //=====================【第一合同段】=======================================================
 
-        //===========施工单位归档资料
-        //=========第四合同段
-          //二工程管理文件
-            //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
-            put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
-
-            //施工准备文件 -5.工地试验室备案申请表及交通质监部门备案通知书、工地实验室成立、资质、授权
-            put("9144353d740c428ea46ca4228d22", 1892759789415432267L);
-         //三 施工质量控制文件
-            //原材
-            put("54dc995fc9814ecd81f6f25dc936", 1892759789415432282L);
-            //配合比
-             put("5f07af9ef5d14a2781cef179ef7c", 1892759789415432284L);
-            //试验报告
-             put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
-             //施工工序资料
-             put("075d3e8a3d48418f959283c55616", 1892759789415432286L);
-         //五 进度控制文件
-          //1 进度计划
-             put("31bc6b0a55cb4c408e292ee0fcdb", 1892759789415432296L);
-
-             //============================
-
-        //=========第三合同段
-            //二工程管理文件
-            //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
-            //put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
-
-            //三 施工质量控制文件
-            //原材
-            put("da9434c6a86147c0979ef09624dd", 1892759789415432221L);
-            //配合比
-            put("3080795a07544c2c972cc938da1f", 1892759789415432223L);
-            //试验报告
-            //put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
-            //施工工序资料
-            put("a1a4ea5ea88549c09c57b6da8e9e", 1892759789415432225L);
-            //五 进度控制文件
-            //1 进度计划
-            //put("31bc6b0a55cb4c408e292ee0fcdb", 1892759789415432296L);
-
-
-        //=========机电标
-        //二工程管理文件
-        //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
-        //put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
+        //评定
+        put("1984907813174e698cb7d473911d", 1927992893465690119L);
+        //施工工序资料
+        put("a22abc54ff8446e59760309263f7", 1927992893465690135L);
 
-        //三 施工质量控制文
+
+        //【No1合同段数字化扫描档案】
+        //二、工程管理文件
+        put("3f84d392080e4375b0f3a6467b22", 1927992893465690115L);
+
+        //三、施工质量控制文件   (一)工程质量管理文件
+        put("2f1c3a407b64441a83416def6c97", 1927992893465690118L);
+
+        //三、施工质量控制文件 (二)工地试验室成立
+        put("f363c765bab44c6082731d529f7f", 1927992893465690136L);
+
+        //三、施工质量控制文件 (四)仪器校准证书
+        put("4ec32cc441394a48a608571a361f", 1927992893465690137L);
+
+        //三、施工质量控制文件 (五)材料及标准试验
+        put("d5b62eb13097434fab99879ed98a", 1927992893465690120L);
+
+        //三、施工质量控制文件 (六)现场抽检试验检测报告
+        put("426db97ebf1a4de9b28153335342", 1927992893465690138L);
+
+        //四、安全文明施工文件
+        put("ff0f6b6962494df7b7b3f03539b2", 1927992893465690146L);
+
+        //五、进度控制文件
+        put("4fbcf1973adb481a89a36d8b9898", 1927992893465690147L);
+
+        //七、变更文件
+        put("2e203ab2574640c2895ac5196204", 1927992893465690162L);
+        //八、施工原始记录
+        put("f50cb7a3288848a88f99ee87e800", 1927992893465690149L);
+
+        //三 施工质量控制文件
+
+
+        //原材
+//        put("4620774da89544e7b8d815d65c01", 1892759789411237917L);
+//        //各种试验报告
+//        put("1929194d06794a6a940a761561f9", 1892759789411237920L);
+//        //配合比
+//        put("c05b1ab104f44875b264c52e81eb", 1892759789411237919L);
         //试验报告
         //put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
+
+
+
+        //=======================【第二合同段】=======================================
+
+        //评定
+        put("f6fb614a515440cb95676d99ce41", 1927992893469884422L);
+
         //施工工序资料
-        put("8a0aa647278548fa9edba59b78c4", 1892759789419626529L);
+        put("4707eb84188443b481398a15e8cf", 1927992893469884438L);
 
 
-        //=========第一合同段
         //二工程管理文件
-        put("3f84d392080e4375b0f3a6467b22", 1892759789411237894L);
 
-        //施工质量文件
-        put("2f1c3a407b64441a83416def6c97", 1892759789411237906L);
 
-        //工地
-        put("f363c765bab44c6082731d529f7f", 1892759789411237916L);
 
-        //仪器
-        put("4ec32cc441394a48a608571a361f", 1892759789411237922L);
 
-        //材料标准试验
-        put("d5b62eb13097434fab99879ed98a", 1915971643921637377L);
+        //三 施工质量控制文件
+        //原材
+        //put("87edcc42ba2b4859a1aec5191080", 1892759789411237978L);
+
+
 
-        //现场抽检
-        put("426db97ebf1a4de9b28153335342", 1915971747701301249L);
+        //【No2合同段数字化扫描档案】
+        //二、工程管理文件
+        put("c2ff86882ea5461084650afc89f4", 1927992893469884418L);
 
-        //安全文明
-        put("ff0f6b6962494df7b7b3f03539b2", 1892759789411237923L);
+        //三、施工质量控制文件   (一)工程质量管理文件
+        put("3b12c00d0fbc4cfbb73804aec5f2", 1927992893469884421L);
 
-        //进度管理文件
-        put("4fbcf1973adb481a89a36d8b9898", 1915965348099366914L);
+        //三、施工质量控制文件 (二)工地试验室成立
+        put("fdbd69cb41f94775b619bdaa3c6e", 1927992893469884439L);
 
-        //变更文件
-        put("2e203ab2574640c2895ac5196204", 1915965498528079873L);
-        //施工原始记录
-        put("f50cb7a3288848a88f99ee87e800", 1915965617583398913L);
+        //三、施工质量控制文件 (四)仪器校准证书
+        put("5501ee640af0481ab4c447dfe201", 1927992893469884440L);
 
-        //三 施工质量控制文件
+        //三、施工质量控制文件 (五)材料及标准试验
+        put("f6fff76903254aeab4511376fed5", 1927992893469884423L);
+
+        //三、施工质量控制文件 (六)现场抽检试验检测报告
+        put("020567726035400a971f95f5a585", 1927992893469884441L);
+
+        //四、安全文明施工文件
+        put("e8e2af76849d4fe392fbfec50156", 1927992893469884449L);
+
+        //五、进度控制文件
+        put("9f7b03959db646f791a1b2581ed2", 1927992893469884450L);
+
+        //七、变更文件
+        put("e04b9db2c50749629bf8a01bf6f3", 1927992893469884465L);
+        //八、施工原始记录
+        put("44c6ef4bacb144d18f06742a2c27", 1927992893469884452L);
+
+        //=========第三合同段================================================
 
         //评定
-        put("1984907813174e698cb7d473911d", 1892759789411237907L);
+        put("0372bb19089347e7aca7683fdd37", 1927992893469884472L);
+
+        //施工工序资料
+        put("a1a4ea5ea88549c09c57b6da8e9e", 1927992893469884488L);
+
+
+        //二工程管理文件
+        //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
+        //put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
+
+        //三 施工质量控制文件
         //原材
-        put("4620774da89544e7b8d815d65c01", 1892759789411237917L);
-        //各种试验报告
-        put("1929194d06794a6a940a761561f9", 1892759789411237920L);
+        put("da9434c6a86147c0979ef09624dd", 1892759789415432221L);
         //配合比
-        put("c05b1ab104f44875b264c52e81eb", 1892759789411237919L);
+        put("3080795a07544c2c972cc938da1f", 1892759789415432223L);
+
+
+        //No3合同段数字化扫描档案
+        //二、工程管理文件
+        put("a6f86360805e494dbd048f0ade6c", 1927992893469884468L);
+
+        //三、施工质量控制文件   (一)工程质量管理文件
+        put("b3fcf7f41c8c475c951bc9dcca9d", 1927992893469884471L);
+
+        //三、施工质量控制文件 (二)工地试验室成立
+        put("fa8b6b2292df4663b7520e69acc8", 1927992893469884489L);
+
+        //三、施工质量控制文件 (四)仪器校准证书
+        put("837670159d8e46eb997c0bdc786a", 1927992893469884490L);
+
+        //三、施工质量控制文件 (五)材料及标准试验
+        put("cfdf96cdaf474f01924861db5828", 1927992893469884473L);
+
+        //三、施工质量控制文件 (六)现场抽检试验检测报告
+        put("70dda230cbca40a4b34004aa03f5", 1927992893469884491L);
+
+        //四、安全文明施工文件
+        put("a5f598023ed4402ba1859ff8d1fa", 1927992893469884499L);
+
+        //五、进度控制文件
+        put("9f3d46f37d194604925ab6bf1f30", 1927992893469884500L);
+
+        //七、变更文件
+        put("7eccf837cfb649c69086427ef9e3", 1927992893469884515L);
+        //八、施工原始记录
+        put("9706a2a21284470eb9625a0417ce", 1927992893469884502L);
+
         //试验报告
         //put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
+
+        //五 进度控制文件
+        //1 进度计划
+        //put("31bc6b0a55cb4c408e292ee0fcdb", 1892759789415432296L);
+
+        //================================【第四合同段】=======================================
+
+        //评定
+        put("ea82c02057f64424948c02a1144f", 1927992893474078726L);
+
         //施工工序资料
-        put("a22abc54ff8446e59760309263f7", 1892759789411237921L);
+        put("075d3e8a3d48418f959283c55616", 1927992893474078742L);
+
+        //No4合同段数字化扫描档案
+        //二工程管理文件
+        put("f0ed754f4068424b9f86a6450674", 1927992893474078722L);
+
+        //二、工程管理文件
+        //(一)工程质量管理文件
+        put("d6862df110b84c18b68c69c84903", 1927992893474078725L);
+
+        //(二)工地试验成立
+        put("30d615fc781244f68f19d2e7c2d3", 1927992893474078743L);
+
+        //(四)仪器校准证书
+        put("2f3bb1a2d7684fae81261f1c68be", 1927992893474078744L);
+
+        //(五)材料及标准试验
+        put("4d5b3a8cb22e422cbc9e89c85a7a", 1927992893474078727L);
+
+        //(六)现场抽检试验检测报告
+        put("d37d15a6893d4f26b7fa326cab98", 1927992893474078745L);
+
+        //四、安全文明施工文件
+        put("eecc8d374650469b87b04af099c3", 1927992893474078753L);
+        //五、进度控制文件
+        put("74a3f78dff114518b3ebd1800562", 1927992893474078754L);
+        //七、变更文件
+        put("c37db7bb196b411ca59b99fad259", 1927992893474078769L);
+        //八、施工原始记录
+        put("04f0816131814923bd4e7d2d2e20", 1927992893474078756L);
 
 
-        //=========第二合同段
         //二工程管理文件
+        //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
+//        put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
+//
+//        //施工准备文件 -5.工地试验室备案申请表及交通质监部门备案通知书、工地实验室成立、资质、授权
+//        put("9144353d740c428ea46ca4228d22", 1892759789415432267L);
+//        //三 施工质量控制文件
+//        //原材
+//        put("54dc995fc9814ecd81f6f25dc936", 1892759789415432282L);
+//        //配合比
+//        put("5f07af9ef5d14a2781cef179ef7c", 1892759789415432284L);
+//        //试验报告
+//        put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
+//
+//        //五 进度控制文件
+//        //1 进度计划
+//        put("31bc6b0a55cb4c408e292ee0fcdb", 1892759789415432296L);
+
+
+        //============================
+
+        //======================【机电标】==============================================
 
-        //三 施工质量控制文件
-        //原材
-        put("87edcc42ba2b4859a1aec5191080", 1892759789411237978L);
+        //评定
+        put("1cb9ca589d2840cba3ce49b18494", 1927992893474078776L);
 
         //施工工序资料
-        put("4707eb84188443b481398a15e8cf", 1892759789411237982L);
+        put("8a0aa647278548fa9edba59b78c4", 1927992893474078792L);
+        //二工程管理文件
+        //施工准备文件 -1.施工项目部组建、印章启用、人员任命文件,进场人员资质报审文件,施工设备仪器进场报审文件、设备仪器校验、率定文件
+        //put("0b0ac82851d7484bba414bb1ccbd", 1892759789415432263L);
+
+        //三 施工质量控制文
+        //试验报告
+        //put("ffe1d44383ed4f438d29b73b7dbb", 1892759789415432285L);
+
 
     }};
 
@@ -310,6 +533,11 @@ public class TransUtil {
         put("relation_typestr", "关系类型");
         put("relationstr", "关系");
         put("relationstrids", "相关实体标识");
+
+        put("fill_user", "创建用户");
+        put("fill_time", "创建时间");
+        put("fill_user1", "修改用户");
+        put("fill_time1", "修改时间");
     }};
 
 

+ 3 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml

@@ -559,7 +559,7 @@
         select uaa.*
         from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id left join
         u_archive_file uaf on uaa.id = uaf.archive_id
-        where uaa.is_deleted = 0 and uaa.is_archive = 1
+        where uaa.is_deleted = 0  and matc.is_deleted = 0 and uaa.is_archive = 1
             and matc.project_id = #{vo.projectId}
         <if test="vo.contractId != null and vo.contractId != ''">
             and uaa.contract_id = #{vo.contractId} and matc.contract_id = #{vo.contractId}
@@ -607,7 +607,7 @@
     <select id="pageByArchivesAuto11" resultMap="archivesAutoResultMap">
         select uaa.*
         from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id
-        where uaa.is_deleted = 0 and uaa.is_archive = 1
+        where uaa.is_deleted = 0 and matc.is_deleted = 0 and uaa.is_archive = 1
         <if test="vo.queryValue != null and vo.queryValue != ''">
             and (uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%'))
         </if>
@@ -1370,7 +1370,7 @@
     <select id="getMetadaFileByFileIds" resultType="java.util.Map">
         SELECT id,file_id
         FROM u_metadata_file
-        WHERE file_id IN
+        WHERE  is_deleted=0 and file_id IN
         <foreach collection="fileIds" item="fileId" open="(" close=")" separator=",">
             #{fileId}
         </foreach>

+ 17 - 5
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java

@@ -73,10 +73,10 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 //        URL_MAP.put("r_Archives_spare", "https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230414/3798f8c3db6f94c8fce63eec8c716d6c.xlsx");
 //        URL_MAP.put("r_Archives_back", "https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230413/31081917b41e12b9b0359f6a9c1755bd.xlsx");
 
-        URL_MAP.put("r_Archives_front", "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20230413/306c87ffc640699aa92d53a5f4e6d632.xlsx");
-        URL_MAP.put("r_Archives_catalog", "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20230413/f2a083fca685c646e4a47daaaa46f04b.xlsx");
-        URL_MAP.put("r_Archives_spare", "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20230414/3798f8c3db6f94c8fce63eec8c716d6c.xlsx");
-        URL_MAP.put("r_Archives_back", "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20230413/31081917b41e12b9b0359f6a9c1755bd.xlsx");
+        URL_MAP.put("r_Archives_front", "https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20230413/306c87ffc640699aa92d53a5f4e6d632.xlsx");
+        URL_MAP.put("r_Archives_catalog", "https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20230413/f2a083fca685c646e4a47daaaa46f04b.xlsx");
+        URL_MAP.put("r_Archives_spare", "https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20230414/3798f8c3db6f94c8fce63eec8c716d6c.xlsx");
+        URL_MAP.put("r_Archives_back", "https://xinan1.zos.ctyun.cn/blade-oss-chongqing/upload/20230413/31081917b41e12b9b0359f6a9c1755bd.xlsx");
 
         NAME_MAP.put("r_Archives_front", "封面");
         NAME_MAP.put("r_Archives_catalog", "卷内目录");
@@ -551,6 +551,18 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
             }
         }
 
+        if ("Archive['secretLevel']".equals(formula)){
+            if (object!= null ) {
+                String strObject = object.toString();
+                if (strObject.contains("null")) {
+                    strObject = strObject.replace("null", "");
+                    object =  strObject;
+                }
+            }else {
+                object = "";
+            }
+        }
+
         dataInfo.put(key, object);
     }
 
@@ -626,7 +638,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
                     String myData = DataInfo.get(val) + "";
 
 
-                    if (myData.indexOf("http") >= 0 && (myData.indexOf("aliyuncs") >= 0 ||myData.indexOf("183.247.216.148") >= 0)) {
+                    if (myData.indexOf("http") >= 0 && (myData.indexOf("ctyun") >= 0 ||myData.indexOf("183.247.216.148") >= 0)) {
 
                         InputStream imageIn = CommonUtil.getOSSInputStream(myData);
                         byte[] bytes = IOUtils.toByteArray(imageIn);

+ 329 - 4
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -729,6 +729,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		//步list = {ArrayList@18238}  size = 19骤二:查询归档树节点。存在未归档文件的节点。
 		List<ArchiveTreeContract> list = archiveTreeContractClient.getHavedFileNodeByProjectID(projectId);
 
+		List<ArchiveTreeContract> listTop = archiveTreeContractClient.getTopAutoTypeNodeByProjectID(projectId);
+
 
 		if (nodeId != null) {
 			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
@@ -772,7 +774,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		archiveAutoMethod3(list3, boxMap, boxFileMap, traceId);//单独组卷
 		//设置完成度30%
 		projectClient.updateIsArchivesAutoById(projectId, 30);
-		archiveAutoMethod2(list2, projectId, boxMap, boxFileMap, traceId);//分类组卷
+		archiveAutoMethod2_new(list2, listTop,projectId, boxMap, boxFileMap, traceId);//分类组卷
 		//设置完成度50%
 		projectClient.updateIsArchivesAutoById(projectId, 50);
 		archiveAutoMethod1(list1, boxMap, boxFileMap, traceId);//默认组卷
@@ -1278,7 +1280,23 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		if (selectList== null || selectList.size() == 0) {
 			return;
 		}
+
+		if (waitArchiveFiles==null || waitArchiveFiles.size()== 0) {
+			return;
+		}
+
+		String strfirstNodeId = waitArchiveFiles.get(0).getNodeId();
+
 		ArchiveTreeContract node = selectList.get(0);
+		if (StringUtils.isNotEmpty(strfirstNodeId)) {
+			Long firstNodeId = Long.parseLong(strfirstNodeId);
+			ArchiveTreeContract firstNode = archiveTreeContractClient.getArchiveTreeContractById(firstNodeId);
+			if (firstNode!= null) {
+				node = firstNode;
+			}
+		}
+
+
 		//获取案卷文件起止时间
 		String archiveStartDateAndEndDate = getArchiveStartDateAndEndDate(waitArchiveFiles);
 		String[] split = archiveStartDateAndEndDate.split(",");
@@ -1523,13 +1541,117 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		}
 	}
 
+	private void archiveAutoMethod3(List<ArchiveTreeContract> list, Map<String, List<ArchiveFile>> boxMap,
+									Map<Long, String> boxFileMap, Long traceId) {
+		// 步骤1:遍历节点集合
+		for (ArchiveTreeContract node : list) {
+			// 步骤2:获取当前节点的案卷规格
+			String specificationStr = node.getSpecification();
+			if (StringUtils.isEmpty(specificationStr)) {
+				specificationStr = "30";
+			}
+			int specification = Integer.parseInt(specificationStr);
+			int specificationSize = specification * 10;
+
+			// 步骤3:查询节点下的未组卷文件
+			List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString());
+			if (archiveFiles == null || archiveFiles.isEmpty()) {
+				continue;
+			}
+
+			// 记录节点文件数量日志
+			String completeMsg = "[自动组卷] 单独组卷:" + "-traceId:" + traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
+			iTraceLogService.saveLog(traceId, completeMsg);
+
+			// 步骤4:遍历未归档文件
+			List<ArchiveFile> waitArchiveFiles = new ArrayList<>();  // 待组卷文件集合
+			int archivesSize = 0;  // 待组卷文件总页数
+			int archiveFilesSize = 0;
+
+			for (ArchiveFile file : archiveFiles) {
+				archiveFilesSize++;
+
+				// 步骤5:判断文件是否存在分盒设置
+				if (file.getBoxNumber() != null && file.getBoxNumber() != -1) {
+					// 添加到分盒文件集合
+					addBoxMap(file, boxMap, boxFileMap);
+
+					// 如果是最后一个文件且有待组卷文件,则组卷
+					if (archiveFilesSize == archiveFiles.size() && !waitArchiveFiles.isEmpty()) {
+						createArchive3(waitArchiveFiles, node, archivesSize);
+						waitArchiveFiles.clear();
+						archivesSize = 0;
+					}
+				} else {
+					// 非分盒文件处理
+					Integer filePage = file.getFilePage() != null ? file.getFilePage() : 0;
+
+					// 步骤6:检查规格状态
+					int tempTotalSize = archivesSize + filePage;
+					int checkStatus = checkSpecificationSize(specificationSize, tempTotalSize);
+
+					// 6.1 未到规格
+					if (checkStatus == 0) {
+						waitArchiveFiles.add(file);
+						archivesSize = tempTotalSize;
+
+						// 最后一个文件直接组卷
+						if (archiveFilesSize == archiveFiles.size()) {
+							createArchive3(waitArchiveFiles, node, archivesSize);
+							waitArchiveFiles.clear();
+							archivesSize = 0;
+						}
+					}
+					// 6.2 达到规格
+					else if (checkStatus == 1) {
+						waitArchiveFiles.add(file);
+						archivesSize = tempTotalSize;
+						createArchive3(waitArchiveFiles, node, archivesSize);
+
+						// 重置待组卷集合
+						waitArchiveFiles.clear();
+						archivesSize = 0;
+					}
+					// 6.3 超出规格
+					else if (checkStatus == -1) {
+						if (!waitArchiveFiles.isEmpty()) {
+							// 先将现有集合组卷(不含当前文件)
+							createArchive3(waitArchiveFiles, node, archivesSize);
+
+							// 新建集合存放当前文件
+							waitArchiveFiles.clear();
+							waitArchiveFiles.add(file);
+							archivesSize = filePage;
+
+							// 最后一个文件直接组卷
+							if (archiveFilesSize == archiveFiles.size()) {
+								createArchive3(waitArchiveFiles, node, archivesSize);
+								waitArchiveFiles.clear();
+								archivesSize = 0;
+							}
+						} else {
+							// 当前文件单独成卷
+							waitArchiveFiles.add(file);
+							archivesSize = filePage;
+							createArchive3(waitArchiveFiles, node, archivesSize);
+
+							// 重置集合
+							waitArchiveFiles.clear();
+							archivesSize = 0;
+						}
+					}
+				}
+			}
+		}
+	}
+
 	/**
-	 * 单租组卷流程  20230628 SBD又说单独组卷规则节点下只组一卷,不用满规格新组。这辈子没见过这样的人。
+	 * 单租组卷流程  20230628 SBD又说单独组卷规则节点下只组一卷,不用满规格新组。
 	 *
 	 * @param list
 	 * @param boxMap
 	 */
-	private void archiveAutoMethod3(List<ArchiveTreeContract> list, Map<String, List<ArchiveFile>> boxMap, Map<Long, String> boxFileMap, Long traceId) {
+	private void archiveAutoMethod3_1(List<ArchiveTreeContract> list, Map<String, List<ArchiveFile>> boxMap, Map<Long, String> boxFileMap, Long traceId) {
 		//步骤1:遍历节点集合
 		for (ArchiveTreeContract node : list) {
 			//步骤2:查询节点下的未组卷文件
@@ -1623,11 +1745,177 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			Long archiveAutoGroupId = entry.getKey();
 			List<ArchiveFile> archiveFiles = entry.getValue();
 			//一个archiveAutoGroupId组成一个案卷  案卷归属同个key的归档树节点select=1的第一个groupId2NodeIdMap
-			createArchive2(archiveFiles, archiveAutoGroupId, projectId);
+			//createArchive2(archiveFiles, archiveAutoGroupId, projectId);
+
+			archiveAutoMethodGroup(archiveFiles, archiveAutoGroupId, projectId);
+		}
+
+	}
+
+
+	private void archiveAutoMethod2_new(List<ArchiveTreeContract> list, List<ArchiveTreeContract> topList, Long projectId,
+										Map<String, List<ArchiveFile>> boxMap, Map<Long, String> boxFileMap, Long traceId) {
+
+		// 分类并卷集合<groupId, List<文件>>
+		Map<Long, List<ArchiveFile>> archiveMap = new LinkedHashMap<>();
+		// 记录同个分组id对应的第一个节点ID(案卷归属节点)
+		Map<Long, Long> groupId2NodeIdMap = new HashMap<>();
+
+		// 当前处理的顶层节点ID
+		Long curTopId = null;
+		// 当前顶层节点对应的分组ID
+		Long currArchiveAutoGroupId = null;
+
+		// 步骤1:遍历节点集合
+		for (ArchiveTreeContract node : list) {
+			// 初始化当前节点的分组ID和顶层节点ID
+			Long archiveAutoGroupId = node.getArchiveAutoGroupId();
+			Long nodeTopId = 0L;
+
+			// 步骤2:查找当前节点的顶层节点ID
+			for (ArchiveTreeContract topNode : topList) {
+				Long topId = topNode.getId();
+				// 检查当前节点是否属于此顶层节点
+				if (node.getAncestors() != null &&
+						node.getAncestors().contains(topId.toString())) {
+					nodeTopId = topId;
+					break;
+				}
+			}
+
+			// 步骤3:确定当前节点的分组ID
+			if (curTopId != null && curTopId.equals(nodeTopId) && nodeTopId != 0) {
+				// 如果属于同一个非零顶层节点,使用之前的分组ID
+				archiveAutoGroupId = currArchiveAutoGroupId;
+			} else {
+				// 新顶层节点或没有顶层节点,更新当前分组信息
+				curTopId = nodeTopId;
+				currArchiveAutoGroupId = archiveAutoGroupId;
+			}
+
+			// 步骤4:查询节点下的未归档文件
+			List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString());
+
+			if (archiveFiles != null && !archiveFiles.isEmpty()) {
+				// 记录日志(每个节点只记录一次)
+				String completeMsg = "[自动组卷] 分类组卷:" + "-traceId:" + traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
+				iTraceLogService.saveLog(traceId, completeMsg);
+
+				// 步骤5:遍历未归档文件
+				for (ArchiveFile file : archiveFiles) {
+					// 步骤6:判断文件是否存在分盒设置
+					if (file.getBoxNumber() != null && file.getBoxNumber() != -1) {
+						// 添加到分盒文件集合
+						addBoxMap(file, boxMap, boxFileMap);
+					} else {
+						// 分类并卷流程
+						// 步骤7:将文件按照<groupId,List<文件>>放入集合
+						if (archiveMap.containsKey(archiveAutoGroupId)) {
+							List<ArchiveFile> groupList = archiveMap.get(archiveAutoGroupId);
+							groupList.add(file);
+						} else {
+							List<ArchiveFile> groupList = new ArrayList<>();
+							groupList.add(file);
+							archiveMap.put(archiveAutoGroupId, groupList);
+							groupId2NodeIdMap.put(archiveAutoGroupId, node.getId());
+						}
+					}
+				}
+			}
 		}
 
+		// 步骤8:按集合创建案卷
+		for (Map.Entry<Long, List<ArchiveFile>> entry : archiveMap.entrySet()) {
+			Long archiveAutoGroupId = entry.getKey();
+			List<ArchiveFile> archiveFiles = entry.getValue();
+
+			// 同一个分组ID下的文件分组组卷
+			archiveAutoMethodGroup(archiveFiles, archiveAutoGroupId, projectId);
+		}
 	}
 
+	private void archiveAutoMethodGroup(List<ArchiveFile> archiveFiles, Long archiveAutoGroupId, Long projectId) {
+		if (archiveFiles.size()==0) {
+			return;
+		}
+
+		// 获取分组规格(取第一个文件的节点规格作为分组规格)
+		int specificationSize = 300; // 默认规格(300页)
+		if (archiveFiles.get(0).getNodeId() != null) {
+			// 查询文件所在节点的规格
+			Long nodeId = Long.parseLong(archiveFiles.get(0).getNodeId());
+			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
+			//ArchiveTreeContract node = archiveTreeClient.getNodeById(archiveFiles.get(0).getNodeId());
+			if (node != null && !StringUtils.isEmpty(node.getSpecification())) {
+				try {
+					specificationSize = Integer.parseInt(node.getSpecification()) * 10;
+				} catch (NumberFormatException e) {
+					// 规格格式错误时使用默认值
+					log.error("规格格式错误: {}", node.getSpecification(), e);
+				}
+			}
+		}
+
+		// 待组卷文件集合
+		List<ArchiveFile> waitArchiveFiles = new ArrayList<>();
+		// 待组卷文件总页数
+		int archivesSize = 0;
+
+		// 遍历文件列表
+		int fileIndex = 0;
+		int totalFiles = archiveFiles.size();
+
+		for (ArchiveFile file : archiveFiles) {
+			fileIndex++;
+			// 获取文件页数,处理null值
+			int filePage = file.getFilePage() != null ? file.getFilePage() : 0;
+
+			// 计算临时总页数
+			int tempTotalSize = archivesSize + filePage;
+
+			// 检查规格状态
+			int checkStatus = checkSpecificationSize(specificationSize, tempTotalSize);
+
+			// 处理不同检查状态
+			switch (checkStatus) {
+				case 0: // 未到规格
+					waitArchiveFiles.add(file);
+					archivesSize = tempTotalSize;
+					if (fileIndex == totalFiles) { // 是最后一个文件
+						createArchive2(waitArchiveFiles, archiveAutoGroupId, projectId);
+					}
+					break;
+
+				case 1: // 达到规格
+					waitArchiveFiles.add(file);
+					createArchive2(waitArchiveFiles, archiveAutoGroupId, projectId);
+					waitArchiveFiles = new ArrayList<>();
+					archivesSize = 0;
+					break;
+
+				case -1: // 超出规格
+					if (waitArchiveFiles.isEmpty()) {
+						// 当前文件单独成卷
+						createArchive2(Collections.singletonList(file), archiveAutoGroupId, projectId);
+					} else {
+						// 先将现有文件组卷
+						createArchive2(waitArchiveFiles, archiveAutoGroupId, projectId);
+
+						// 创建新的待组卷集合
+						waitArchiveFiles = new ArrayList<>();
+						waitArchiveFiles.add(file);
+						archivesSize = filePage;
+
+						if (fileIndex == totalFiles) { // 是最后一个文件
+							createArchive2(waitArchiveFiles, archiveAutoGroupId, projectId);
+						}
+					}
+					break;
+			}
+		}
+	}
+
+
 	/**
 	 * 默认组卷流程 文件可以跨节点组卷,受最高并卷节点限制范围,跨节点文件组卷时,案卷规格按照第一个文件所在的节点规格 组卷。
 	 */
@@ -2414,7 +2702,44 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * @param nodeId               筛选条件:节点编号
 	 * @return 符合条件的档案列表
 	 */
+
 	public List<ArchiveTreeContract> archiveTreeContractFilterNum(List<ArchiveTreeContract> archiveTreeContracts, String treeCode, String nodeId, Long contractId) {
+		if (contractId == null) {
+			return archiveTreeContracts;
+		}
+
+		List<ArchiveTreeContract> result = new ArrayList<>();
+		for (ArchiveTreeContract contract : archiveTreeContracts) {
+			// 核心逻辑:nodeId不为空时必须满足祖先/ID条件
+			if (StringUtils.isNotEmpty(nodeId)) {
+				boolean matchesNode = (StringUtils.isNotEmpty(contract.getAncestors()) && contract.getAncestors().contains(nodeId))
+						|| contract.getId().toString().equals(nodeId);
+				if (!matchesNode) {
+					continue; // 不满足node条件直接跳过
+				}
+			}
+
+			// 根据treeCode决定额外条件
+			boolean isOwnerContract = StringUtils.isEmpty(treeCode); // 业主合同段标识
+			boolean passesOwnerCheck = contractId.toString().equals(contract.getTreeCode())
+					|| contractId.equals(contract.getContractId())
+					|| StringUtils.isEmpty(contract.getTreeCode());
+
+			if (isOwnerContract) {
+				// 业主合同段:仅需额外检查(nodeId为空时)
+				if (passesOwnerCheck) {
+					result.add(contract);
+				}
+			} else {
+				// 非业主合同段:treeCode匹配或额外检查
+				if (treeCode.equals(contract.getTreeCode()) || passesOwnerCheck) {
+					result.add(contract);
+				}
+			}
+		}
+		return result;
+	}
+	public List<ArchiveTreeContract> archiveTreeContractFilterNum1(List<ArchiveTreeContract> archiveTreeContracts, String treeCode, String nodeId, Long contractId) {
 		List<ArchiveTreeContract> result = new ArrayList<>();
 
 		if (contractId == null) {

+ 3 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FileUtils.java

@@ -293,7 +293,7 @@ public class FileUtils {
 
             for (String urlStr : urlList) {
                 try {
-                    if (urlStr.indexOf("https") >= 0 && urlStr.indexOf("aliyuncs") >= 0) {
+                    if (urlStr.indexOf("https") >= 0 && urlStr.indexOf("ctyun") >= 0) {
                         int lastIndexOf = urlStr.lastIndexOf("/");
                         String prefix = urlStr.substring(0, lastIndexOf + 1);
                         String suffix = urlStr.substring(lastIndexOf + 1);
@@ -516,7 +516,7 @@ public class FileUtils {
 
                     String fileNameWithoutExtension = fileNameWithExtension.substring(0, fileNameWithExtension.lastIndexOf("."));
 
-                    if (url.indexOf("https") >= 0 && url.indexOf("aliyuncs") >= 0) {
+                    if (url.indexOf("https") >= 0 && url.indexOf("ctyun") >= 0) {
                         int lastIndexOf = url.lastIndexOf("/");
                         String prefix = url.substring(0, lastIndexOf + 1);
                         String suffix = url.substring(lastIndexOf + 1);
@@ -661,7 +661,7 @@ public class FileUtils {
 
                     String fileNameWithoutExtension = fileNameWithExtension.substring(0, fileNameWithExtension.lastIndexOf("."));
 
-                    if (url.indexOf("https") >= 0 && url.indexOf("aliyuncs") >= 0) {
+                    if (url.indexOf("https") >= 0 && url.indexOf("ctyun") >= 0) {
                         int lastIndexOf = url.lastIndexOf("/");
                         String prefix = url.substring(0, lastIndexOf + 1);
                         String suffix = url.substring(lastIndexOf + 1);

+ 17 - 8
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -150,6 +150,7 @@ public class InformationWriteQueryController extends BladeController {
 
     private final IRecycleBinService recycleBinService;
 
+
     @Autowired
     StringRedisTemplate RedisTemplate;
 
@@ -200,7 +201,7 @@ public class InformationWriteQueryController extends BladeController {
             .map(Long::valueOf)
             .collect(Collectors.toList());
         List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
-            .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus).in(InformationQuery::getId, idList));
+            .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus,InformationQuery::getWbsId).in(InformationQuery::getId, idList));
         String sgSuffix="";
         String jlSuffix="";
         if(queryList.size()>0){
@@ -211,15 +212,23 @@ public class InformationWriteQueryController extends BladeController {
                 jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
             }
             for (InformationQuery query : queryList) {
-                if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
-                   if(!query.getName().endsWith(sgSuffix)){
-                       query.setName(query.getName()+sgSuffix);
-                   }
-                }else if(query.getClassify()!=null&&query.getClassify()==2&&StringUtils.isNotEmpty(jlSuffix)){
-                    if(!query.getName().endsWith(jlSuffix)){
-                        query.setName(query.getName()+jlSuffix);
+                String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
+                WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+                  String result=wbsParamClient.createFileTitle(contract);
+                if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
+                    if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
+                        result=result+sgSuffix;
+                        if(!query.getName().equals(result)){
+                            query.setName(result);
+                        }
+                    }else if(query.getClassify()!=null&&query.getClassify()==2&&StringUtils.isNotEmpty(jlSuffix)){
+                        result=result+jlSuffix;
+                        if(!query.getName().equals(result)){
+                            query.setName(result);
+                        }
                     }
                 }
+                query.setName(result);
             }
         }
         List<InformationQuery> taskList = queryList.stream().filter(o -> o.getStatus() == 1 || o.getStatus() == 2).collect(Collectors.toList());

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

@@ -329,11 +329,16 @@ public class TaskController extends BladeController {
             }
 
             //校验当前项目是否为垂直审批
-            List<Task> taskList = taskService.getBaseMapper().selectList(Wrappers.<Task>lambdaQuery().select(Task::getProjectId, Task::getTaskName, Task::getProcessInstanceId, Task::getContractId, Task::getFormDataId).in(Task::getId, Arrays.asList(taskIdArray)));
+            List<String> taskIdList = new ArrayList<>();
+            List<Task> taskList = taskService.getBaseMapper().selectList(Wrappers.<Task>lambdaQuery().select(Task::getId,Task::getProjectId, Task::getTaskName, Task::getProcessInstanceId, Task::getContractId, Task::getFormDataId, Task::getStatus).in(Task::getId, Arrays.asList(taskIdArray)));
             for (Task task : taskList) {
                 if (ObjectUtil.isEmpty(task.getProjectId())) {
                     throw new ServiceException("未获取到任务【" + task.getTaskName() + "】对应的项目信息");
                 }
+                if (task.getStatus() != null && task.getStatus() == 3) {
+                    taskIdList.add(task.getId() + "");
+                    continue;
+                }
                 ProjectInfo projectInfo = jdbcTemplate.query("select approval_type from m_project_info where id = " + task.getProjectId(), new BeanPropertyRowMapper<>(ProjectInfo.class)).stream().findAny().orElse(null);
                 //如果是垂直审批,那么检查当前用户是否符合当前顺序
                 if (projectInfo != null && projectInfo.getApprovalType() != null && new Integer(1).equals(projectInfo.getApprovalType())) {
@@ -369,6 +374,9 @@ public class TaskController extends BladeController {
             List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
 
             for (int i = 0, l = taskIdArray.length; i < l; i++) {
+                if (taskIdList.contains(taskIdArray[i])) {
+                    continue;
+                }
                 TaskApprovalVO approvalVO = new TaskApprovalVO();
                 approvalVO.setTaskId(taskIdArray[i]);
                 approvalVO.setParallelProcessInstanceId(parallelProcessInstanceIdArray[i]);
@@ -384,7 +392,7 @@ public class TaskController extends BladeController {
             this.taskService.batchCompleteApprovalTask(taskApprovalVOS);
             Map<String, TaskApprovalVO> taskApprovalVOMap = taskApprovalVOS.stream().collect(Collectors.toMap(TaskApprovalVO::getTaskId, taskApprovalVO -> taskApprovalVO, (o1, o2) -> o1));
             for (Task task : taskList) {
-                if (batchTaskVO.getFlag().equals("NO")) {
+                if (batchTaskVO.getFlag().equals("NO") && task.getStatus() != null && task.getStatus() != 3) {
                     JSONObject json = new JSONObject();
                     json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
                     json.put("operationObjName", "批量废除");
@@ -1233,9 +1241,12 @@ public class TaskController extends BladeController {
         //生成等待批次,任务完成后删除
         List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
         taskApprovalVOS.add(taskApprovalVO);
+        Task task = taskService.getOne(Wrappers.<Task>lambdaQuery().eq(Task::getId, taskApprovalVO.getTaskId()));
+        if (task == null || (task.getStatus() != null && task.getStatus() == 3)) {
+            return R.fail("任务已被撤回或者驳回");
+        }
         this.taskService.batchCompleteApprovalTask(taskApprovalVOS);
         if (!taskApprovalVO.isPass()) {
-            Task task = taskService.getBaseMapper().selectOne(Wrappers.<Task>lambdaQuery().select(Task::getProjectId, Task::getContractId, Task::getFormDataId).eq(Task::getId, taskApprovalVO.getTaskId()));
             JSONObject json = new JSONObject();
             json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
             json.put("operationObjName", "批量废除");
@@ -1539,23 +1550,25 @@ public class TaskController extends BladeController {
                             .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
                     if (min.isPresent()){
                         OperationLog operationLog = min.get();
+                        String createUserName = operationLog.getCreateUserName();
+                        String date = DateUtil.formatDateTime(operationLog.getCreateTime());
                         if (operationLog.getOperationType() != null && operationLog.getOperationType() == 61) {
-                            businessTaskPageVO.setEVisaStatus("驳回成功:"+operationLog.getCreateUserName()+"-"+operationLog.getCreateTime());
+                            businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date);
                             String saveData = operationLog.getSaveData();
                             if (saveData != null && !saveData.isEmpty()) {
                                 try  {
                                     JSONObject data = JSONObject.parseObject(saveData);
                                     if (data != null && data.containsKey("comment")) {
-                                        businessTaskPageVO.setEVisaStatus("驳回成功:"+operationLog.getCreateUserName()+"-"+operationLog.getCreateTime() + ";驳回原因:"+data.getString("comment"));
+                                        businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date + ";驳回原因:"+data.getString("comment"));
                                     }
                                 } catch (Exception e) {
                                     e.printStackTrace();
                                 }
                             }
                         } else if (operationLog.getOperationType() != null && operationLog.getOperationType() == 62) {
-                            businessTaskPageVO.setEVisaStatus("撤回成功:"+operationLog.getCreateUserName()+"-"+operationLog.getCreateTime());
+                            businessTaskPageVO.setEVisaStatus("撤回成功:"+ createUserName +"-"+ date);
                         } else {
-                            businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+operationLog.getCreateUserName()+"-"+operationLog.getCreateTime());
+                            businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+ createUserName +"-"+ date);
                         }
                     }
                 }
@@ -1873,7 +1886,7 @@ public class TaskController extends BladeController {
             throw new ServiceException("未获取到当前登陆的用户信息");
         } else {
             if (!SecureUtil.getUser().getRoleName().contains("administrator")) {
-                return R.data(200, null, "当前用户不是超管角色,未查询到信息");
+                return R.fail(200, "当前用户不是超管角色,未查询到信息");
             }
         }
         if (ObjectUtil.isEmpty(dto.getContractId())) {
@@ -1889,7 +1902,7 @@ public class TaskController extends BladeController {
         //封装入参SQL
         List<Object> params = new ArrayList<>();
         Integer eVisaStatus = dto.getVisaStatus();
-        StringBuilder sqlString = new StringBuilder("SELECT * FROM u_task WHERE approval_type not in (4, 5, 6, 7, 8) AND status != 3 AND is_deleted=0 AND contract_id = " + dto.getContractId()); //approval_type != 4 非档案的任务就是1填报资料,2工程文件,3日志资料
+        StringBuilder sqlString = new StringBuilder("SELECT * FROM u_task WHERE approval_type not in (4, 5, 6, 7, 11) AND status != 3 AND is_deleted=0 AND contract_id = " + dto.getContractId()); //approval_type != 4 非档案的任务就是1填报资料,2工程文件,3日志资料
 
         if (StringUtils.isNotBlank(dto.getStartTimeValue()) && StringUtils.isNotBlank(dto.getEndTimeValue())) {
             if (dto.getStartTimeValue().equals(dto.getEndTimeValue())) {

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

@@ -452,7 +452,7 @@
                 LEFT JOIN m_archive_tree_contract ar on u.node_id = ar.id
         where 	u.contract_id = #{contractId} and u.classify = #{classify}
           AND u.is_deleted = 0
-          AND u.source_type = 1 and ar.is_deleted = 0;
+          AND u.node_ext_id is not null and ar.is_deleted = 0  order by u.sort,u.sort_num,u.create_time
     </select>
 
     <select id="getListByContractId1" resultType="org.springblade.business.entity.ArchiveFile">

+ 9 - 8
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -276,7 +276,8 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
             if(formDataIds.size()>0){
                 for (String formDataId : formDataIds) {
                     String sql="Select * from u_task where form_data_id="+formDataId +" and status!=3 and is_deleted=0";
-                    Task task = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Task.class));
+					List<Task> tasks = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Task.class));
+					Task task = tasks.isEmpty() ? null : tasks.get(0);
                     if(task!=null){
                         String updateTaskParallel="update u_task_parallel set status=3 , e_visa_content = '撤回成功' where process_instance_id='" + task.getProcessInstanceId() + "'";
                         String updateTask="update u_task set status=3 where id="+task.getId()+" and status!=3 and is_deleted=0";
@@ -284,16 +285,16 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
                         jdbcTemplate.update(updateTaskParallel);
                         jdbcTemplate.update(updateTask);
                         jdbcTemplate.execute(deleted);
+						JSONObject json = new JSONObject();
+						json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
+						json.put("operationObjName", "批量废除");
+						json.put("projectId", task.getProjectId());
+						json.put("contractId", task.getContractId());
+						//保存操作记录
+						this.operationLogClient.saveUserOperationLog(62, "资料撤回废除", "委托单", json);
                     }
                     String updateinformationQuery="update u_information_query set status=3,e_visa_pdf_url= null where id="+formDataId;
                     jdbcTemplate.update(updateinformationQuery);
-					JSONObject json = new JSONObject();
-					json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
-					json.put("operationObjName", "批量废除");
-					json.put("projectId", task.getProjectId());
-					json.put("contractId", task.getContractId());
-					//保存操作记录
-					this.operationLogClient.saveUserOperationLog(62, "资料撤回废除", "委托单", json);
 				}
 			}
 

+ 67 - 60
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -387,71 +387,76 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         } else {
             //首先根据wbsId获取合同段ID和项目ID
             WbsTreeContract contractTree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));
+            int type = (contractTree.getIsExpernode() == null || contractTree.getIsExpernode() <= 0) ? 1 : 2;
+            if (DistributedRedisLock.acquire("saveOrUpdateInformationQueryData:" + primaryKeyId + ":" + contractTree.getContractId() + ":" + classify + ":" + type,5)) {
+                try {
+                    //判断当前填报节点下是否已经存在相应数据
+                    InformationQuery oldData = this.baseMapper.getInformationQueryByWbsId(contractTree.getPKeyId(), classify,contractTree.getContractId());
 
-            //判断当前填报节点下是否已经存在相应数据
-            InformationQuery oldData = this.baseMapper.getInformationQueryByWbsId(contractTree.getPKeyId(), classify,contractTree.getContractId());
-
-            if (oldData != null) {
-                //存在记录,修改
-                if (StringUtils.isNotEmpty(fileName)) {
-                    oldData.setName(fileName);
-                }
-
-                //拼接填报人信息
-                String fileUser = userId + "-" + userNmae;
-                if (StringUtils.isNotEmpty(oldData.getFileUserIdAndName())) {
-                    if (!oldData.getFileUserIdAndName().contains(userId.toString())) {
-                        //不包含,拼接
-                        oldData.setFileUserIdAndName(oldData.getFileUserIdAndName() + "," + fileUser);
-                    }
-                } else {
-                    oldData.setFileUserIdAndName(fileUser);
-                }
-
-                oldData.setUpdateTime(new Date());
-                oldData.setUpdateUser(userId);
+                    if (oldData != null) {
+                        //存在记录,修改
+                        if (StringUtils.isNotEmpty(fileName)) {
+                            oldData.setName(fileName);
+                        }
 
-                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
-                if (linkIds.size() > 0) {
-                    oldData.setSjRecordIds(StringUtils.join(linkIds, ","));
-                }
+                        //拼接填报人信息
+                        String fileUser = userId + "-" + userNmae;
+                        if (StringUtils.isNotEmpty(oldData.getFileUserIdAndName())) {
+                            if (!oldData.getFileUserIdAndName().contains(userId.toString())) {
+                                //不包含,拼接
+                                oldData.setFileUserIdAndName(oldData.getFileUserIdAndName() + "," + fileUser);
+                            }
+                        } else {
+                            oldData.setFileUserIdAndName(fileUser);
+                        }
 
-                //修改数据
-                this.baseMapper.updateById(oldData);
-            } else {
-                //新增基础数据
-                InformationQuery newData = new InformationQuery();
-                //设置文件题名
-                newData.setName(fileName);
-                //设置文件类型
-                newData.setCategory(contractTree.getNodeType());
-                //项目ID
-                newData.setProjectId(Long.parseLong(contractTree.getProjectId()));
-                //合同段ID
-                newData.setContractId(Long.parseLong(contractTree.getContractId()));
-                //施工资料还是质检资料
-                newData.setClassify(classify);
-                //节点ID
-                newData.setWbsId(contractTree.getPKeyId());
-
-                //1资料填报,2试验,3首件
-                newData.setType((contractTree.getIsExpernode() == null || contractTree.getIsExpernode() <= 0) ? 1 : 2);
-
-                //流程状态,默认未上报
-                newData.setStatus(0);
-                //填报人ID及姓名
-                newData.setFileUserIdAndName(userId + "-" + userNmae);
-                //数据源类型
-                newData.setSourceType(sourceType);
-                newData.setCreateUser(userId);
-                newData.setCreateTime(new Date());
+                        oldData.setUpdateTime(new Date());
+                        oldData.setUpdateUser(userId);
 
-                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
-                if (linkIds.size() > 0) {
-                    newData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                        List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                        if (linkIds.size() > 0) {
+                            oldData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                        }
+                        //修改数据
+                        this.baseMapper.updateById(oldData);
+                    } else {
+                        //新增基础数据
+                        InformationQuery newData = new InformationQuery();
+                        //设置文件题名
+                        newData.setName(fileName);
+                        //设置文件类型
+                        newData.setCategory(contractTree.getNodeType());
+                        //项目ID
+                        newData.setProjectId(Long.parseLong(contractTree.getProjectId()));
+                        //合同段ID
+                        newData.setContractId(Long.parseLong(contractTree.getContractId()));
+                        //施工资料还是质检资料
+                        newData.setClassify(classify);
+                        //节点ID
+                        newData.setWbsId(contractTree.getPKeyId());
+
+                        //1资料填报,2试验,3首件
+                        newData.setType(type);
+
+                        //流程状态,默认未上报
+                        newData.setStatus(0);
+                        //填报人ID及姓名
+                        newData.setFileUserIdAndName(userId + "-" + userNmae);
+                        //数据源类型
+                        newData.setSourceType(sourceType);
+                        newData.setCreateUser(userId);
+                        newData.setCreateTime(new Date());
+
+                        List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                        if (linkIds.size() > 0) {
+                            newData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                        }
+                        //保存数据
+                        this.baseMapper.insert(newData);
+                    }
+                } finally {
+                    DistributedRedisLock.release("saveOrUpdateInformationQueryData:" + primaryKeyId + ":" + contractTree.getContractId() + ":" + classify + ":" + type);
                 }
-                //保存数据
-                this.baseMapper.insert(newData);
             }
         }
         return null;
@@ -1091,6 +1096,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                         informationQuery.setReportNumber(null);
                         informationQuery.setAuditUserIdAndName(null);
                         informationQuery.setTaskId(null);
+                        informationQuery.setCreateTime(new Date());
+                        informationQuery.setUpdateTime(new Date());
                         this.save(informationQuery);
                     } finally {
                         DistributedRedisLock.release("informationQueryLock_" + informationQuery.getWbsId() + "_" + informationQuery.getContractId() + "_" + informationQuery.getClassify() + "_" + informationQuery.getType());

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

@@ -691,6 +691,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         jdbcTemplate.execute("update u_contract_log set status=3 where id='"+taskApp.getFormDataId()+"'");
                     }else if (taskApp.getApprovalType()==8) {
                         this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='"+taskApp.getFormDataId()+"')");
+                        this.jdbcTemplate.execute("update u_information_query set status=3 where id='"+taskApp.getFormDataId()+"'");
                     }else {
                         jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='"+taskApp.getFormDataId()+"'");
                         InformationQuery informationQuery = informationQueryService.getById(taskApp.getFormDataId());
@@ -2027,7 +2028,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                          b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
                                 .eq(InformationQuery::getId, task.getFormDataId())
                                 .set(InformationQuery::getEVisaPdfUrl, null)
-                                .set(InformationQuery::getPdfUrl, null));
+//                                .set(InformationQuery::getPdfUrl, null)
+                         );
                     }else {
                         if(task.getApprovalType()==3){
                            b=contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
@@ -2049,7 +2051,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         //重新保存
                         long startTime_1 = System.currentTimeMillis();
                         //质检资料
-                        if(task.getApprovalType()==1){
+                        if(task.getApprovalType()==1 || task.getApprovalType()== 9){
                             String sql="select type from u_information_query where id="+task.getFormDataId();
                             Integer InformationType = jdbcTemplate.queryForObject(sql, new SingleColumnRowMapper<>(Integer.class));
                             if(InformationType==1){

+ 36 - 7
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java

@@ -35,24 +35,25 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.core.tool.utils.DateUtil;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.*;
 import org.springblade.resource.entity.Attach;
+import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.resource.vo.NewBladeFile;
 import org.springblade.system.entity.Dict;
 import org.springblade.system.feign.IDictClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springframework.http.MediaType;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -66,6 +67,7 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
     private final TrialSamplingRecordMapper trialSamplingRecordMapper;
     private final NewIOSSClient newIOSSClient;
     private final JdbcTemplate jdbcTemplate;
+    private final CommonFileClient commonFileClient;
 
     @Override
     public boolean mobilizationVerification(String number, String id, String contractId) {
@@ -410,21 +412,48 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
 
     @Override
     public boolean uploadFile(String id, Integer type, String url) {
+        String pdfUrl = "";
+        try {
+            NewBladeFile bladeFile =  null;
+            InputStream is = CommonUtil.getOSSInputStream(url);
+            String fileName = url.substring(url.lastIndexOf("/") + 1);
+            MultipartFile files = new MockMultipartFile("file", fileName, "text/plain", org.apache.poi.util.IOUtils.toByteArray(is));
+            // 根据url后缀检测文件类型
+            String extension = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
+            if (extension.equals("xlsx") || extension.equals("xls")) {
+                bladeFile = this.commonFileClient.excelToPdf(files);
+            } else if (extension.equals("jpg") || extension.equals("png") ||  extension.equals("jpeg")) {
+                bladeFile = this.commonFileClient.pngOrJpgToPdf(files);
+            } else if (extension.equals("docx") || extension.equals("doc")) {
+                bladeFile = this.commonFileClient.wordToPdf(files);
+            } else if (extension.equals("pdf")) {
+                pdfUrl = url;
+            }
+            if (bladeFile != null) {
+                pdfUrl = bladeFile.getPdfUrl();
+            }
+        } catch (IOException e) {
+            log.error("上传文件失败", e);
+        }
+
         if (type == 1) {
             this.update(Wrappers.<TrialMaterialMobilization>lambdaUpdate()
                     .set(TrialMaterialMobilization::getProductionCertificate, url)
+                    .set(TrialMaterialMobilization::getProductionCertificatePdfUrl, pdfUrl)
                     .eq(TrialMaterialMobilization::getId, id));
             return true;
         }
         if (type == 2) {
             this.update(Wrappers.<TrialMaterialMobilization>lambdaUpdate()
                     .set(TrialMaterialMobilization::getQualityInspectionReport, url)
+                    .set(TrialMaterialMobilization::getQualityInspectionReportPdfUrl, pdfUrl)
                     .eq(TrialMaterialMobilization::getId, id));
             return true;
         }
         if (type == 3) {
             this.update(Wrappers.<TrialMaterialMobilization>lambdaUpdate()
                     .set(TrialMaterialMobilization::getOtherAccessories, url)
+                    .set(TrialMaterialMobilization::getOtherAccessoriesPdfUrl, pdfUrl)
                     .eq(TrialMaterialMobilization::getId, id));
             return true;
         }

+ 8 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java

@@ -335,7 +335,7 @@ public class EVDataServiceImpl implements EVDataService {
                     if (taskApp.getSigType() == 2) {
                         this.jdbcTemplate.execute("update u_entrust_info set sample_status=2,status=" + (taskApp.getSigType() + 1) + ",entrust_e_pdf='" + taskApp.getLastFilePdfUrl() + "' where id=(SELECT wbs_id from u_information_query where id='" + taskApp.getFormDataId() + "')");
                     }
-                    updateSql = "update u_information_query set e_visa_pdf_url='" + taskApp.getLastFilePdfUrl() + "',status=" + taskApp.getSigType() + " where id='" + taskApp.getFormDataId() + "'";
+                    updateSql = "update u_information_query set e_visa_pdf_url='" + taskApp.getLastFilePdfUrl() + "',status=" + taskApp.getSigType() + ",business_time='" + taskApp.getPdfDate() + "' where id='" + taskApp.getFormDataId() + "'";
                 }
                 this.jdbcTemplate.execute(updateSql);
                 System.out.println("u_information_query修改语句:"+updateSql);
@@ -378,6 +378,13 @@ public class EVDataServiceImpl implements EVDataService {
                 String eVisaPdfUrl = map.get("e_visa_pdf_url") + ""; //签字的PDF路径
                 String pdfUrl = map.get("pdf_url") + ""; //合并后的PDF路径
                 String type = map.get("type") + ""; //资料类型,1资料填报,2试验,3首件
+                Object status = map.get("status");
+                if (status != null && status.toString().equals("3")) {
+                     this.jdbcTemplate.execute("delete from u_task_batch where id in(" + taskApp.getId()+")");
+                     RedisTemplate.delete("sign-" + taskApp.getFormDataId());
+                     taskApp.setSigState(2);
+                     return;
+                }
                 taskApp.setPdfDataType(type);
                 if (StringUtils.isNotEmpty(pdfTrialUrlPosition) || StringUtils.isNotEmpty(pdfTrialUrl) || StringUtils.isNotEmpty(eVisaPdfUrl) || StringUtils.isNotEmpty(pdfUrl)) {
                     if ("1".equals(type)) {

+ 34 - 8
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java

@@ -1,16 +1,17 @@
 package org.springblade.evisa.utils;
 
 import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
 import org.apache.pdfbox.text.PDFTextStripper;
 import org.springblade.business.vo.TaskSignInfoVO;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.utils.Func;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
@@ -23,7 +24,9 @@ public class PDFUtils {
             PDFTextStripper stripper = new PDFTextStripper();
             String text = stripper.getText(document);
             String[] lines = text.split("[ \\n]+");
-            String regex = "^\\d{4}年\\d{2}月\\d{2}日$";
+            String lastDate = getPdfFirstPageLastDate(document);
+            taskApp.setPdfDate(lastDate);
+            Pattern pattern = Pattern.compile("(\\d{4}[年-]\\d{2}[月-]\\d{2}日?)");
 
             for(int k=0;k<lines.length;k++){
                 String textStr = lines[k];
@@ -41,10 +44,11 @@ public class PDFUtils {
                     if (txt.length() >= 15 && Func.isNumeric(txt)||(Func.isNumeric(txt)&&txt.length()==8&&txt.startsWith("123"))) {
                         eVisaConfigList.add(txt);
                     }
-
-                    Pattern pattern = Pattern.compile(regex);
-                    if(pattern.matcher(txt).matches()){
-                        taskApp.setPdfDate(txt);
+                    if (taskApp.getPdfDate() == null || taskApp.getPdfDate().isEmpty()) {
+                        Matcher matcher = pattern.matcher(txt);
+                        if(matcher.matches()){
+                            taskApp.setPdfDate(matcher.group(1));
+                        }
                     }
                 }
 
@@ -123,4 +127,26 @@ public class PDFUtils {
         }
     }
 
+    public static String getPdfFirstPageLastDate(PDDocument document) throws IOException {
+        PDFTextStripper stripper = new PDFTextStripper();
+        stripper.setStartPage(1);
+        stripper.setEndPage(1);
+        String text = stripper.getText(document);
+        Pattern pattern = Pattern.compile("(\\d{4}[-年.]\r?\n?\\d{2}[-月.]\r?\n?\\d{2}日?)");
+        Matcher matcher = pattern.matcher(text);
+        List<String> dates = new ArrayList<>();
+        while (matcher.find()) {
+            dates.add(matcher.group(1));
+        }
+        if (!dates.isEmpty()) {
+            Optional<String> max = dates.stream().map(item -> {
+                String replace = item.replace("年", "-").replace("月", "-").replace("日", "").replaceAll("\\.", "-");
+                return replace.replaceAll("[\r\n]",  "");
+            }).max(String::compareTo);
+            return max.get();
+        } else {
+            return "";
+        }
+    }
+
 }

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

@@ -17,11 +17,13 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
 import org.springblade.manager.dto.ArchiveTreeDTO;
 import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.entity.WbsTree;
 import org.springblade.manager.service.IArchiveTreeContractService;
 import org.springblade.manager.vo.ArchiveTreeVO2;
 import org.springblade.manager.vo.ArchiveTreeVO3;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springblade.manager.entity.ArchiveTree;

+ 161 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -3017,6 +3017,167 @@ public class ExcelTabController extends BladeController {
         return R.data(resultMapList);
     }
 
+    /**
+     * 获取新增时的表头数据
+     * @param theLogId
+     * @param nodePrimaryKeyId
+     * @param recordTime
+     * @param contractId
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("/getAddTheLogBusinessData")
+    @ApiOperationSupport(order = 26)
+    @ApiOperation(value = "获取新增表格的默认值")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "theLogId", value = "日志记录的ids,可能为空(多张表)"),
+        @ApiImplicitParam(name = "nodePrimaryKeyId", value = "当前操作的日志类型ID,即左侧列表的节点primaryKeyId"),
+        @ApiImplicitParam(name = "recordTime", value = "当前选择的填写日期,即右侧日期控件所选日期,格式为 yyyy-MM-dd"),
+        @ApiImplicitParam(name = "contractId", value = "合同段id")
+    })
+    public R<Map<String, Object>> getAddTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) throws Exception {
+        Map<String, Object> resultMapList = new HashMap<>();
+        //数据结果
+        String logId2 = "";
+        //获取对应的记录
+        String dataIds;
+        if (StringUtils.isNotEmpty(theLogId)) {
+            String[] split = theLogId.split(",");
+            List<String> ids = new LinkedList<>();
+            for (String logId : split) {
+                ContractLog contractLog = this.contractLogClient.queryContractLogByIdToObj(logId);
+                ids.add(contractLog.getDataId().toString());
+            }
+            dataIds = ids.stream().filter(Objects::nonNull).collect(Collectors.joining(","));
+        } else {
+            List<ContractLog> contractLogs = this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTimeList(nodePrimaryKeyId, recordTime, contractId,null);
+            if (contractLogs.size() == 0) {
+                logId2 = "";
+            } else {
+                logId2 = contractLogs.get(0).getId() + "";
+            }
+            dataIds = contractLogs.stream().map(ContractLog::getDataId).filter(Objects::nonNull).map(String::valueOf).collect(Collectors.joining(","));
+        }
+        WbsTreePrivate node;
+        WbsTreePrivate tableNode2;
+        try{
+            node = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodePrimaryKeyId));
+            tableNode2= this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId, node.getProjectId()));
+        } catch (Exception e) {
+            throw new ServiceException("表单重复,请确认表单");
+        }
+        if (StringUtils.isNotEmpty(dataIds)) {
+            if (dataIds.startsWith(",")) {
+                dataIds = dataIds.substring(1);
+            }
+            String[] ids = dataIds.split(",");
+            //检查实体表是否存在
+            String tabName = tableNode2.getInitTableName();
+            String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
+            List<Map<String, Object>> tabList = this.jdbcTemplate.queryForList(isExitSql);
+            if (tabList.size() <= 0) {
+                return R.fail("无实体表对应");
+            }
+            //查询数据
+            String querySql = "SELECT * FROM " + tabName + " WHERE id = " + ids[0] + " and group_id = " + tableNode2.getPKeyId();
+            List<Map<String, Object>> businessDataMap = this.jdbcTemplate.queryForList(querySql);
+            Map<String, Object> reData=new HashMap<>();
+            if (businessDataMap.size() > 0){
+                try {
+                    if (tableNode2.getHtmlUrl() != null){
+                        InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(tableNode2.getHtmlUrl());
+                        String htmlString = IoUtil.readToString(inputStreamByUrl);
+                        Document doc = Jsoup.parse(htmlString);
+                        // 模糊匹配
+                        Elements cbdw = doc.select("el-select[placeholder*=承包单位]");
+                        Elements htd = doc.select("el-select[placeholder*=合同段]");
+                        Elements jldw = doc.select("el-input[placeholder*=监理单位]");
+                        Elements jljg = doc.select("el-select[placeholder*=监理机构]");
+                        Elements jlr = doc.select("el-input[placeholder*=记录人]");
+                        Elements rq = doc.select("el-date-picker[placeholder*=日期]");
+                        Elements shr = doc.select("el-input[placeholder*=审核人]");
+                        Elements tqqk = doc.select("el-input[placeholder*=天气情况]");
+                        List<Elements> allElements=new ArrayList<>();
+                        allElements.add(cbdw);
+                        allElements.add(htd);
+                        allElements.add(jldw);
+                        allElements.add(jljg);
+                        allElements.add(jlr);
+                        allElements.add(rq);
+                        allElements.add(shr);
+                        allElements.add(tqqk);
+                        allElements=allElements.stream().filter(o->o!=null&&o.size()>0).collect(Collectors.toList());
+                        if(allElements.size()>0){
+                            for (String key : businessDataMap.get(0).keySet()) {
+                                String tabVal = businessDataMap.get(0).get(key) + "";
+                                // 时间段处理
+                                if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
+                                    if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
+                                        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]);
+                                        }
+                                        String sql = tabData[0];
+                                        sql = sql.replaceAll("\\[", "['");
+                                        sql = sql.replaceAll("]", "']");
+                                        sql = sql.replaceAll("000Z,", "000Z',");
+                                        sql = sql.replaceAll(", 20", ", '20");
+                                        sql = sql.replaceAll("'", "");
+                                        reData.put(key + "__" + tabData[1], sql);
+                                    } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
+                                        String[] tabData = tabVal.split("_\\^_");
+                                        reData.put(key + "__" + tabData[1], tabData[0]);
+                                    } else if (tabVal.indexOf("☆") >= 0) {
+                                        String[] mysql = tabVal.split("☆");
+                                        for (String data : mysql) {
+                                            String[] tabData = data.split("_\\^_");
+                                            reData.put(key + "__" + tabData[1], tabData[0]);
+                                        }
+                                    } else if (tabVal.indexOf("_^_") >= 0) { //数组处理方式
+                                        String[] tabData = tabVal.split("_\\^_");
+                                        if (StringUtils.isNotEmpty(tabData[0])) {
+                                            if (tabVal.contains("[") && tabVal.contains("年")) {
+                                                String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
+                                                reData.put(key + "__" + tabData[1], strings);
+                                            }
+                                            if (tabVal.contains("[") && tabVal.contains("]") && tabVal.indexOf(",") >= 0) {
+                                                String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
+                                                reData.put(key + "__" + tabData[1], strings);
+                                            } else {
+                                                if (tabVal.contains("[") && tabVal.contains("]")) {
+                                                    String[] strings = new String[]{tabData[0].replaceAll("\\[","").replaceAll("]","")};
+                                                    reData.put(key + "__" + tabData[1],strings);
+                                                } else {
+                                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                                }
+                                            }
+                                        }
+                                    } else {
+                                        reData.put(key, tabVal);
+                                    }
+                                }
+                            }
+                            for (Elements element : allElements) {
+                                if(reData.containsKey(element.attr("keyname"))){
+                                    resultMapList.put(element.attr("keyname"),reData.get(element.attr("keyname")));
+                                }
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+        return R.data(resultMapList);
+    }
+
+
+
     /**
      * 复制指定日期的日志填报数据
      */

+ 178 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignConfigController.java

@@ -0,0 +1,178 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.*;
+import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.*;
+import org.springblade.manager.service.*;
+import org.springblade.manager.vo.*;
+import org.springblade.manager.wrapper.SignConfigWrapper;
+import org.springblade.system.entity.Dict;
+import org.springblade.system.feign.IDictClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.*;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**
+ * 电签配置 控制器
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/signConfig")
+@Api(value = "电签配置表", tags = "电签配置表接口")
+public class SignConfigController extends BladeController {
+
+    private final ISignConfigService signConfigService;
+
+    private final IDictClient dictClient;
+
+    /**
+     * 获取参建方 角色列表
+     */
+    @GetMapping("/roleList")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "岗位列表")
+    public R<List<RoleVO2>> roleMenuList(@ApiParam(value = "参建方类型,1:施工,2:监理,3:业主", required = true) @RequestParam Integer type, @ApiParam(value = "岗位名称") @RequestParam(required = false) String roleName) {
+        return R.data(signConfigService.getRoleList(type, roleName));
+    }
+
+    /**
+     * 分页
+     */
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分页", notes = "传入excelTab")
+    public R<IPage<SignConfigVO>> list(@ApiParam(value = "岗位id") @RequestParam(required = false) Long roleId, @ApiParam(value = "搜索keyword") @RequestParam(required = false) String keyword, Query query, @RequestParam() Integer type) {
+        return R.data(signConfigService.selectPageByRoleId(Condition.getPage(query), roleId, keyword, type));
+    }
+
+    /**
+     * 岗位详情
+     */
+    @GetMapping("/roleDetail")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "岗位详情", notes = "传入id")
+    public R<List<SignConfigRelationVO>> roleDetail(@RequestParam Long id) {
+        List<SignConfigRelation> signConfigRelationList = signConfigService.getSignConfigRelationListByConfId(id, 1);
+        return R.data(SignConfigRelationVO.build(signConfigRelationList));
+    }
+
+    /**
+     * 元素详情
+     */
+    @GetMapping("/elementDetail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "元素详情", notes = "传入id")
+    public R<List<SignConfigRelationVO>> elementDetail(@RequestParam Long id) {
+        List<SignConfigRelation> signConfigRelations = signConfigService.getSignConfigRelationListByConfId(id, 0);
+        R<List<Dict>> type = dictClient.getList("table_type");
+        List<SignConfigRelationVO> list = SignConfigRelationVO.build(signConfigRelations);
+        if (type.isSuccess() && type.getData() != null) {
+            List<Dict> data = type.getData();
+            Map<String, String> map = data.stream().collect(Collectors.toMap(Dict::getDictKey, Dict::getDictValue));
+            list.forEach(vo -> vo.setType(map.getOrDefault(vo.getType(), vo.getType())));
+        }
+        return R.data(list);
+    }
+
+    /**
+     * 元素表分类列表
+     */
+    @GetMapping("/tableType")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "元素表分类列表")
+    public R<List<Dict>> tableType() {
+        return dictClient.getList("table_type");
+    }
+
+    /**
+     * 元素表列表
+     */
+    @GetMapping("/tableList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取元素表列表")
+    public R<List<TableInfo>> tableList(@RequestParam(required = false) Integer tableType, @RequestParam(required = false) String name) {
+        return R.data( signConfigService.tableList(tableType, name));
+    }
+
+    /**
+     * 元素列表
+     */
+    @GetMapping("/elementList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取所有元素列表")
+    public R<List<WbsFormElementVO3>> elementList() {
+        List<WbsFormElementVO3> elements =  signConfigService.elementList();
+        return R.data(elements);
+    }
+
+    /**
+     * 获取所有施工方、监理方、业主方的角色列表
+     */
+    @GetMapping("/queryAllRoleList")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "获取所有施工方、监理方、业主方的角色列表")
+    public R<List<RoleVO>> queryAllRoleList(@ApiParam(value = "参建方类型,1:施工,2:监理,3:业主", required = true) @RequestParam Integer type, @RequestParam(required = false) String roleName) {
+        List<RoleVO> roleVOS = signConfigService.queryAllRoleList(type, roleName);
+        return R.data(roleVOS);
+    }
+
+
+
+    /**
+     * 新增或修改 清表基础数据表
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改")
+    public R submit(@Valid @RequestBody List<SignConfigDTO> signConfigDTOs) {
+        return R.status(signConfigService.addOrEdit(signConfigDTOs));
+    }
+
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        signConfigService.deleteLogic(Func.toLongList(ids));
+        return R.status(true);
+    }
+
+    /**
+     * 停用\启用
+     */
+    @PostMapping("/updateStatus")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "停用、启用", notes = "传入ids")
+    public R updateStatus(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @ApiParam(value = "状态", required = true) @RequestParam Integer status) {
+        if (status == null || status < 0 || status > 1) {
+            return R.fail("状态错误");
+        }
+        return R.status(signConfigService.changeStatus(Func.toLongList(ids),  status));
+    }
+
+}

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

@@ -126,7 +126,7 @@ public class TableFileController extends BladeController {
             }
             excelTabService.getBussPdfs(wbsTreeContractP.getPKeyId() + "", classfy, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
         }
-        if (tableFile.getType() == 20 || tableFile.getType() == 21||tableFile.getType() == 22) {
+        if (tableFile.getType() == 20 || tableFile.getType() == 21||tableFile.getType() == 22 || tableFile.getType() == 10 || tableFile.getType() == 11||tableFile.getType() == 12) {
             //查询当前节点 如果是数字化节点 需要删除上报信息,变成未填报
             List<TableFileVO> fileVOList = tableFileService.selectTableFileList1(Long.parseLong(tableFile.getTabId()));
             // 该文本无附件

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

@@ -510,10 +510,10 @@ public class WbsTreeController extends BladeController {
     @ApiOperationSupport(order = 20)
     @ApiOperation(value = "根据表单id查询所有元素", notes = "传入表单id")
     @ApiImplicitParam(name = "id", value = "表单id", required = true)
-    public R<List<WbsFormElementVO>> selectPrivateFormElements(@RequestParam("id") String id, String eName) {
+    public R<List<WbsFormElementVO>> selectPrivateFormElements(@RequestParam("id") String id, String eName,Integer eType) {
         List<WbsFormElementVO> wbsFormElements = null;
         if (StringUtils.isNotEmpty(id)) {
-            wbsFormElements = wbsTreeService.selectPrivateFormElements(id, eName);
+            wbsFormElements = wbsTreeService.selectPrivateFormElements(id, eName,eType);
             if (wbsFormElements.size() > 0) {
                 return R.data(wbsFormElements);
             }

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

@@ -980,8 +980,8 @@ public class WbsTreePrivateController extends BladeController {
     public String getNameRuleV(String string){
         // 定义工程名称到C格式的映射
         Map<String, String> mapping = new HashMap<>();
-        mapping.put("单位工程", "C0");
-        mapping.put("单位工程", "C1");
+        mapping.put("单位工程类型", "C0");
+        mapping.put("单位工程", "C1");
         mapping.put("分部工程", "C2");
         mapping.put("子分部工程", "C3");
         mapping.put("分项工程", "C4");
@@ -1002,8 +1002,8 @@ public class WbsTreePrivateController extends BladeController {
     public String getNameRuleV1(String string){
         // 定义工程名称到C格式的映射
         Map<String, String> mapping = new HashMap<>();
-        mapping.put("C0", "单位工程");
-        mapping.put("C1", "单位工程");
+        mapping.put("C0", "单位工程类型");
+        mapping.put("C1", "单位工程");
         mapping.put("C2", "分部工程");
         mapping.put("C3", "子分部工程");
         mapping.put("C4", "分项工程");

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

@@ -166,6 +166,10 @@ public class ArchiveTreeContractImpl implements ArchiveTreeContractClient {
         archiveTreeContractService.addArchiveTreeContract(archiveTreeContracts,rootId);
     }
 
+    @Override
+    public List<ArchiveTreeContract> getTopAutoTypeNodeByProjectID(@RequestParam Long projectId){
+        return archiveTreeContractMapper.getTopAutoTypeNodeByProjectID(projectId);
+    }
 
 
 }

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

@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.springblade.manager.entity.WbsParam;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.service.IWbsParamService;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -21,4 +22,9 @@ public class WbsParamClientImpl implements WbsParamClient{
     public WbsParam getWbsParam(Long nodeId) {
         return iWbsParamService.getBaseMapper().selectOne(Wrappers.lambdaQuery(WbsParam.class).eq(WbsParam::getNodeId, nodeId).eq(WbsParam::getType, 200).eq(WbsParam::getIsDeleted, 0).eq(WbsParam::getK,"FILE_TITLE"));
     }
+
+    @Override
+    public String createFileTitle(WbsTreeContract contract) {
+        return iWbsParamService.createFileTitle(contract);
+    }
 }

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

@@ -84,6 +84,8 @@ public interface ArchiveTreeContractMapper extends BaseMapper<ArchiveTreeContrac
 
     List<ArchiveTreeContract> getListByProjectId(@Param("projectId") Long projectId);
 
+    List<ArchiveTreeContract> getTopAutoTypeNodeByProjectID(@Param("projectId") Long projectId);
+
     List<ArchiveTreeContract> getStorageNodeByGroupId(@Param("projectId") Long projectId, @Param("archiveAutoGroupId") Long archiveAutoGroupId);
 
     @MapKey("id")

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

@@ -235,7 +235,7 @@
                         inner join u_archive_file b on b.node_id = a.id and b.is_deleted = a.is_deleted and b.project_id = a.project_id and (b.is_auto_file is null or b.is_auto_file != 1)
                            WHERE  a.is_deleted = 0
                              and a.project_id = #{projectId}
-                             and a.ancestors like CONCAT('%',d.id,'%')
+                             and (FIND_IN_SET(d.id,a.ancestors) or a.id = d.id)
         <if test="code!=null and code!=''">
             AND (a.tree_code = #{code} or a.tree_code = #{contractId} or a.parent_id = 0)
         </if>
@@ -357,6 +357,20 @@
         order by ancestors asc,tree_sort asc
     </select>
 
+
+    <select id="getTopAutoTypeNodeByProjectID" resultMap="archiveTreeContractResultMap">
+        SELECT
+            *
+        FROM
+            m_archive_tree_contract
+        WHERE
+            1 = 1
+          AND project_id = #{projectId}
+          AND is_deleted = 0
+          AND archive_auto_type = 1
+        order by ancestors asc,tree_sort asc
+    </select>
+
     <select id="getHavedBoxFileNodeByProjectID" resultMap="archiveTreeContractResultMap">
         SELECT
             *

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

@@ -77,6 +77,7 @@
         <result column="major_data_type" property="majorDataType"/>
         <result column="old_id" property="oldId"/>
         <result column="sort" property="sort"/>
+        <result column="node_class" property="nodeClass"/>
     </resultMap>
 
 
@@ -472,7 +473,8 @@
         d.id AS "key",
         old_id,
         major_data_type,
-        sort
+        sort,
+        node_class
         FROM m_wbs_tree_contract d
         WHERE
         d.is_deleted = 0

+ 44 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 电签配置 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+public interface SignConfigMapper extends BaseMapper<SignConfig> {
+
+    List<RoleVO2> getRoleList(@Param("relationType") Integer relationType,@Param("roleName") String roleName);
+    List<SignConfigRelation> getSignConfigRelationListByConfId(@Param("confId") Long confId, @Param("type") Integer type);
+
+    List<SignConfig> selectPageByRoleId(IPage<SignConfig> page, @Param("roleId") Long roleId, @Param("keyword") String keyword, @Param("relationType") Integer relationType);
+
+    List<SignConfigVO> getConfigByENames(@Param("names") Set<String> names);
+}

+ 90 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.xml

@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.SignConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="signConfigResultMap" type="org.springblade.manager.entity.SignConfig">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="e_name" property="eName"/>
+        <result column="e_id" property="eId"/>
+        <result column="e_key" property="eKey"/>
+        <result column="table_type" property="tableType"/>
+        <result column="element_type" property="elementType"/>
+        <result column="tenant_id" property="tenantId"/>
+    </resultMap>
+    <resultMap id="signConfigRelationResultMap" type="org.springblade.manager.entity.SignConfigRelation">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="relation_id" property="relationId"/>
+        <result column="relation_name" property="relationName"/>
+        <result column="relation_type" property="relationType"/>
+        <result column="type" property="type"/>
+        <result column="conf_id" property="confId"/>
+    </resultMap>
+    <resultMap id="signConfigVO" type="org.springblade.manager.vo.SignConfigVO" extends="signConfigResultMap">
+        <association property="relations" resultMap="signConfigRelationResultMap"/>
+    </resultMap>
+    <select id="getRoleList" resultType="org.springblade.system.vo.RoleVO2">
+        select distinct relation_id as roleId,relation_name as roleName from m_sign_config_relation
+            WHERE  type = 1 and is_deleted = 0
+        <if test="roleName != null and roleName != ''">
+            and relation_name like concat('%',#{roleName},'%')
+        </if>
+        <if test="relationType != null">
+            and relation_type = #{relationType}
+        </if>
+    </select>
+
+    <select id="getSignConfigRelationListByConfId" resultMap="signConfigRelationResultMap">
+        select id,conf_id,type,relation_type,relation_id,relation_name,create_user,create_dept,create_time,update_user,update_time,status,is_deleted from m_sign_config_relation
+        WHERE is_deleted = 0
+        <if test="type != null">
+            and type = #{type}
+        </if>
+        <if test="confId != null">
+            and conf_id = #{confId}
+        </if>
+    </select>
+    <select id="selectPageByRoleId" resultType="org.springblade.manager.entity.SignConfig">
+        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted
+        from m_sign_config a WHERE a.is_deleted = 0
+        and ( SELECT count(1) from m_sign_config_relation  where type = 1 and is_deleted = 0 and conf_id = a.id
+        <if test="roleId != null">
+            and relation_id = #{roleId}
+        </if>
+        <if test="relationType != null">
+            and relation_type = #{relationType}
+        </if>
+        limit 1 ) > 0
+        <if test="keyword != null and keyword != ''">
+            and a.e_name like concat('%',#{keyword},'%')
+        </if>
+    </select>
+    <select id="getConfigByENames" resultMap="signConfigVO">
+        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted,
+               b.id,b.conf_id,b.type,b.relation_type,b.relation_id,b.relation_name,b.create_user,b.create_dept,b.create_time,b.update_user,b.update_time,b.status,b.is_deleted
+        from m_sign_config a LEFT JOIN m_sign_config_relation b
+            on a.id = b.conf_id WHERE a.`status` = 1 and a.is_deleted = 0 and b.is_deleted = 0
+        <if test="names != null">
+            and a.e_name in
+            <foreach item="item" index="index" collection="names" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+
+</mapper>

+ 35 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.java

@@ -0,0 +1,35 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+/**
+ * 电签配置关联表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+public interface SignConfigRelationMapper extends BaseMapper<SignConfigRelation> {
+
+}

+ 21 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigRelationMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.SignConfigRelationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="signConfigRelationResultMap" type="org.springblade.manager.entity.SignConfigRelation">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="relation_id" property="relationId"/>
+        <result column="relation_name" property="relationName"/>
+        <result column="relation_type" property="relationType"/>
+        <result column="conf_id" property="confId"/>
+    </resultMap>
+
+</mapper>

+ 6 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -23,6 +23,10 @@
         <result column="time_col_key" property="timeColKey"/>
     </resultMap>
 
+    <resultMap id="textdictInfoVoResultMap" type="org.springblade.manager.vo.TextdictInfoVO" extends="textdictInfoResultMap">
+
+    </resultMap>
+
     <select id="selectTextdictInfoPage" resultMap="textdictInfoResultMap">
         select distinct * from m_textdict_info where is_deleted = 0
         <if test="param2.type== 2 ">
@@ -40,13 +44,13 @@
         select  *,(SELECT parent_id from blade_role c where c.id=b.sig_role_id) as parentRoleId from m_textdict_info b where is_deleted = 0 and id=#{id}
     </select>
 
-    <select id="selectTextdictInfoByExcelId" resultMap="textdictInfoResultMap">
+    <select id="selectTextdictInfoByExcelId" resultMap="textdictInfoVoResultMap">
         SELECT a.* from m_textdict_info a,
                         (select tab_id,count(1) from m_textdict_info where is_deleted = 0 and type in('2','6') and excel_id=#{param2.excelId} GROUP BY tab_id ORDER BY count(tab_id) desc LIMIT 1) b
         where a.tab_id=b.tab_id and a.is_deleted = 0 and a.type in('2','6') and a.excel_id=#{param2.excelId}
     </select>
 
-    <select id="selectTextdictBYIds" resultMap="textdictInfoResultMap">
+    <select id="selectTextdictBYIds" resultMap="textdictInfoVoResultMap">
         SELECT a.* from m_textdict_info a
         where project_id=#{projectId} and  id in
         <foreach collection="ids" item="id" open="(" close=")" separator=",">

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

@@ -40,7 +40,7 @@ public interface WbsTreeMapper extends EasyBaseMapper<WbsTree> {
 
     List<WbsFormElementVO> selectFormElements4TableId(@Param("id") String id);
 
-    List<WbsFormElementVO> selectPrivateFormElements(@Param("id") String id, @Param("eName") String eName);
+    List<WbsFormElementVO> selectPrivateFormElements(@Param("id") String id, @Param("eName") String eName,@Param("eType") Integer eType);
 
     Integer insertForm(WbsTree wbsTree);
 

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

@@ -467,6 +467,10 @@
         <if test="eName != null and eName != '' ">
             and e_name like concat('%',#{eName},'%')
         </if>
+        <if test="eType != null and eType != '' ">
+            and e_type like concat('%',#{eType},'%')
+        </if>
+
     </select>
 
     <select id="selectRepeatByProjectId" resultType="java.lang.Integer">

+ 12 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigRelationService.java

@@ -0,0 +1,12 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+public interface ISignConfigRelationService extends BaseService<SignConfigRelation> {
+
+}

+ 34 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignConfigService.java

@@ -0,0 +1,34 @@
+package org.springblade.manager.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.entity.TableInfo;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.manager.vo.TextdictInfoVO;
+import org.springblade.manager.vo.WbsFormElementVO3;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+
+import java.util.List;
+
+public interface ISignConfigService extends BaseService<SignConfig> {
+
+    List<RoleVO2> getRoleList(Integer type, String roleName);
+
+    List<SignConfigRelation> getSignConfigRelationListByConfId(Long confId, Integer type);
+
+    Boolean addOrEdit(List<SignConfigDTO> signConfigDTOs);
+
+    List<WbsFormElementVO3> elementList();
+
+    IPage<SignConfigVO> selectPageByRoleId(IPage<SignConfig> page, Long roleId, String keyword, Integer relationType);
+
+    List<RoleVO> queryAllRoleList(Integer type, String roleName);
+
+    List<TableInfo> tableList(Integer tableType, String name);
+
+    List<TextdictInfoVO> hasSignConfig(String initTableName, List<String> keys, TextdictInfoVO vo);
+}

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

@@ -41,7 +41,7 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
     List<WbsFormElementVO> selectFormElements4Formula(String id);
 
     // 项目级
-    List<WbsFormElementVO> selectPrivateFormElements(String id, String eName);
+     List<WbsFormElementVO> selectPrivateFormElements(String id, String eName,Integer eType);
 
     boolean importWbsTree(MultipartFile excelFile, WbsTree wbsTreeFu, WbsTree wbsTree1) throws IOException;
 

+ 87 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractSyncImpl.java

@@ -367,7 +367,7 @@ public class ArchiveTreeContractSyncImpl {
         Map<Long,WbsTreeContractVO6> wbsTreeContractVO6Map = new HashMap<>();
         // keyid 到id的映射
         Map<Long,Long> wbsTreeKeyToIdMap = new HashMap<>();
-        Map<Long,Integer> wbsTreeKeyToSortMap = new HashMap<>();
+        Map<Long,Integer> wbsTreeKeyToSortMap = new LinkedHashMap<>();
         for (WbsTreeContractVO6 wbsTreeContractVO6 : wbsTreeContractVO6s) {
             i++;
             wbsTreeKeyToSortMap.put(wbsTreeContractVO6.getPKeyId(),i);
@@ -381,7 +381,7 @@ public class ArchiveTreeContractSyncImpl {
 
         //同步质检关联节点
         syncNodes(contractId, informationQueryList, wbsTreeContractVO6Map, wbsTreeKeyToSortMap,
-                wbsTreeKeyToIdMap, archiveKeyIdMap, contractIndfo,classify,orgContractId);
+                wbsTreeKeyToIdMap, archiveKeyIdMap, contractIndfo,classify,orgContractId,archiveFiles);
 
 
         //wbs的keyId到 归档树的映射
@@ -467,8 +467,8 @@ public class ArchiveTreeContractSyncImpl {
 
     private void syncNodes(Long contractId, List<InformationQuery> informationQueryList,
                            Map<Long, WbsTreeContractVO6> wbsTreeContractVO6Map, Map<Long, Integer> wbsTreeKeyToSortMap,
-                           Map<Long, Long> wbsTreeKeyToIdMap, Map<Long, ArchiveFile> archiveKeyIdMap,
-                           ContractInfo contractIndfo,Integer classify,Long orgContractId) {
+                           Map<Long, Long> wbsTreeKeyToIdMap, Map<Long, ArchiveFile> checkMap,
+                           ContractInfo contractIndfo,Integer classify,Long orgContractId,List<ArchiveFile>  archiveFiles) {
         // 获取关联节点的合同段id
         Long associatedContractId = contractId;
         if (classify == 2) {
@@ -484,6 +484,7 @@ public class ArchiveTreeContractSyncImpl {
 
         Map<Long,Long> archiveTreeContractIdMap = new LinkedHashMap<>();
 
+
         for (ArchiveTreeContract node : associatedNodes) {
             Integer nodeLevel = Integer.valueOf(node.getDisplayHierarchy());
 
@@ -495,12 +496,37 @@ public class ArchiveTreeContractSyncImpl {
             // 获取该合同段下的wbs节点
             List<ArchiveTreeContract> archiveTreeContracts = getArchiveTreeContractsWbs(contractId, node.getId(),classify);
 
+            Set<Long> archiveTreeContractIds = archiveTreeContracts.stream()
+                    .map(ArchiveTreeContract::getId)
+                    .collect(Collectors.toSet());
+
             // 更新archiveTreeContractIdMap映射
              archiveTreeContractIdMap.clear();
             for (ArchiveTreeContract ar : archiveTreeContracts) {
                 archiveTreeContractIdMap.put(ar.getExtKeyId(), ar.getId());
             }
 
+            Map<Long, ArchiveFile> archiveKeyIdMap = new LinkedHashMap<>();
+            for (ArchiveFile file : archiveFiles) {
+                // 获取nodeId字符串
+                String nodeIdStr = file.getNodeId();
+                if (nodeIdStr != null && !nodeIdStr.isEmpty()) {
+                    try {
+                        Long nodeIdLong = Long.parseLong(nodeIdStr);
+                        // 如果转换后的nodeIdLong在archiveTreeContractIds集合中,则加入映射
+                        if (archiveTreeContractIds.contains(nodeIdLong)) {
+                            // 注意:这里使用file.getNodeExtId()作为key(原始代码逻辑)
+                            if (file.getNodeExtId()!= null) {
+                                archiveKeyIdMap.put(file.getNodeExtId(),file);
+                            }
+                        }
+                    } catch (NumberFormatException e) {
+                        // 转换失败,忽略这个文件
+                        log.warn("文件nodeId不是有效的数字: {}, 文件ID: {}", nodeIdStr, file.getId());
+                    }
+                }
+            }
+
             syncNode(informationQueryList, wbsTreeContractVO6Map, wbsTreeKeyToSortMap, wbsTreeKeyToIdMap,
                     archiveKeyIdMap, archiveTreeContractIdMap,
                     nodeLevel, node.getMajorDataType(), contractIndfo,classify);
@@ -548,8 +574,11 @@ public class ArchiveTreeContractSyncImpl {
                     continue;
                 }
                 if (treeContractVO6.getMajorDataType()!= null) {
-                    if (!majarDataType.contains(treeContractVO6.getMajorDataType().toString())) {
-                        continue;
+//                    if (!majarDataType.contains(treeContractVO6.getMajorDataType().toString())) {
+//                        continue;
+//                    }
+                    if (!shouldIncludeTreeContract(treeContractVO6, majarDataType)) {
+                        continue; // 跳过不符合条件的项
                     }
                 }
 
@@ -565,9 +594,9 @@ public class ArchiveTreeContractSyncImpl {
                     // 2024 08 19
                     // else  if (info.getEVisaPdfUrl() != null && !info.getEVisaPdfUrl().equals(archiveFile.getPdfFileUrl())
                     //         || sort != null && !sort.equals(archiveFile.getSort())) {
-                    else  if (info.getNodePdfUrl() != null && !info.getNodePdfUrl().equals(archiveFile.getPdfFileUrl())
-                                || sort != null && !sort.equals(archiveFile.getSort())
-                                || nodeId != null && !nodeId.toString().equals(archiveFile.getNodeId())
+                    else  if ( (info.getNodePdfUrl() != null && !info.getNodePdfUrl().equals(archiveFile.getPdfFileUrl()))
+                                || (sort != null && !sort.equals(archiveFile.getSort()))
+                                || (nodeId != null && !nodeId.toString().equals(archiveFile.getNodeId()))
                                 || (StringUtils.isNotEmpty(info.getBusinessTime() ) && !info.getBusinessTime().equals(archiveFile.getFileTime()))
                                 || (info.getEVisaPdfSize()!= null && info.getEVisaPdfSize() > 0L && !info.getEVisaPdfSize().equals(archiveFile.getFileSize()))
                     ) {
@@ -618,13 +647,19 @@ public class ArchiveTreeContractSyncImpl {
             //向上找到符合条件的level
             Long levelKeyId = findPKeyIdByNodeType(wbsTreeContractVO6Map,id,level);
 
+            Integer nodeClass = 1;
+            WbsTreeContractVO6 treeContractVO6 = wbsTreeContractVO6Map.get(id);
+            if (treeContractVO6!= null && treeContractVO6.getNodeClass()!= null ) {
+                nodeClass = treeContractVO6.getNodeClass();
+            }
+
             //根据map获取到对应的归档树节点nodeid
             Long nodeId = archiveTreeContractIdMap.get(levelKeyId);
             if (nodeId == null) {
                 continue;
             }
             //生成新增的归档文件
-            ArchiveFile archiveFile = getArchiveFile(info,nodeId,info.getWbsId(),contractIndfo,classify);
+            ArchiveFile archiveFile = getArchiveFile(info,nodeId,info.getWbsId(),contractIndfo,classify,nodeClass);
             if (archiveFile != null) {
                 newArchiveFiles.add(archiveFile);
             }
@@ -634,6 +669,46 @@ public class ArchiveTreeContractSyncImpl {
         handleAddandUpdateFiles(newArchiveFiles,updateArchiveFiles);
     }
 
+
+    /**
+     * 针对质量评定的处理
+     * @param treeContractVO6
+     * @param majarDataType
+     * @return
+     */
+    public boolean shouldIncludeTreeContract(WbsTreeContractVO6 treeContractVO6, String majarDataType) {
+        if (treeContractVO6.getMajorDataType() == null) {
+            return false; // 如果 majorDataType 为空,过滤
+        }
+
+        String currentMajor = treeContractVO6.getMajorDataType().toString();
+
+        // 检查是否是特殊类型 (2,8,9)
+        if (currentMajor.equals("2") || currentMajor.equals("8") || currentMajor.equals("9")) {
+            // 特殊类型处理:根据 nodeType 匹配对应的数字
+            if (treeContractVO6.getNodeType() != null) {
+                switch (treeContractVO6.getNodeType()) {
+                    case 1: // 单位工程 → 匹配 2
+                        return majarDataType.contains("2");
+                    case 2: // 分部工程 → 匹配 8
+                    case 3: // 子分部工程 → 匹配 8
+                        return majarDataType.contains("8");
+                    case 4: // 分项工程 → 匹配 9
+                    case 5: // 子分项工程 → 匹配 9
+                        return majarDataType.contains("9");
+                    default:
+                        return majarDataType.contains(currentMajor);
+                }
+            } else {
+                // nodeType 为空时,按原逻辑处理
+                return majarDataType.contains(currentMajor);
+            }
+        } else {
+            // 非特殊类型 (1,4 等):直接匹配
+            return majarDataType.contains(currentMajor);
+        }
+    }
+
     /**
      * 刷新文件
      * @param newArchiveFiles
@@ -706,7 +781,7 @@ public class ArchiveTreeContractSyncImpl {
         }
     }
 
-    public ArchiveFile getArchiveFile(InformationQuery query,Long nodeId,Long keyId,ContractInfo contractIndfo,Integer classify) {
+    public ArchiveFile getArchiveFile(InformationQuery query,Long nodeId,Long keyId,ContractInfo contractIndfo,Integer classify,Integer nodeClass) {
         ArchiveFile archiveFile = new ArchiveFile();
         archiveFile.setNodeId(nodeId.toString());
         archiveFile.setNodeExtId(keyId);
@@ -733,7 +808,7 @@ public class ArchiveTreeContractSyncImpl {
             archiveFile.setFileTime(businessTime);
         }
 
-        archiveFile.setSourceType(1);
+        archiveFile.setSourceType(nodeClass);
         archiveFile.setIsArchive(0);
 
         //设置认证

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

@@ -49,6 +49,7 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.node.ForestNodeMerger;
 import org.springblade.core.tool.utils.DateUtil;
@@ -1246,13 +1247,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     if (wbsTreeContractByP != null) {
                         //处理文件提名
                         String fileName = this.wbsParamService.createFileTitle(wbsTreeContractByP);
-                        String sql1="Select sg_suffix,jl_suffix from m_project_info where id="+wbsTreeContractByP.getProjectId()+" and is_deleted=0";
-                        List<ProjectInfo> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
-                        if(query.size()>0){
-                            if(tableInfo.getClassify()!=null&&tableInfo.getClassify().equals("1")){
-                                fileName=fileName+(query.get(0).getSgSuffix()==null?"":query.get(0).getSgSuffix());
-                            }else {
-                                fileName=fileName+(query.get(0).getJlSuffix()==null?"":query.get(0).getJlSuffix());
+                        if(wbsTreeContract.getMajorDataType()!=null&&wbsTreeContract.getMajorDataType()==6){
+                            String sql1="Select sg_suffix,jl_suffix from m_project_info where id="+wbsTreeContractByP.getProjectId()+" and is_deleted=0";
+                            List<ProjectInfo> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
+                            if(query.size()>0){
+                                if(tableInfo.getClassify()!=null&&tableInfo.getClassify().equals("1")){
+                                    fileName=fileName+(query.get(0).getSgSuffix()==null?"":query.get(0).getSgSuffix());
+                                }else {
+                                    fileName=fileName+(query.get(0).getJlSuffix()==null?"":query.get(0).getJlSuffix());
+                                }
                             }
                         }
                         //huangjn 保存成功后调用生成资料查询列表数据
@@ -1291,15 +1294,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
                 //处理文件提名
                 fileName1= this.wbsParamService.createFileTitle(wbsTreeContractByP);
-                String sql1="Select sg_suffix,jl_suffix from m_project_info where id="+wbsTreeContractByP.getProjectId()+" and is_deleted=0";
-                List<ProjectInfo> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
-                if(query.size()>0){
-                    if(tableInfoList.get(0).getClassify()!=null&&tableInfoList.get(0).getClassify().equals("1")){
-                        fileName1=fileName1+(query.get(0).getSgSuffix()==null?"":query.get(0).getSgSuffix());
-                    }else {
-                        fileName1=fileName1+(query.get(0).getJlSuffix()==null?"":query.get(0).getJlSuffix());
+                if(wbsTreeContract.getMajorDataType()!=null&&wbsTreeContract.getMajorDataType()==6){
+                    String sql1="Select sg_suffix,jl_suffix from m_project_info where id="+wbsTreeContractByP.getProjectId()+" and is_deleted=0";
+                    List<ProjectInfo> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
+                    if(query.size()>0){
+                        if(tableInfoList.get(0).getClassify()!=null&&tableInfoList.get(0).getClassify().equals("1")){
+                            fileName1=fileName1+(query.get(0).getSgSuffix()==null?"":query.get(0).getSgSuffix());
+                        }else {
+                            fileName1=fileName1+(query.get(0).getJlSuffix()==null?"":query.get(0).getJlSuffix());
+                        }
                     }
                 }
+
                 //huangjn 保存成功后调用生成资料查询列表数据
                 this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName1, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
                 JSONObject json = new JSONObject();
@@ -2295,6 +2301,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
                         Cell cell = row.getCell(x1 - 1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                        if (cell == null) {
+                            cell = row.createCell(x1 - 1);
+                        }
                         if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                              // 获取单元格的现有值
                             String existingValue = cell.getStringCellValue();
@@ -2361,10 +2370,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
 
         //附件
-        TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1)).stream().findAny().orElse(null);
-        if (tableFile1 != null) {
-            tableFileService.update(Wrappers.<TableFile>lambdaUpdate().set(TableFile::getDomainPdfUrl, bladeFile.getLink()).eq(TableFile::getId, tableFile1.getId()));
-        } else {
+//        TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1)).stream().findAny().orElse(null);
+//        if (tableFile1 != null) {
+//            tableFileService.update(Wrappers.<TableFile>lambdaUpdate().set(TableFile::getDomainPdfUrl, bladeFile.getLink()).eq(TableFile::getId, tableFile1.getId()));
+//        } else
+        {
             TableFile tableFile = new TableFile();
             String fileExtension = FileUtil.getFileExtension(wbsTreeContract.getFullName() + ".pdf");
             tableFile.setTabId(pkeyId + "");
@@ -2374,7 +2384,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             tableFile.setIsDeleted(0);
             tableFile.setExtension(fileExtension);
             tableFile.setDomainPdfUrl(bladeFile.getLink());
-            tableFileService.saveOrUpdate(tableFile);
+            tableFileService.remove(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1));
+            tableFileService.save(tableFile);
         }
 
         List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getIsDeleted, 0));
@@ -2440,7 +2451,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
         }
 
-        String listPdf = file_path + "/pdf/" + nodeId + ".pdf";
+        String listPdf = file_path + "/pdf/" + nodeId + "_" + classify + ".pdf";
         File tabpdf2 = ResourceUtil.getFile(listPdf);
         if (tabpdf2.exists()) {
             tabpdf2.delete();
@@ -3633,7 +3644,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
                 valStr = valStr.substring(0, valStr.lastIndexOf(","));
                 sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
-
                 TransactionStatus transactionStatus = this.beginTransaction(transactionManager1);
                 try {
                     //删除
@@ -3647,6 +3657,37 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     transactionManager1.rollback(transactionStatus);
                     throw new RuntimeException("500"+e.getCause().getMessage()+"  字段过长,新增失败");
                 }
+                //添加操作日志
+                try {
+                    String delSqlNew = delSql.replace("\"", "'");
+                    StringBuffer sb = new StringBuffer();
+                    sb.append("insert into blade_trial_sql (id,p_key_id,group_id,user_id,create_time,sql_info) VALUES");
+                    sb.append("(" + SnowFlakeUtil.getId());
+                    sb.append(",\"" + tableInfo.getPkeyId()+"\"");
+                    sb.append(",\"" + groupId+"\"");
+                    sb.append(","+ AuthUtil.getUserId());
+                    sb.append(",SYSDATE()");
+                    sb.append(",\"");
+                    sb.append(delSqlNew);
+                    sb.append("\")");
+                    jdbcTemplate.execute(sb.toString());
+
+                    String sqlInfoNew = sqlInfo.replace("\"", "'");
+                    StringBuffer sb1 = new StringBuffer();
+                    sb1.append("insert into blade_trial_sql (id,p_key_id,group_id,user_id,create_time,sql_info) VALUES");
+                    sb1.append("(" + SnowFlakeUtil.getId());
+                    sb1.append(",\"" + tableInfo.getPkeyId()+"\"");
+                    sb1.append(",\"" + groupId+"\"");
+                    sb1.append(","+ AuthUtil.getUserId());
+                    sb1.append(",SYSDATE()");
+                    sb1.append(",\"");
+                    sb1.append(sqlInfoNew);
+                    sb1.append("\")");
+                    jdbcTemplate.execute(sb1.toString());
+                } catch (DataAccessException e) {
+                    log.error("添加操作日志异常:ExcelTabServiceImpl-saveOrUpdateInfoTrial() ");
+                }
+
             }
         }
     }
@@ -4157,7 +4198,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
-                        Cell cell = row.getCell(x1 - 1);
+                        Cell cell = row.getCell(x1 - 1,  Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
                         if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                             short fontIndex = cell.getCellStyle().getFontIndex();
                             Font oldfontAt = workbook.getFontAt(fontIndex);

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

@@ -684,7 +684,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         return;
                     }
                     List<Map<String, Object>> tableNamePkIdsMaps = this.jdbcTemplate.queryForList(
-                            "select c.init_table_name tableName,c.p_key_id pkId,c.html_url url from" +
+                            "select c.init_table_name tableName,c.p_key_id pkId,c.html_url url,c.p_id from" +
                                     " (select id from m_wbs_tree_contract where contract_id=" + currentNode.getContractId() + " and is_deleted=0 and node_type=6 and tree_code like '" + parent.getTreeCode() + "%' ORDER BY sort) k" +
                                     " join m_wbs_tree_contract c on c.parent_id = k.id " +
                                     "where  c.contract_id=" + currentNode.getContractId() + " and c.is_deleted=0 "
@@ -705,6 +705,31 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                                 }
                                 List<Map<String, Object>> tableDatas = this.jdbcTemplate.queryForList("select * from " + tn + " where p_key_id in (" + targetIds + ")");
                                 String tmp = elementInfo == null ? "" : StringUtils.handleNull(elementInfo.get("ename"));
+                                // 优先查找当前节点下的元素
+                                if (!tableDatas.isEmpty()) {
+                                    Map<Long, Long> map = new HashMap<>();
+                                    tableNamePkIdsMaps.forEach(m -> {
+                                        if (StringUtils.isEquals(m.get("tableName"), tn)) {
+                                            Object o = m.get("pkId");
+                                            Object o1 = m.get("p_id");
+                                            if(o instanceof Long && currentNode.getPkId().equals(o1)) {
+                                                map.put((Long) o, 1L);
+                                            }
+                                        }
+                                    });
+                                    if (!map.isEmpty()) {
+                                        List<Map<String, Object>> datas = tableDatas.stream().filter(t -> {
+                                            Object pKeyId = t.get("p_key_id");
+                                            if (pKeyId instanceof Long) {
+                                                return map.containsKey(pKeyId);
+                                            }
+                                            return false;
+                                        }).collect(Collectors.toList());
+                                        if (!datas.isEmpty()) {
+                                            tableDatas = datas;
+                                        }
+                                    }
+                                }
                                 fill(tableDatas, removeList, tn, key, tmp, tec);
                             }
                         });

+ 38 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigRelationServiceImpl.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service.impl;
+
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.mapper.SignConfigRelationMapper;
+import org.springblade.manager.service.ISignConfigRelationService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 电签配置关联表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+@Service
+@AllArgsConstructor
+public class SignConfigRelationServiceImpl extends BaseServiceImpl<SignConfigRelationMapper, SignConfigRelation> implements ISignConfigRelationService {
+
+}

+ 381 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigServiceImpl.java

@@ -0,0 +1,381 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service.impl;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.manager.dto.SignConfigDTO;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.entity.SignConfigRelation;
+import org.springblade.manager.entity.TableInfo;
+import org.springblade.manager.entity.WbsFormElement;
+import org.springblade.manager.mapper.SignConfigMapper;
+import org.springblade.manager.mapper.WbsFormElementMapper;
+import org.springblade.manager.service.ISignConfigRelationService;
+import org.springblade.manager.service.ISignConfigService;
+import org.springblade.manager.service.ITableInfoService;
+import org.springblade.manager.utils.WbsElementUtil;
+import org.springblade.manager.vo.SignConfigVO;
+import org.springblade.manager.vo.TextdictInfoVO;
+import org.springblade.manager.vo.WbsFormElementVO3;
+import org.springblade.manager.wrapper.SignConfigWrapper;
+import org.springblade.system.feign.ISysClient;
+import org.springblade.system.vo.RoleVO;
+import org.springblade.system.vo.RoleVO2;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.support.TransactionTemplate;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+/**
+ * 电签配置 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-05-27
+ */
+@Service
+@AllArgsConstructor
+public class SignConfigServiceImpl extends BaseServiceImpl<SignConfigMapper, SignConfig> implements ISignConfigService {
+
+    private final ITableInfoService tableInfoService;
+
+    private final WbsFormElementMapper wbsFormElementMapper;
+
+    private final TransactionTemplate transactionTemplate;
+
+    private final ISignConfigRelationService signConfigRelationService;
+
+    private final ISysClient sysClient;
+
+    @Override
+    public List<RoleVO2> getRoleList(Integer relationType, String roleName) {
+        return this.baseMapper.getRoleList(relationType, roleName);
+    }
+
+    @Override
+    public List<SignConfigRelation> getSignConfigRelationListByConfId(Long confId, Integer type) {
+        return this.baseMapper.getSignConfigRelationListByConfId(confId, type);
+    }
+
+    @Override
+    public Boolean addOrEdit(List<SignConfigDTO> signConfigDTOs) {
+        signConfigDTOs.forEach(signConfigDTO -> {
+            SignConfig config = new SignConfig();
+            BeanUtil.copyProperties(signConfigDTO, config);
+            if (signConfigDTO.getElementId() == null) {
+                if (signConfigDTO.getEId() == null) {
+                    throw new ServiceException("请选择元素");
+                }
+                signConfigDTO.setElementId(signConfigDTO.getEId() + "");
+            }
+            WbsFormElement element = wbsFormElementMapper.selectById(signConfigDTO.getElementId());
+            if (element == null) {
+                throw new ServiceException("未查找到该元素,请重新选择");
+            }
+            config.setEId(element.getId());
+            config.setTenantId(AuthUtil.getTenantId());
+            config.setEKey(element.getEKey());
+            config.setElementType(element.getEType());
+            config.setEName(element.getEName());
+            List<String> roleIds = signConfigDTO.getRoleIds();
+            List<SignConfigRelation> signConfigRelationsByRoles = new ArrayList<>();
+            List<SignConfigRelation> signConfigRelationsByTables = new ArrayList<>();
+            if (roleIds != null && !roleIds.isEmpty()) {
+                R<List<RoleVO>> roleResult = sysClient.search();
+                if (!roleResult.isSuccess() || roleResult.getData() == null || roleResult.getData().isEmpty()) {
+                    throw new ServiceException("获取岗位信息失败");
+                }
+                List<RoleVO> data = roleResult.getData();
+                Map<String, RoleVO> roleVOMap = new HashMap<>();
+                //先处理管理员
+                for (RoleVO vos : data) {
+                    if (vos.getRoleName().contains("施工方") || vos.getRoleName().contains("监理方") || vos.getRoleName().contains("业主方")) {
+                        List<RoleVO> children = vos.getChildren();
+                        roleVOMap.put(vos.getId() + "", vos);
+                        if (children != null && !children.isEmpty()) {
+                            children.forEach(child -> roleVOMap.put(child.getId() + "", child));
+                        }
+                    }
+                }
+                for (String roleId : roleIds) {
+                    RoleVO roleVO = roleVOMap.get(roleId);
+                    if (roleVO != null) {
+                        SignConfigRelation signConfigRelation = new SignConfigRelation();
+                        signConfigRelation.setRelationId(Long.valueOf(roleId));
+                        signConfigRelation.setType(1);
+                        signConfigRelation.setRelationName(roleVO.getRoleName());
+                        RoleVO parent = roleVOMap.get(roleVO.getParentId() + "");
+                        if (parent != null) {
+                            if (parent.getRoleName().contains("施工方")) {
+                                signConfigRelation.setRelationType(1);
+                            }
+                            if (parent.getRoleName().contains("监理方")) {
+                                signConfigRelation.setRelationType(2);
+                            }
+                            if (parent.getRoleName().contains("业主方")) {
+                                signConfigRelation.setRelationType(3);
+                            }
+                        }
+                        signConfigRelationsByRoles.add(signConfigRelation);
+                    }
+                }
+            }
+            List<String> tableIds = signConfigDTO.getTableIds();
+            if (tableIds != null && !tableIds.isEmpty()) {
+                List<TableInfo> tableInfos = tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().select(TableInfo::getTabChName, TableInfo::getId, TableInfo::getTabType).in(TableInfo::getId, tableIds));
+                if (tableInfos == null || tableInfos.isEmpty()) {
+                    throw new ServiceException("获取元素表信息失败");
+                }
+                Map<String, TableInfo> tableMap = tableInfos.stream().collect(Collectors.toMap(tableInfo -> tableInfo.getId() + "", tab -> tab, (v1, v2) -> v1));
+                for (String tableId : tableIds) {
+                    TableInfo tableInfo = tableMap.get(tableId);
+                    if (tableInfo != null) {
+                        SignConfigRelation signConfigRelation = new SignConfigRelation();
+                        signConfigRelation.setRelationId(Long.valueOf(tableId));
+                        signConfigRelation.setType(0);
+                        signConfigRelation.setRelationName(tableInfo.getTabChName());
+                        signConfigRelation.setRelationType(tableInfo.getTabType());
+                        signConfigRelationsByTables.add(signConfigRelation);
+                    }
+                }
+                config.setTableType(1);
+            } else {
+                config.setTableType(0);
+            }
+            transactionTemplate.execute(transactionStatus -> {
+                if (config.getId() !=  null) {
+                    this.updateById(config);
+                    if (!signConfigRelationsByTables.isEmpty()) {
+                        signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().eq(SignConfigRelation::getConfId, config.getId()).eq(SignConfigRelation::getType, 0));
+                    }
+                    if (!signConfigRelationsByRoles.isEmpty()) {
+                        signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().eq(SignConfigRelation::getConfId, config.getId()).eq(SignConfigRelation::getType, 1));
+                    }
+                } else {
+                    this.save(config);
+                }
+                if (!signConfigRelationsByRoles.isEmpty()) {
+                    signConfigRelationsByRoles.forEach(signConfigRelation -> signConfigRelation.setConfId(config.getId()));
+                    this.signConfigRelationService.saveBatch(signConfigRelationsByRoles);
+                }
+                if (!signConfigRelationsByTables.isEmpty()) {
+                    signConfigRelationsByTables.forEach(signConfigRelation -> signConfigRelation.setConfId(config.getId()));
+                    this.signConfigRelationService.saveBatch(signConfigRelationsByTables);
+                }
+                return true;
+            });
+        });
+        return true;
+    }
+
+    @Override
+    public List<WbsFormElementVO3> elementList() {
+        List<WbsFormElement> list = wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery().select(WbsFormElement::getEName, WbsFormElement::getId, WbsFormElement::getEType)
+                .eq(WbsFormElement::getEType, WbsElementUtil.getElementType("签名")).groupBy(WbsFormElement::getEName));
+        List<WbsFormElementVO3> result =  list.stream().map(element -> {
+            WbsFormElementVO3 vo = new WbsFormElementVO3();
+            vo.setId(element.getId());
+            vo.setEName(element.getEName());
+            vo.setEType(element.getEType());
+            vo.setETypeName(WbsElementUtil.getElementTypeName(element.getEType()));
+            return vo;
+        }).collect(Collectors.toList());
+        return result;
+    }
+
+    @Override
+    public IPage<SignConfigVO> selectPageByRoleId(IPage<SignConfig> page, Long roleId, String keyword, Integer relationType) {
+        List<SignConfig> signConfigs = baseMapper.selectPageByRoleId(page, roleId, keyword, relationType);
+        page.setRecords(signConfigs);
+        IPage<SignConfigVO> pageVO = SignConfigWrapper.build().pageVO(page);
+        List<SignConfigVO> records = pageVO.getRecords();
+        List<Long> ids = records.stream().map(SignConfigVO::getId).collect(Collectors.toList());
+        if (!ids.isEmpty()) {
+            List<SignConfigRelation> signConfigRelations = signConfigRelationService.list(Wrappers.<SignConfigRelation>lambdaQuery().select(SignConfigRelation::getConfId, SignConfigRelation::getRelationId, SignConfigRelation::getType)
+                    .in(SignConfigRelation::getConfId, ids).eq(SignConfigRelation::getIsDeleted, 0));
+            Map<Long, Map<Integer, List<SignConfigRelation>>> map = signConfigRelations.stream().collect(Collectors.groupingBy(SignConfigRelation::getConfId, Collectors.groupingBy(SignConfigRelation::getType)));
+            records.forEach(record -> {
+                Map<Integer, List<SignConfigRelation>> listMap = map.get(record.getId());
+                if (listMap != null) {
+                    List<SignConfigRelation> list = listMap.get(1);
+                    if (list != null) {
+                        record.setRoleIds(list.stream().map(SignConfigRelation::getRelationId).map(String::valueOf).collect(Collectors.toList()));
+                    }
+                    list = listMap.get(0);
+                    if (list != null) {
+                        record.setTableIds(list.stream().map(SignConfigRelation::getRelationId).map(String::valueOf).collect(Collectors.toList()));
+                    }
+                }
+            });
+        }
+        return pageVO;
+    }
+
+    @Override
+    public List<RoleVO> queryAllRoleList(Integer type, String roleName) {
+        //获取当前系统配置的角色划分
+        R<List<RoleVO>> result = this.sysClient.search();
+        if (!result.isSuccess() || result.getData() == null || result.getData().isEmpty()) {
+            throw new ServiceException("获取岗位信息失败");
+        }
+        List<RoleVO> roleVOS = result.getData();
+        List<RoleVO> roles = new ArrayList<>();
+        //先处理管理员
+        for (RoleVO vos : roleVOS) {
+            if (vos.getRoleName().contains("施工方") || vos.getRoleName().contains("监理方") || vos.getRoleName().contains("业主方")) {
+                if (type != null ) {
+                    if (type == 1 && vos.getRoleName().contains("施工方")) {
+                        roles = vos.getChildren();
+                    } else if (type == 2 && vos.getRoleName().contains("监理方")) {
+                        roles = vos.getChildren();
+                    } else if (type == 3 && vos.getRoleName().contains("业主方")) {
+                        roles = vos.getChildren();
+                    }
+                } else {
+                    roles.addAll(vos.getChildren());
+                }
+            }
+        }
+        if (roleName != null && !roleName.isEmpty()) {
+            if (roles != null && !roles.isEmpty()) {
+                List<RoleVO> temp = new ArrayList<>();
+                for (RoleVO role : roles) {
+                    if (role.getRoleName().contains(roleName)) {
+                        temp.add(role);
+                        List<RoleVO> children = role.getChildren();
+                        if (children != null && !children.isEmpty()) {
+                            List<RoleVO> temp1 = new ArrayList<>();
+                            for (RoleVO child2 : children) {
+                                if (child2.getRoleName().contains(roleName)) {
+                                    temp1.add(child2);
+                                }
+                            }
+                            role.setChildren(temp1);
+                        }
+                    }
+                }
+                return temp;
+            }
+        }
+        return roles;
+    }
+
+    @Override
+    public List<TableInfo> tableList(Integer tableType, String name) {
+        List<TableInfo> tableInfos = this.tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().eq(tableType != null, TableInfo::getTabType, tableType).like(name != null && !name.isEmpty(), TableInfo::getTabChName, name));
+        tableInfos.sort(Comparator.comparingInt(TableInfo::getTabType));
+        return tableInfos;
+    }
+
+    @Override
+    public List<TextdictInfoVO> hasSignConfig(String initTableName, List<String> keyNames, TextdictInfoVO vo) {
+        List<TextdictInfoVO> textdictInfoVOS = new ArrayList<>();
+        if (keyNames == null || keyNames.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Map<String, String> keyMap = keyNames.stream().collect(Collectors.toMap(key -> key.split("__")[0], key -> key, (key1, key2) -> key1));
+        List<TableInfo> tableInfos = this.tableInfoService.list(Wrappers.<TableInfo>lambdaQuery().select(TableInfo::getId).eq(TableInfo::getTabEnName, initTableName));
+        if (tableInfos == null || tableInfos.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        List<WbsFormElement> list = this.wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery().select(WbsFormElement::getEName, WbsFormElement::getEKey)
+                .eq(WbsFormElement::getFId, tableInfos.get(0).getId()).in(WbsFormElement::getEKey, keyMap.keySet()));
+        if (list == null || list.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Set<String> names = list.stream().map(WbsFormElement::getEName).collect(Collectors.toSet());
+        List<SignConfigVO> signConfigs = this.baseMapper.getConfigByENames(names);
+        if (signConfigs == null || signConfigs.isEmpty()) {
+            return textdictInfoVOS;
+        }
+        Map<String, List<SignConfigVO>> map = signConfigs.stream().collect(Collectors.groupingBy(SignConfigVO::getEName));
+        Map<String, String> keyNameMap = list.stream().collect(Collectors.toMap(WbsFormElement::getEKey, WbsFormElement::getEName));
+        keyMap.forEach((key, value) -> {
+            String colName = keyNameMap.get(key);
+            if (colName == null) {
+                return;
+            }
+            List<SignConfigVO> signConfigVOS = map.get(colName);
+            if (signConfigVOS == null || signConfigVOS.isEmpty()) {
+                return;
+            }
+            Map<Long, String> roleIdNameMap = new HashMap<>();
+            signConfigVOS.forEach(signConfigVO -> {
+                List<SignConfigRelation> relations = signConfigVO.getRelations();
+                if (relations != null && !relations.isEmpty()) {
+                    Map<Integer, List<SignConfigRelation>> collect = relations.stream().collect(Collectors.groupingBy(SignConfigRelation::getType));
+                    // 部分表,判断tableInfos是否在其中
+                    if (signConfigVO.getTableType() == 1) {
+                        List<SignConfigRelation> tables = collect.get(0);
+                        if (tables == null || tables.isEmpty()) {
+                            return;
+                        }
+                        Map<Long, SignConfigRelation> tableMap = tables.stream().collect(Collectors.toMap(SignConfigRelation::getRelationId, v -> v, (v1, v2) -> v1));
+                        SignConfigRelation relation = tableMap.get(tableInfos.get(0).getId());
+                        if (relation == null) {
+                            return;
+                        }
+                    }
+                    List<SignConfigRelation> roles = collect.get(1);
+                    if (roles != null && !roles.isEmpty()) {
+                        roles.forEach(role -> {
+                            roleIdNameMap.put(role.getRelationId(), role.getRelationName());
+                        });
+                    }
+                }
+            });
+            if (!roleIdNameMap.isEmpty()) {
+                roleIdNameMap.forEach((roleId, roleName) -> {
+                    TextdictInfoVO textdictInfoVO = new TextdictInfoVO();
+                    if (vo != null) {
+                        BeanUtil.copy(vo, textdictInfoVO);
+                    }
+                    textdictInfoVO.setId(null);
+                    textdictInfoVO.setColKey(value);
+                    textdictInfoVO.setColName(colName);
+                    textdictInfoVO.setIsSystem(1);
+                    textdictInfoVO.setSigRoleId(roleId + "");
+                    textdictInfoVO.setSigRoleName(roleName);
+                    textdictInfoVOS.add(textdictInfoVO);
+                });
+            }
+        });
+        return textdictInfoVOS;
+    }
+
+    @Override
+    public boolean deleteLogic(@NotEmpty List<Long> ids) {
+        if (!ids.isEmpty()) {
+            transactionTemplate.execute(status -> {
+                super.deleteLogic(ids);
+                return signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().in(SignConfigRelation::getConfId, ids));
+            });
+        }
+        return true;
+    }
+}

+ 51 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -33,11 +33,12 @@ import org.springblade.manager.entity.TextdictInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.mapper.TextdictInfoMapper;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
+import org.springblade.manager.service.ISignConfigService;
 import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.TextdictBy345VO;
 import org.springblade.manager.vo.TextdictInfoVO;
-import org.springblade.system.cache.ParamCache;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -47,6 +48,7 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 参数信息表 服务实现类
@@ -58,6 +60,9 @@ import java.util.*;
 public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, TextdictInfo> implements ITextdictInfoService {
     @Resource
     private WbsTreePrivateMapper wbsTreePrivateMapper;
+
+    @Resource
+    private ISignConfigService iSignConfigService;
     @Override
     public IPage<TextdictInfoVO> selectTextdictInfoPage(IPage<TextdictInfoVO> page, TextdictInfoVO textdictInfo) {
         List<TextdictInfoVO> textdict = new ArrayList<>();
@@ -69,20 +74,54 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 String htmlString = IoUtil.readToString(fileInputStream);
                 Document doc = Jsoup.parse(htmlString);
                 Elements table = doc.getElementsByAttribute("dqid");
-
-                    List<String> dqid = new ArrayList<>();
-                    for(Element ek:table){
-                        dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
+                List<String> dqid = new ArrayList<>();
+                List<String> keys = new ArrayList<>();
+                for(Element ek:table){
+                    dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
+                    Elements keyNames = ek.getElementsByAttribute("keyname");
+                    if(Func.isNotEmpty(keyNames)){
+                        for(Element keyName:keyNames){
+                            keys.addAll(Func.toStrList("\\|\\|",keyName.attr("keyname")));
+                        }
                     }
-                    if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
-                        if(Func.isNotEmpty(dqid) && dqid.size() > 0){
-                            textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
-                        }else {
-                            textdict = new ArrayList<>();
+                }
+                if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
+                    if(Func.isNotEmpty(dqid) && dqid.size() > 0){
+                        textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
+                    }else {
+                        textdict = new ArrayList<>();
+                    }
+                    if (!keys.isEmpty()) {
+                        // 查询系统级电签配置
+                        TextdictInfoVO temp = null;
+                        if (textdict != null && !textdict.isEmpty()) {
+                            temp = textdict.get(0);
+                        }
+                        if (temp == null) {
+                            temp = new TextdictInfoVO();
+                            temp.setProjectId(privateInfo.getProjectId());
+                            temp.setExcelId(privateInfo.getExcelId() + "");
+                            temp.setTabId(privateInfo.getPKeyId() + "");
+                            temp.setType(2);
+                        }
+                        List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
+                        if (textdict == null || textdict.isEmpty()) {
+                            textdict = textdictList;
+                        } else {
+                            Map<String, Map<String, TextdictInfoVO>> map = textdict.stream().collect(Collectors.groupingBy(TextdictInfoVO::getColKey, Collectors.toMap(TextdictInfoVO::getSigRoleId, v -> v, (v1, v2) -> v1)));
+                            List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
+                                Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
+                                if (voMap != null && !voMap.isEmpty() ) {
+                                    return voMap.get(textdictInfoVO.getSigRoleId()) == null;
+                                }
+                                return true;
+                            }).collect(Collectors.toList());
+                            textdict.addAll(collect);
                         }
-                    }else{
-                        textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
                     }
+                }else{
+                    textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
+                }
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }

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

@@ -2536,7 +2536,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     }
                 }
                 //wbs节点和分部工程的名称类型能对应上,并且编号不一样,并且祖级节点也都能对应上,就修改编号
-                if(vo.getNodeName().equals(dto.getDivisionName())&&vo.getNodeType()==2&&!vo.getPartitionCode().equals(dto.getDivisionCode())){
+                if(vo.getNodeName().equals(dto.getDivisionName())&&vo.getNodeType()==2&&(vo.getPartitionCode()==null||vo.getPartitionCode().equals(dto.getDivisionCode()))){
                     Boolean exist = this.isExist(dto, WbsTreeContractListupdate, 3, wbsTreeContractRoot);
                     if(exist){
                         if(isTrueNode(Arrays.asList(dto.getUnitName(),dto.getSubUnitName(),dto.getDivisionName()),vo)){

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

@@ -818,8 +818,8 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     }
 
     @Override
-    public List<WbsFormElementVO> selectPrivateFormElements(String id, String eName) {
-        return wbsTreeMapper.selectPrivateFormElements(id, eName);
+    public List<WbsFormElementVO> selectPrivateFormElements(String id, String eName,Integer eType) {
+        return wbsTreeMapper.selectPrivateFormElements(id, eName,eType);
     }
 
     @Override

+ 25 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java

@@ -164,6 +164,31 @@ public class WbsElementUtil {
         }
     }
 
+    public static String getElementTypeName(Integer type) {
+        if (type != null) {
+            switch (type) {
+                case 1:
+                    return "字符串";
+                case 2:
+                    return "整数";
+                case 3:
+                    return "小数";
+                case 4:
+                    return "日期";
+                case 5:
+                    return "数值";
+                case 6:
+                    return "签名";
+                case 7:
+                    return "文件";
+                default:
+                    return "其它";
+            }
+        } else {
+            return "其它";
+        }
+    }
+
     public static Integer getTableType(String tableType) {
         if (tableType != null) {
             switch (tableType) {

+ 48 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/SignConfigWrapper.java

@@ -0,0 +1,48 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.manager.entity.ExcelTab;
+import org.springblade.manager.entity.SignConfig;
+import org.springblade.manager.utils.WbsElementUtil;
+import org.springblade.manager.vo.ExcelTabVO;
+import org.springblade.manager.vo.SignConfigVO;
+
+import java.util.Objects;
+
+/**
+ * 清表基础数据表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+public class SignConfigWrapper extends BaseEntityWrapper<SignConfig, SignConfigVO> {
+
+    public static SignConfigWrapper build() {
+        return new SignConfigWrapper();
+    }
+
+    @Override
+    public SignConfigVO entityVO(SignConfig signConfig) {
+        SignConfigVO signConfigVO = Objects.requireNonNull(BeanUtil.copy(signConfig, SignConfigVO.class));
+        signConfigVO.setElementTypeName(WbsElementUtil.getElementTypeName(signConfig.getElementType()));
+        return signConfigVO;
+    }
+
+}

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/InterimPayCertificateItemServiceImpl.java

@@ -127,7 +127,7 @@ public class InterimPayCertificateItemServiceImpl extends BaseServiceImpl<Interi
 
     @Override
     public void saveOrUpdateBatchList(List<InterimPayCertificateItem> items,Long reportId) {
-        List<InterimPayCertificateItem> list = baseMapper.selectList(new QueryWrapper<InterimPayCertificateItem>().eq("certificate_id", reportId));
+        List<InterimPayCertificateItem> list = baseMapper.selectList(new QueryWrapper<InterimPayCertificateItem>().eq("certificate_id", reportId).ne("chapter_seq","施工单位送审金额"));
         if(list.size()>0){
             for (InterimPayCertificateItem item : items) {
                 baseMapper.updateById(item);

+ 53 - 14
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -84,6 +84,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.Function;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @Service
 @AllArgsConstructor
@@ -789,12 +790,16 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 
                         /* ================ 处理颜色 ================ */
                         long startTime = System.currentTimeMillis();
-                        List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
-                        Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
+//                        List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
+//                        Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
                         List<NodeVO> treeNodeVOList = this.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
-                        NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
-                        List<NodeVO> nodeVOS = this.flattenTree(treeNodeVOList);
-                        Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
+//                        NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
+                        Map<Long, Integer> nodeColorStatusMap = new HashMap<>();
+                        NodeVO.calculateStatusToDFS1(treeNodeVOList, nodeColorStatusMap);
+//                        buildNodeTreeByStream(distinctNodesAll, lowestNodesMap, nodeColorStatusMap);
+                        // 将树形结构展开成列表
+//                        List<NodeVO> nodeVOS = this.flattenTree(treeNodeVOList);
+//                        Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
                         long endTime = System.currentTimeMillis();
                         long executionTime = endTime - startTime;
                         _logger.info("合同段 " + contractId + " 处理颜色 执行时间:" + executionTime + " ms");
@@ -928,13 +933,15 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                                             }
                                         }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
-                                List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
-                                Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
+//                                List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
+//                                Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
                                 List<NodeVO> treeNodeVOList = this.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
-                                NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
-                                List<NodeVO> nodeVOS = this.flattenTree(treeNodeVOList);
-                                Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
-
+//                                NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
+//                                List<NodeVO> nodeVOS = this.flattenTree(treeNodeVOList);
+//                                Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
+                                Map<Long, Integer> nodeColorStatusMap = new HashMap<>();
+                                NodeVO.calculateStatusToDFS1(treeNodeVOList, nodeColorStatusMap);
+//                                buildNodeTreeByStream(distinctNodesAll, lowestNodesMap, nodeColorStatusMap);
                                 if (lazyNodes.size() > 0) {
                                     Map<Long, Integer> countMap = new HashMap<>();
                                     for (WbsTreeContractLazyVO node : resultParentNodesTB) {
@@ -1426,7 +1433,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 
             /*重新计算,进行递归获取父节点计数统计*/
             this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
-
+//            Map<Long, List<WbsTreeContractLazyVO>> map = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getId));
+//            recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, map);
             long endTime = System.currentTimeMillis();
             long executionTime = endTime - startTime;
             _logger.info("合同段 " + contractId + " wbs节点树 数量计算 执行时间:" + executionTime + " ms");
@@ -1482,6 +1490,37 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         }
     }
 
+    public void recursiveGetParentNodes(List<WbsTreeContractLazyVO> result, List<Long> lowestNodeParentIds, Map<Long, List<WbsTreeContractLazyVO>> nodeMap) {
+        if (lowestNodeParentIds == null || lowestNodeParentIds.isEmpty()) {
+            return;
+        }
+        Map<Long, Long> parentIdGroup = lowestNodeParentIds.stream()
+                .collect(Collectors.groupingByConcurrent(Function.identity(), Collectors.counting()));
+
+        List<WbsTreeContractLazyVO> collectedNodes = parentIdGroup.entrySet().stream()
+                .flatMap(entry -> {
+                    List<WbsTreeContractLazyVO> nodes = nodeMap.get(entry.getKey());
+                    if (nodes == null || nodes.isEmpty()) {
+                        return Stream.empty();
+                    }
+                    if (entry.getValue() > 1L) {
+                        nodes = nodes.stream().limit(1)
+                                .flatMap(node -> Collections.nCopies(entry.getValue().intValue(), node).stream())
+                                .collect(Collectors.toList());
+                    }
+                    return nodes.stream();
+                })
+                .collect(Collectors.toList());
+        List<Long> collect = collectedNodes.stream()
+                .map(WbsTreeContractLazyVO::getParentId).filter(Objects::nonNull).distinct()
+                .collect(Collectors.toList());
+        if (!collect.isEmpty()) {
+            result.addAll(collectedNodes);
+            this.recursiveGetParentNodes(result, collect, nodeMap);
+        }
+    }
+
+
     /**
      * 转换VO
      *
@@ -1493,7 +1532,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         nodeVO.setId(wbsTreeContractLazyVO.getId());
         nodeVO.setParentId(wbsTreeContractLazyVO.getParentId());
         nodeVO.setPKeyId(wbsTreeContractLazyVO.getPKeyId());
-        nodeVO.setStatus(cn.hutool.core.util.ObjectUtil.isNotEmpty(wbsTreeContractLazyVO.getColorStatus()) ? wbsTreeContractLazyVO.getColorStatus() : 1);
+        nodeVO.setStatus(wbsTreeContractLazyVO.getColorStatus() != null ? wbsTreeContractLazyVO.getColorStatus() : 1);
         return nodeVO;
     }
 
@@ -1517,7 +1556,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         for (WbsTreeContractLazyVO vo : list) {
             if (vo.getHasChildren().equals(0)) {
                 WbsTreeContractLazyVO lowestNodeVO = lowestNodesMap.getOrDefault(vo.getPKeyId(), null);
-                if (lowestNodeVO != null && cn.hutool.core.util.ObjectUtil.isNotEmpty(lowestNodeVO.getColorStatus())) {
+                if (lowestNodeVO != null && lowestNodeVO.getColorStatus() != null) {
                     //最底层颜色初始化
                     vo.setColorStatus(lowestNodeVO.getColorStatus());
                 }