Переглянути джерело

Merge branch 'master' of http://39.108.216.210:3000/zhuwei/bladex

huangtf 1 тиждень тому
батько
коміт
ae1d43dc77
100 змінених файлів з 3794 додано та 742 видалено
  1. 4 4
      blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java
  2. 2 0
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  3. 2 2
      blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java
  4. 0 1
      blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  5. 4 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java
  6. 1 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java
  7. 1 8
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java
  8. 22 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO.java
  9. 33 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO2.java
  10. 6 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/reSigningEVisaDTO.java
  11. 6 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLog.java
  12. 5 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/EntrustInfo.java
  13. 1 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQuery.java
  14. 8 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java
  15. 12 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  16. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java
  17. 5 7
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/SaveContractLogVO.java
  18. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskApprovalVO.java
  19. 1 1
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClient.java
  20. 1 1
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClientFallBack.java
  21. 11 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/CopyDto.java
  22. 17 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/EvaluateDate.java
  23. 302 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/WbsTreeContractDto1.java
  24. 11 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/WbsTreeDTO.java
  25. 33 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/Classifcation.java
  26. 13 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/EvaluateDate.java
  27. 8 4
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignPfxFile.java
  28. 37 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignPfxFilePre.java
  29. 14 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTree.java
  30. 27 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreeContract.java
  31. 17 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java
  32. 5 6
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  33. 5 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClientFallBack.java
  34. 2 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreeContractClient.java
  35. 4 4
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/MaterialWithheld.java
  36. 14 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignPfxFilePreVo.java
  37. 6 3
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignPfxFileVO.java
  38. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SubprojectInterimPaymentSummary.java
  39. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java
  40. 25 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java
  41. 17 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/InformationQueryVO1.java
  42. 20 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/InformationQueryVO2.java
  43. 59 54
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/JinLinPushApiController.java
  44. 7 5
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java
  45. 2 4
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java
  46. 22 4
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java
  47. 17 5
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java
  48. 31 11
      blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java
  49. 312 186
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  50. 108 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java
  51. 69 5
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  52. 17 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialMaterialController.java
  53. 16 7
      blade-service/blade-business/src/main/java/org/springblade/business/controller/UserViewProjectContractController.java
  54. 23 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java
  55. 21 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  56. 4 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.java
  57. 18 2
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.xml
  58. 6 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/IEntrustInfoService.java
  59. 6 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java
  60. 79 6
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java
  61. 29 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  62. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  63. 205 12
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  64. 18 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java
  65. 102 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  66. 0 1
      blade-service/blade-business/src/main/java/org/springblade/business/utils/FileUtils.java
  67. 1 1
      blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java
  68. 16 11
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  69. 104 0
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaJLController.java
  70. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/feign/EVisaClientImpl.java
  71. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/EVisaService.java
  72. 225 174
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  73. 0 25
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/PDFUtils.java
  74. 0 4
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/ThreadPoolDemo.java
  75. 2 2
      blade-service/blade-manager/pom.xml
  76. 7 3
      blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java
  77. 3 0
      blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java
  78. 4 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/ManagerApplication.java
  79. 317 75
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  80. 18 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FormulaController.java
  81. 97 16
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java
  82. 31 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java
  83. 27 6
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java
  84. 25 8
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java
  85. 617 16
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  86. 22 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java
  87. 3 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorInit.java
  88. 101 22
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java
  89. 8 7
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaTurnPoint.java
  90. 118 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaZhiZuo.java
  91. 10 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFileMapper.xml
  92. 25 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFilePreMapper.java
  93. 75 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFilePreMapper.xml
  94. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TableFileMapper.java
  95. 5 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TableFileMapper.xml
  96. 6 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java
  97. 19 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml
  98. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  99. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IFormulaService.java
  100. 12 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/ISignPfxFilePreService.java

+ 4 - 4
blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java

@@ -287,10 +287,10 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
                 || (("2").equals(result) && user.getUserType().contains("2")) //app
                 || (("3").equals(result) && user.getUserType().contains("3")) //档案
                 || (("4").equals(result) && user.getUserType().contains("4")) //后管
-                || (("5").equals(result)) // 成本管控系统
-                || (("6").equals(result)) // 征拆系统
-                || (("7").equals(result)) // 计量系统
-                || (("8").equals(result)) // 安全
+                || (("5").equals(result) && user.getUserType().contains("5")) // 成本管控系统
+                || (("6").equals(result) && user.getUserType().contains("6")) // 征拆系统
+                || (("7").equals(result) && user.getUserType().contains("7")) // 计量系统
+                || (("8").equals(result) && user.getUserType().contains("8")) // 安全
         ) {
             //放行
             return;

+ 2 - 0
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@@ -81,6 +81,8 @@ public interface LauncherConstant {
      * nacos dev 地址 215==172.31.222.127   192.168.0.109     127.0.0.1  210-=-172.30.224.81
      * nacos dev 地址 172.31.222.127   192.168.0.109     127.0.0.1    172.30.224.81(39.108.216.210) 152.168.2.11
      */
+    //更107服务器时打包的时候要改成192.168.0.109
+    //127.0.0.1
     String NACOS_DEV_ADDR = "127.0.0.1:8848";
 
     /**

+ 2 - 2
blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java

@@ -15,7 +15,7 @@ public class AsyncConfigurer {
     /**
      * cpu 核心数量
      */
-    public static final int cpuNum =6 ;//Runtime.getRuntime().availableProcessors();
+    public static final int cpuNum = 10 ;//Runtime.getRuntime().availableProcessors();
 
     /**
      * 线程池配置
@@ -24,7 +24,7 @@ public class AsyncConfigurer {
     @Bean("taskExecutor1")
     public ThreadPoolExecutor getAsyncExecutor() {
         return new ThreadPoolMonitor(cpuNum
-                , 10
+                , 15
                 , 30
                 , TimeUnit.SECONDS
                 , new LinkedBlockingQueue<>(2000)

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

@@ -594,7 +594,6 @@ public class CommonUtil {
         return baos.toByteArray();
     }
 
-
     /**
      * 图片压缩
      *

+ 4 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java

@@ -21,9 +21,13 @@ import com.aliyun.oss.OSSClient;
 import com.aliyun.oss.common.auth.CredentialsProvider;
 import com.aliyun.oss.common.auth.DefaultCredentialProvider;
 import lombok.SneakyThrows;
+import org.springblade.core.oss.AliossTemplate;
+import org.springblade.core.oss.OssTemplate;
 import org.springblade.core.oss.props.OssProperties;
 import org.springblade.core.oss.rule.BladeOssRule;
+import org.springblade.core.oss.rule.OssRule;
 import org.springblade.resource.builder.ossre.AliossTemplateRe;
+import org.springblade.resource.builder.ossre.OssTemplateRe;
 import org.springblade.resource.entity.Oss;
 
 /**

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@@ -85,7 +85,7 @@ public class OssBuilder {
         String tenantId = AuthUtil.getTenantId();
         Oss oss = getOss(tenantId, code);
         oss.setEndpoint("http://183.247.216.148:9000/");
-      // oss.setEndpoint("https://oss-cn-shenzhen.aliyuncs.com/");
+       //oss.setEndpoint("https://oss-cn-shenzhen.aliyuncs.com/");
         Oss ossCached = ossPool.get(tenantId);
         OssTemplateRe template = templatePool.get(tenantId);
         // 若为空或者不一致,则重新加载

+ 1 - 8
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java

@@ -23,7 +23,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.poi.util.IOUtils;
 import org.springblade.common.utils.CommonUtil;
-import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.oss.model.OssFile;
@@ -42,14 +41,8 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.image.BufferedImage;
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.security.SecureRandom;
 import java.text.DecimalFormat;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.Objects;
 
@@ -432,7 +425,7 @@ public class OssEndpoint {
      */
     @SneakyThrows
     @PostMapping("/remove-file")
-    @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+    //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
     public R removeFile(@RequestParam String fileName) {
         ossBuilder.template().removeFile(fileName);
         return R.success("操作成功");

+ 22 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 
 @Data
 public class CustomAddContractNodeDTO implements Serializable {
@@ -20,4 +21,25 @@ public class CustomAddContractNodeDTO implements Serializable {
     @ApiModelProperty(value = "划分编号")
     private String partitionCode;
 
+    @ApiModelProperty(value = "1 水利工程 2 数字化上传")
+    private Integer nodeClass;
+
+    @ApiModelProperty(value ="是否含单元评定 0否 1是 默认否")
+    private Integer isClassifition;
+
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "优良个数 默认1")
+    private Integer excellentNum;
+
+    @ApiModelProperty(value = "单元个数默认1")
+    private Integer unitNum;
+
+    @ApiModelProperty(value = "自定义数字化节点的时间")
+    private String digitizeTime;
+
 }

+ 33 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO2.java

@@ -0,0 +1,33 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CustomAddContractNodeDTO2 implements Serializable {
+    @ApiModelProperty(required = true, value = "当前选择新增节点的primaryKeyId")
+    private String primaryKeyId;
+
+    @ApiModelProperty(required = true, value = "节点名称")
+    private String nodeName;
+
+    @ApiModelProperty(required = true, value = "节点类型")
+    private Integer nodeType;
+
+    @ApiModelProperty(value = "划分编号")
+    private String partitionCode;
+
+    @ApiModelProperty(value ="是否含单元评定")
+    private Integer isClassifition;
+
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "优良个数")
+    private Integer excellentNum;
+}

+ 6 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/reSigningEVisaDTO.java

@@ -19,4 +19,10 @@ public class reSigningEVisaDTO {
     private String projectId;
 
     private Integer type;
+    //日志重签-日志id
+    private String logIds;
+    //日志重签-父节点p_key_id
+    private Long nodePrimaryKeyId;
+    //日志重签-表单p_key_id
+    private Long logPkeyId;
 }

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

@@ -79,7 +79,7 @@ public class ContractLog extends BaseEntity {
     /**
      * 数据ID
      */
-    private Long dataId;
+    private String dataId;
 
     @ApiModelProperty("填报人姓名")
     private String createUserName;
@@ -99,4 +99,9 @@ public class ContractLog extends BaseEntity {
     @ApiModelProperty("上报批次")
     private Integer batch;
 
+    @ApiModelProperty("源数据的日志id")
+    private  String oldDataId;
+
+
+
 }

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

@@ -141,6 +141,10 @@ public class EntrustInfo extends BaseEntity {
 	@ApiModelProperty(value = "样品操作状态")
 	private String sampleStatus;
 
-
+	/**
+	 * 委托单类型
+	 */
+	@ApiModelProperty(value = "委托单类型 1=客户 2=rfId")
+	private Integer entrustType;
 
 }

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

@@ -20,6 +20,7 @@ public class InformationQuery extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
 
+
     /**
      * 文件名称
      */

+ 8 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java

@@ -40,6 +40,9 @@ public interface ContractLogClient {
     @GetMapping(API_PREFIX + "/queryContractLogByPrimaryKeyIdAndRecordTimeList")
     List<ContractLog> queryContractLogByPrimaryKeyIdAndRecordTimeList(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId);
 
+    @GetMapping(API_PREFIX + "/queryContractLogByPrimaryKeyIdAndRecordTimeAndCreateUserList")
+    List<ContractLog> queryContractLogByPrimaryKeyIdAndRecordTimeAndCreateUserList(@RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId, @RequestParam Long createUser);
+
     @GetMapping(API_PREFIX + "/queryContractLogById")
     JSONObject queryContractLogById(@RequestParam String theLogId);
 
@@ -54,5 +57,10 @@ public interface ContractLogClient {
      */
     @PostMapping(API_PREFIX + "/saveContractLog")
     String saveContractLog(@RequestBody SaveContractLogVO saveContractLogVO);
+    /**
+     * 保存表关联的工序节点信息
+     */
+    @PostMapping(API_PREFIX + "/saveLogWbsList")
+    String saveLogWbsList(@RequestBody SaveContractLogVO saveContractLogVO);
 
 }

+ 12 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java

@@ -92,4 +92,16 @@ public interface InformationQueryClient {
 
     @PostMapping(API_PREFIX + "/getInformationByContractId1")
     void getInformationByContractId1(Long contractId);
+
+    @PostMapping(API_PREFIX+"/insertInformationQuery1")
+    void insert(@RequestBody InformationQuery iq);
+
+    @PostMapping(API_PREFIX+"/getInfoByWbsId")
+    InformationQuery getInfoByWbsId(@RequestParam Long wbsId);
+
+    @PostMapping(API_PREFIX+"/updateInformationQuery1")
+    void update(@RequestBody  InformationQuery iq);
+
+    @PostMapping(API_PREFIX+"/delInformation")
+    void delInformation(@RequestBody InformationQuery infoByWbsId);
 }

+ 2 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java

@@ -46,6 +46,8 @@ public class ContractLogVO extends ContractLog {
 
     @ApiModelProperty("是否有删除、废除权限")
     private boolean operation;
+    @ApiModelProperty(value = "签字人员集合")
+    private List<Object> taskApproveUserNamesList;
 
     public void setSelectNodeList(String primaryKeyId, String title) {
         if (this.selectNodeList == null) {

+ 5 - 7
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/SaveContractLogVO.java

@@ -3,19 +3,14 @@ package org.springblade.business.vo;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.apache.http.client.utils.DateUtils;
-import org.springblade.business.entity.ContractLog;
-import org.springblade.business.entity.ContractLogWbs;
-import org.springblade.core.tool.utils.DateUtil;
 
-import java.util.Date;
 import java.util.List;
 
 @Data
 public class SaveContractLogVO {
 
     @ApiModelProperty("列表数据主键")
-    private Long dataId;
+    private String dataId;
 
     @ApiModelProperty("项目ID")
     private Long projectId;
@@ -37,8 +32,10 @@ public class SaveContractLogVO {
 
     @ApiModelProperty("关联工序的ids")
     private List<JSONObject> correlationIds;
+    @ApiModelProperty("源数据的日志id")
+    private  String oldDataId;
 
-    public SaveContractLogVO(Long businessId, String projectId, String contractId, Long wbsNodeId, Long tableId, Integer wbsNodeType, String recordTime, List<JSONObject> correlationIds) {
+    public SaveContractLogVO(String businessId, String projectId, String contractId, Long wbsNodeId, Long tableId, Integer wbsNodeType, String recordTime, List<JSONObject> correlationIds, String oldDataId) {
         this.dataId = businessId;
         this.projectId = Long.parseLong(projectId);
         this.contractId = Long.parseLong(contractId);
@@ -47,6 +44,7 @@ public class SaveContractLogVO {
         this.wbsNodeType = wbsNodeType;
         this.recordTime = recordTime;
         this.correlationIds = correlationIds;
+        this.oldDataId = oldDataId;
     }
 
     public SaveContractLogVO() {

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskApprovalVO.java

@@ -26,7 +26,7 @@ public class TaskApprovalVO {
     @ApiModelProperty("数据源")
     private String formDataId;
 
-    // 1=填报数据(质量填报,试验上报)   2=工程文件 3=日志资料 4=档案数据   5=计量支付证书  6=计量 材料  7= 计量 中间支付  8委托单
+    // 1=填报数据(质量填报,试验上报) 2=工程文件 3=日志资料 4=档案数据   5=计量支付证书  6=计量 材料  7= 计量 中间支付  8委托单
     @ApiModelProperty("上报类型")
     private Integer approvalType;
 

+ 1 - 1
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClient.java

@@ -58,6 +58,6 @@ public interface EVisaClient {
      * 单张PDF批量电签,返回电签后的PDF
      */
     @PostMapping(API_PREFIX + "/batchEVisa")
-    R<String> batchEVisa(@RequestBody SigInfoVO vo);
+    R<String> batchEVisa(@RequestBody SealPdfVO pdfVO);
 
 }

+ 1 - 1
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClientFallBack.java

@@ -48,7 +48,7 @@ public class EVisaClientFallBack implements FallbackFactory<EVisaClient> {
             }
 
             @Override
-            public R<String> batchEVisa(SigInfoVO vo){return R.fail("feign调用失败");}
+            public R<String> batchEVisa(SealPdfVO vo){return R.fail("feign调用失败");}
         };
     }
 }

+ 11 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/CopyDto.java

@@ -0,0 +1,11 @@
+package org.springblade.manager.dto;
+
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+@Data
+public class CopyDto {
+    private Long id;
+    private String nodeName;
+    private Integer num;
+}

+ 17 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/EvaluateDate.java

@@ -0,0 +1,17 @@
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
+import lombok.Data;
+
+@Data
+public class EvaluateDate {
+    @ApiModelProperty(value = "单元工程种类")
+    private String unitName;
+    @ApiModelProperty(value = "单元工程个数")
+    private Integer unitNum;
+    @ApiModelProperty(value = "合格个数")
+    private Integer qualifiedNum;
+    @ApiModelProperty(value = "优良个数")
+    private Integer excellentNum;
+}

+ 302 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/WbsTreeContractDto1.java

@@ -0,0 +1,302 @@
+package org.springblade.manager.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.springblade.manager.entity.WbsTreeContract;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class WbsTreeContractDto1{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(value = "主键id")
+    private Long pKeyId;
+
+    /**
+     * wbsId
+     */
+    @ApiModelProperty(name = "wbsId", value = "wbsId", required = true)
+    private String wbsId;
+
+    /**
+     * wbsType
+     */
+    @ApiModelProperty(name = "wbsType", value = "wbsType")
+    private Integer wbsType;
+
+    /**
+     * 项目Id
+     */
+    @JsonProperty(value = "projectId")
+    @ApiModelProperty(name = "projectId", value = "项目Id", required = true)
+    private String projectId;
+
+    /**
+     * 合同Id
+     */
+    @JsonProperty(value = "contractId")
+    @ApiModelProperty(name = "contractId", value = "合同Id", required = true)
+    private String contractId;
+
+    /**
+     * 合同段类型
+     */
+    @ApiModelProperty(name = "contractType", value = "合同段类型")
+    private Integer contractType;
+
+    /**
+     * 合同段关联id(监理、业主合同关联施工合同id)
+     */
+    @ApiModelProperty(name = "contractIdRelation", value = "合同段关联id(监理、业主合同关联施工合同id)")
+    private String contractIdRelation;
+
+    /**
+     * 租户id
+     */
+    @ApiModelProperty(value = "租户id")
+    private String tenantId;
+
+    /**
+     * 父主键
+     */
+    @ApiModelProperty(value = "父主键id")
+    private Long parentId;
+
+    /**
+     * 节点类型
+     */
+    @ApiModelProperty(value = "节点类型")
+    private Integer nodeType;
+
+    /**
+     * '1'节点 '2'表单
+     */
+    @ApiModelProperty(value = "'1'节点 '2'表单")
+    private Integer type;
+
+    /**
+     * 节点名称
+     */
+    @ApiModelProperty(value = "节点名称")
+    private String nodeName;
+    /**
+     * 节点全称
+     */
+    @ApiModelProperty(value = "节点全称")
+    private String fullName;
+
+    /**
+     * 表单类型
+     */
+    @ApiModelProperty(value = "表单类型")
+    private Integer tableType;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /**
+     * 祖级列表
+     */
+    @ApiModelProperty(value = "祖级id列表")
+    private String ancestors;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 唯一编号
+     */
+    @ApiModelProperty(value = "唯一编号")
+    private String uniqueCode;
+
+    /**
+     * 划分编号
+     */
+    @ApiModelProperty(value = "划分编号")
+    private String partitionCode;
+
+    /**
+     * 是否是实验节点 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "实验节点")
+    private Integer isExpernode;
+
+    /**
+     * 是否有混泥土 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "混泥土")
+    private Integer isConcrete;
+
+    /**
+     * 表单所属方
+     */
+    @ApiModelProperty(value = "表单所属方")
+    private String tableOwner;
+
+    /**
+     * 内业资料类型
+     */
+    @ApiModelProperty(value = "内业资料类型")
+    private Integer majorDataType;
+
+    /**
+     * 初始化实体表名
+     */
+    @ApiModelProperty(value = "初始化实体表名")
+    private String initTableName;
+
+
+    /**
+     * 是否关联清表 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否关联清表 '0'否 '1'是")
+    private Integer isLinkTable;
+
+    /**
+     * 清表Id
+     */
+    @ApiModelProperty(name = "excel_id", value = "excel_id")
+    private Long excelId;
+
+    /**
+     * html路径
+     */
+    @ApiModelProperty(value = "html路径")
+    private String htmlUrl;
+
+    /**
+     * html路径
+     */
+    @ApiModelProperty(value = "pdf路径")
+    private String pdfUrl;
+
+    /**
+     * 用户端是否隐藏
+     */
+
+    @ApiModelProperty(name = "is_buss_show", value = "is_buss_show")
+    private Integer isBussShow;
+
+
+    @ApiModelProperty(value = "原id,如果当前字段有数据则说明这条数据是复制节点")
+    private String oldId;
+
+    /**
+     * 表单是否上传附件1否
+     */
+    @ApiModelProperty(value = "表单是否上传附件1否 2是")
+    private Integer tabFileType;
+
+    /**
+     * 表单是否上传附件1否
+     */
+    @ApiModelProperty(value = "是否复制表 1否 2是")
+    private Integer isCopeTab;
+
+    /**
+     * 是否能预览pdf
+     */
+    @ApiModelProperty(value = "是否能预览pdf 1否 2是")
+    private Integer isTabPdf;
+
+    /**
+     * type=2,映射私有pKeyId
+     */
+    @ApiModelProperty(value = "type=2,映射私有pKeyId")
+    private Long isTypePrivatePid;
+
+    /**
+     * 填报率百分比
+     */
+    @ApiModelProperty(value = "填报率百分比")
+    private String fillRate;
+
+    /**
+     * 节点导入是否识别成功 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "节点导入是否识别成功 '0'否 '1'是")
+    private Integer isImportIdentificationNode;
+
+    /**
+     * 导入wbs划分匹配字段
+     */
+    @ApiModelProperty(value = "导入wbs划分匹配字段")
+    private String importMatchingInfo;
+
+    /**
+     * 是否为隐蔽工程节点 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否为隐蔽工程节点 '0'否 '1'是")
+    private Integer isConcealedWorksNode;
+
+    /**
+     * 配合试验比ids
+     */
+    @ApiModelProperty(value = "配合比试验ids")
+    private String mixRatioTestIds;
+
+    /**
+     * 是否为引用元素
+     */
+    @ApiModelProperty(value = "是否为引用元素 1是 2否")
+    private Integer isEle;
+
+    /**
+     * 数据分组
+     */
+    @ApiModelProperty(value = "数据分组Id")
+    private Long tabGroupId;
+
+    /**
+     * 填报率
+     */
+    @ApiModelProperty(value = "实际填报率")
+    private Integer realFillRate;
+
+    /**
+     * 查询索引
+     */
+    @ApiModelProperty(value = "查询索引")
+    private String treeCode;
+
+    @ApiModelProperty(value = "是否为自定义新增节点 1=是")
+    private Integer isCustom;
+
+    @ApiModelProperty(value = "是否采用排序0否1是")
+    private Integer isUseSort;
+
+    @ApiModelProperty(value = "1 水利工程 2是数字化")
+    private Integer nodeClass;
+
+    @ApiModelProperty(value ="是否含单元评定 0否 1是 默认否")
+    private Integer isClassifition;
+
+    @ApiModelProperty(value = "标准分类")
+    private String className;
+
+    @ApiModelProperty(value = "单元名称")
+    private String unitName;
+
+    @ApiModelProperty(value = "优良个数")
+    private Integer excellentNum;
+
+    @ApiModelProperty(value = "子节点")
+    private List<WbsTreeContractDto1> Children=new ArrayList<>();
+}

+ 11 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/WbsTreeDTO.java

@@ -111,4 +111,15 @@ public class WbsTreeDTO extends WbsTree {
     @ApiModelProperty(value = "表单所属方")
     private String tableOwner;
 
+    /**
+     * 标准分类
+     */
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    /**
+     * 单元名称
+     */
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
 }

+ 33 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/Classifcation.java

@@ -0,0 +1,33 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@TableName("m_classifcation")
+@EqualsAndHashCode
+public class Classifcation {
+    private static final long serialVersionUID = 1L;
+    /**
+     * id
+     */
+    @TableField("id")
+    private Integer id;
+    /**
+     * 标准分类
+     */
+    @TableField("class_name")
+    private String className;
+    /**
+     * 单元名称
+     */
+    @TableField("unit_name")
+    private String unitName;
+    /**
+     * 分类编号
+     */
+    @TableField("type")
+    private Integer type;
+}

+ 13 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/EvaluateDate.java

@@ -0,0 +1,13 @@
+package org.springblade.manager.entity;
+
+import lombok.Data;
+
+@Data
+public class EvaluateDate {
+    private String unitName;
+    private String className;
+    private Integer unitNum;
+    private Integer qualifiedNum;
+    private Integer excellentNum;
+
+}

+ 8 - 4
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignPfxFile.java

@@ -17,13 +17,10 @@
 package org.springblade.manager.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-
 import io.swagger.annotations.ApiModelProperty;
-import org.springblade.core.mp.base.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
 
 /**
  * 个人/企业证书信息表实体类
@@ -103,4 +100,11 @@ public class SignPfxFile extends BaseEntity {
     @ApiModelProperty("企业章类型")
     private String pfxType;
 
+    @ApiModelProperty("图片尺寸宽度")
+    private Double wide;
+
+    @ApiModelProperty("图片尺寸高度")
+    private Double high;
+
+
 }

+ 37 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/SignPfxFilePre.java

@@ -0,0 +1,37 @@
+package org.springblade.manager.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 
+ * @TableName m_sign_pfx_file_pre
+ */
+
+@Data
+public class SignPfxFilePre implements Serializable {
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 签名图片地址
+     */
+    private String signaturePngUrl;
+
+    /**
+     * 宽度
+     */
+    private Double wide;
+
+    /**
+     * 高度
+     */
+    private Double high;
+
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 14 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTree.java

@@ -177,4 +177,18 @@ public class WbsTree extends BaseEntity {
     @ApiModelProperty(value = "委托单Id")
     private Long erTreeId;
 
+    /**
+     * 标准分类
+     */
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    /**
+     * 单元名称
+     */
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "是否包含单元评定")
+    private Integer isClassifition;
 }

+ 27 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreeContract.java

@@ -9,6 +9,8 @@ import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 import org.springblade.core.mp.base.BaseEntity;
 
+import java.util.Date;
+
 @Data
 @TableName("m_wbs_tree_contract")
 @EqualsAndHashCode(callSuper = true)
@@ -23,6 +25,9 @@ public class WbsTreeContract extends BaseEntity {
     @ApiModelProperty(value = "主键id")
     private Long pKeyId;
 
+
+    @ApiModelProperty(value = "新节点Id")
+    private Long pId;
     /**
      * wbsId
      */
@@ -282,4 +287,26 @@ public class WbsTreeContract extends BaseEntity {
     @ApiModelProperty(value = "是否采用排序0否1是")
     private Integer isUseSort;
 
+    @ApiModelProperty(value = "1 水利工程 2是数字化")
+    private Integer nodeClass;
+
+    @ApiModelProperty(value ="是否含单元评定 0否 1是 默认否")
+    private Integer isClassifition;
+
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "优良个数")
+    private Integer excellentNum;
+
+    @ApiModelProperty(value = "单元个数")
+    private Integer unitNum;
+
+    @ApiModelProperty(value = "自定义数字化节点的上传时间")
+    private String digitizeTime;
+
+
 }

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

@@ -231,4 +231,21 @@ public class WbsTreePrivate extends BaseEntity {
 
     @ApiModelProperty(value = "是否在客户端新增时隐藏,0否1是")
     private Integer isAddConceal;
+
+    /**
+     * 标准分类
+     */
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    /**
+     * 单元名称
+     */
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "是否包含单元评定")
+    private Integer isClassifition;
+
+
 }

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

@@ -5,12 +5,7 @@ import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.ExcelTab;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import javax.servlet.http.HttpServletRequest;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -66,4 +61,8 @@ public interface ExcelTabClient {
     // 保存
     @PostMapping(API_PREFIX + "/saveEntrustTabData")
     String saveEntrustTabData(@RequestBody JSONObject table) throws RuntimeException;
+    // 获取质检日志的pdf数据
+    @GetMapping(  API_PREFIX + "/get-the-log-pdfInfo")
+    R<String> getTheContractLogBusinessData(@RequestParam String pkeyId, @RequestParam String nodePrimaryKeyId
+            ,@RequestParam String recordTime,@RequestParam String contractId, @RequestParam Long createUser) throws Exception;
 }

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

@@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 @Component
@@ -58,4 +57,9 @@ public class ExcelTabClientFallBack implements ExcelTabClient {
         return null;
     }
 
+    @Override
+    public R<String> getTheContractLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId,Long createUser) {
+        return null;
+    }
+
 }

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

@@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
-import java.util.Set;
 
 import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
 
@@ -185,4 +184,6 @@ public interface WbsTreeContractClient {
     @GetMapping(API_PREFIX + "/searchNodeAllTableInfo")
     List<AppWbsTreeContractVO> searchNodeAllTableInfo(@RequestParam String primaryKeyId, @RequestParam String type, @RequestParam String contractId, @RequestParam String projectId, @RequestParam Long userId);
 
+    @PostMapping(API_PREFIX + "/selectContractJLForm")
+    List<WbsTreeContractTreeVOS> selectContractJLForm(@RequestBody List<Long> removeList);
 }

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

@@ -9,7 +9,7 @@ import lombok.Data;
  * @description 扣回材料垫付款
  */
 @Data
-public class MaterialWithheld {
+public class MaterialWithheld implements  DataModel{
     public static final String ID="20300000000";
     public static final String TBN="MtWi";
     public static final String TBN_CH="扣回材料垫付款";
@@ -24,11 +24,11 @@ public class MaterialWithheld {
     @JSONField(name = "key_5",label="到本期末累计预付设备款",ordinal = 1)
     private String curPeriodEndPayEi;
 
-    @JSONField(name = "key_6",label="本期预付合计",ordinal = 1)
+    @JSONField(name = "key_16",label="本期预付合计",ordinal = 1)
     private String curPeriodPaySum;
-    @JSONField(name = "key_7",label="本期预付材料款",ordinal = 1)
+    @JSONField(name = "key_17",label="本期预付材料款",ordinal = 1)
     private String curPeriodPayMt;
-    @JSONField(name = "key_8",label="本期预付设备款",ordinal = 1)
+    @JSONField(name = "key_18",label="本期预付设备款",ordinal = 1)
     private String curPeriodPayEi;
 
     @JSONField(name = "key_6",label="到本期末回扣款合计",ordinal = 1)

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

@@ -0,0 +1,14 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.manager.entity.SignPfxFilePre;
+import org.springframework.web.multipart.MultipartFile;
+
+@Data
+public class SignPfxFilePreVo extends SignPfxFilePre {
+    //接收的图片文件
+    private MultipartFile file;
+    private  String preUrl;
+    //接收的图片地址
+    private String fileStr;
+}

+ 6 - 3
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SignPfxFileVO.java

@@ -17,12 +17,11 @@
 package org.springblade.manager.vo;
 
 import io.swagger.annotations.ApiModelProperty;
-import org.springblade.manager.entity.SignPfxDeputy;
-import org.springblade.manager.entity.SignPfxFile;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springblade.manager.entity.SignPfxDeputy;
+import org.springblade.manager.entity.SignPfxFile;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -56,5 +55,9 @@ public class SignPfxFileVO extends SignPfxFile {
     private List<SignPfxDeputy> signPfxDeputieList;
 
     private String key;
+    //图片尺寸宽度
+    private Double  wide;
+    //图片尺寸高度
+    private Double  high;
 
 }

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

@@ -109,6 +109,8 @@ public class SubprojectInterimPaymentSummary  implements  DataModel{
         if(data!=null&&data.size()>0){
             /*合同金额*/
             count(this::setContractMoney,data,SubprojectInterimPaymentSummary::getContractMoney,scale);
+            /*到上期末累计*/
+            count(this::setPreviousPeriodPay,data,SubprojectInterimPaymentSummary::getPreviousPeriodPay,scale);
             /*本次支付*/
             count(this::setCurrentPeriodPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodPay,scale);
             /*本次累计支付*/

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

@@ -32,4 +32,6 @@ public class TextdictInfoVO extends TextdictInfo {
     private static final long serialVersionUID = 1L;
 
     private String parentRoleId;
+    //1.电签配置 2.系统识别
+    private Integer showType;
 }

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

@@ -3,6 +3,7 @@ package org.springblade.manager.vo;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.bouncycastle.asn1.x509.V2AttributeCertificateInfoGenerator;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -99,4 +100,28 @@ public class WbsTreeContractLazyVO implements Serializable {
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @ApiModelProperty(value = "标准分类")
+    private Integer className;
+
+    @ApiModelProperty(value = "单元名称")
+    private Integer unitName;
+
+    @ApiModelProperty(value = "单元个数")
+    private Integer unitNum;
+
+    @ApiModelProperty(value = "1自定义水利 2自定义数字化")
+    private Integer nodeClass;
+
+    @ApiModelProperty(value = "优良个数")
+    private Integer excellentNum;
+
+    @ApiModelProperty(value = "是否含单元评定0否1是")
+    private Integer isClassifition;
+
+    @ApiModelProperty(value = "数字化节点的创建时间")
+    private Date digitizeTime;
+
+    @ApiModelProperty(value = "是否引用编号")
+    private Integer isReferenceNumber;
+
 }

+ 17 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/InformationQueryVO1.java

@@ -0,0 +1,17 @@
+package org.springblade.system.user.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+@Data
+@TableName("u_information_query")
+public class InformationQueryVO1 {
+    @TableField("id")
+    private String id;
+    @TableField("name")
+    private String name;
+    @JsonProperty("eVisaPdfUrl")
+    private String eVisaPdfUrl;
+}

+ 20 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/InformationQueryVO2.java

@@ -0,0 +1,20 @@
+package org.springblade.system.user.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+@Data
+@TableName("u_information_query")
+public class InformationQueryVO2 {
+    @TableField("id")
+    private String id;
+    @TableField("name")
+    private String name;
+    @TableField("e_visa_pdf_url")
+    @JsonProperty("eVisaPdfUrl")
+    private String eVisaPdfUrl;
+    @TableField("node_pdf_url")
+    private String nodePdfUrl;
+}

+ 59 - 54
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/JinLinPushApiController.java

@@ -70,22 +70,22 @@ public class JinLinPushApiController {
     @GetMapping("/test")
     public void JinlinApiPush() throws JsonProcessingException {
 //        //获取发送get请求的校验码
-//     String query = "clientSecretKey="+HJCLIENTSECRETKEY;
+//     String query = "clientSecretKey="+PYCLIENTSECRETKEY;
 //     String querySignature = DigestUtils.md5Hex(query).toUpperCase();
 //       // 获取吉林项目合同段的地址
 //     String queryUrl = "https://hgqs.jtyst.jl.gov.cn:6100/dock/openapi/hqsws/hqsprojpact/query";
 //     HashMap<String,String> queryHeaders=new HashMap<>();
 //        queryHeaders.put("Content-Type", "application/json");
-//        queryHeaders.put("clientId",HJCLIENTID);
+//        queryHeaders.put("clientId",PYCLIENTID);
 //        queryHeaders.put("signature",querySignature);
-//        queryHeaders.put("systemId",HJSYSTEMID);
+//        queryHeaders.put("systemId",PYSYSTEMID);
 //     String queryBody = HttpUtil.createGet(queryUrl).addHeaders(queryHeaders).execute().body();
 //     JSONObject jsonObject=JSONObject.parseObject(queryBody);
 //     //吉林蒲烟项目合同段信息
 //     List<PactAndProjDto> pactAndProjDtoList = JSONObject.parseArray(jsonObject.getString("data").toString(),PactAndProjDto.class);
 //
 //     //重庆吉林蒲烟项目合同段信息(中间表)
-//     List<ArchiveJiLinPush>archiveJiLinPushList= iArchiveJiLinPushService.getArchiveJiLinPush(jlHjProjId);
+//     List<ArchiveJiLinPush>archiveJiLinPushList= iArchiveJiLinPushService.getArchiveJiLinPush(jlPyProjId);
 //
 //     //中间项目合同中间集合
 //     List<JiLinQueryDto>dtos=new ArrayList<>();
@@ -104,9 +104,10 @@ public class JinLinPushApiController {
 //            }
 //        }
 //      //传入重庆的项目ID,和吉林需要的合同段集合 查出重庆的目录树
-//        Long projectId=cqHjProjectId;
+//        Long projectId=cqPyProjectId;
 //        List<ArchiveTreeContractDTO> archiveTreeContractDtos = archiveTreeContractClient.getArchiveTreeContractDto(dtos,projectId);
 //        System.out.println(archiveTreeContractDtos.size());
+//
 //      //构建需要传给吉林的目录树 数据
 //        List<JiLinPushTreeDto>jiLinPushTreeDtos=new ArrayList<>();
 //        for (ArchiveTreeContractDTO archiveTreeContractDto : archiveTreeContractDtos) {
@@ -118,7 +119,7 @@ public class JinLinPushApiController {
 //            jiLinPushTreeDto.setAddUserName(archiveTreeContractDto.getUpdateUserName());
 //            jiLinPushTreeDto.setPactId(archiveTreeContractDto.getContractId());
 //            //直接统一设置好目录树项目Id为吉林的项目ID
-//            jiLinPushTreeDto.setProjId(jlHjProjId);
+//            jiLinPushTreeDto.setProjId(jlPyProjId);
 //            jiLinPushTreeDtos.add(jiLinPushTreeDto);
 //
 //        }
@@ -169,36 +170,39 @@ public class JinLinPushApiController {
 //        iJiLinArchiveAutoDtoService.saveBatch(archiveAutoDtos);
 
             Long projId=jlPyProjId;
-        for (int j = 46; j <47 ; j++) {
-            Page<JiLinArchiveAutoDto> pages=iJiLinArchiveAutoDtoService.queryAll(j,500,projId);
-            List<JiLinArchiveAutoDto> archiveAutoDtos = pages.getRecords();
-            if(archiveAutoDtos.size()<500) {
-                System.out.println("最后一次数据大小:"+archiveAutoDtos.size());
-                j=101;
-            }
-            List<JiLinPushTomeDto> jiLinPushTomeDtoList = new ArrayList<>();
-            List<JiLinPushCatalogDto> jiLinPushCatalogDtoList = new ArrayList<>();
-            List<JiLinPushFileUrlDto> jiLinPushFileUrlDtoList = new ArrayList<>();
+        Page<JiLinArchiveAutoDto> pages=iJiLinArchiveAutoDtoService.queryAll(77,500,projId);
+        List<JiLinArchiveAutoDto> archiveAutoDtos = pages.getRecords();
+        List<JiLinPushCatalogDto> jiLinPushCatalogDtoList = new ArrayList<>();
+        List<JiLinPushFileUrlDto> jiLinPushFileUrlDtoList = new ArrayList<>();
+//        for (int j = 0; j <100 ; j++) {
+
+//            if(archiveAutoDtos.size()<500) {
+//                System.out.println("最后一次数据大小:"+archiveAutoDtos.size());
+//                j=101;
+//            }
+//            List<JiLinPushTomeDto> jiLinPushTomeDtoList = new ArrayList<>();
+
             for (int i = 0; i < archiveAutoDtos.size(); i++) {
-                //设置档案案卷
-                JiLinPushTomeDto jiLinPushTomeDto = new JiLinPushTomeDto();
-                jiLinPushTomeDto.setPactId(jlPyProjId);
-                jiLinPushTomeDto.setPactId(archiveAutoDtos.get(i).getContractId());
-                jiLinPushTomeDto.setKid(archiveAutoDtos.get(i).getTomeId());
-                jiLinPushTomeDto.setSortID(archiveAutoDtos.get(i).getNodeId());
-                jiLinPushTomeDto.setTomeSuper(StringUtils.deleteWhitespace(archiveAutoDtos.get(i).getName()));
-                jiLinPushTomeDto.setRecordNum(archiveAutoDtos.get(i).getFileNumber());
-                jiLinPushTomeDto.setAddUserName(archiveAutoDtos.get(i).getUpdateUserName());
-                jiLinPushTomeDto.setAddTime(archiveAutoDtos.get(i).getCreateUserTime());
-                jiLinPushTomeDto.setBWeaveDate(archiveAutoDtos.get(i).getStartDate());
-                jiLinPushTomeDto.setEWeaveDate(archiveAutoDtos.get(i).getEndDate());
-                jiLinPushTomeDto.setKeepTerm(archiveAutoDtos.get(i).getStorageTime());
-                jiLinPushTomeDto.setSortOrder(i);
-                jiLinPushTomeDto.setMutualNum("0");
-                jiLinPushTomeDto.setWeaveUnit(archiveAutoDtos.get(i).getUnit());
-                jiLinPushTomeDto.setSecrecy(archiveAutoDtos.get(i).getSecretLevel());
-                jiLinPushTomeDto.setYear(Integer.parseInt(archiveAutoDtos.get(i).getStorageTime()));
-                jiLinPushTomeDtoList.add(jiLinPushTomeDto);
+                String name=StringUtils.deleteWhitespace(archiveAutoDtos.get(i).getName());
+//                //设置档案案卷
+//                JiLinPushTomeDto jiLinPushTomeDto = new JiLinPushTomeDto();
+//                jiLinPushTomeDto.setProjId(jlHjProjId);
+//                jiLinPushTomeDto.setPactId(archiveAutoDtos.get(i).getContractId());
+//                jiLinPushTomeDto.setKid(archiveAutoDtos.get(i).getTomeId());
+//                jiLinPushTomeDto.setSortID(archiveAutoDtos.get(i).getNodeId());
+//                jiLinPushTomeDto.setTomeSuper(name);
+//                jiLinPushTomeDto.setRecordNum(archiveAutoDtos.get(i).getFileNumber());
+//                jiLinPushTomeDto.setAddUserName(archiveAutoDtos.get(i).getUpdateUserName());
+//                jiLinPushTomeDto.setAddTime(archiveAutoDtos.get(i).getCreateUserTime());
+//                jiLinPushTomeDto.setBWeaveDate(archiveAutoDtos.get(i).getStartDate());
+//                jiLinPushTomeDto.setEWeaveDate(archiveAutoDtos.get(i).getEndDate());
+//                jiLinPushTomeDto.setKeepTerm(archiveAutoDtos.get(i).getStorageTime());
+//                jiLinPushTomeDto.setSortOrder(i);
+//                jiLinPushTomeDto.setMutualNum("0");
+//                jiLinPushTomeDto.setWeaveUnit(archiveAutoDtos.get(i).getUnit());
+//                jiLinPushTomeDto.setSecrecy(archiveAutoDtos.get(i).getSecretLevel());
+//                jiLinPushTomeDto.setYear(Integer.parseInt(archiveAutoDtos.get(i).getStorageTime()));
+//                jiLinPushTomeDtoList.add(jiLinPushTomeDto);
                 //    设置档案卷内目录
                 JiLinPushCatalogDto jiLinPushCatalogDto = new JiLinPushCatalogDto();
                 jiLinPushCatalogDto.setProjId(jlPyProjId);
@@ -206,7 +210,7 @@ public class JinLinPushApiController {
                 jiLinPushCatalogDto.setKid(archiveAutoDtos.get(i).getCatlogId());
                 jiLinPushCatalogDto.setSortId(archiveAutoDtos.get(i).getNodeId());
                 jiLinPushCatalogDto.setTomeId(archiveAutoDtos.get(i).getTomeId());
-                jiLinPushCatalogDto.setFileSuper(StringUtils.deleteWhitespace(archiveAutoDtos.get(i).getName()));
+                jiLinPushCatalogDto.setFileSuper(name);
                 jiLinPushCatalogDto.setCatalogRecord(archiveAutoDtos.get(i).getFileNumber());
                 jiLinPushCatalogDto.setAmsFileNum("0");
                 jiLinPushCatalogDto.setFileNum("0");
@@ -225,7 +229,7 @@ public class JinLinPushApiController {
                 jiLinPushFileUrlDto.setPactId(archiveAutoDtos.get(i).getContractId());
                 jiLinPushFileUrlDto.setKid(archiveAutoDtos.get(i).getId());
                 jiLinPushFileUrlDto.setCatalogID(archiveAutoDtos.get(i).getCatlogId());
-                jiLinPushFileUrlDto.setAnnexName(StringUtils.deleteWhitespace(archiveAutoDtos.get(i).getName()));
+                jiLinPushFileUrlDto.setAnnexName(name);
                 jiLinPushFileUrlDto.setTableNumber(archiveAutoDtos.get(i).getFileNumber());
                 jiLinPushFileUrlDto.setWeaveDate(archiveAutoDtos.get(i).getCreateUserTime());
                 jiLinPushFileUrlDto.setAnnexPage(archiveAutoDtos.get(i).getPageN());
@@ -235,18 +239,18 @@ public class JinLinPushApiController {
                 jiLinPushFileUrlDto.setAddTime(archiveAutoDtos.get(i).getUpdateUserTime());
                 jiLinPushFileUrlDtoList.add(jiLinPushFileUrlDto);
             }
-        //传输吉林档案案卷的地址
-        String tome=JSONObject.toJSONString(jiLinPushTomeDtoList);
-        String tomeMsg=tome+PYCLIENTSECRETKEY;
-        String tomeUrl="https://hgqs.jtyst.jl.gov.cn:6100/dock/openapi/veams/api/doc/tome";
-        String tomeSignature = DigestUtils.md5Hex(tomeMsg).toUpperCase();
-        HashMap<String,String> tomeHeaders=new HashMap<>();
-        tomeHeaders.put("Content-Type", "application/json");
-        tomeHeaders.put("clientId",PYCLIENTID);
-        tomeHeaders.put("signature",tomeSignature);
-        tomeHeaders.put("systemId",PYSYSTEMID);
-        String tomeBody = HttpUtil.createPost(tomeUrl).addHeaders(tomeHeaders).body(tome).contentType("application/json").execute().body();
-        System.out.println("第"+(j+1)+"次档案案卷"+tomeBody);
+//        //传输吉林档案案卷的地址
+//        String tome=JSONObject.toJSONString(jiLinPushTomeDtoList);
+//        String tomeMsg=tome+HJCLIENTSECRETKEY;
+//        String tomeUrl="https://hgqs.jtyst.jl.gov.cn:6100/dock/openapi/veams/api/doc/tome";
+//        String tomeSignature = DigestUtils.md5Hex(tomeMsg).toUpperCase();
+//        HashMap<String,String> tomeHeaders=new HashMap<>();
+//        tomeHeaders.put("Content-Type", "application/json");
+//        tomeHeaders.put("clientId",HJCLIENTID);
+//        tomeHeaders.put("signature",tomeSignature);
+//        tomeHeaders.put("systemId",HJSYSTEMID);
+//        String tomeBody = HttpUtil.createPost(tomeUrl).addHeaders(tomeHeaders).body(tome).contentType("application/json").execute().body();
+//        System.out.println("第"+(j+1)+"次档案案卷"+tomeBody);
         //传输吉林档案卷内目录
         String catLog=JSONObject.toJSONString(jiLinPushCatalogDtoList);
         String catLogMsg=catLog+PYCLIENTSECRETKEY;
@@ -258,7 +262,7 @@ public class JinLinPushApiController {
         catLogHeaders.put("signature",catLogSignature);
         catLogHeaders.put("systemId",PYSYSTEMID);
         String catLogBody = HttpUtil.createPost(catLogUrl).addHeaders(catLogHeaders).body(catLog).contentType("application/json").execute().body();
-        System.out.println("第"+(j+1)+"次卷内目录"+catLogBody);
+        System.out.println(catLogBody);
 
         //传输吉林档案文件
         String annex=JSONObject.toJSONString(jiLinPushFileUrlDtoList);
@@ -271,8 +275,9 @@ public class JinLinPushApiController {
         annexHeaders.put("signature",annexSignature);
         annexHeaders.put("systemId",PYSYSTEMID);
         String annexBody = HttpUtil.createPost(annexUrl).addHeaders(annexHeaders).body(annex).contentType("application/json").execute().body();
-        System.out.println("第"+(j+1)+"次档案文件"+annexBody);
-        }
-        System.out.println("蒲烟传输结束");
-   }
+        System.out.println(annexBody);
+
+    }
+//        System.out.println("烟长传输结束");
+//   }
 }

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

@@ -340,7 +340,8 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         // Step 1: Get the list of formulas using archiveFormulaConfigService
         List<ArchiveFormulaConfig> formulaConfigs = archiveFormulaConfigService.getByNumber(number);
 
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = FileUtils.getSysLocalFileUrl(); //ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+
         String excelUrl = getUrlByNumber(number);
         Map<String, Object> dataInfo = new HashMap<>();
 
@@ -382,6 +383,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         } else {
             try {
                 String url = getBussPdfInfo(fileName, dataInfo, excelUrl, file_path, OssConstant.ARCHIVE_DIRECTORY, archivesAuto.getProjectId());
+                url = url+"@@@"+fileName;
                 urls.add(url);
             } catch (Exception e) {
                 e.printStackTrace();
@@ -484,10 +486,10 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 //            FileUtils.PdfCopyPublicMethods(bos, localUrls);
 //            BladeFile bladeFile = newIOSSClient.updateFile(bos.toByteArray(),fileName + ".pdf");
             if (bladeFile != null) {
-                urls.add(bladeFile.getLink());
+                urls.add(bladeFile.getLink()+"@@@"+fileName);
             }
         } else if (localUrls.size() == 1) {
-            urls.add(localUrls.get(0));
+            urls.add(localUrls.get(0)+"@@@"+fileName);
         }
     }
 
@@ -671,7 +673,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY, fileName, projectId);
         BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdfPath);
 
-        ///BladeFile bladeFile = newIOSSClient.uploadFile(fileName + ".pdf", localPdfPath,ossPath, projectId);
+     //   BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdfPath,ossPath, projectId);
         String pdfLink = "";
         if (bladeFile != null) {
             pdfLink = bladeFile.getLink();
@@ -912,7 +914,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
     public String MergePdfAndUpload(List<String> urlList, String fileName, String filePath, Long pojectId) {
         String url = "";
         Long id = SnowFlakeUtil.getId();
-        String localPdf = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL) + "/pdf/" + id + ".pdf";
+        String localPdf = FileUtils.getSysLocalFileUrl() + "/pdf/" + id + ".pdf";
 
         try {
             //合并pdf

+ 2 - 4
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java

@@ -15,7 +15,6 @@ import org.apache.commons.lang.StringUtils;
 import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.archive.entity.ArchiveExpertScore;
 import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
-import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
 import org.springblade.archive.service.IArchiveExpertConclusionService;
 import org.springblade.archive.service.IArchiveExpertScoreService;
 import org.springblade.archive.utils.ItextPdfUtils;
@@ -28,7 +27,6 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.evisa.feign.EVisaClient;
-import org.springblade.evisa.vo.SigInfoVO;
 import org.springblade.manager.entity.ProjectInfo;
 import org.springblade.manager.entity.SignPfxFile;
 import org.springblade.manager.feign.ProjectClient;
@@ -256,7 +254,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
             throw new ServiceException("生成PDF失败:"+e.getMessage());
         }
         //构建专家电签信息
-        SigInfoVO vo = new SigInfoVO();
+  /*      SigInfoVO vo = new SigInfoVO();
         List<SigInfoVO.SigInfo> infos = new ArrayList<>();
         for (User user : users) {
             SignPfxFile file = map.get(user.getId());
@@ -294,7 +292,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
         baseMapper.updateAllArchiveByProject(conclusion.getProjectId());
         //还原当前项目所有分配的树节点
         baseMapper.updateAllNodeByProject(conclusion.getProjectId());
-        this.updateById(conclusion);
+        this.updateById(conclusion);*/
     }
 
     private String buildPdf(ArchiveExpertConclusion conclusion,List<User> users) throws Exception {

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

@@ -2023,13 +2023,31 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			if (frontUrls != null) {
 				for (String frontUrl : frontUrls) {
 					if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0]) && config.getFactorType().contains("1")) {
-						front = frontUrl;
+						if(frontUrl.contains("@@@")){
+							front = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							front = frontUrl;
+						}
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1]) && config.getFactorType().contains("2")) {
-						cataLog = frontUrl;
+						if(frontUrl.contains("@@@")){
+							cataLog = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							cataLog = frontUrl;
+						}
+
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2]) && config.getFactorType().contains("3")) {
-						spare = frontUrl;
+						if(frontUrl.contains("@@@")){
+							spare = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							spare = frontUrl;
+						}
+
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3]) && config.getFactorType().contains("4")) {
-						back = frontUrl;
+						if(frontUrl.contains("@@@")){
+							back = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							back = frontUrl;
+						}
 					}
 				}
 			}

+ 17 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -16,13 +16,14 @@ import org.springblade.business.entity.*;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.TaskClient;
+import org.springblade.business.service.IContractLogService;
 import org.springblade.business.service.IContractLogWbsService;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.utils.YearTreeUtils;
 import org.springblade.business.vo.*;
-import org.springblade.common.constant.ClientIdConstant;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -42,8 +43,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
-import org.springblade.business.service.IContractLogService;
-import org.springblade.core.boot.ctrl.BladeController;
 
 import java.io.IOException;
 import java.util.*;
@@ -409,9 +408,12 @@ public class ContractLogController extends BladeController {
                 if (new Integer("1").equals(task.getStatus())) {
                     //正在审批,调用废除
                     this.taskClient.abolishTask(task);
-                } else if (new Integer("2").equals(task.getStatus())) {
+                } else if (new Integer("2").equals(task.getStatus()) || new Integer("3").equals(task.getStatus())) {
                     //已审批的任务,修改业务数据的审批状态为未上报并撤签即可
-                    this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getAuditUserIdAndName, null).set(ContractLog::getEVisaPdfUrl, null).set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
+                    this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate()
+                            .set(ContractLog::getAuditUserIdAndName, null)
+                            .set(ContractLog::getEVisaPdfUrl, null)
+                            .set(ContractLog::getStatus, 0).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
                 }
 
                 List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
@@ -502,11 +504,21 @@ public class ContractLogController extends BladeController {
                                 }
                             }
                         }
+                        /*修改任务副表u_task_parallel全部废除*/
+                        List<Long> collect = linkList.stream().map(TaskParallel::getId).collect(Collectors.toList());
+                        if (collect.size() > 0) {
+                            jdbcTemplate.execute("UPDATE u_task_parallel SET status = 3,e_visa_content = '废除成功' WHERE id in(" + StringUtils.join(collect, ",") + ")");
+                        }
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
             }
+            /*修改主表u_task(全部废除)*/
+            List<Long> collect = taskList.stream().map(Task::getId).collect(Collectors.toList());
+            if (collect.size() > 0) {
+                jdbcTemplate.execute("UPDATE u_task SET status = 3 WHERE id in(" + StringUtils.join(collect, ",") + ")");
+            }
             return R.data(200, aopParamsSet, "操作成功");
         }
         return R.fail("操作失败");

+ 31 - 11
blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java

@@ -19,9 +19,7 @@ package org.springblade.business.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
 import org.springblade.business.entity.EntrustInfo;
 import org.springblade.business.service.IEntrustInfoService;
@@ -40,6 +38,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 委托单信息表 控制器
@@ -117,14 +116,21 @@ public class  EntrustInfoController extends BladeController {
 	@ApiOperation(value = "修改", notes = "传入entrustInfo")
 	@Transactional
 	public R update(@Valid @RequestBody EntrustInfo entrustInfo) {
-		if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==1){
-			entrustInfo.setSampleStatus("6");
-			entrustInfo.setRepealTime(new Date());
-		}
-		if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==2){
-			entrustInfo.setSampleStatus("5");
-		}
-		return R.status(entrustInfoService.updateById(entrustInfo));
+			// rfid--绑定 需要判断 委托单的状态和创建情况
+
+
+			if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==1){
+				entrustInfo.setSampleStatus("6");
+				entrustInfo.setRepealTime(new Date());
+			}
+			if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==2){
+				entrustInfo.setSampleStatus("5");
+			}
+			if ("".equals(entrustInfo.getSampleStatus())){
+				entrustInfo.setSampleStatus(null);
+			}
+
+		    return R.status(entrustInfoService.updateById(entrustInfo));
 	}
 
 	/**
@@ -215,4 +221,18 @@ public class  EntrustInfoController extends BladeController {
 	public R checkSample(Long sampleId){
 		return  entrustInfoService.checkSample(sampleId);
 	}
+
+	/**
+	 * rfid 获取数据
+	 */
+	@GetMapping("/selectRfidListById")
+	@ApiOperationSupport(order = 11)
+	@ApiOperation(value = "自定义分页", notes = "传入entrustInfo")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "rids", value = "rids", required = true),
+			@ApiImplicitParam(name = "state", value = "流程所在状态", required = true)
+	})
+	public R getRfiList(String rids,String state) {
+		return entrustInfoService.getRfiList(rids,state);
+	}
 }

+ 312 - 186
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -139,7 +139,7 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 29)
     @ApiOperation(value = "获取文件题名")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "queryId", value = "列表ID", required = true)
+        @ApiImplicitParam(name = "queryId", value = "列表ID", required = true)
     })
     public R<String> queryFirstDocumentTitle(@RequestParam String queryId) {
         InformationQuery query = this.informationQueryService.getById(queryId);
@@ -156,8 +156,8 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 28)
     @ApiOperation(value = "获取文件题名")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "primaryKeyId", value = "节点的primaryKeyId", required = true),
-            @ApiImplicitParam(name = "classify", value = "当前所选的类型", required = true)
+        @ApiImplicitParam(name = "primaryKeyId", value = "节点的primaryKeyId", required = true),
+        @ApiImplicitParam(name = "classify", value = "当前所选的类型", required = true)
     })
     public R<String> queryDocumentTitle(@RequestParam String primaryKeyId, @RequestParam Integer classify) {
         List<InformationQuery> result = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getClassify, classify).eq(InformationQuery::getWbsId, primaryKeyId));
@@ -227,9 +227,9 @@ public class InformationWriteQueryController extends BladeController {
 
                         //根据id、nodeName去重
                         List<WbsTreeContract> resultNodeData = queryValueList.stream().collect(
-                                Collectors.collectingAndThen(
-                                        Collectors.toCollection(() -> new TreeSet<>(
-                                                Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
+                            Collectors.collectingAndThen(
+                                Collectors.toCollection(() -> new TreeSet<>(
+                                    Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
 
                         //处理参数
                         this.queryContractTree(associatedVONodeList, resultNodeData, 2);
@@ -302,9 +302,9 @@ public class InformationWriteQueryController extends BladeController {
 
                 //根据id、nodeName去重
                 List<WbsTreeContract> resultNodeData = queryValueList.stream().collect(
-                        Collectors.collectingAndThen(
-                                Collectors.toCollection(() -> new TreeSet<>(
-                                        Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
+                    Collectors.collectingAndThen(
+                        Collectors.toCollection(() -> new TreeSet<>(
+                            Comparator.comparing(o -> o.getId() + ";" + o.getNodeName()))), ArrayList::new));
 
                 this.queryContractTree(associatedVONodeList, resultNodeData, 1);
 
@@ -615,7 +615,7 @@ public class InformationWriteQueryController extends BladeController {
     public R<Object> abolishOneSJ(@RequestParam String primaryKeyId, @RequestParam String id, @RequestParam String projectId, @RequestParam String contractId) {
         //查询填报状态
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
-                .eq(InformationQuery::getId, id));
+            .eq(InformationQuery::getId, id));
         if (businessData != null) {
             //使用批量废除接口
             return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId);
@@ -759,8 +759,8 @@ public class InformationWriteQueryController extends BladeController {
         String status = "1";
         //查询填报状态,type=3首件
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
-                .eq(InformationQuery::getId, id)
-                .eq(InformationQuery::getType, 3)
+            .eq(InformationQuery::getId, id)
+            .eq(InformationQuery::getType, 3)
         );
         if (businessData != null) {
             switch (businessData.getStatus()) {
@@ -825,7 +825,7 @@ public class InformationWriteQueryController extends BladeController {
         String status = "1";
         //查询填报状态,type=2试验
         InformationQuery businessData = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
-                .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2)).stream().findAny().orElse(null);
+            .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2)).stream().findAny().orElse(null);
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -887,17 +887,25 @@ public class InformationWriteQueryController extends BladeController {
         if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId())) {
             //试验
             businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2));
+            if (businessData != null) {
+                //设置业务数据ID
+                startTaskVO.setIds(businessData.getWbsId().toString());
+                startTaskVO.setTrialSelfInspectionRecordId(1L);
+                return this.batchTask(startTaskVO);
+            } else {
+                return R.data(300, false, "未查询到填报信息,上报失败");
+            }
         } else { //质检
             businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1));
+            if (businessData != null) {
+                //设置业务数据ID
+                startTaskVO.setIds(businessData.getId().toString());
+                return this.batchTask(startTaskVO);
+            } else {
+                return R.data(300, false, "未查询到填报信息,上报失败");
+            }
         }
-        //处理上报信息
-        if (businessData != null) {
-            //设置业务数据ID
-            startTaskVO.setIds(businessData.getId().toString());
-            return this.batchTask(startTaskVO);
-        } else {
-            return R.data(300, false, "未查询到填报信息,上报失败");
-        }
+
     }
 
     /**
@@ -1009,47 +1017,45 @@ public class InformationWriteQueryController extends BladeController {
             List<InformationQuery> result = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, Arrays.asList(ids.split(","))));
 
 
-
             if (result != null && result.size() > 0) {
                 //删除掉pdfUrl和eVisaPdfUrl都为空的数据
                 /** 任务审批查看时,把节点附件列表跟在上报文件后面*/
 
 
-
                 result.removeIf(query -> StringUtils.isEmpty(query.getPdfUrl()) && StringUtils.isEmpty(query.getPdfUrl()));
                 if (result.size() > 0) {
                     List<String> urls = new ArrayList<>();
                  /*   result.forEach(query -> urls.add(
                             StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() + "@@@" + query.getName() + "-" + query.getId() : query.getPdfUrl() + "@@@" + query.getName() + "-" + query.getId()));
                    */
-                    for(InformationQuery query:result){
+                    for (InformationQuery query : result) {
                         String url_link = "";
-                        List<TaskApprovalVO.ApprovalFile> files = jdbcTemplate.query("select name as fileName,domain_url as fileUrl from m_table_file where is_deleted = 0 and type in(10,11,12)and tab_id = ?",new BeanPropertyRowMapper<>(TaskApprovalVO.ApprovalFile.class),query.getWbsId());
+                        List<TaskApprovalVO.ApprovalFile> files = jdbcTemplate.query("select name as fileName,domain_url as fileUrl from m_table_file where is_deleted = 0 and type in(10,11,12)and tab_id = ?", new BeanPropertyRowMapper<>(TaskApprovalVO.ApprovalFile.class), query.getWbsId());
                         List<String> url = new ArrayList();
-                        if (ObjectUtil.isNotEmpty(files)){
-                            for (TaskApprovalVO.ApprovalFile da:files){
+                        if (ObjectUtil.isNotEmpty(files)) {
+                            for (TaskApprovalVO.ApprovalFile da : files) {
                                 url.add(da.getFileUrl());
                             }
                         }
 
-                        if(query!=null && Func.isNull(query.getEVisaPdfUrl())){
+                        if (query != null && Func.isNull(query.getEVisaPdfUrl())) {
                             url.add(query.getEVisaPdfUrl());
-                        }else{
+                        } else {
                             url.add(query.getPdfUrl());
                         }
 
-                        if(urls!=null && urls.size()>1){
-                            String localUrl = FileUtils.getSysLocalFileUrl()+"\\" + query.getId()+".pdf";
-                            FileUtils.mergePdfPublicMethods(url,localUrl);
-                            BladeFile bladeFile = newIOSSClient.uploadFile(query.getId()+".pdf",localUrl);
+                        if (urls != null && urls.size() > 1) {
+                            String localUrl = FileUtils.getSysLocalFileUrl() + "\\" + query.getId() + ".pdf";
+                            FileUtils.mergePdfPublicMethods(url, localUrl);
+                            BladeFile bladeFile = newIOSSClient.uploadFile(query.getId() + ".pdf", localUrl);
                             if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
-                                url.add( bladeFile.getLink());
+                                url.add(bladeFile.getLink());
                             }
 
-                        }else if(urls!=null && urls.size()==1){
+                        } else if (urls != null && urls.size() == 1) {
                             url_link = url.get(0);
                         }
-                        url.add(url_link+ "@@@" + query.getName() + "-" + query.getId());
+                        url.add(url_link + "@@@" + query.getName() + "-" + query.getId());
                     }
 
                     //删除空数据
@@ -1081,9 +1087,9 @@ public class InformationWriteQueryController extends BladeController {
         if (taskList.size() == 0) {
             //试验
             List<InformationQuery> dataList = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
-                    .select(InformationQuery::getId)
-                    .eq(InformationQuery::getType, 2)
-                    .in(InformationQuery::getWbsId, Func.toStrList(ids)));
+                .select(InformationQuery::getId)
+                .eq(InformationQuery::getType, 2)
+                .in(InformationQuery::getWbsId, Func.toStrList(ids)));
             if (dataList.size() > 0) {
                 List<Long> dataIds = dataList.stream().map(InformationQuery::getId).collect(Collectors.toList());
                 taskList = this.taskClient.queryTaskListByFormDataId(StringUtils.join(dataIds, ","));
@@ -1155,18 +1161,18 @@ public class InformationWriteQueryController extends BladeController {
 
                                         //保存通知记录
                                         this.messageWarningClient.savePushUserMessageWarning(
-                                                new MessageWarningVO(
-                                                        query.getProjectId(),
-                                                        query.getContractId(),
-                                                        //废除通知
-                                                        3,
-                                                        //内容
-                                                        projectName + contractName + "的用户【" + AuthUtil.getNickName() + "】废除了【" + query.getName() + "】",
-                                                        //推送的目标人
-                                                        Long.parseLong(strs[0]),
-                                                        //默认未读
-                                                        0
-                                                ));
+                                            new MessageWarningVO(
+                                                query.getProjectId(),
+                                                query.getContractId(),
+                                                //废除通知
+                                                3,
+                                                //内容
+                                                projectName + contractName + "的用户【" + AuthUtil.getNickName() + "】废除了【" + query.getName() + "】",
+                                                //推送的目标人
+                                                Long.parseLong(strs[0]),
+                                                //默认未读
+                                                0
+                                            ));
 
                                         if (ObjectUtil.isNotEmpty(query.getProjectId()) && ObjectUtil.isNotEmpty(query.getContractId()) && ObjectUtil.isNotEmpty(strs[0])) {
                                             String param = strs[0] + "," + query.getProjectId() + "," + query.getContractId();
@@ -1186,16 +1192,16 @@ public class InformationWriteQueryController extends BladeController {
                                 List<MessageWarningVO> messageList = new ArrayList<>();
                                 for (TaskParallel taskParallel : linkList) {
                                     messageList.add(new MessageWarningVO(
-                                            Long.parseLong(task.getProjectId()),
-                                            Long.parseLong(task.getContractId()),
-                                            //废除通知
-                                            3,
-                                            //内容
-                                            (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + query.getName() + "】流程,请及时查看",
-                                            //推送的目标人
-                                            Long.parseLong(taskParallel.getTaskUser()),
-                                            //默认未读
-                                            0
+                                        Long.parseLong(task.getProjectId()),
+                                        Long.parseLong(task.getContractId()),
+                                        //废除通知
+                                        3,
+                                        //内容
+                                        (StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + query.getName() + "】流程,请及时查看",
+                                        //推送的目标人
+                                        Long.parseLong(taskParallel.getTaskUser()),
+                                        //默认未读
+                                        0
                                     ));
                                 }
                                 if (messageList.size() > 0) {
@@ -1281,11 +1287,11 @@ public class InformationWriteQueryController extends BladeController {
                 //试验批量上报
                 String trialIds = "";
                 Map<Long, Long> mapKey = new HashMap<>();
-                if (queryList.size() == 0 ) {
+                if (queryList.size() == 0) {
                     //试验填报数据
                     queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
                     //重新绑定trialSelfInspectionRecordId使用map
-                    if(appType == 1L){ // 试验上报
+                    if (appType == 1L) { // 试验上报
                         for (InformationQuery informationQuery : queryList) {
                             mapKey.put(informationQuery.getId(), informationQuery.getWbsId());
                         }
@@ -1327,9 +1333,9 @@ public class InformationWriteQueryController extends BladeController {
                         //设置数据源指向
                         taskVO.setFormDataId(id);
                         //设置上报类型
-                        if(appType!=null && appType==2L){
+                        if (appType != null && appType == 2L) {
                             taskVO.setApprovalType(8);
-                        }else{
+                        } else {
                             taskVO.setApprovalType(1);
                         }
 
@@ -1361,21 +1367,21 @@ public class InformationWriteQueryController extends BladeController {
                             }
 
                             // 为多单上报 状态修改
-                            if(appType!=null && appType == 2L){
+                            if (appType != null && appType == 2L) {
                                 //获取当前时间
                                 LocalDateTime now = LocalDateTime.now();
                                 //格式化时间
                                 String nowFormat = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
-                                String sql = "update u_entrust_info set status = 2 , entrust_time = '"+ nowFormat + "' ,sample_status=1 where id = " + startTaskVO.getIds();
+                                String sql = "update u_entrust_info set status = 2 , entrust_time = '" + nowFormat + "' ,sample_status=1 where id = " + startTaskVO.getIds();
                                 jdbcTemplate.execute(sql);
                             }
                             var = true;
-                        }else{
+                        } else {
                             return R.fail("创建主流程失败");
                         }
                     }
 
-                    if (StringUtils.isNotEmpty(trialIds) && var && appType==1L) {
+                    if (StringUtils.isNotEmpty(trialIds) && var && appType == 1L) {
                         //修改试验记录上报任务状态(批量上报)
                         String sql = "update u_trial_self_inspection_record set task_status = '待审批' where id in(" + trialIds + ")";
                         jdbcTemplate.execute(sql);
@@ -1510,20 +1516,20 @@ public class InformationWriteQueryController extends BladeController {
                 Map<Long, Map<String, Object>> colMaps = new HashMap<>();
                 if (vo.getIsCopyData() == 1) {
                     List<String> tabNames = nodeChildAll.stream()
-                            .map(WbsTreeContract::getInitTableName)
-                            .filter(ObjectUtil::isNotEmpty)
-                            .distinct()
-                            .collect(Collectors.toList());
+                        .map(WbsTreeContract::getInitTableName)
+                        .filter(ObjectUtil::isNotEmpty)
+                        .distinct()
+                        .collect(Collectors.toList());
                     String inClausePlaceholders = String.join(",", Collections.nCopies(tabNames.size(), "?"));
                     String sql = "SELECT table_name AS queryType, GROUP_CONCAT(COLUMN_name) AS ancestors " +
-                            "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
-                            "GROUP BY table_name";
+                        "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
+                        "GROUP BY table_name";
                     Object[] params = tabNames.toArray();
                     List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, params);
 
                     Map<String, List<WbsTreeContract>> tabsGroup = nodeChildAll.stream()
-                            .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
-                            .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
+                        .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
+                        .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
 
                     Set<Long> continuePkeyIds = new HashSet<>();
                     for (Map<String, Object> result : results) {
@@ -1534,8 +1540,8 @@ public class InformationWriteQueryController extends BladeController {
                         }
 
                         List<String> filteredList = Arrays.stream(col.split(","))
-                                .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
-                                .collect(Collectors.toList());
+                            .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
+                            .collect(Collectors.toList());
                         String keys = StringUtils.join(filteredList, ",");
                         List<WbsTreeContract> tabs = tabsGroup.get(tabName);
                         for (WbsTreeContract tab : tabs) {
@@ -1597,8 +1603,8 @@ public class InformationWriteQueryController extends BladeController {
 
                     /*处理复制表数据*/
                     if (nodeOld.getType() == 2 && vo.getIsCopyData() == 1
-                            && StringUtils.isNotEmpty(newData.getInitTableName())
-                            && tabOwner.contains(nodeOld.getTableOwner())) {
+                        && StringUtils.isNotEmpty(newData.getInitTableName())
+                        && tabOwner.contains(nodeOld.getTableOwner())) {
 
                         /*获取表对应的实体数据*/
                         Map<String, Object> resultMap = colMaps.getOrDefault(nodeOld.getPKeyId(), null);
@@ -1636,15 +1642,15 @@ public class InformationWriteQueryController extends BladeController {
                         String delSql = "DELETE FROM " + newData.getInitTableName() + " WHERE p_key_id = " + newData.getPKeyId() + " ; ";
                         //insert SQL
                         copySql.append(delSql)
-                                .append("INSERT INTO ")
-                                .append(newData.getInitTableName())
-                                .append(" (id,p_key_id,group_id")
-                                .append(keysHaveValue)
-                                .append(") VALUES (")
-                                .append(SnowFlakeUtil.getId()).append(",")
-                                .append(newData.getPKeyId()).append(",null")
-                                .append(newString)
-                                .append(");");
+                            .append("INSERT INTO ")
+                            .append(newData.getInitTableName())
+                            .append(" (id,p_key_id,group_id")
+                            .append(keysHaveValue)
+                            .append(") VALUES (")
+                            .append(SnowFlakeUtil.getId()).append(",")
+                            .append(newData.getPKeyId()).append(",null")
+                            .append(newString)
+                            .append(");");
                     }
                 }
             }
@@ -2033,11 +2039,11 @@ public class InformationWriteQueryController extends BladeController {
                     for (String k : colsList) {
                         if (p2.containsKey(k)) {
                             Object value = reviseValue(p2, k, origin.get(k));
-                            if (value != null ) {
-                                if( value.toString().contains("_^_")) {
+                            if (value != null) {
+                                if (value.toString().contains("_^_")) {
                                     value = "'" + value + "'";
                                     target.set(target.indexOf(k), value.toString());
-                                }else{
+                                } else {
                                     target.set(target.indexOf(k), StringPool.NULL);
                                 }
                             }
@@ -2147,11 +2153,11 @@ public class InformationWriteQueryController extends BladeController {
         List<WbsTreeContract> needCopyNodeTabs = this.getChildNodesTables(wbsTreeContractsNeed, needCopyNode.getContractId());
         List<WbsTreeContract> toCopyNodeTabs = this.getChildNodesTables(wbsTreeContractsTo, needCopyNode.getContractId());
         Map<String, WbsTreeContract> toCopyNodeTabsMaps = toCopyNodeTabs.stream()
-                .collect(Collectors.toMap(
-                        obj -> obj.getNodeName() + "-" + obj.getHtmlUrl(),
-                        Function.identity(),
-                        (existing, replacement) -> existing
-                ));
+            .collect(Collectors.toMap(
+                obj -> obj.getNodeName() + "-" + obj.getHtmlUrl(),
+                Function.identity(),
+                (existing, replacement) -> existing
+            ));
         if (needCopyNodeTabs.size() > 0) {
             for (WbsTreeContract needTab : needCopyNodeTabs) {
                 if (ObjectUtil.isNotEmpty(needTab.getHtmlUrl())) {
@@ -2493,7 +2499,7 @@ public class InformationWriteQueryController extends BladeController {
      * 递归获取所有子级节点
      */
     private void recursionGetChildNodes(List<WbsTreeContract> list, List<WbsTreeContract> result, String
-            contractId) {
+        contractId) {
         List<Long> ids = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
         if (ids.size() > 0) {
             List<WbsTreeContract> query = jdbcTemplate.query("select * from m_wbs_tree_contract where type = 1 and parent_id in(" + StringUtils.join(ids, ",") + ") and status = 1 and is_deleted = 0 and contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContract.class));
@@ -2604,9 +2610,9 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 14)
     @ApiOperation(value = "导图结构树节点查询")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "parentId", value = "父节点,首次进入传0、null、''", required = true),
-            @ApiImplicitParam(name = "wbsType", value = "模板类型, 1质检,2试验", required = true),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+        @ApiImplicitParam(name = "parentId", value = "父节点,首次进入传0、null、''", required = true),
+        @ApiImplicitParam(name = "wbsType", value = "模板类型, 1质检,2试验", required = true),
+        @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<List<WbsTreeContractTreeVOS>> queryMappingStructureTree(@RequestParam String parentId,
                                                                      @RequestParam String contractId,
@@ -2658,12 +2664,14 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "修改节点信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "pKeyId", value = "节点的primaryKeyId", required = true),
-            @ApiImplicitParam(name = "nodeName", value = "节点的title", required = true),
-            @ApiImplicitParam(name = "partitionCode", value = "划分编号")
+        @ApiImplicitParam(name = "pKeyId", value = "节点的primaryKeyId", required = true),
+        @ApiImplicitParam(name = "nodeName", value = "节点的title", required = true),
+        @ApiImplicitParam(name = "partitionCode", value = "划分编号")
     })
     public R<Boolean> updateContractNodeParameter(@RequestParam Long pKeyId, @RequestParam String
-            nodeName, @RequestParam String partitionCode) {
+        nodeName, @RequestParam String partitionCode, @RequestParam(required = false) Integer className,
+                                                  @RequestParam(required = false) Integer unitName, @RequestParam(required = false) Integer excellentNum,
+                                                  @RequestParam(required = false) Integer unitNum,@RequestParam(required = false)String digitizeTime) {
         WbsTreeContract node = new WbsTreeContract();
         node.setPKeyId(pKeyId);
         node.setNodeName(nodeName);
@@ -2675,7 +2683,40 @@ public class InformationWriteQueryController extends BladeController {
         }
 
         WbsTreeContract queries = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(pKeyId);
+        if (ObjectUtil.isNotEmpty(className) || ObjectUtil.isNotEmpty(unitName)) {
+            //查询当前节点的是否是子节点,以及当前节点父节点是否包含单元评定
+            String child = "SELECT * FROM m_wbs_tree_contract WHERE parent_id=" + queries.getId() + " AND is_deleted=0";
+            List<WbsTreeContract> childList = jdbcTemplate.query(child, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+            if (childList.size() > 0) {
+                for (WbsTreeContract wbsTreeContract : childList) {
+                    if (ObjectUtil.isEmpty(wbsTreeContract.getInitTableName())) {
+                        return R.fail("当前节点存在子节点,不能设置标准分类和单元名称");
+                    }
+                }
 
+            }
+            String father = "SELECT * FROM m_wbs_tree_contract WHERE id=" + queries.getParentId()+" AND is_deleted=0";
+             List<WbsTreeContract>  fatherNode = jdbcTemplate.query(father, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+            if (ObjectUtil.isNotEmpty(fatherNode)&&fatherNode.size()>0) {
+                for (WbsTreeContract wbsTreeContract : fatherNode) {
+                    if (wbsTreeContract.getIsClassifition() == Integer.valueOf(1)) {
+                        return R.fail("当前节点的父节点包含单元评定");
+                    }
+                }
+            }
+        }
+        if(ObjectUtil.isNotEmpty(digitizeTime)){
+            node.setDigitizeTime(digitizeTime);
+        }
+        if (ObjectUtil.isNotEmpty(unitName) && ObjectUtil.isNotEmpty(className)) {
+            node.setIsClassifition(1);
+            node.setClassName(className);
+            node.setUnitName(unitName);
+            if (queries.getNodeClass() == Integer.valueOf(2)) {
+                node.setExcellentNum(excellentNum);
+                node.setUnitNum(unitNum);
+            }
+        }
         //保存操作记录
         try {
             JSONObject json = new JSONObject();
@@ -2742,6 +2783,33 @@ public class InformationWriteQueryController extends BladeController {
         }
     }
 
+    /**
+     * 查询当前节点下的数据 是否包含监理填报数据
+     */
+    @PostMapping("/removeContractTreeNodeJudge")
+    @ApiOperationSupport(order = 11)
+    @ApiOperation(value = "删除节点前的校验判断")
+    @ApiImplicitParam(name = "ids", value = "节点的primaryKeyId")
+    public R removeContractTreeNodeJudge(@RequestParam String ids) {
+        //删除的节点
+        WbsTreeContract removeNode = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(ids));
+
+        List<WbsTreeContract> removeNodeList = new ArrayList<>();
+        this.currentNodeAllChild(removeNodeList, Collections.singletonList(removeNode), removeNode.getContractId());
+
+        //获取pKeyId
+        List<Long> removeList = removeNodeList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList());
+        removeList.add(Long.parseLong(ids));
+        if (removeList.size() > 0) {
+            /** 判断是否子节点有上存在监理填报内容的资料,提示用户谨慎操作*/
+            List<WbsTreeContractTreeVOS> list = this.wbsTreeContractClient.selectContractJLForm(removeList);
+            if (list != null && list.size() >= 1) {
+                return R.data(300, false, "当前节点已存在监理资料,删除节点会把监理数据一并删除(永久删除),建议与监理方确认是否能删除该数据,请慎重删除!删除后果请自行负责。");
+            }
+        }
+        return R.data(true);
+    }
+
     /**
      * 删除节点
      *
@@ -2881,6 +2949,7 @@ public class InformationWriteQueryController extends BladeController {
             if (allSelectedNodeList.size() > 0) {
                 //查询数据
                 selectedNodeList = this.unifiedCode(allSelectedNodeList, treeContract, "1", query);
+
                 if (ObjectUtil.isEmpty(selectedNodeList)) {
                     return R.data(null);
                 }
@@ -2896,8 +2965,8 @@ public class InformationWriteQueryController extends BladeController {
 
                 //处理重复的数据
                 selectedNodeList = selectedNodeList.stream().collect(Collectors.collectingAndThen(
-                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
-                        ArrayList::new
+                    Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
+                    ArrayList::new
                 ));
             }
             //处理半选
@@ -2926,8 +2995,8 @@ public class InformationWriteQueryController extends BladeController {
 
                 //处理重复的数据
                 selectedNodeList = selectedNodeList.stream().collect(Collectors.collectingAndThen(
-                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
-                        ArrayList::new
+                    Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreePrivate::getId))),
+                    ArrayList::new
                 ));
             }
         }
@@ -2938,17 +3007,19 @@ public class InformationWriteQueryController extends BladeController {
 
         //封裝节点名称nodeName与id的Map
         Map<Long, String> idAndNodeNameMaps = query.stream()
-                .filter(wbsTreePrivate -> pKeyIds.contains(wbsTreePrivate.getPKeyId().toString()))
-                .collect(Collectors.toMap(WbsTreePrivate::getId,
-                        wbsTreePrivate -> selectList.stream()
-                                .filter(node -> node.getPrimaryKeyId().equals(wbsTreePrivate.getPKeyId().toString()))
-                                .findFirst()
-                                .map(AddContractTreeNodeVO.Node::getNodeName)
-                                .orElse("")));
+            .filter(wbsTreePrivate -> pKeyIds.contains(wbsTreePrivate.getPKeyId().toString()))
+            .collect(Collectors.toMap(WbsTreePrivate::getId,
+                wbsTreePrivate -> selectList.stream()
+                    .filter(node -> node.getPrimaryKeyId().equals(wbsTreePrivate.getPKeyId().toString()))
+                    .findFirst()
+                    .map(AddContractTreeNodeVO.Node::getNodeName)
+                    .orElse("")));
+
 
         //原始表ids,电签位置信息使用
         List<Long> oldTabIds = selectedNodeList.stream().filter(f -> new Integer(2).equals(f.getType())).map(WbsTreePrivate::getId).collect(Collectors.toList());
 
+
         //构造参数
         if (selectedNodeList.size() > 0) {
             //重塑关键信息
@@ -2997,19 +3068,19 @@ public class InformationWriteQueryController extends BladeController {
                             //自定义节点(非根节点才处理)
                             if (!newData.getParentId().equals(0L)) {
                                 newData.setParentId(OldIdToNewIdMap.containsKey(half.getParentId())
-                                        ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
-                                        ||
-                                        treeContract.getOldId().equals(half.getParentId().toString())
-                                        ? treeContract.getId() : SnowFlakeUtil.getId());
+                                    ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
+                                    ||
+                                    treeContract.getOldId().equals(half.getParentId().toString())
+                                    ? treeContract.getId() : SnowFlakeUtil.getId());
                             }
                         } else {
                             //非自定义节点
                             //同节点
                             newData.setParentId(OldIdToNewIdMap.containsKey(half.getParentId())
-                                    ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
-                                    ||
-                                    treeContract.getOldId().equals(half.getParentId().toString())
-                                    ? treeContract.getId() : SnowFlakeUtil.getId());
+                                ? OldIdToNewIdMap.get(half.getParentId()) : treeContract.getId().equals(half.getParentId())
+                                ||
+                                treeContract.getOldId().equals(half.getParentId().toString())
+                                ? treeContract.getId() : SnowFlakeUtil.getId());
                         }
                     }
 
@@ -3124,7 +3195,15 @@ public class InformationWriteQueryController extends BladeController {
             saveList.clear();
             saveList.addAll(customResult);
         }
-
+        //找到最顶级节点设置parentId
+        WbsTreeContract topLevelNode = findTopLevelNode(saveList);
+        if (ObjectUtils.isNotEmpty(topLevelNode)) {
+            for (WbsTreeContract wbsTreeContract : saveList) {
+                if (topLevelNode.getPKeyId().equals(wbsTreeContract.getPKeyId())) {
+                    wbsTreeContract.setParentId(treeContract.getId());
+                }
+            }
+        }
         R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 2, treeContract);
 
         List<WbsTreeContract> nowTabs = saveList.stream().filter(f -> new Integer(2).equals(f.getType())).collect(Collectors.toList());
@@ -3135,6 +3214,19 @@ public class InformationWriteQueryController extends BladeController {
         return booleanR;
     }
 
+    public static WbsTreeContract findTopLevelNode(List<WbsTreeContract> saveList) {
+        Set<Long> nodeIds = new HashSet<>();
+        for (WbsTreeContract node : saveList) {
+            nodeIds.add(node.getId());
+        }
+        for (WbsTreeContract node : saveList) {
+            if (!nodeIds.contains(node.getParentId())) {
+                return node;
+            }
+        }
+        return null;
+    }
+
     private void child(List<WbsTreeContract> resultChild, List<WbsTreeContract> nodeAll, WbsTreeContract root) {
         for (WbsTreeContract node : nodeAll) {
             if (Objects.equals(node.getParentId(), root.getId())) {
@@ -3201,18 +3293,18 @@ public class InformationWriteQueryController extends BladeController {
     }
 
     private List<WbsTreePrivateAddVO> unifiedCode
-            (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
-                    saveType, List<WbsTreePrivate> queryResultP) {
+        (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
+            saveType, List<WbsTreePrivate> queryResultP) {
         //获取项目节点树的主键
         List<Long> halfSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).map(Long::parseLong).distinct().collect(Collectors.toList());
 
         //获取项目对应的合同段的树原始节点的信息
         List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select *," +
-                        "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id" +
-                        " AND b.type = 1 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
-                        " AND b.wbs_id = " + treeContract.getWbsId() + " AND b.wbs_type = " + treeContract.getWbsType() + ") AS low " +
-                        " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
-                new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
+                "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id" +
+                " AND b.type = 1 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
+                " AND b.wbs_id = " + treeContract.getWbsId() + " AND b.wbs_type = " + treeContract.getWbsType() + ") AS low " +
+                " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
+            new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
 
         if (query.size() > 0) {
             //返回结果集,匹配节点名称使用
@@ -3221,8 +3313,10 @@ public class InformationWriteQueryController extends BladeController {
             //剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
             if ("1".equals(saveType)) {
                 query.removeIf(wbsTreePrivate -> {
-                    Long id = wbsTreePrivate.getId();
-                    return treeContract.getId() != null && treeContract.getId().equals(id);
+                    /*Long id = wbsTreePrivate.getId();
+                    return treeContract.getId() != null && treeContract.getId().equals(id);*/
+                    Long pKeyId = wbsTreePrivate.getPKeyId();
+                    return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
                 });
             }
 
@@ -3233,18 +3327,18 @@ public class InformationWriteQueryController extends BladeController {
     }
 
     private List<WbsTreePrivateAddVO> unifiedCode2
-            (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
-                    saveType, List<WbsTreePrivate> queryResultP) {
+        (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract, String
+            saveType, List<WbsTreePrivate> queryResultP) {
         //获取项目节点树的主键
         List<Long> halfSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).map(Long::parseLong).distinct().collect(Collectors.toList());
 
         //获取项目对应的合同段的树原始节点的信息
         List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select *," +
-                        "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_private b WHERE b.parent_id = a.id" +
-                        " AND b.type = 2 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
-                        ") AS low " +
-                        " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
-                new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
+                "(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_private b WHERE b.parent_id = a.id" +
+                " AND b.type = 2 and b.status = 1 AND b.is_deleted = 0 AND b.project_id = " + treeContract.getProjectId() +
+                ") AS low " +
+                " FROM m_wbs_tree_private a WHERE p_key_id IN (" + StringUtils.join(halfSelectedList, ",") + ")",
+            new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
 
         if (query.size() > 0) {
             //返回结果集,匹配节点名称使用
@@ -3253,8 +3347,10 @@ public class InformationWriteQueryController extends BladeController {
             //剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
             if ("1".equals(saveType)) {
                 query.removeIf(wbsTreePrivate -> {
-                    Long id = wbsTreePrivate.getId();
-                    return treeContract.getId() != null && treeContract.getId().equals(id);
+                    /*Long id = wbsTreePrivate.getId();
+                    return treeContract.getId() != null && treeContract.getId().equals(id);*/
+                    Long pKeyId = wbsTreePrivate.getPKeyId();
+                    return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
                 });
             }
 
@@ -3266,8 +3362,8 @@ public class InformationWriteQueryController extends BladeController {
 
     @NotNull
     public R<Boolean> saveOrCopyNodeTree
-            (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
-                    operationType, WbsTreeContract currentNode) {
+        (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
+            operationType, WbsTreeContract currentNode) {
         if (saveList.size() > 0) {
             //StringBuilder str = new StringBuilder();
             //str.append("-" + saveList.get(0).getFullName());
@@ -3314,8 +3410,8 @@ public class InformationWriteQueryController extends BladeController {
 
     @NotNull
     private R<Boolean> saveOrCopyNodeTree2
-            (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
-                    operationType, WbsTreeContract currentNode) {
+        (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
+            operationType, WbsTreeContract currentNode) {
         if (saveList.size() > 0) {
             //StringBuilder str = new StringBuilder();
             //str.append("-" + saveList.get(0).getFullName());
@@ -3379,15 +3475,17 @@ public class InformationWriteQueryController extends BladeController {
 
             //获取项目对应的合同段的树原始节点的信息
             List<WbsTreePrivateAddVO> query = jdbcTemplate.query("select * from m_wbs_tree_private where p_key_id in(" + StringUtils.join(allSelectedList, ",") + ")",
-                    new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
+                new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
             if (query.size() > 0) {
                 //返回结果集,匹配节点名称使用
                 queryResultP.addAll(query);
 
                 //剔除与当前操作节点相同的ID
                 query.removeIf(wbsTreePrivate -> {
-                    Long id = wbsTreePrivate.getId();
-                    return treeContract.getId() != null && treeContract.getId().equals(id);
+                    /*Long id = wbsTreePrivate.getId();
+                    return treeContract.getId() != null && treeContract.getId().equals(id);*/
+                    Long pKeyId = wbsTreePrivate.getPKeyId();
+                    return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
                 });
 
                 //设置到集合中
@@ -3405,11 +3503,11 @@ public class InformationWriteQueryController extends BladeController {
      */
     private void foreachQueryChild(List<Long> parentIdsList, List<WbsTreePrivateAddVO> childList, WbsTreeContract wbsTreeContract) {
         List<WbsTreePrivateAddVO> childS = jdbcTemplate.query("select * from m_wbs_tree_private" +
-                " where parent_id in(" + StringUtils.join(parentIdsList, ",") + ")" +
-                " and project_id = " + wbsTreeContract.getProjectId() +
-                " and wbs_id = " + wbsTreeContract.getWbsId() +
-                " and wbs_type = " + wbsTreeContract.getWbsType() +
-                " and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
+            " where parent_id in(" + StringUtils.join(parentIdsList, ",") + ")" +
+            " and project_id = " + wbsTreeContract.getProjectId() +
+            " and wbs_id = " + wbsTreeContract.getWbsId() +
+            " and wbs_type = " + wbsTreeContract.getWbsType() +
+            " and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(WbsTreePrivateAddVO.class));
         if (childS.size() > 0) {
             childList.addAll(childS);
         }
@@ -3426,11 +3524,11 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "懒加载项目级工程划分树")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "projectId", value = "项目ID"),
-            @ApiImplicitParam(name = "id", value = "点击节点ID")
+        @ApiImplicitParam(name = "projectId", value = "项目ID"),
+        @ApiImplicitParam(name = "id", value = "点击节点ID")
     })
     public R<List<WbsTreeContractTreeVOS>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String
-                                                                                       projectId, @RequestParam String id) {
+                                                                                   projectId, @RequestParam String id) {
         List<WbsTreeContractTreeVOS> result = new ArrayList<>();
 
         if (StringUtils.isNotEmpty(id)) {
@@ -3464,11 +3562,11 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "懒加载合同段工程划分树")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "contractId", value = "合同段ID"),
-            @ApiImplicitParam(name = "id", value = "点击节点ID")
+        @ApiImplicitParam(name = "contractId", value = "合同段ID"),
+        @ApiImplicitParam(name = "id", value = "点击节点ID")
     })
     public R<List<WbsTreeContractTreeVOS>> queryWbsTreeContractByContractIdAndId(@RequestParam String
-                                                                                         contractId, @RequestParam String id) {
+                                                                                     contractId, @RequestParam String id) {
         List<WbsTreeContractTreeVOS> result = new ArrayList<>();
         if (StringUtils.isNotEmpty(id)) {
             WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();
@@ -3569,10 +3667,10 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "分页")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "size", value = "当前页条数", required = true),
-            @ApiImplicitParam(name = "current", value = "当前页", required = true),
-            @ApiImplicitParam(name = "wbsId", value = "节点ID", required = true),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+        @ApiImplicitParam(name = "size", value = "当前页条数", required = true),
+        @ApiImplicitParam(name = "current", value = "当前页", required = true),
+        @ApiImplicitParam(name = "wbsId", value = "节点ID", required = true),
+        @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<IPage<InformationQueryVO>> page(@RequestBody InformationQueryVO vo) {
         if (ObjectUtil.isEmpty(vo.getContractId())) {
@@ -3713,12 +3811,12 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 29)
     @ApiOperation(value = "获取当前合同段的划分树")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+        @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
+        @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<List<WbsTreeContractTreeVOS>> queryStandingBookContractWbsTree(@RequestParam String
-                                                                                    primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String
-                                                                                    contractIdRelation) {
+                                                                                primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String
+                                                                                contractIdRelation) {
         if (StringUtils.isNotEmpty(primaryKeyId)) {
             parentId = primaryKeyId;
         }
@@ -3737,12 +3835,12 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "获取当前合同段的划分树")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
-            @ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
+        @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
+        @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
+        @ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
     })
     public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String
-                                                                                           primaryKeyId,
+                                                                                       primaryKeyId,
                                                                                    @RequestParam String parentId,
                                                                                    @RequestParam String contractId,
                                                                                    @RequestParam String contractIdRelation,
@@ -3773,8 +3871,8 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "修改(只能修改编号和文件名)")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "name", value = "文件名称, 必须有值", required = true),
-            @ApiImplicitParam(name = "number", value = "文件编号,可以为空")
+        @ApiImplicitParam(name = "name", value = "文件名称, 必须有值", required = true),
+        @ApiImplicitParam(name = "number", value = "文件编号,可以为空")
     })
     public R<Boolean> update(@Valid @RequestBody InformationQuery informationQuery) {
         if ("null".equals(String.valueOf(informationQuery.getId())) || StringUtils.isEmpty(String.valueOf(informationQuery.getId()))) {
@@ -3804,11 +3902,11 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 28)
     @ApiOperation(value = "首件wbs树")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+        @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
+        @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String
-                                                                                   parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
+                                                                               parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
         List<WbsTreeContractTreeVOS> rootTreeNode = informationQueryService.queryContractTree(parentId, contractId, contractIdRelation, null);
         //查询被标记为首件的数据
         rootTreeNode = rootTreeNode.stream().filter(WbsTreeContractTreeVOS::getIsFirst).collect(Collectors.toList());
@@ -3823,7 +3921,7 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 29)
     @ApiOperation(value = "分页")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "ids", value = "ids", required = true)
+        @ApiImplicitParam(name = "ids", value = "ids", required = true)
     })
     public R<String> getQueryInfoIds(String ids) {
         List<String> strList = Func.toStrList(ids);
@@ -3891,10 +3989,9 @@ public class InformationWriteQueryController extends BladeController {
                 if (parentNode.getParentId().equals(0L)) {
                     obj.setNodeType(1);
                 } else {
-                    obj.setNodeType(parentNode.getNodeType().equals(6) ? 6 : parentNode.getNodeType() + 1);
+                    obj.setNodeType(parentNode.getNodeType().equals(6) ? 6 : dto.getNodeType());
                 }
             }
-
             obj.setPartitionCode(dto.getPartitionCode());
             obj.setParentId(parentNode.getId());
             obj.setAncestors(parentNode.getAncestors() + "," + parentNode.getId());
@@ -3917,12 +4014,41 @@ public class InformationWriteQueryController extends BladeController {
                 obj.setTenantId(SecureUtil.getTenantId());
             }
 
-            if (wbsTreeContractClient.saveBatch(Collections.singletonList(obj))) {
-                informationQueryService.delAsyncWbsTree(parentNode.getContractId());
-                return R.success("操作成功");
+            if (dto.getNodeClass() == Integer.valueOf(2)) {
+                if (dto.getIsClassifition() == 1) {
+                    if (parentNode.getNodeClass() == Integer.valueOf(2)) {
+                        throw new ServiceException("当前节点的父节点已经是数字化上传节点");
+                    }
+                    if (ObjectUtil.isEmpty(dto.getClassName())) {
+                        throw new ServiceException("请选择标准分类");
+                    } else {
+                        if (ObjectUtil.isEmpty(dto.getUnitName())) {
+                            throw new ServiceException("请选择单元名称");
+                        }
+                    }
+                    if (ObjectUtil.isNotEmpty(dto.getClassName()) && ObjectUtil.isNotEmpty(dto.getUnitName())) {
+                        obj.setClassName(dto.getClassName());
+                        obj.setUnitName(dto.getUnitName());
+                        obj.setIsClassifition(dto.getIsClassifition());
+                        obj.setExcellentNum(dto.getExcellentNum());
+                        obj.setUnitNum(dto.getUnitNum());
+
+                    } else {
+                        throw new ServiceException("标准分类或单元名称选择有误");
+                    }
+                }
+                obj.setNodeClass(dto.getNodeClass());
+                if (ObjectUtil.isEmpty(dto.getDigitizeTime())) {
+                    throw new ServiceException("请选择节点时间");
+                }
+                obj.setDigitizeTime(dto.getDigitizeTime());
             }
+                if (wbsTreeContractClient.saveBatch(Collections.singletonList(obj))) {
+                    informationQueryService.delAsyncWbsTree(parentNode.getContractId());
+                    return R.success("操作成功");
+                }
+
         }
         return R.fail("未获取到当前选择节点信息");
     }
-
 }

+ 108 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java

@@ -27,19 +27,31 @@ import org.springblade.business.service.IImageClassificationFileService;
 import org.springblade.business.service.IInformationQueryService;
 import org.springblade.business.vo.MaterialProgressVO;
 import org.springblade.business.vo.QueryProcessDataVO;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
-import org.springframework.web.bind.annotation.*;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.system.entity.Menu;
+import org.springblade.system.entity.RoleMenu;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 
 /**
  * 资料进度 控制器
@@ -60,6 +72,7 @@ public class MaterialProgressController extends BladeController {
     private final IImageClassificationFileService imageClassificationFileService;
 
     private final ContractClient contractClient;
+    private final JdbcTemplate jdbcTemplate;
 
     /**
      * 资料进度
@@ -286,6 +299,7 @@ public class MaterialProgressController extends BladeController {
                 if (countList.size() > 0) {
                     //设置参数
                     this.setTaskParameter(reVO, countList, classifyType);
+                    filtetDataByRole(contract, reVO,2);
                     return R.data(reVO);
                 }
             }
@@ -294,6 +308,7 @@ public class MaterialProgressController extends BladeController {
             List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
             if (submitNodeList != null && submitNodeList.size() > 0) {
                 this.setTaskParameter(reVO, submitNodeList, classifyType);
+                filtetDataByRole(contract, reVO,2);
                 return R.data(reVO);
             }
         }
@@ -301,6 +316,95 @@ public class MaterialProgressController extends BladeController {
         return R.data(200, null, "未找到数据");
     }
 
+    private void filtetDataByRole(ContractInfo contract, MaterialProgressVO reVO,int type) {
+        //获取该用户的该合同段角色
+        Long userId = AuthUtil.getUserId();
+        String projectId = contract.getPId();
+        SaveUserInfoByProjectDTO saveUserInfoByProjectDTO = jdbcTemplate.queryForObject("select role_id from m_project_assignment_user where user_id = " + userId + " and project_id = " + projectId + " and contract_id=" + contract.getId(), new BeanPropertyRowMapper<>(SaveUserInfoByProjectDTO.class));
+        //获取该用户的所有菜单权限
+        List<RoleMenu> roleMenuList = jdbcTemplate.query("select * from blade_role_menu where role_id = " + saveUserInfoByProjectDTO.getRoleId(), new BeanPropertyRowMapper<>(RoleMenu.class));
+        Map<Long, String> havaMenusMap = roleMenuList.stream().filter(roleMenu -> roleMenu != null && roleMenu.getMenuId() != null && roleMenu.getStatus() != null)
+                .collect(Collectors.toMap(
+                        roleMenu -> roleMenu.getMenuId(),
+                        roleMenu -> roleMenu.getStatus(),
+                        (existingValue, newValue) -> existingValue
+                ));
+        //获取系统所有表单权限 这里只有质检需要所以系统写死  如果后续其他地方需要相同的方法 sys_id根据前端请求头种的参数动态配置
+        List<Menu> menuList = jdbcTemplate.query("select id,parent_id,code,name from blade_menu where is_deleted = 0 and sys_id=1528578177090609154", new BeanPropertyRowMapper<>(Menu.class));
+        Map<String, Menu> allMenuMap = menuList.stream()
+                .filter(roleMenu -> roleMenu != null && roleMenu.getId() != null)  // 过滤掉 null 值
+                .collect(Collectors.toMap(
+                        Menu::getCode,
+                        Menu -> Menu,
+                        (existingValue, newValue) -> existingValue
+                ));
+
+        //根据合同段角色id过滤出当前角色能看到的数据
+        if(type == 1){//控制不同的页面数据 1.顶部环形图 2.左下柱状图
+            filterProcessMaterials(reVO.getProcessMaterialList(), allMenuMap, havaMenusMap);
+        }else {
+            filterProcessMaterialStatuses(reVO.getProcessMaterialStatusList(), allMenuMap, havaMenusMap);
+        }
+    }
+    private void filterProcessMaterials(List<MaterialProgressVO.ProcessMaterial> processMaterialList, Map<String, Menu> allMenuMap, Map<Long, String> haveMenusMap) {
+        Iterator<MaterialProgressVO.ProcessMaterial> iterator = processMaterialList.iterator();
+        while (iterator.hasNext()) {
+            MaterialProgressVO.ProcessMaterial processMaterial = iterator.next();
+            String title = processMaterial.getTitle();
+            String code = getCodeFromTitle(title);
+            Menu menu = allMenuMap.get(code);
+            boolean b = checkPermissions(menu, haveMenusMap);
+            if (!b) {
+                iterator.remove();
+            }
+        }
+    }
+
+    private void filterProcessMaterialStatuses(List<MaterialProgressVO.ProcessMaterialStatus> processMaterialStatusList, Map<String, Menu> allMenuMap, Map<Long, String> haveMenusMap) {
+        Iterator<MaterialProgressVO.ProcessMaterialStatus> iterator = processMaterialStatusList.iterator();
+        while (iterator.hasNext()) {
+            MaterialProgressVO.ProcessMaterialStatus processMaterialStatus = iterator.next();
+            String title = processMaterialStatus.getTitle();
+            String code = getCodeFromTitle(title);
+            Menu menu = allMenuMap.get(code);
+            boolean b = checkPermissions(menu, haveMenusMap);
+            if (!b) {
+                iterator.remove();
+            }
+        }
+    }
+
+    private String getCodeFromTitle(String title) {
+        switch (title) {
+            case "开工报告":
+                return "schedule-data-chart-1";
+            case "工序资料":
+                return "schedule-data-chart-2";
+            case "评定资料":
+                return "schedule-data-chart-3";
+            case "中间交工":
+                return "schedule-data-chart-4";
+            default:
+                return "";
+        }
+    }
+    private  boolean checkPermissions(Menu menu ,Map<Long, String> havaMenusMap){
+        String status = havaMenusMap.get(menu.getId());
+        return ObjectUtil.isEmpty(status) ? false : true;
+        /*全选半选会精确到最小权限 不需要去寻找父权限
+        if(ObjectUtil.isEmpty(status)){
+            Long parentId = menu.getParentId();
+            if(ObjectUtil.isEmpty(parentId)){
+                return false;
+            }else {
+                Menu menu1 = allMenuMap.get(parentId);
+                return checkPermissions(menu1,havaMenusMap,allMenuMap);
+            }
+        }else {
+            return true;
+        }*/
+    }
+
     private void setTaskParameter(MaterialProgressVO reVO, List<WbsTreeContract> submitNodeList, String classifyType) {
         classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
 
@@ -388,6 +492,7 @@ public class MaterialProgressController extends BladeController {
                     //设置参数
                     this.setParameter(countList, reVO, classifyType);
                 }
+                filtetDataByRole(contract, reVO,1);
                 return R.data(reVO);
             }
         } else {
@@ -397,6 +502,7 @@ public class MaterialProgressController extends BladeController {
             if (submitNodeList != null && submitNodeList.size() > 0) {
                 //设置参数
                 this.setParameter(submitNodeList, reVO, classifyType);
+                filtetDataByRole(contract, reVO,1);
                 return R.data(reVO);
             }
         }

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

@@ -24,11 +24,12 @@ import org.springblade.archive.feign.ArchiveAutoClient;
 import org.springblade.archive.feign.ArchiveExpertConclusionClient;
 import org.springblade.business.dto.*;
 import org.springblade.business.entity.*;
-import org.springblade.business.service.*;
+import org.springblade.business.service.IDefaultConfigService;
+import org.springblade.business.service.ITaskParallelService;
+import org.springblade.business.service.ITaskService;
 import org.springblade.business.service.impl.MessageWarningServiceImpl;
 import org.springblade.business.utils.StringSPUtils;
 import org.springblade.business.vo.*;
-import org.springblade.common.constant.ClientIdConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.log.exception.ServiceException;
@@ -69,7 +70,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.time.Duration;
 import java.util.*;
@@ -492,7 +492,14 @@ public class TaskController extends BladeController {
                 task.setBatch(archiveTaskBatchReportDTO.getBatch());
                 task.setType(1);
                 task.setApprovalType(4); //档案审批
-                task.setFixedFlowId(0L);
+                Long flowId = null;
+                try {
+                    String fixedFlowId = archiveTaskBatchReportDTO.getFixedFlowId();
+                    flowId = Long.parseLong(fixedFlowId);
+                } catch (NumberFormatException e) {
+                    flowId = 0L;
+                }
+                task.setFixedFlowId(flowId);
                 task.setStatus(1); //待审批
                 task.setIsDeleted(0);
                 task.setTrialSelfInspectionRecordId(null);
@@ -1443,6 +1450,48 @@ public class TaskController extends BladeController {
                 })
                 .filter(Objects::nonNull) //过滤掉为null的任务
                 .collect(Collectors.toList());
+        //所有满足条件的任务 转map
+        Map<Long, Task> taskMap = new HashMap<>();
+        Map<String, List<OperationLog>> operationLogMap = new HashMap<>();
+        List<Long> taskIds = pageList.stream().filter(b -> "已废除".equals(b.getTaskStatusName())).map(BusinessTaskPageVO::getTaskId).collect(Collectors.toList());
+        if (ObjectUtil.isNotEmpty(taskIds)){
+            String joinTaskIds = StringUtils.join(taskIds, ",");
+            List<Task> tasks = jdbcTemplate.query("select id, create_time,form_data_id from u_task where id in ( " + joinTaskIds+")", new BeanPropertyRowMapper<>(Task.class));
+             taskMap = tasks.stream()
+                    .collect(Collectors.toMap(
+                            Task::getId,
+                            task -> task));
+        }
+        //所有满足条件的日志 转map
+        String logQuery = "select business_id,create_user_name ,create_time from u_operation_log where  operation_content like '%废除%'";
+        List<OperationLog> operationLogs = jdbcTemplate.query(logQuery, new BeanPropertyRowMapper<>(OperationLog.class));
+        if(ObjectUtil.isNotEmpty(operationLogs)){
+             operationLogMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getBusinessId));
+        }
+        for (BusinessTaskPageVO businessTaskPageVO : pageList) {
+            if("已废除".equals(businessTaskPageVO.getTaskStatusName())){
+                Long taskId = businessTaskPageVO.getTaskId();
+                Task task = taskMap.get(taskId);
+                if (ObjectUtil.isEmpty(task)){
+                    continue;
+                }
+                //任务创建时间
+                Date createTime = task.getCreateTime();
+                //废除时间肯定在任务创建时间之后  选择距离当前任务创建时间最近的一条数据
+                List<OperationLog> operationLogsF = operationLogMap.get(task.getFormDataId());
+                /*List<OperationLog> operationLogs = jdbcTemplate.query("select create_user_name ,create_time from u_operation_log where business_id = '" +
+                                task.getFormDataId() + "'and operation_content like '%废除%' and create_time >= '"+format+"' ORDER BY ABS(TIMESTAMPDIFF(SECOND, '"+format+"', create_time)) LIMIT 1"
+                        , new BeanPropertyRowMapper<>(OperationLog.class));*/
+                if(ObjectUtil.isNotEmpty(operationLogsF)){
+                    Optional<OperationLog> min = operationLogsF.stream().filter(o -> o.getCreateTime().compareTo(createTime) >= 0)
+                            .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
+                    if (min.isPresent()){
+                        OperationLog operationLog = min.get();
+                        businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+operationLog.getCreateUserName()+"-"+operationLog.getCreateTime());
+                    }
+                }
+            }
+        }
         page.setRecords(pageList);
         page.setTotal(totalCount);
         return R.data(page);
@@ -1619,7 +1668,22 @@ public class TaskController extends BladeController {
             return R.fail("请选择一条记录");
         }
         String header = request.getHeader("Blade-Auth");
-        taskService.reSigningEVisa(dto.getClassifyType(), dto.getTaskIds(), dto.getContractId(), dto.getProjectId(), dto.getType(), header);
+        taskService.reSigningEVisa(dto.getClassifyType(), dto.getTaskIds(), dto.getContractId(), dto.getProjectId(), dto.getType(), header,request);
+        return R.success("任务已经成功提交重签,请耐心等待!");
+    }
+
+    /**
+     * 质检-日志-一键重签
+     */
+    @PostMapping("/logReSigningEVisa")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "质检-日志-一键重签", notes = "传入taskIds、下拉框的contractId、projectId")
+    public R<Object> logReSigningEVisa(@RequestBody reSigningEVisaDTO dto, HttpServletRequest request) {
+        if (StringUtils.isBlank(dto.getLogIds())) {
+            return R.fail("请选择一条记录");
+        }
+        String header = request.getHeader("Blade-Auth");
+        taskService.logReSigningEVisa(dto.getLogIds(),dto.getLogPkeyId(),dto.getNodePrimaryKeyId(), dto.getContractId(),request,dto.getType());
         return R.success("任务已经成功提交重签,请耐心等待!");
     }
 

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

@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springblade.business.dto.TrialMaterialMobilizationDTO;
 import org.springblade.business.dto.TrialSampleInfoDTO;
 import org.springblade.business.entity.TrialMaterialMobilization;
@@ -24,6 +25,8 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -31,6 +34,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.util.List;
 
+@Slf4j
 @RestController
 @AllArgsConstructor
 @RequestMapping("/material")
@@ -39,6 +43,7 @@ public class TrialMaterialController extends BladeController {
 
     private final ITrialMaterialMobilizationService iTrialMaterialMobilizationService;
     private final ITrialSampleInfoService iTrialSampleInfoService;
+    private final JdbcTemplate jdbcTemplate;
 
     @GetMapping("/mobilization/verification")
     @ApiOperationSupport(order = 1)
@@ -144,7 +149,18 @@ public class TrialMaterialController extends BladeController {
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "样品材料批量删除", notes = "传入ids")
     public R<Object> sampleRemove(@Valid @RequestParam String ids) {
-        return R.status(iTrialSampleInfoService.deleteLogic(Func.toLongList(ids)));
+        boolean b = iTrialSampleInfoService.deleteLogic(Func.toLongList(ids));
+        if(b){
+            //删除关联表中的额数据
+            String sqlForDelTrailSampleRecord = "delete from u_trial_sampling_record where sample_info_id in ("+ids+")";
+            try {
+                jdbcTemplate.execute(sqlForDelTrailSampleRecord);
+            } catch (DataAccessException e) {
+                log.error("删除关联表中的额数据失败", e);
+                throw new RuntimeException(e);
+            }
+        }
+        return R.status(b);
     }
 
     @PostMapping("/sample/copy")

+ 16 - 7
blade-service/blade-business/src/main/java/org/springblade/business/controller/UserViewProjectContractController.java

@@ -4,7 +4,6 @@ import cn.hutool.core.date.StopWatch;
 import cn.hutool.log.StaticLog;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
@@ -14,7 +13,6 @@ import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.DefaultProject;
 import org.springblade.business.service.IDefaultProjectService;
 import org.springblade.business.vo.UserVO;
-import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
@@ -22,11 +20,15 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
-import org.springblade.manager.entity.*;
-import org.springblade.manager.feign.*;
+import org.springblade.manager.entity.ContractInfo;
+import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.entity.SignPfxFile;
+import org.springblade.manager.feign.ContractClient;
+import org.springblade.manager.feign.ProjectAssignmentUserClient;
+import org.springblade.manager.feign.ProjectClient;
+import org.springblade.manager.feign.SignPfxClient;
 import org.springblade.manager.vo.ContractInfoVO;
 import org.springblade.manager.vo.ProjectInfoVO;
-import org.springblade.manager.vo.ProjectInfoWbsTypeVO;
 import org.springblade.system.entity.Role;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
@@ -38,7 +40,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -224,7 +225,15 @@ public class UserViewProjectContractController {
 
             //剔除没有合同段的项目
             projectInfoVOS.removeIf(next -> next.getContractInfoList().size() == 0);
-
+            //将合同段中业主合同段排在最前面
+            if(ObjectUtil.isNotEmpty(projectInfoVOS)){
+                for (ProjectInfoVO projectInfoVO : projectInfoVOS) {
+                    if(ObjectUtil.isNotEmpty(projectInfoVO.getContractInfoList())){
+                        List<ContractInfoVO> contractInfoList = projectInfoVO.getContractInfoList();
+                        contractInfoList.sort(Comparator.comparingInt(contractInfo->contractInfo.getContractType() == 3 ? -1:0));
+                    }
+                }
+            }
             return R.data(projectInfoVOS);
         }
         return R.data(-1, null, "数据查询失败");

+ 23 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -13,6 +13,7 @@ import org.springblade.business.vo.SaveContractLogVO;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.feign.WbsTreePrivateClient;
@@ -107,6 +108,15 @@ public class ContractLogClientImpl implements ContractLogClient {
                 .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
     }
 
+    @Override
+    public List<ContractLog> queryContractLogByPrimaryKeyIdAndRecordTimeAndCreateUserList(String nodePrimaryKeyId, String recordTime, String contractId, Long createUser) {
+        return this.contractLogService.getBaseMapper().selectList(Wrappers.<ContractLog>lambdaQuery()
+                .eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
+                .eq(ContractLog::getRecordTime, recordTime)
+                .eq(ContractLog::getContractId, contractId)
+                .eq(ContractLog::getCreateUser, createUser));
+    }
+
     @Override
     public JSONObject queryContractLogById(String theLogId) {
         ContractLog log = this.contractLogService.getById(theLogId);
@@ -154,6 +164,19 @@ public class ContractLogClientImpl implements ContractLogClient {
         return contractLog.getId().toString();
     }
 
+    @Override
+    public String saveLogWbsList(SaveContractLogVO saveContractLogVO) {
+        ContractLog contractLog = new ContractLog();
+        List<JSONObject> logWbsList = saveContractLogVO.getCorrelationIds();
+        BeanUtil.copyProperties(saveContractLogVO, contractLog);
+        contractLog.setId(saveContractLogVO.getContractId());
+        List<ContractLogWbs> newLogWbsList = new ArrayList<>();
+        //处理数据
+        logWbsList.forEach(json -> newLogWbsList.add(this.createContractLogWbs(json, contractLog)));
+        this.contractLogWbsService.saveBatch(newLogWbsList);
+        return "success";
+    }
+
     private ContractLogWbs createContractLogWbs(JSONObject json, ContractLog contractLog) {
         ContractLogWbs newLogWbs = new ContractLogWbs();
         newLogWbs.setId(SnowFlakeUtil.getId());

+ 21 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -1,6 +1,7 @@
 package org.springblade.business.feignClient;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
@@ -120,5 +121,25 @@ public class InformationQueryClientImpl implements InformationQueryClient {
          System.out.println("1111");
     }
 
+    @Override
+    public void insert(InformationQuery iq) {
+       informationQueryMapper.insert(iq);
+    }
+
+    @Override
+    public InformationQuery getInfoByWbsId(Long wbsId) {
+        return informationQueryMapper.selectOne(new QueryWrapper<InformationQuery>().eq("wbs_id",wbsId));
+    }
+
+    @Override
+    public void update(InformationQuery iq) {
+        informationQueryMapper.updateById(iq);
+    }
+
+    @Override
+    public void delInformation(InformationQuery infoByWbsId) {
+        informationQueryMapper.deleteById(infoByWbsId);
+    }
+
 
 }

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.java

@@ -55,4 +55,8 @@ public interface EntrustInfoMapper extends BaseMapper<EntrustInfo> {
 	int delEntrustInfo(@Param("ids") List<Long> ids);
 
 	Integer selectCountBySampleId(Long sampleId);
+
+	List<EntrustInfo> checkDelete(@Param("ids") List<Long> ids);
+
+	List<EntrustInfo> getRfiList(@Param("ids") List<String> ids,@Param("state") String state);
 }

+ 18 - 2
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.xml

@@ -57,7 +57,7 @@
         SELECT a.*,b.node_id as nodeId,b.material_name as materialName ,
           (SELECT max(c.id) from u_trial_self_inspection_record c where c.entrust_id = a.id) as testId
                from u_entrust_info a LEFT JOIN u_trial_sample_info b on a.sample_id=b.id
-        where a.is_deleted = 0 and b.is_deleted=0
+        where a.is_deleted = 0 and b.is_deleted=0 and entrust_type!=2
         <if test="param2.nodeId != null">
             and b.node_id = #{param2.nodeId}
         </if>
@@ -91,7 +91,7 @@
         SELECT
         CASE
         WHEN max(c.task_status) = '未上报' THEN 1
-        WHEN max(c.task_status) = '待审批' THEN 3
+        WHEN max(c.task_status) = '待审批' THEN 2
         WHEN max(c.task_status) = '已审批' THEN 4
         ELSE 5
         END
@@ -158,6 +158,15 @@
     <select id="selectCountBySampleId" resultType="java.lang.Integer">
         select  count(*) from u_entrust_info where sample_id=#{sampleId} and is_deleted=0
     </select>
+    <select id="checkDelete" resultType="org.springblade.business.entity.EntrustInfo">
+        select id from u_entrust_info where  id in (
+            <foreach collection="ids" item="id" separator=",">
+                #{id}
+            </foreach>
+            )
+        and (status = 2
+        or id  in (select entrust_id from u_trial_self_inspection_record where is_deleted=0))
+    </select>
 
 
     <delete id="delEntrustInfo" >
@@ -169,4 +178,11 @@
         and id not in(SELECT entrust_id from u_trial_self_inspection_record where is_deleted=0)
     </delete>
 
+    <select id="getRfiList" resultType="org.springblade.business.entity.TrialSampleInfo">
+        SELECT b.id,a.* from u_trial_sample_info a ,u_entrust_info b where a.id=b.sample_id and b.entrust_type=2 and a.is_deleted=0 and sample_status=#{state} and  b.is_deleted=0 and a.rf_id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+
 </mapper>

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

@@ -26,6 +26,8 @@ import org.springblade.business.vo.TrialSampleDataInfoVO;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.core.tool.api.R;
 
+import java.util.List;
+
 /**
  * 委托单信息表 服务类
  *
@@ -43,10 +45,13 @@ public interface IEntrustInfoService extends BaseService<EntrustInfo> {
 	 */
 	IPage<EntrustInfoVO> selectEntrustInfoPage(IPage<EntrustInfoVO> page, EntrustInfoVO entrustInfo);
 
+	// 获取rids
+	R getRfiList(String rids,String state);
+
 	EntrustDataInfoVO getReportDetail(String id);
 
 	/**
-	 * 样品分
+	 * 样品分
 	 * @param page
 	 * @param trialSampleInfo
 	 * @return

+ 6 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java

@@ -22,7 +22,6 @@ import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskVO;
 import org.springblade.core.mp.base.BaseService;
 import org.springframework.scheduling.annotation.Async;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.FileNotFoundException;
@@ -98,7 +97,7 @@ public interface ITaskService extends BaseService<Task> {
     void delArchiveFileBusinessData(Long projectId, Long wbsId);
 
     @Async
-    void reSigningEVisa(String classify, String taskIds, String contractId, String projectId,Integer type, String header);
+    void reSigningEVisa(String classify, String taskIds, String contractId, String projectId,Integer type, String header,HttpServletRequest request);
 
     /**
      * 根据数据源id查询任务
@@ -115,4 +114,9 @@ public interface ITaskService extends BaseService<Task> {
      */
     void trialSelfTaskRelated(TaskApprovalVO taskApprovalVO, String pdfUrlEVisa, String batchId) throws FileNotFoundException;
 
+    /**
+     * 质检-日志重签
+     */
+    @Async
+    void logReSigningEVisa(String logIds,Long logPkeyId,Long nodePrimaryKeyId, String contractId,HttpServletRequest request, Integer type);
 }

+ 79 - 6
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java

@@ -18,23 +18,25 @@ package org.springblade.business.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.ContractLog;
-import org.springblade.business.vo.ContractLogVO;
+import org.springblade.business.entity.Task;
+import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.mapper.ContractLogMapper;
 import org.springblade.business.service.IContractLogService;
+import org.springblade.business.vo.ContractLogVO;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -46,6 +48,12 @@ import java.util.stream.Collectors;
 @Service
 public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, ContractLog> implements IContractLogService {
 
+    private final JdbcTemplate jdbcTemplate;
+
+    public ContractLogServiceImpl(JdbcTemplate jdbcTemplate) {
+        this.jdbcTemplate = jdbcTemplate;
+    }
+
     @Override
     public List<String> queryReportLogTimeTree(String contractId, String nodePrimaryKeyId) {
         return this.baseMapper.queryReportLogTimeTree(contractId, nodePrimaryKeyId);
@@ -112,6 +120,71 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
 
         IPage<ContractLogVO> iPage = Condition.getPage(query);
         iPage.setTotal(count);
+
+        //待审批和已审批的id集合
+        List<Long> ids = deduplicatedList.stream().filter(vo -> vo.getStatus() == 1 || vo.getStatus() == 2).map(ContractLogVO::getId).collect(Collectors.toList());
+        //构造map
+        HashMap<String, String> taskMap = new HashMap<>();
+        Map<String, List<TaskParallel>> taskParallelMap = new HashMap<>();
+        if(ObjectUtil.isNotEmpty(ids)){
+            List<Task> tasks = jdbcTemplate.query("select form_data_id ,process_instance_id from u_task where status != 3 and  form_data_id in (" + StringUtils.join(ids, ",") + ")"
+                    , new BeanPropertyRowMapper<>(Task.class));
+            if(ObjectUtil.isNotEmpty(tasks)){
+                 taskMap = tasks.stream()
+                        .collect(Collectors.toMap(
+                                Task::getFormDataId,
+                                Task::getProcessInstanceId,
+                                (existingValue, newValue) -> existingValue,
+                                HashMap::new
+                        ));
+
+                String processInstanceIds = taskMap.values().stream().collect(Collectors.joining("\',\'"));
+                processInstanceIds = "\'" + processInstanceIds+"\'";
+
+                List<TaskParallel> taskParallels = jdbcTemplate.query("select * from u_task_parallel where process_instance_id in (" + processInstanceIds + ")"
+                        , new BeanPropertyRowMapper<>(TaskParallel.class));
+                if (ObjectUtil.isNotEmpty(taskParallels)){
+                     taskParallelMap = taskParallels.stream().collect(Collectors.groupingBy(
+                            TaskParallel::getProcessInstanceId
+                    ));
+                }
+            }
+            for (Long id : ids) {
+                String processInstanceId = taskMap.get(id.toString());
+                /*判断签字人的验证 2=绿色 3=黄色 999=红色 其他代表=灰色*/
+                List<TaskParallel> statList = new ArrayList<>();
+                if(StringUtils.isNotEmpty(processInstanceId)){
+                    List<TaskParallel> taskParallels = taskParallelMap.get(processInstanceId);
+                    if(ObjectUtil.isNotEmpty(taskParallels)){
+                        for (TaskParallel taskPa : taskParallels) {
+                            if (taskPa.getStatus() == 2 && ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 1) {
+                                taskPa.setEVisaStatus(2);
+                            } else if (taskPa.getStatus() == 3) {
+                                if (taskPa.getInitiative() == 2) {
+                                    taskPa.setEVisaStatus(3);
+                                }
+                            } else if (ObjectUtil.isNotEmpty(taskPa.getEVisaStatus()) && taskPa.getEVisaStatus() == 99) {
+                                taskPa.setEVisaStatus(999);
+                            } else {
+                                taskPa.setEVisaStatus(1);
+                            }
+                            statList.add(taskPa);
+                        }
+                    }
+                }
+                List<Object> objectList = statList.stream().map(taskPa -> (Object) taskPa).collect(Collectors.toList());
+                Optional<ContractLogVO> first = deduplicatedList.stream().filter(vo -> vo.getId().equals(id)).findFirst();
+                first.ifPresent(vo -> vo.setTaskApproveUserNamesList(objectList));
+                /*if (statList.size() > 0) {
+                    List<Object> objectList = statList.stream().map(taskPa -> (Object) taskPa).collect(Collectors.toList());
+                    ContractLogVO contractLogVO = deduplicatedMap.get(id);
+                    if(ObjectUtil.isNotEmpty(contractLogVO)){
+                        contractLogVO.setTaskApproveUserNamesList(objectList);
+                        resultList.add(contractLogVO);
+                    }
+                }*/
+            }
+        }
         return iPage.setRecords(deduplicatedList);
     }
 

+ 29 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -18,6 +18,7 @@ package org.springblade.business.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.springblade.business.entity.EntrustInfo;
@@ -37,6 +38,7 @@ import org.springblade.manager.feign.WbsTreePrivateClient;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -60,6 +62,21 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 		return page.setRecords(baseMapper.selectEntrustInfoPage(page, entrustInfo));
 	}
 
+	@Override
+	public R getRfiList(String rids,String state) {
+
+		if(Func.isNull(rids) || Func.isEmpty(rids)){
+			return R.fail("ids不能为null");
+		}
+		if(Func.isNull(state) || Func.isEmpty(state)){
+			return R.fail("state不能为null");
+		}
+
+		List<String> longList = Func.toStrList(rids);
+		List<EntrustInfo> entrustInfos = baseMapper.getRfiList(longList,state);
+		return R.data(entrustInfos);
+	}
+
 	@Override
 	public EntrustDataInfoVO getReportDetail(String id) {
 		return baseMapper.getReportDetail(id);
@@ -67,6 +84,14 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 
 	@Override
 	public IPage<TrialSampleDataInfoVO> samplePage(IPage<TrialSampleDataInfoVO> page, TrialSampleDataInfoVO trialSampleInfo) {
+		String startTime = trialSampleInfo.getStartTime();
+		String endTime = trialSampleInfo.getEndTime();
+		if(StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)){
+			startTime = startTime +" 00:00:00";
+			endTime = endTime +" 23:59:59";
+			trialSampleInfo.setStartTime(startTime);
+			trialSampleInfo.setEndTime(endTime);
+		}
 		return page.setRecords(baseMapper.samplePage(page, trialSampleInfo));
 	}
 
@@ -162,6 +187,10 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 			return R.fail("ids不能为null");
 		}
 		List<Long> longList = Func.toLongList(ids);
+		List<EntrustInfo> entrustInfos = baseMapper.checkDelete(longList);
+		if (entrustInfos.size()>0){
+			return R.fail("删除失败");
+		}
 		int delete = baseMapper.delEntrustInfo(longList);
 
 		return R.success("");

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
@@ -11,11 +12,11 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.http.client.utils.DateUtils;
 import org.springblade.business.entity.*;
 import org.springblade.business.feign.TaskClient;
+import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.service.*;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
-import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -42,7 +43,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.io.File;
 import java.io.FileNotFoundException;

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

@@ -49,15 +49,19 @@ import org.springblade.manager.vo.AppWbsTreeContractVO;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.user.entity.User;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.dao.DataAccessException;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.util.*;
@@ -118,6 +122,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     private final ExcelTabClient excelTabClient;
 
     private final NewIOSSClient newIOSSClient;
+    //超级管理员的角色id
+    private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
+    //泓创智诚公司的部门id
+    private final Long  HONGCHENG_DEPT_ID = 1536982621165592577L;
 
     @Autowired
     StringRedisTemplate RedisTemplate;
@@ -257,7 +265,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //资料填报原始pdf
 //                    String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
                     /** 修改需求,任务查看时,附件不在列表中显示,需要拼接在电签后面。如果此处修改影响其他地方,则到时候再说*/
-                    String approvalPdf = StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() : query.getPdfUrl();
+                    String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
                     vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf));
 
                     //试验关联文件合并pdf
@@ -946,6 +954,112 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         }
     }
 
+    /**
+     * 质检-日志重签
+     */
+    @Override
+    public void logReSigningEVisa( String logids,Long logPkeyId, Long nodePrimaryKeyId, String contractId ,HttpServletRequest request, Integer type) {
+        List<Task> taskList = jdbcTemplate.query("select * from u_task where is_deleted = 0 and status != 3 and  form_data_id in(" + logids + ")", new BeanPropertyRowMapper<>(Task.class));
+        if (taskList.size() > 0) {
+            //获取任务详情信息Map
+            Set<String> processInstanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
+            Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
+            if (processInstanceIds.size() > 0) {
+                String resultIds = processInstanceIds.stream()
+                        .map(id -> "'" + id + "'")
+                        .collect(Collectors.joining(","));
+                taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
+            }
+            Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
+            //获取所有日志数据 生成map
+            List<String> formDataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
+            String formDataIds = String.join(",", formDataIdList);
+            List<ContractLog> contractLogList = jdbcTemplate.query("select * from u_contract_log where id in (" + formDataIds + ")", new BeanPropertyRowMapper<>(ContractLog.class));
+            Map<Long, ContractLog> contractLogMap = contractLogList.stream().collect(Collectors.toMap(ContractLog::getId, ContractLog -> ContractLog));
+            try {
+                for (Task task : taskList) {
+                    ContractLog contractLog = contractLogMap.get(Long.valueOf(task.getFormDataId()));
+                    R result = new R();
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
+                    boolean b = false;
+                    if(type == 1){
+                         b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
+                                .set(ContractLog::getEVisaPdfUrl, null)
+                                .set(ContractLog::getPdfUrl, null));
+                    }else {
+                         b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
+                                .set(ContractLog::getEVisaPdfUrl, null));
+                    }
+
+
+                    if (type == 1) {
+                        //重新保存
+                        long startTime_1 = System.currentTimeMillis();
+                        //获取详细的日志数据
+
+                        result = excelTabClient.getTheContractLogBusinessData(logPkeyId.toString(), nodePrimaryKeyId.toString(), contractLog.getRecordTime(), contractId,contractLog.getCreateUser());
+                        long endTime_1 = System.currentTimeMillis();
+                        long executionTime_1 = endTime_1 - startTime_1;
+                        log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
+                    }else{
+                        if (!b){
+                            throw new ServiceException("清空电签PDF失败");
+                        }
+                        result.setData("成功");
+                    }
+                    //重新电签
+                    if (result != null && "成功".equals(result.getData())) {
+                        List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
+                        List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
+                        for (TaskParallel taskParallel : taskParallelList) {
+                            //待审批的不进行重签, 存在待审批,但是电签状态是失败的
+                            if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
+                                TaskApprovalVO approvalVO = new TaskApprovalVO();
+                                approvalVO.setTaskId(task.getId().toString());
+                                approvalVO.setFlag("OK");
+                                approvalVO.setComment("重新发起电签");
+                                approvalVO.setApprovalType(3);
+                                approvalVO.setFormDataId(task.getFormDataId());
+                                approvalVO.setParallelProcessInstanceId(taskParallel.getParallelProcessInstanceId());
+                                approvalVO.setYsNickName(taskParallel.getTaskUserName());
+                                approvalVO.setUserId(Long.parseLong(taskParallel.getTaskUser()));
+                                taskApprovalVOS.add(approvalVO);
+                            }
+                        }
+                        long startTime_2 = System.currentTimeMillis();
+                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                            this.batchCompleteApprovalTask(taskApprovalVOS);
+                        }
+                        long endTime_2 = System.currentTimeMillis();
+                        long executionTime_2 = endTime_2 - startTime_2;
+                        log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
+                        /*//修改记录人
+                        if(ObjectUtil.isNotEmpty(contractLog.getCreateUser())){
+                            Long userId = AuthUtil.getUserId(request);
+                            String userName = AuthUtil.getNickName(request);
+                            if(userId == contractLog.getCreateUser()){
+                                    contractLog.setCreateUser(userId);
+                                    contractLog.setCreateUserName(userName);
+                                    jdbcTemplate.execute("update u_contract_log set create_user = "+userId+",create_user_name = '"+userName+"' where id = "+contractLog.getId());
+                            }
+                        }*/
+                    } else {
+                        //修改重签状态为保存PDF失败
+                        this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
+                                .set(TaskParallel::getEVisaContent, "重新保存PDF失败")
+                                .eq(TaskParallel::getProcessInstanceId, task.getProcessInstanceId()));
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
+            }
+
+        }else {
+            throw new ServiceException("未获取到任务信息,操作失败!");
+        }
+    }
+
     @Override
     public Boolean startApproval(TaskVO vo) {
         if (ObjectUtil.isEmpty(vo.getReportUserId()) || ObjectUtil.isEmpty(vo.getReportUserName())) {
@@ -1130,12 +1244,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             System.out.println("----- 电签成功--------");
             //添加nodePdf的值
             List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + "+formDataId+")");
-            if(Func.isNotEmpty(mapList)&&mapList.size()>=1){
+            if(Func.isNotEmpty(mapList)&&mapList.size()>=1) {
                 String file_path = org.springblade.business.utils.FileUtils.getSysLocalFileUrl();
                 List<String> datainfo = new ArrayList<>();
                 datainfo.add(newFileUrl);
                 for (Map<String, Object> tabsx : mapList) {
-                    datainfo.add(tabsx.get("url")+"");
+                    datainfo.add(tabsx.get("url") + "");
                 }
                 String listPdf = file_path + "/nodePDF/" + formDataId + ".pdf";
                 File tabpdf2 = ResourceUtil.getFile(listPdf);
@@ -1144,12 +1258,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 }
 
                 org.springblade.business.utils.FileUtils.mergePdfPublicMethods(datainfo, listPdf);
-                if(sys_isonline.equals("20")){
+                if (sys_isonline.equals("20")) {
                     BladeFile bladeFile = this.newIOSSClient.uploadFile(formDataId + ".pdf", listPdf);
                     if (bladeFile != null && Func.isNotEmpty(bladeFile.getLink())) {
                         nodePdfUrl = bladeFile.getLink();
                     }
-                }else{
+                } else {
                     nodePdfUrl = org.springblade.business.utils.FileUtils.getNetUrl(listPdf);
                 }
 
@@ -1442,7 +1556,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 //    }
 
     @Override
-    public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId,Integer type, String header) {
+    public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header , HttpServletRequest request) {
         //查询任务信息
         List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
         if (taskList.size() > 0) {
@@ -1464,9 +1578,18 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             try {
                 for (Task task : taskList) {
                     R result = new R();
-                    boolean b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                            .eq(InformationQuery::getId, task.getFormDataId())
-                            .set(InformationQuery::getEVisaPdfUrl, null));
+                    jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
+                    boolean b = false;
+                    if(type == 1){
+                         b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
+                                .eq(InformationQuery::getId, task.getFormDataId())
+                                .set(InformationQuery::getEVisaPdfUrl, null)
+                                .set(InformationQuery::getPdfUrl, null));
+                    }else {
+                        b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
+                                .eq(InformationQuery::getId, task.getFormDataId())
+                                .set(InformationQuery::getEVisaPdfUrl, null));
+                    }
 
                     if (type == 1) {
                         //重新保存
@@ -1487,7 +1610,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
                         for (TaskParallel taskParallel : taskParallelList) {
                             //待审批的不进行重签, 存在待审批,但是电签状态是失败的
-                            if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
+                            if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
                                 TaskApprovalVO approvalVO = new TaskApprovalVO();
                                 approvalVO.setTaskId(task.getId().toString());
                                 approvalVO.setFlag("OK");
@@ -1501,7 +1624,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                             }
                         }
                         long startTime_2 = System.currentTimeMillis();
-                        this.batchCompleteApprovalTask(taskApprovalVOS);
+                        if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
+                            this.batchCompleteApprovalTask(taskApprovalVOS);
+                        }
                         long endTime_2 = System.currentTimeMillis();
                         long executionTime_2 = endTime_2 - startTime_2;
                         log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
@@ -1512,7 +1637,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                                 .eq(TaskParallel::getProcessInstanceId, task.getProcessInstanceId()));
                     }
                 }
-
+                //获取当前操作人
+                Long userId = AuthUtil.getUserId(request);
+                String userName = AuthUtil.getNickName(request);
+                //判断是否是超级管理员并且是泓创智诚下的部门
+                if(judgeRoleIdAndDeptId(userId)){
+                    //满足去除当前填报人的条件 去除当前任务的填报人中当前操作人的信息
+                    removeUserAndName(taskIds, userId, userName);
+                }
             } catch (Exception e) {
                 e.printStackTrace();
                 throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
@@ -1523,10 +1655,71 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
         }
     }
 
+
     R saveNodePdf(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
         return excelTabClient.synPDFInfo(contractId, nodePKeyIds, classify, projectId, header);
     }
 
+    /**
+     * 返回true代表满足条件 是超级管理员并且部门是在泓创智诚下面的部门
+     */
+    public boolean judgeRoleIdAndDeptId(Long userId ){
+        try {
+            String sqlForUser = "select role_id ,dept_id from blade_user where id = "+userId;
+            User user = jdbcTemplate.queryForObject(sqlForUser, new BeanPropertyRowMapper<>(User.class));
+            String sqlforSkipDept = "select id from blade_dept where parent_id = "+HONGCHENG_DEPT_ID + " or id = "+HONGCHENG_DEPT_ID;
+            List<Dept> depts = jdbcTemplate.query(sqlforSkipDept, new BeanPropertyRowMapper<>(Dept.class));
+            String roleId = user.getRoleId();
+            String deptId = user.getDeptId();
+            //既是超级管理员同时是泓创下面的部门才允许跳过填报人赋值
+            if(roleId.contains(SUPER_ADMIN_ROLE_ID)){
+                Boolean flag = false;
+                for (Dept dept : depts) {
+                    if(deptId.contains(dept.getId().toString())){
+                        flag = true;
+                        return flag;
+                    }
+                }
+                return flag;
+            }else {
+                return false;
+            }
+        } catch (DataAccessException e) {
+            log.error(e.getMessage());
+            throw new RuntimeException("校验操作人角色异常");
+        }
+    }
+
+    /**
+     * 去掉对应的填报人信息
+     */
+    private void removeUserAndName(String taskIds, Long userId, String userName) {
+        try {
+            String[] split1 = taskIds.split(",");
+            for (String taskId : split1) {
+                String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" +taskId+ ")";
+                InformationQuery informationQuery = jdbcTemplate.queryForObject(sqlForInformationQuery, new BeanPropertyRowMapper<>(InformationQuery.class));
+                String fileUserIdAndName = informationQuery.getFileUserIdAndName();
+                if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)){
+                    String[] split = fileUserIdAndName.split(",");
+                    if(split != null && split.length > 0){
+                        ArrayList<String> list = new ArrayList<>(Arrays.asList(split));
+                        for (int i = 0; i < list.size(); i++) {
+                            if(list.get(i).contains(userId + "-" + userName)){
+                                list.remove(i);
+                            }
+                        }
+                        String fileUserIdAndNameNew = String.join(",", list);
+                        String sqlForUpdateInformationQuery = "update  u_information_query set file_user_id_and_name = '"+fileUserIdAndNameNew+"' where id = (select form_data_id from u_task where id =" +taskId+ ")";
+                        jdbcTemplate.execute(sqlForUpdateInformationQuery);
+                    }
+                }
+            }
+        } catch (DataAccessException e) {
+           throw new RuntimeException("去除对应的填报人信息异常");
+        }
+    }
+
     @Override
     public Task getTaskByFormDataId(String formDataId) {
         return getOne(Wrappers.<Task>lambdaQuery()

+ 18 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -15,12 +15,14 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.springblade.business.dto.TrialSampleInfoDTO;
+import org.springblade.business.entity.EntrustInfo;
 import org.springblade.business.entity.TrialSampleInfo;
 import org.springblade.business.entity.TrialSamplingRecord;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.excel.TrialSampleInfoExcel;
 import org.springblade.business.mapper.TrialSampleInfoMapper;
 import org.springblade.business.mapper.TrialSamplingRecordMapper;
+import org.springblade.business.service.IEntrustInfoService;
 import org.springblade.business.service.ITrialSampleInfoService;
 import org.springblade.business.utils.PDFUtil;
 import org.springblade.business.utils.StringSPUtils;
@@ -62,6 +64,7 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
     private final NewIOSSClient newIOSSClient;
     private final TrialSamplingRecordMapper trialSamplingRecordMapper;
     private final JdbcTemplate jdbcTemplate;
+    private final IEntrustInfoService entrustInfoService;
 
     @Override
     public boolean sampleVerification(String specificationNumber, String id, String contractId, String nodeId) {
@@ -124,7 +127,6 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
 
     @Override
     public IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfoVO> page, TrialSampleInfoVO obj) {
-
         return page.setRecords(baseMapper.trialSamplePage(page, obj));
     }
 
@@ -153,6 +155,21 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
                 }
             }
         }
+
+        //rfId 创建委托单
+        if(Func.isNotEmpty(obj.getRfId())){
+            List<EntrustInfo> entrustInfoList = entrustInfoService.getBaseMapper().selectList(Wrappers.<EntrustInfo>lambdaQuery().eq(EntrustInfo::getSampleId,trialSampleInfo.getId()).eq(EntrustInfo::getStatus,2));
+            if(entrustInfoList==null || entrustInfoList.size()<=0){
+                EntrustInfo entrustInfo = new EntrustInfo();
+                entrustInfo.setSampleId(trialSampleInfo.getId());
+                entrustInfo.setStatus(1);
+                entrustInfo.setSampleStatus("1");
+                entrustInfo.setContractId(obj.getContractId()+"");
+                entrustInfo.setEntrustType(2);
+                entrustInfoService.save(entrustInfo);
+            }
+        }
+
         return true;
     }
 

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

@@ -55,6 +55,7 @@ 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.dao.DataAccessException;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.scheduling.annotation.Async;
@@ -174,9 +175,17 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (entrustInfo != null){
                     record.setEntrustName(entrustInfo.getEntrustName());
                     record.setEntrustNo(entrustInfo.getEntrustNo());
+                    //材料id不为空
+                     if(Func.isNotEmpty(entrustInfo.getSampleId())){
+                         TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
+                         if (Func.isNotEmpty(sampleInfo)){
+                             record.setSpecificationNumber(sampleInfo.getSpecificationNumber());
+                             record.setSpecificationModel(sampleInfo.getSpecificationModel());
+                         }
+                     }
                 }
                 //合并的pdfUrl
-                String pdf = this.getMergePdfToTrial(record.getContractId(), record.getId());
+                String pdf = this.getMergePdfToTrialNew(record.getContractId(), record.getId());
                 record.setPdfUrl(pdf);
             }
 
@@ -248,6 +257,98 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         return "";
     }
 
+    /**
+     *新增返回该试验材料报告关联的委托单pdf也拼接在后面
+     * @param contractId
+     * @param nodeId
+     * @return
+     * @throws FileNotFoundException
+     */
+    private String getMergePdfToTrialNew(Long contractId, Long nodeId) throws FileNotFoundException {
+        String sql = "select pdf_url,e_visa_pdf_url from u_information_query where wbs_id='" + nodeId + "' and contract_id ='" + contractId + "'";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        if (maps.size() >= 1) {
+            Map<String, Object> stringObjectMap = maps.get(0);
+            Object pdfUrl = stringObjectMap.get("pdf_url");
+
+            if (stringObjectMap.get("e_visa_pdf_url") != null) {
+                //优先使用电签的pdf
+                pdfUrl = stringObjectMap.get("e_visa_pdf_url");
+            }
+            String entrustPdfUrl = "";
+            //关联的委托单pdf
+            String sqlEntrust = "select entrust_id from u_trial_self_inspection_record where is_deleted = 0 and id = "+nodeId ;
+            TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sqlEntrust, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
+            if(ObjectUtil.isNotEmpty(record) && ObjectUtil.isNotEmpty(record.getEntrustId()) && record.getEntrustId() != 0){
+                String sqlEntrustPdf = "select entrust_pdf from u_entrust_info where is_deleted = 0 and id = "+record.getEntrustId();
+                try {
+                    entrustPdfUrl = jdbcTemplate.queryForObject(sqlEntrustPdf, String.class);
+                } catch (DataAccessException e) {
+                    entrustPdfUrl = "";
+                }
+            }
+            
+            //关联原材料检测报告的pdf(合并后的dpf都一样,取其一)
+            String sqlRecord = "select old_pdf_url from u_trial_raw_material_self_record where self_record_id =" + nodeId;
+            TrialRawMaterialSelfRecord recordObj = jdbcTemplate.query(sqlRecord, new BeanPropertyRowMapper<>(TrialRawMaterialSelfRecord.class)).stream().findAny().orElse(null);
+            if (pdfUrl != null && recordObj != null && recordObj.getOldPdfUrl() != null) {
+                String pdfUrlTrialRawMaterial = recordObj.getOldPdfUrl();
+                List<String> pdfList = new ArrayList<>();
+                //试验原始pdf
+                pdfList.add(pdfUrl.toString());
+                //材料检测报告pdf
+                pdfList.add(pdfUrlTrialRawMaterial);
+                //委托单pdf
+                if(ObjectUtil.isNotEmpty(entrustPdfUrl)){
+                    pdfList.add(entrustPdfUrl);
+                }
+                String file_path = FileUtils.getSysLocalFileUrl();
+                Long id = SnowFlakeUtil.getId();
+                String trialPdf = file_path + "/pdf/" + id + ".pdf";
+                File trialPdf2 = ResourceUtil.getFile(trialPdf);
+                if (trialPdf2.exists()) {
+                    trialPdf2.delete();
+                }
+                if (pdfList.size() > 0) {
+                    //合并当前所有选择的试验pdf
+                    FileUtils.mergePdfPublicMethods(pdfList, trialPdf);
+                    BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", trialPdf);
+                    if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
+                        pdfUrl = bladeFile.getLink();
+                        return pdfUrl.toString();
+                    }
+                }
+            }
+            assert pdfUrl != null;
+            //拼接委托单pdf
+            if(ObjectUtil.isNotEmpty(entrustPdfUrl)){
+                List<String> pdfList = new ArrayList<>();
+                //试验原始pdf
+                pdfList.add(pdfUrl.toString());
+                //委托单pdf
+                pdfList.add(entrustPdfUrl);
+                String file_path = FileUtils.getSysLocalFileUrl();
+                Long id = SnowFlakeUtil.getId();
+                String trialPdf = file_path + "/pdf/" + id + ".pdf";
+                File trialPdf2 = ResourceUtil.getFile(trialPdf);
+                if (trialPdf2.exists()) {
+                    trialPdf2.delete();
+                }
+                if (pdfList.size() > 0) {
+                    //合并当前所有选择的试验pdf
+                    FileUtils.mergePdfPublicMethods(pdfList, trialPdf);
+                    BladeFile bladeFile = this.newIOSSClient.uploadFile(id + ".pdf", trialPdf);
+                    if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
+                        pdfUrl = bladeFile.getLink();
+                        return pdfUrl.toString();
+                    }
+            }}
+
+            return pdfUrl.toString();
+        }
+        return "";
+    }
+
     @Override
     public List<TrialRecordAncillaryDocumentsVO> selfAncillaryDocumentsList(String id, String type) {
         //关联取样附件

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

@@ -150,7 +150,6 @@ public class FileUtils {
                 imageData = baos.toByteArray();
             }
         }
-
         // 缩放图像
         String formatName = "JPEG";
         ByteArrayInputStream bais = new ByteArrayInputStream(imageData);

+ 1 - 1
blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java

@@ -50,7 +50,7 @@ public class LeaveServiceImpl extends BaseServiceImpl<LeaveMapper, ProcessLeave>
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    // @GlobalTransactional
+    //@GlobalTransactional
     public boolean startProcess(ProcessLeave leave) {
         String businessTable = FlowUtil.getBusinessTable(ProcessConstant.LEAVE_KEY);
         if (Func.isEmpty(leave.getId())) {

+ 16 - 11
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -61,15 +61,17 @@ public class EVisaController {
 
     // 电签主类
 
-    @Scheduled(cron = "0/10 * * * * ?")
+    @Scheduled(cron = "0/30 * * * * ?")
     public void SignInfo() {
         //执行代码
 
         log.info("扫描开始");
-        //String sql = "SELECT * from u_task_batch where json_data like '%1821798868568768512%' and is_deleted<>5  LIMIT 10";
-        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 10";
+       // String sql = "SELECT * from u_task_batch where json_data like '%1840658122872455168%' a
+        // nd is_deleted<>5  LIMIT 10";
+        String sql = "SELECT * from u_task_batch where is_deleted=0 and id in(SELECT max(id) as id from u_task_batch where is_deleted=0 GROUP BY JSON_EXTRACT(json_data, '$.formDataId')) LIMIT 10 ";
+        //String sql = "SELECT * from u_task_batch where is_deleted=5 and `status`=2";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
-        if (maps != null && maps.size() >= 1 && SystemUtils.isLinux()) {
+        if (maps != null && maps.size() >= 1 && SystemUtils.isLinux()) {//&& SystemUtils.isLinux()
             for (Map<String, Object> dataInfo : maps) {
                 if (executor.getQueue().size()<=40 ) {
                     String jsonData = dataInfo.get("json_data") + "";
@@ -83,7 +85,7 @@ public class EVisaController {
                     taskApprovalVO.setNickName(nickName);
 
                     if (!aBoolean) {
-                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",600, TimeUnit.SECONDS);
+                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",1800, TimeUnit.SECONDS);
                         CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
                             try {
                                 /*===============执行批量任务===============*/
@@ -129,9 +131,8 @@ public class EVisaController {
 
                 String  sql = "SELECT a.* from u_task_parallel a where a.process_instance_id=(SELECT process_instance_id from u_task_parallel b where  b.parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"') and is_deleted=0 and `status`=1 and sort not in(SELECT fixed_flow_branch_sort from u_fixed_flow_link where fixed_flow_id ="+masterTask.getFixedFlowId()+" and  flow_task_type=2 ) ";
                 List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
-                if (maps == null || maps.size() == 0) {
+                if (maps == null || maps.size() == 0 ) {
                     // 最后修改计量数据
-
                     //说明都审批完成,将主表状态更改为已完成
                     String finalPdfUrl = null;
                     if (eVisaStatus.contains("@@@@")) {
@@ -196,12 +197,16 @@ public class EVisaController {
             this.jdbcTemplate.execute("delete from u_task_batch where id="+taskApprovalVO.getId());
             jdbcTemplate.execute(up_task_par);
             jdbcTemplate.execute(up_task);
-            jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=0 where id='"+taskApprovalVO.getFormDataId()+"'");
-            RedisTemplate.delete("sign-" + taskApprovalVO.getFormDataId());
-            //委托单
-            if (taskApprovalVO.getApprovalType()==8) {
+
+            if(taskApprovalVO.getApprovalType() == 3){
+                jdbcTemplate.execute("update u_contract_log set status=0 where id='"+taskApprovalVO.getFormDataId()+"'");
+            }else if (taskApprovalVO.getApprovalType()==8) {
                 this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='"+taskApprovalVO.getFormDataId()+"')");
+            }else {
+                jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=0 where id='"+taskApprovalVO.getFormDataId()+"'");
             }
+            RedisTemplate.delete("sign-" + taskApprovalVO.getFormDataId());
+
         }
     }
 

+ 104 - 0
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaJLController.java

@@ -0,0 +1,104 @@
+package org.springblade.evisa.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.Task;
+import org.springblade.business.feign.TaskClient;
+import org.springblade.business.vo.TaskApprovalVO;
+import org.springblade.evisa.service.EVisaService;
+import org.springblade.evisa.vo.EVisaTaskApprovalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * 清表基础数据表 控制器
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/evisaInfo")
+@Api(value = "电签类", tags = "电签类接口")
+@Slf4j
+public class EVisaJLController {
+
+    @Autowired
+    StringRedisTemplate RedisTemplate;
+
+    // jdbc
+    private final JdbcTemplate jdbcTemplate;
+
+    //电签服务类
+    private final EVisaService eVisaService;
+
+    // 线程池
+    @Resource(name = "taskExecutor1")
+    private ThreadPoolExecutor executor;
+
+    private final TaskClient taskClient;
+
+    // 电签主类
+    public void SignInfo() {
+        //执行代码
+
+        log.info("扫描开始");
+        String sql = "SELECT * from u_task_batch where is_deleted=0 and id in(SELECT max(id) as id from u_task_batch where is_deleted=0 GROUP BY JSON_EXTRACT(json_data, '$.formDataId')) LIMIT 10 ";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        if (maps != null && maps.size() >= 1 ) {//&& SystemUtils.isLinux()
+            for (Map<String, Object> dataInfo : maps) {
+                if (executor.getQueue().size()<=40 ) {
+                    String jsonData = dataInfo.get("json_data") + "";
+                    TaskApprovalVO taskApprovalVO = JSON.parseObject(jsonData, TaskApprovalVO.class);
+                    String taskBatchId = dataInfo.get("id").toString();
+                    Long userId = Long.valueOf(dataInfo.get("create_user") + "");
+                    String nickName = dataInfo.get("nick_name") + "";
+                    Boolean aBoolean = RedisTemplate.hasKey("sign-" + taskApprovalVO.getFormDataId());
+                    taskApprovalVO.setId(taskBatchId);
+                    taskApprovalVO.setUserId(userId);
+                    taskApprovalVO.setNickName(nickName);
+
+                    if (!aBoolean) {
+                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",1800, TimeUnit.SECONDS);
+                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
+                            try {
+                                /*===============执行批量任务===============*/
+                                this.checkIsExsitTaskBatch(taskApprovalVO);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }, executor);
+                    }
+                }
+            }
+        }
+        System.out.println("队列数量" + executor.getQueue().size());
+        System.out.println("活跃数量" + executor.getActiveCount());
+        System.out.println("总共数量" + executor.getTaskCount());
+        System.out.println("完成数量" + executor.getCompletedTaskCount());
+    }
+
+    @Transactional
+    public void checkIsExsitTaskBatch(TaskApprovalVO taskApprovalVO){
+
+    }
+
+}

+ 2 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/feign/EVisaClientImpl.java

@@ -31,8 +31,8 @@ public class EVisaClientImpl implements EVisaClient {
     }
 
     @Override
-    public R<String> batchEVisa(SigInfoVO vo) {
-        return eVisaService.batchEVisa(vo);
+    public R<String> batchEVisa(SealPdfVO pdfVO) {
+        return eVisaService.batchEVisa(pdfVO);
     }
 
     @Override

+ 2 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/EVisaService.java

@@ -4,7 +4,7 @@ import cfca.paperless.dto.bean.CertBean;
 import org.springblade.core.tool.api.R;
 import org.springblade.evisa.vo.EVisaMakeSealVO;
 import org.springblade.evisa.vo.EVisaTaskApprovalVO;
-import org.springblade.evisa.vo.SigInfoVO;
+import org.springblade.evisa.vo.SealPdfVO;
 
 import java.util.List;
 
@@ -43,6 +43,6 @@ public interface EVisaService {
     /**
      * 单张PDF批量电签,返回电签后的PDF
      */
-    R<String> batchEVisa(SigInfoVO vo);
+    R<String> batchEVisa(SealPdfVO pdfVO);
 
 }

+ 225 - 174
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -32,6 +32,7 @@ import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.http.entity.ContentType;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,10 +59,12 @@ import org.springblade.evisa.utils.PDFUtils;
 import org.springblade.evisa.vo.*;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.SignPfxFile;
+import org.springblade.manager.entity.TextdictInfo;
 import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.SignPfxClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
+import org.springblade.system.user.entity.User;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@@ -70,6 +73,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
@@ -81,6 +85,7 @@ import javax.imageio.metadata.IIOMetadataNode;
 import javax.imageio.stream.ImageOutputStream;
 import java.awt.image.BufferedImage;
 import java.io.*;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
@@ -90,7 +95,7 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 
-   // private static final String SIGN_HOST = "172.30.224.79";
+ //   private static final String SIGN_HOST = "172.30.224.79";
     private static final String SIGN_HOST = "47.115.117.246";
 
     private static final String SIGN_PORT = "8183";
@@ -422,12 +427,9 @@ public class EVisaServiceImpl implements EVisaService {
             return NOT_PFX_SGIN;
         }
 
-        //上锁
-        //if (DistributedRedisLock.acquire(task.getUserId().toString(), batch)) {
         try {
             //获取需要签章的数据
             List<TaskApprovalVO.ApprovalFile> files = taskFile.getApprovalFileList();
-
             //这里的文件只会是一张拼接好的PDF
             for (TaskApprovalVO.ApprovalFile file : files) {
 
@@ -457,28 +459,28 @@ public class EVisaServiceImpl implements EVisaService {
                 String contractId = Func.toStrArray(dataInfo)[0];
                 String projectId = Func.toStrArray(dataInfo)[1];
 
+
                 if (taskFile.getRemarkType().equals("2")) {
+                    // 查询任务下所有
                     String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
                     System.out.println("东方中讯-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
                     List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
-                    if (maps2 != null && !maps2.isEmpty()) {
-                        List<Map<String, Object>> maps = new ArrayList<>();
-                        Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
+                    List<Map<String, Object>> maps = new ArrayList<>();
+                    Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
                                 .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("keyWord")))));
-
-                        for(String keyId :peopleByAge.keySet()){
-                            List<Map<String, Object>> keyList = peopleByAge.get(keyId);
-                            if(keyList!=null && keyList.size()==1){
-                                maps.addAll(keyList);
-                            }else if(keyList!=null && keyList.size()>=2){
-                                for(Map<String, Object> datax : keyList){
-                                    if((datax.get("project_id")+"").equals(projectId)){
-                                        maps.add(datax);
-                                    }
+                    if (maps2 != null && !maps2.isEmpty()) {
+                    for(String keyId :peopleByAge.keySet()){
+                        List<Map<String, Object>> keyList = peopleByAge.get(keyId);
+                        if(keyList!=null && keyList.size()==1){
+                            maps.addAll(keyList);
+                        }else if(keyList!=null && keyList.size()>=2){
+                            for(Map<String, Object> datax : keyList){
+                                if((datax.get("project_id")+"").equals(projectId)){
+                                    maps.add(datax);
                                 }
                             }
                         }
-
+                    }
                         String fileUrl = pdfUrl;
                         for (Map<String, Object> dataMap : maps) {
                             HashMap<String, Object> daMa = new HashMap<>();
@@ -603,7 +605,7 @@ public class EVisaServiceImpl implements EVisaService {
                     Object[] result = this.signPdfByAXQZ(pdfVO, fileByte);
                     if (result != null) {
                         if (result[0] != null) {
-                            MultipartFile newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", "text/plain", IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
+                            MultipartFile newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", ContentType.APPLICATION_OCTET_STREAM.toString(), IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
                             //重新上传
                             BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
 
@@ -874,7 +876,7 @@ public class EVisaServiceImpl implements EVisaService {
     private Object[] signPdfByAXQZ(SealPdfVO pdfVO, byte[] fileByte) {
         Object[] result = new Object[3];
         try {
-            PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 300000, 1800000);
+            PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 18000000, 72000000);
             paperlessClient.setSSL(false);
             //*****************************************************************************
             CompoundSealPdfListDetachedRequest compoundSealPdfListDetachedRequest = new CompoundSealPdfListDetachedRequest();
@@ -901,6 +903,7 @@ public class EVisaServiceImpl implements EVisaService {
             pdfBean.setBizSerialNo(GUIDUtil.generateId());
             pdfBean.setInputSource("");
             pdfBean.setInputType(BaseConstants.INPUT_TYPE_FILEDATA);
+            logger.info("【电签模块】pdf{}", "长度"+fileByte.length);
             pdfBean.setPdfData(fileByte);
             pdfBeans.add(pdfBean);
 
@@ -961,7 +964,6 @@ public class EVisaServiceImpl implements EVisaService {
         if (strategyVoList == null || strategyVoList.size() <= 0) {
             return null;
         }
-
         //构建策略
         for (SealStrategyVO vo : strategyVoList) {
             try {
@@ -1006,7 +1008,7 @@ public class EVisaServiceImpl implements EVisaService {
                             imageData = ImageUtil.resizeImage(imageData, 540, 540);
                         } else {
                             //非合同章
-                            imageData = ImageUtil.resizeImage(imageData, 400, 200);
+                            imageData = ImageUtil.resizeImage(imageData, 480, 132);
                         }
                     }
 
@@ -1444,168 +1446,217 @@ public class EVisaServiceImpl implements EVisaService {
         }
     }
 
+   // @Scheduled(cron = "0/40 * * * * ?")
+    public void SignInfo() throws IOException {
+        //获取字节
+        String pdfUrl="/Users/hongchuangyanfa/Desktop/excel/TJ06标咨询意见单.pdf";
+        byte[] fileByte = IOUtils.toByteArray(new FileInputStream(new File(pdfUrl)));
+
+        SealPdfVO pdfVO = new SealPdfVO();
+        List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
+
+
+        String userId ="1794916072011603970";
+        SealStrategyVO vo = new SealStrategyVO();
+        vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId);
+
+        if(userId.length()<=EVisaConstant.USER_ID_SUB){
+            vo.setSealPassword(userId);
+        }else{
+            vo.setSealPassword(userId.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo.setSealPerson("谭立剑");
+        //设置签字文件
+        vo.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240530/d935381e0ba7e9a7d97cbcebd2b25702.png");
+        vo.setSealType("3");
+        vo.setKeyword("1808342935356309504");
+
+        String userId2 ="1794914652935954434";
+        SealStrategyVO vo2 = new SealStrategyVO();
+        vo2.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId2);
+        if(userId2.length()<=EVisaConstant.USER_ID_SUB){
+            vo2.setSealPassword(userId2);
+        }else{
+            vo2.setSealPassword(userId2.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo2.setSealPerson("黎军丰");
+        //设置签字文件
+        vo2.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240530/e7f435510f9b4dc7080d05d8d6061de6.png");
+        vo2.setSealType("3");
+        vo2.setKeyword("1808342935364698112");
+
+        String userId3 ="1794914652935954434";
+        SealStrategyVO vo3 = new SealStrategyVO();
+        vo3.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId3);
+        if(userId3.length()<=EVisaConstant.USER_ID_SUB){
+            vo3.setSealPassword(userId3);
+        }else{
+            vo3.setSealPassword(userId3.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo3.setSealPerson("李梦君");
+        //设置签字文件
+        vo3.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240419/2a56ec080c61c812875f797658414de1.png");
+        vo3.setSealType("3");
+        vo3.setKeyword("1810847886083096576");
+
+        String userId4 ="104326754034";
+        SealStrategyVO vo4 = new SealStrategyVO();
+        vo3.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId4);
+        if(userId4.length()<=EVisaConstant.USER_ID_SUB){
+            vo4.setSealPassword(userId4);
+        }else{
+            vo4.setSealPassword(userId4.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo4.setSealPerson("王涛");
+        //设置签字文件
+        vo4.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240419/0f6f989997036b9f4d3a3a288da96dcc.png");
+        vo4.setSealType("3");
+        vo4.setKeyword("1810847886083096576");
+
+        //设置签章策略
+        SealStrategyVO vo5 = new SealStrategyVO();
+        vo5.setSealCode(EVisaConstant.SIGN_SEAL_CODE + "1808350880450215936");
+        vo5.setSealPassword("123456");
+        vo5.setSealPerson("万邦工程管理咨询有限公司");
+        //设置签字文件
+        vo5.setImageUrl("http://183.247.216.148:9000//minio-oss-chongqing/upload/20240826/0726789415206b444d0bbe88840cf459.png");
+        vo5.setSealType("3");
+        vo5.setCompanySeal(true);
+        vo5.setKeyword("1808342935356309504");
+
+
+        // 6期
+
+        String userId6 ="1796388593051426817";
+        SealStrategyVO vo6 = new SealStrategyVO();
+        vo6.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId6);
+        if(userId6.length()<=EVisaConstant.USER_ID_SUB){
+            vo6.setSealPassword(userId6);
+        }else{
+            vo6.setSealPassword(userId6.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo6.setSealPerson("刘宝平");
+        //设置签字文件
+        vo6.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240605/e234e767e38d3e0c84c81dffab7f3c19.png");
+        vo6.setSealType("3");
+        vo6.setKeyword("1808342935356309504");
+
+
+        String userId7 ="1796388092851314689";
+        SealStrategyVO vo7 = new SealStrategyVO();
+        vo7.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId7);
+        if(userId7.length()<=EVisaConstant.USER_ID_SUB){
+            vo7.setSealPassword(userId7);
+        }else{
+            vo7.setSealPassword(userId7.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo7.setSealPerson("李富生");
+        //设置签字文件
+        vo7.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240531/d76792ab80aae67d5640d88813bd4175.png");
+        vo7.setSealType("3");
+        vo7.setKeyword("1808342935364698112");
+
+
+        String userId8 ="104326754036";
+        SealStrategyVO vo8 = new SealStrategyVO();
+        vo8.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId8);
+        if(userId8.length()<=EVisaConstant.USER_ID_SUB){
+            vo8.setSealPassword(userId8);
+        }else{
+            vo8.setSealPassword(userId8.substring(0, EVisaConstant.USER_ID_SUB));
+        }
+        vo8.setSealPerson("许利利");
+        //设置签字文件
+        vo8.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240419/0ca5682ba89915e48b03676de4c1bc12.png");
+        vo8.setSealType("3");
+        vo8.setKeyword("1810847886083096576");
+
+        //设置签章策略
+        SealStrategyVO vo9 = new SealStrategyVO();
+        vo9.setSealCode(EVisaConstant.SIGN_SEAL_CODE + "1808351286031024128");
+        vo9.setSealPassword("123456");
+        vo9.setSealPerson("浙江同欣工程管理有限公司");
+        //设置签字文件
+        vo9.setImageUrl("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240703/b40c2907e1cc4549a0f18df1504382ef.png");
+        vo9.setSealType("3");
+        vo9.setCompanySeal(true);
+        vo9.setKeyword("1808342935377281024");
+        //sealStrategyVOS.add(vo);
+       // sealStrategyVOS.add(vo2);
+        //sealStrategyVOS.add(vo3);
+        // 3期
+       // sealStrategyVOS.add(vo4);
+        // 6期
+        sealStrategyVOS.add(vo6);
+        sealStrategyVOS.add(vo7);
+        sealStrategyVOS.add(vo8);
+        sealStrategyVOS.add(vo9);
+
+        pdfVO.setStrategyVoList(sealStrategyVOS);
+        Object[] result = this.signPdfByAXQZ(pdfVO, fileByte);
+        if (result != null) {
+            if (result[0] != null) {
+                MultipartFile newFiles = null;
+                try {
+                    newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", ContentType.APPLICATION_OCTET_STREAM.toString(), IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+                //重新上传
+                BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
+
+                System.out.println(bladeFile.getLink());
+
+            } else {
+            }
+        } else {
+        }
+
+    }
     /**
      *      单张PDF批量电签,返回电签后的PDF
-     * @param vo
+     * @param
      * @return
      */
     @Override
-    public R<String> batchEVisa(SigInfoVO vo) {
+    public R<String> batchEVisa(SealPdfVO pdfVO) {
+        //获取字节
+        URL url = null;
         try {
-            List<SigInfoVO.SigInfo> list = vo.getList();
-            String pdfUrl = vo.getPdfUrl();
-
-            for (SigInfoVO.SigInfo sigInfo : list) {
-                pdfUrl = myDoWork(sigInfo, pdfUrl);
-            }
-            return R.data(pdfUrl);
-        }catch (Exception e){
-            return R.fail(e.getMessage());
+            String fileUrl = CommonUtil.replaceOssUrl(pdfVO.getPdfFileUrl());
+            url = new URL(fileUrl);
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
         }
-    }
-    public String myDoWork(SigInfoVO.SigInfo sig,String pdfUrl) throws Exception {
-
-        PaperlessClient paperlessClient = new PaperlessClient(SIGN_HOST, SIGN_PORT, 300000, 1800000);
-
-        paperlessClient.setSSL(false);
-        /*******************************************************************************/
-        SealPdfRequest sealPdfRequest = new SealPdfRequest();
-        RequestHead requestHead = new RequestHead();
-        String transactionNo = GUIDUtil.generateId();
-        //机构编码非空
-        String organizationCode = EVisaConstant.organizationCode;
-        //操作员编码 可为空
-        String operatorCode = "";
-        //渠道编码 可为空
-        String channelCode = "";
-        //设置属性
-        requestHead.setBasicInfo(transactionNo, organizationCode,operatorCode,channelCode);
-
-        sealPdfRequest.setHead(requestHead);
-        /*******************************************************************************/
-        SealPdfRequestBody requestBody = new SealPdfRequestBody();
-        //待签章文件
-        byte[] pdfData = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(pdfUrl));
-        // 数据源类型 1 pdf文件路径 2 pdf文件字节流
-        String inputType = BaseConstants.INPUT_TYPE_FILEDATA;
-        //设置数据源,数据源类型为2时,为空,数据源类型为1时,上送数据源路径(服务器可以访问到的文件路径)
-        requestBody.setInputSource("");
-        //数据源类型
-        requestBody.setInputType(inputType);
-        //数据源为2时,需上送 pdf文件数据
-        requestBody.setPdfData(pdfData);
-        //签章后文件保存地址,不为空时,直接将签章文件保存在此地址,不再返回签章后文档数据
-        requestBody.setOutputFilepath("");
-        //时间戳方式,默认为0;0:实时访问CFCA 时间戳服务;1:使用从CFCA购置并在本地部署的时间戳服务器产品;
-        requestBody.setTimestampChannel(BaseConstants.TIME_STAMP_CHANNEL_CFCA);
-
-        /************************ ②-2.构造机构章策略 *********************************************/
-        SealStrategy sealStrategy = myGenerateSealStrategy(sig);
-
-        requestBody.setSealStrategy(sealStrategy);
-
-        sealPdfRequest.setBody(requestBody);
-
-        /************************请求签章 ********************************************/
-        ResponseDto responseDto = paperlessClient.execute(sealPdfRequest);
-
-        /************************解析响应结果 *********************************************/
-
-        SealPdfResponse sealPdfResponse = (SealPdfResponse)responseDto;
-
-        ResponseHead responseHead = sealPdfResponse.getHead();
-        SealPdfResponseBody responseBody = sealPdfResponse.getBody();
-        String resultOutputFilepath = "";
-        if(ClientConstants.CODE_SUCCESS.equals(responseHead.getCode())){
-
-            resultOutputFilepath = responseBody.getOutputFilepath();
-
-            byte[] pdf = responseBody.getPdf();
-            System.out.println(pdf == null ? 0 : pdf.length);
-
-            String resultPdfFileDataHash = responseBody.getPdfFileDataHash();
-            System.out.println("resultPdfFileDataHash=" + resultPdfFileDataHash);
-
-            if(cfca.paperless.base.util.StringUtil.isNotEmpty(resultOutputFilepath)) {
-                System.out.println("文件已输出到:"+ resultOutputFilepath);
-            } else {
-                Random random = new Random();
-                int i = random.nextInt(100000);
-                String pdfFile = FileUtils.getSysLocalFileUrl() + "/archiveCheck/" + i +".pdf";
-                resultOutputFilepath = pdfFile;
-                IoUtil.write(resultOutputFilepath, pdf);
-                System.out.println("文件已输出到:"+ resultOutputFilepath );
-                BladeFile bladeFile = newIOSSClient.uploadFile("aa.pdf",pdfFile);
-                if (bladeFile == null || StringUtils.isBlank(bladeFile.getLink())){
-                    throw new ServiceException("上传阿里云失败");
+        byte[] fileByte;
+        try {
+            fileByte = IOUtils.toByteArray(url);
+        } catch (Exception e) {
+            return null;
+        }
+        //执行电签
+        Object[] result = this.signPdfByAXQZ(pdfVO, fileByte);
+        if (result != null) {
+            if (result[0] != null) {
+                MultipartFile newFiles = null;
+                try {
+                    newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", ContentType.APPLICATION_OCTET_STREAM.toString(), IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
                 }
-                resultOutputFilepath = bladeFile.getLink();
-            }
+                //重新上传
+                BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
 
+                if (bladeFile != null) {
+                    return R.data(bladeFile.getLink());
+                } else {
+                    return R.data(bladeFile.getLink());
+                }
+            } else {
+                return R.fail("无法获取pdf路径");
+            }
         } else {
-            throw new ServiceException(" NG,Code:"+responseHead.getCode()+",Message:"+responseHead.getMessage());
+            return R.fail("电签解析失败");
         }
-
-        return resultOutputFilepath;
     }
-    public SealStrategy  myGenerateSealStrategy(SigInfoVO.SigInfo sig) throws Exception{
-
-        String type = BaseConstants.SEAL_TYPE_IMAGE;
-        String sealCode = sig.getSealCode();
-        String sealPassword = PwdEncryptUtil.encrypto(sig.getSealPassword());
-        SealStrategy  sealStrategy = new SealStrategy();
-        sealStrategy.setSealInfo(type, sealCode, sealPassword);
-
-        String pngFilePath = sig.getSigPic();
-        //外传图片
-        byte[] imageData = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(pngFilePath));
-        //图片进行Base64编码/
-        String imageDataString =  new String(Base64.encode(imageData), StandardCharsets.UTF_8);
-        sealStrategy.setSealImage(imageDataString);
-        //算法,非空
-        String hashAlg = BaseConstants.HASHALG_SM3;
-        sealStrategy.setHashAlg(hashAlg);
-        //透明度,0-1.0f,默认1.0f,不透明
-        String fillOpacity = "1";
-        sealStrategy.setFillOpacity(fillOpacity);
-        //是否显示,默认1 显示
-        String visible = "1";
-        sealStrategy.setVisible(visible);
-        //签章图片显示尺寸  单位毫米  默认为图片本身尺寸
-        //签章图片显示尺寸,单位毫米;如果是圆形,则为半径实际尺寸;如果是矩形,则为较长的一边的实际尺寸;如果是不规则图形,则为较长的一边的实际尺寸
-        String displaySize = "50";
-        sealStrategy.setDisplaySize(displaySize);
-        // 业务码 businessCode ,businessCode为空,则不添加业务码,业务码相关属性都不需要设置
-        //业务码内容
-        String businessCode = "";
-        // 业务码字体大小,默认12,可以为空
-        String businessFontSize = "20";
-        //以图片底部为起点,向上占图片百分之多少的位置开始显示业务码,默认0.5
-        String textRectHeightPercent = "0.5";
-        //颜色值,默认黑色 000000
-        String businessColor = "FF0000";
-        //字体,默认宋体,可以为空
-        String bussinessFamily = "";
-        // 业务码  end
-        sealStrategy.setBusinessInfo(businessCode, businessFontSize, textRectHeightPercent, businessColor, bussinessFamily);
-        // 签章杂项信息
-        //签章人姓名,必填
-        String sealPerson = sig.getUserName();
-        //签章地点,可以为空
-        String sealLocation = "";
-        //签章原因,可以为空
-        String sealReason = "";
-        sealStrategy.setSealMiscInfo(sealPerson, sealLocation, sealReason);
-        /************************关键字签章****************************************************/
-        //关键字
-        String keyword =sig.getUserSig();
-        //x轴偏移,默认0
-        String offSetX = "0";
-        //y轴偏移,默认0
-        String offSetY = "0";
-        sealStrategy.setSignWithKeywordInfo(keyword, offSetX, offSetY);
-        return sealStrategy;
-    }
-
-
 }

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

@@ -59,29 +59,4 @@ public class PDFUtils {
         }
     }
 
-    public static void main123(String[] args) {
-        String pdfUrl= "https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230913/0193a0611867a1828164bb0abc65584c.pdf";
-        List<String> eVisaConfigList = new ArrayList<>();
-        try {
-            PdfDocument pdf = new PdfDocument();
-            InputStream ossInputStream = CommonUtil.getOSSInputStream(pdfUrl);
-            //加载PDF文档
-            pdf.loadFromStream(ossInputStream);
-
-            for(int i= 0;i<pdf.getPages().getCount();i++){
-                PdfPageBase page = pdf.getPages().get(i);
-                String text= page.extractText(false);
-                PdfTextFindCollection allText = page.findAllText();
-                PdfTextFind[] finds = allText.getFinds();
-                for(int k=0;k<finds.length;k++){
-                    String textStr = finds[k].getMatchText();
-                    if (textStr.length() >= 15 && Func.isNumeric(textStr)) {
-                        eVisaConfigList.add(textStr);
-                    }
-                }
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-    }
 }

+ 0 - 4
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/utils/ThreadPoolDemo.java

@@ -17,10 +17,6 @@ public class ThreadPoolDemo {
     }
 
 
-    @Scheduled(cron = "0 */1 * * * ?")
-    public void SignInfo() {
-
-    }
 
     public static void main11(String[] args) throws InterruptedException {
 

+ 2 - 2
blade-service/blade-manager/pom.xml

@@ -87,8 +87,8 @@
 
         <dependency>
             <groupId>e-iceblue</groupId>
-            <artifactId>spire.office.free</artifactId>
-            <version>5.3.1</version>
+            <artifactId>spire.xls.free</artifactId>
+            <version>5.3.0</version>
         </dependency>
 
         <dependency>

+ 7 - 3
blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java

@@ -17,6 +17,7 @@ import org.springblade.manager.dto.ParamElements;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -914,8 +915,8 @@ public class CustomFunction {
         return timePassed(t1, t2, "D", 0, "yyyy-MM-dd");
     }
 
-/*    public static void main(String[] args) {
-        LocalDateTime ldt1= LocalDateTime.now();
+   /* public static void main(String[] args) {
+       *//* LocalDateTime ldt1= LocalDateTime.now();
         LocalDateTime ldt2=ldt1.minusDays(-1);
         LocalDateTime ldt3=ldt1.minusDays(120L);
         System.out.println(daysPassed(ldt2,ldt1));
@@ -923,7 +924,10 @@ public class CustomFunction {
         System.out.println(hoursPassed(ldt2,ldt1));
         System.out.println(hoursPassed(ldt3,ldt1));
         System.out.println(minutesPassed(ldt2,ldt1));
-        System.out.println(minutesPassed(ldt3,ldt1));
+        System.out.println(minutesPassed(ldt3,ldt1));*//*
+      *//*  LocalDate t1 = LocalDate.of(2023, 1, 1);
+        LocalDate t2 = LocalDate.of(2023, 1, 1);t2=t2.plusDays(1);
+        System.out.println(timePassed(t1, t2, "D", 0, "yyyy-MM-dd"));*//*
     }*/
 
     public static Object hoursPassed(Object t1, Object t2) {

+ 3 - 0
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -1015,6 +1015,7 @@ public class FormulaUtils {
     public static List<Object> slice(List<LocalVariable>  local, String formula){
         int min =0;
         List<Object> result = new ArrayList<>();
+
         try {
             pretreatment(local,formula);
             List<Object>  r= local.stream().map(e-> {
@@ -1024,7 +1025,9 @@ public class FormulaUtils {
             if(CollectionUtil.isNotEmpty(r)&&r.stream().anyMatch(StringUtils::isNotEmpty)){
                 result.addAll(r);
             }
+
         }catch (Exception e){
+            e.printStackTrace();
             StaticLog.error("公式:{},执行出错",formula);
         }
         return  result;

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

@@ -5,12 +5,15 @@ import org.springblade.core.cloud.feign.EnableBladeFeign;
 import org.springblade.core.launch.BladeApplication;
 import org.springframework.cache.annotation.EnableCaching;
 import org.springframework.cloud.client.SpringCloudApplication;
+
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 @EnableBladeFeign
 @SpringCloudApplication
 @EnableAsync
-@EnableCaching //缓存
+@EnableCaching//缓存
+@EnableScheduling
 public class ManagerApplication {
 
     public static void main(String[] args) {

+ 317 - 75
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -21,9 +21,6 @@ import lombok.SneakyThrows;
 import org.apache.commons.codec.Charsets;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -168,6 +165,8 @@ public class ExcelTabController extends BladeController {
     private final TaskClient taskClient;
 
 
+
+
     // 线程池
     @Resource(name = "taskExecutor1")
     private ThreadPoolExecutor executor;
@@ -855,7 +854,9 @@ public class ExcelTabController extends BladeController {
         ExcelTab dataInfo = excelTabService.getById(wbsTreePrivate.getExcelId());
         // 添加标题显示
         Elements trs = table.select("tr");
-        if( Func.isNotEmpty(dataInfo) && dataInfo.getTabType()!=100L) {
+        //这句代码在正式环境要加上
+
+        if( Func.isNotEmpty(dataInfo)&&dataInfo.getTabType()!=null&&dataInfo.getTabType()!=100L) {
             for (int i = 1; i < 6; i++) {
                 Element tr = trs.get(i);
                 Elements tds = tr.select("td");
@@ -1037,9 +1038,18 @@ public class ExcelTabController extends BladeController {
                     //判断高度
                     String style = data.attr("style");
                     if (StringUtils.isNotBlank(style)) {
-                        String substring = style.substring(style.lastIndexOf(":") + 1);
+                        int index = style.lastIndexOf(":");
+                        String substring = style.substring( index+ 1);
                         String height = substring.substring(0, substring.length() - 3);
-                        if (Integer.parseInt(height) > 90) {
+                        int i1 = 0;
+                        try {
+                             i1 = Integer.parseInt(height);
+                        } catch (NumberFormatException e) {
+                             substring = style.substring(style.lastIndexOf(":",index-1) + 1);
+                             height = substring.substring(0,substring.indexOf("px;"));
+                             i1 = Integer.parseInt(height);
+                        }
+                        if (i1 > 90) {
                             isText = true;
                         }
                     }
@@ -1621,20 +1631,39 @@ public class ExcelTabController extends BladeController {
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
 
         List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda()
-                .eq(WbsTreeContract::getId, wbsInfo.getId())
+                .likeRight(WbsTreeContract::getNodeName,wbsInfo.getNodeName())
                 .eq(WbsTreeContract::getContractId, wbsInfo.getContractId())
                 .eq(WbsTreeContract::getParentId, wbsInfo.getParentId()));
         List<WbsTreeContract> wbsTreeContractList2 = wbsTreeContractList.stream().sorted(Comparator.comparing(WbsTreeContract::getCreateTime).reversed()).collect(Collectors.toList());
+        Set<String> strings = wbsTreeContractList2.stream().map(o -> o.getNodeName()).collect(Collectors.toSet());
+        List<WbsTreeContract>wbsTreeContractList3=wbsTreeContractList.stream().sorted(Comparator.comparing(WbsTreeContract::getCreateTime)).collect(Collectors.toList());
+        Boolean flag=false;
+        if(strings.size()!=wbsTreeContractList3.size()){
+            flag=true;
+            for (int i = 0; i < wbsTreeContractList3.size(); i++) {
+                if(wbsTreeContractList3.get(i).getIsCopeTab()!=null&&wbsTreeContractList3.get(i).getIsCopeTab().equals(Integer.valueOf(2))){
+                    String  nodeName=wbsTreeContractList3.get(0).getNodeName();
+                    nodeName=nodeName+"__"+(i);
+                    wbsTreeContractList3.get(i).setNodeName(nodeName);
+                    String update="UPDATE m_wbs_tree_contract Set node_name= "+"'"+wbsTreeContractList3.get(i).getNodeName()+"'"+" WHERE p_key_id="+wbsTreeContractList3.get(i).getPKeyId();
+                    jdbcTemplate.update(update);
+                }
+            }
+        }
+        //新增
         long tabGroupId = SnowFlakeUtil.getId();
-
         long newPkId = SnowFlakeUtil.getId();
         WbsTreeContract wbsTreeContract = new WbsTreeContract();
         BeanUtil.copy(wbsInfo, wbsTreeContract);
         wbsTreeContract.setPKeyId(newPkId);
         wbsTreeContract.setCreateTime(new Date());
         wbsTreeContract.setTabGroupId(tabGroupId);
-        String nodeName = wbsTreeContractList2.get(0).getNodeName();
-
+        String nodeName;
+        if(flag){
+            nodeName=wbsTreeContractList3.get(wbsTreeContractList3.size()-1).getNodeName();
+        }else {
+            nodeName=  wbsTreeContractList2.get(0).getNodeName();
+        }
         if (nodeName.indexOf("__") >= 0) {
             String[] oldName = nodeName.split("__");
             nodeName = oldName[0] + "__" + (Integer.parseInt(oldName[1]) + 1);
@@ -1799,10 +1828,28 @@ public class ExcelTabController extends BladeController {
         //获取节点下的所有表单,和附件,如果表单全是隐藏的,并且没有附件,则提示暂无数据
         String sql = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position,status from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id='" + contractId + "'";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        if(maps.size() < 1){
+            //判断当前合同段的类型
+            ContractInfo contractInfo = contractInfoService.selectById(contractId);
+            if(ObjectUtil.isNotEmpty(contractInfo)){
+                Integer contractType = contractInfo.getContractType();
+                if(contractType == 3 || contractType == 2 ){//业主和监理
+                    //当前业主合同段关联的施工合同段数据
+                    String sqlForSG = "select contract_id_sg from m_contract_relation_jlyz where contract_id_jlyz = " + contractId;
+                    List<ContractRelationJlyz> ContractRelationJlyzs = jdbcTemplate.query(sqlForSG, new BeanPropertyRowMapper<>(ContractRelationJlyz.class));
+                    if(ObjectUtil.isNotEmpty(ContractRelationJlyzs)){
+                        List<Long> contractsIds = ContractRelationJlyzs.stream().map(ContractRelationJlyz::getContractIdSg).collect(Collectors.toList());
+                        String contractsIdsStr = StringUtils.join(contractsIds, ",");
+                        String sql1 = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position,status from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id in('" + contractsIdsStr + "')";
+                        maps = jdbcTemplate.queryForList(sql1);
+                    }
+                }
+            }
+        }
         if (maps.size() >= 1) {
             Map<String, Object> stringObjectMap = maps.get(0);
             String pdfUrl = stringObjectMap.get("pdf_url") + "";
-            if (stringObjectMap.get("e_visa_pdf_url") != null) {
+            if (Func.isNotEmpty(stringObjectMap.get("e_visa_pdf_url"))) {
                 //优先使用电签的pdf
                 pdfUrl = stringObjectMap.get("e_visa_pdf_url") + "";
             }
@@ -1829,7 +1876,6 @@ public class ExcelTabController extends BladeController {
                     if (tabpdf2.exists()) {
                         tabpdf2.delete();
                     }
-
                     FileUtils.mergePdfPublicMethods(datainfo, listPdf);
                     String netUrl = "";
                     if(sys_isonline.equals("20")){
@@ -1925,13 +1971,7 @@ public class ExcelTabController extends BladeController {
         /*全加载,或者可以优化成依赖加载*/
         List<AppWbsTreeContractVO> tableAll = new ArrayList<>();
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
-/*        long start = System.currentTimeMillis();
-        if (tableInfoList != null) {
-            tableInfoList.forEach(e->{e.setToBeUpdated(true);});
-            tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, "1", contractId, projectId, null);
-            doForTableIst(tableAll,tableInfoList);
-        }
-        System.out.println("加载所有表单数据耗时:"+(System.currentTimeMillis()-start));*/
+
         executionTime.info("公式前");
         //公式填充
         this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId), ExecuteType.INSPECTION);
@@ -1939,6 +1979,7 @@ public class ExcelTabController extends BladeController {
         if(tableInfoList.size()==0){
             R.success("数据未发生变化");
         }
+
         executionTime.info("公式耗时");
         //保存数据到数据库
         R<Object> result = this.excelTabService.saveOrUpdateInfo(tableInfoList);
@@ -2350,8 +2391,8 @@ public class ExcelTabController extends BladeController {
                     CellRange[] columns = sheet.getMergedCells();
                     for (int i = 0; i < columns.length; i++) {
                         CellRange cellRange = columns[i];
-                        System.out.println(cellRange.getText());
-                        if (cellRange.getStyle().getFont().getSize() >= 12 && Func.isNotEmpty(cellRange.getText())) {
+
+                        if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
                             String title = projectInfo.getProjectName();
                             if (title.length() >= 30) {
                                 cellRange.setRowHeight(40);
@@ -2366,6 +2407,7 @@ public class ExcelTabController extends BladeController {
 
                     if (ObjectUtil.isNotEmpty(dataMap)) {
                         for (String val : dataMap.keySet()) {
+                            boolean flag=false;
                             if (val.indexOf("__") >= 0) {
                                 String[] DataVal = val.split("__");
                                 String[] xy = DataVal[1].split("_");
@@ -2374,7 +2416,9 @@ public class ExcelTabController extends BladeController {
                                     Elements tdDatas = trData.select("td");
                                     if (tdDatas.size() > Integer.parseInt(xy[1])) {
                                         Element data = tdDatas.get(Integer.parseInt(xy[1]));
-
+                                        if(data.html().indexOf("date")>=0){
+                                            flag=true;
+                                        }
                                         if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 0) {
                                             int x1, y1;
 
@@ -2389,12 +2433,11 @@ public class ExcelTabController extends BladeController {
                                                 x1 = 1;
                                             }
                                             String myData = dataMap.get(val) + "";
-                                            if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
+                                            if (((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0))&&flag) {
                                                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                                                 sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
                                                 SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
                                                 if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
-
                                                     myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
                                                     String[] dataVal = myData.split(",");
                                                     Date Start_dataStr = sdf.parse(dataVal[0]);
@@ -2413,6 +2456,28 @@ public class ExcelTabController extends BladeController {
                                                     }
                                                 }
                                             }
+                                            if (myData.indexOf("lang.String") >= 0) {
+                                                Object obj = dataMap.get(val);
+                                                if (obj instanceof String[]) {
+                                                    String[] dataDate = (String[]) obj;
+                                                    String HtmlEle = data.toString();
+                                                    if (HtmlEle.indexOf("el-date-picker") >= 0) {//时间时间段处理格式
+                                                        if ((dataDate[0].trim()).equals((dataDate[1].trim()))) {
+                                                            myData = dataDate[0];
+                                                        } else {
+                                                            myData = dataDate[0].replace("\"", "") + "-" + dataDate[1].trim().replace("\"", "");
+                                                        }
+                                                    }
+                                                    else {
+                                                        myData = Func.convert(dataDate, String.class).replaceAll(" ", "");
+                                                        if (myData.startsWith("[") && myData.endsWith("]")) {
+                                                            // 去掉两端的中括号
+                                                            myData = myData.substring(1, myData.length() - 1);
+                                                        }
+                                                    }
+
+                                                }
+                                            }
 
                                             if (myData.indexOf("http") >= 0 && (myData.indexOf("aliyuncs") >= 0 ||myData.indexOf("183.247.216.148") >= 0)) {
                                                 Element element = trs.get(y1).select("td").get(x1);
@@ -2520,7 +2585,6 @@ public class ExcelTabController extends BladeController {
         return R.data(null);
     }
 
-
     /**
      * 获取当前用户当前日期的填报记录
      */
@@ -2723,7 +2787,8 @@ public class ExcelTabController extends BladeController {
                                         String[] tabData = data.split("_\\^_");
                                         reData.put(key + "__" + tabData[1], tabData[0]);
                                     }
-                                } else if (tabVal.indexOf("_^_") >= 0) {
+                                }
+                                else if (tabVal.indexOf("_^_") >= 0) { //数组处理方式
                                     String[] tabData = tabVal.split("_\\^_");
                                     if (StringUtils.isNotEmpty(tabData[0])) {
                                         if (tabVal.contains("[") && tabVal.contains("年")) {
@@ -2733,16 +2798,16 @@ public class ExcelTabController extends BladeController {
                                         if (tabVal.contains("[") && tabVal.contains("]") && tabVal.indexOf(",") >= 0) {
                                             String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
                                             reData.put(key + "__" + tabData[1], strings);
-                                        }
-                                        if(tabVal.contains("[")&&tabVal.contains("]")&&tabVal.indexOf(",")==-1){
-                                        String[]strings= new String[]{StringUtils.strip(tabData[0],"[]")};
-                                            reData.put(key+"__"+tabData[1],strings);
-                                        }
-                                        else {
-                                            reData.put(key + "__" + tabData[1], tabData[0]);
+                                        } else {
+                                            if(tabVal.contains("[") && tabVal.contains("]")){
+                                                reData.put(key+"__"+tabData[1],tabData);
+                                            }else {
+                                                reData.put(key + "__" + tabData[1],tabData[0]);
+                                            }
                                         }
                                     }
-                                } else {
+                                }
+                                else {
                                     reData.put(key, tabVal);
                                 }
                             }
@@ -2900,6 +2965,7 @@ public class ExcelTabController extends BladeController {
     })
     public R<List<Map<String, Object>>> copyTheLogBusinessData(@RequestParam String theLogId, @RequestParam String nodePrimaryKeyId, @RequestParam String currentTime, @RequestParam String contractId) {
         if (StringUtils.isNotEmpty(theLogId) && StringUtils.isNotEmpty(currentTime)) {
+
             //复制出来的新日志记录logIds
             List<String> logIds = new ArrayList<>();
             //复制出来的新增表的实体表SQL集合
@@ -2908,6 +2974,7 @@ public class ExcelTabController extends BladeController {
             List<JSONObject> logWbsList = new ArrayList<>();
             //记录第一组
             List<JSONObject> oneGroupLogWbsList = new ArrayList<>();
+            ArrayList<String> dataIdList = new ArrayList<>();
 
             //获取所有选择的日志表的数据信息
             List<ContractLog> contractLogList = jdbcTemplate.query("select * from u_contract_log where id in(" + theLogId + ")", new BeanPropertyRowMapper<>(ContractLog.class));
@@ -2921,7 +2988,7 @@ public class ExcelTabController extends BladeController {
             for (ContractLog objLog : contractLogList) {
                 long dataId = 0;
                 //获取目标数据
-                String queryTargetDataSql = "SELECT * FROM " + tableTemp.getInitTableName() + " WHERE id = " + objLog.getDataId();
+                String queryTargetDataSql = "SELECT * FROM " + tableTemp.getInitTableName() + " WHERE id in( " + objLog.getDataId()+")";
                 List<Map<String, Object>> targetData = this.jdbcTemplate.queryForList(queryTargetDataSql);
 
                 //只需要替换group_id和id即可
@@ -2947,11 +3014,11 @@ public class ExcelTabController extends BladeController {
                             value = SnowFlakeUtil.getId();
 
                             //赋值给log的dataId,也就是businessId要与实体表数据id对应
-                            dataId = Long.parseLong(String.valueOf(value));
+                            dataIdList.add(String.valueOf(value));
 
                             //后续关联工序节点businessId赋值,businessId=实体表数据的id
                             for (JSONObject json : wbsJsonList) {
-                                json.put("businessId", dataId);
+                                json.put("businessId", Long.parseLong(String.valueOf(value)));
                             }
                             logWbsList.addAll(wbsJsonList);
                         }
@@ -2974,25 +3041,51 @@ public class ExcelTabController extends BladeController {
                     insertSql.append(" VALUES(").append(valueSql.substring(1)).append(")");
                     insertSqlList.add(insertSql.toString());
                 }
-
-                if (dataId != 0) {
-                    //处理log当前表的记录数据
-                    String id = this.contractLogClient.saveContractLog(new SaveContractLogVO(
-                            dataId,
-                            String.valueOf(objLog.getProjectId()),
-                            String.valueOf(objLog.getContractId()),
-                            objLog.getWbsNodeId(),
-                            objLog.getTableId(),
-                            objLog.getWbsNodeType(),
-                            currentTime,
-                            logWbsList
-                    ));
-                    //log记录id
-                    if (StringUtils.isNotEmpty(id)) {
+                String dataIds= dataIdList.stream().collect(Collectors.joining(","));
+                if(ObjectUtil.isEmpty(dataIdList)){
+                    return fail("没有数据可复制");
+                }else {
+                    //查询当前所在日期日志记录
+                    List<ContractLog> contractLogs = this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTimeList(nodePrimaryKeyId, currentTime, contractId);
+                    if(ObjectUtil.isEmpty(contractLogs)){
+                        String id = this.contractLogClient.saveContractLog(new SaveContractLogVO(
+                                dataIds,
+                                String.valueOf(objLog.getProjectId()),
+                                String.valueOf(objLog.getContractId()),
+                                objLog.getWbsNodeId(),
+                                objLog.getTableId(),
+                                objLog.getWbsNodeType(),
+                                currentTime,
+                                logWbsList,
+                                theLogId
+                        ));
                         logIds.add(id);
+                    }else {
+                        //关联dataIds
+                        ContractLog contractLog = contractLogs.get(0);
+                        String oldDataId = contractLog.getDataId();
+                        ArrayList<String> OldDataIdList =new ArrayList<>(Arrays.asList(oldDataId.split(",")));
+                        OldDataIdList.addAll(dataIdList);
+                        // 将列表重新组合为字符串
+                        String updatedDataId = String.join(",", OldDataIdList);
+                        jdbcTemplate.execute("update u_contract_log set data_id = '" + updatedDataId + "'  where id = " + contractLog.getId());
+                        //新增表关联工序节点集合
+                        if(ObjectUtil.isNotEmpty(logWbsList)){
+                            SaveContractLogVO saveContractLogVO = new SaveContractLogVO(
+                                    updatedDataId,
+                                    String.valueOf(contractLog.getProjectId()),
+                                    String.valueOf(contractLog.getContractId()),
+                                    contractLog.getWbsNodeId(),
+                                    contractLog.getTableId(),
+                                    contractLog.getWbsNodeType(),
+                                    currentTime,
+                                    logWbsList,
+                                    theLogId
+                            );
+                            this.contractLogClient.saveLogWbsList(saveContractLogVO);
+                        }
+                        logIds.add(contractLog.getId().toString());
                     }
-                } else {
-                    var = false;
                 }
             }
 
@@ -3004,7 +3097,6 @@ public class ExcelTabController extends BladeController {
             } else {
                 throw new ServiceException("数据构造失败");
             }
-
             //返回当前复制的表数据
             return this.getTheLogBusinessData(StringUtils.join(logIds, ","), nodePrimaryKeyId, currentTime, contractId);
         }
@@ -3844,16 +3936,34 @@ public class ExcelTabController extends BladeController {
     @ApiOperation(value = "删除施工日志对应的表数据记录信息等", notes = "传入get-the-log-business-data接口返回的内部id")
     @Transactional
     public R<Object> removeLogTab(@RequestParam String id) {
+        //todo  这里前端需要改一下 多传一个日志id参数 避免like查询影响性能
         if (StringUtils.isNotEmpty(id)) {
-            Map<String, Object> obj = jdbcTemplate.queryForMap("select * from u_contract_log where data_id =" + id + " ");
-            if (obj!=null && Func.isNotEmpty(obj)) {
+            ContractLog contractLog = jdbcTemplate.queryForObject("select * from u_contract_log where data_id like '%" + id + "%'"
+                    , new BeanPropertyRowMapper<>(ContractLog.class));
+            if (contractLog!=null && Func.isNotEmpty(contractLog)) {
                 //删除施工日志记录信息
-                jdbcTemplate.execute("delete from u_contract_log where data_id = " + id);
+                String dataId = contractLog.getDataId();
+                // 将字符串拆分为列表
+                List<String> dataIdList = Arrays.asList(dataId.split(","));
+                if(dataIdList.size() == 1){
+                    //删除整条日志
+                    jdbcTemplate.execute("delete from u_contract_log where id = " + contractLog.getId());
+                }else {
+                   if(dataIdList.size()>1){
+                       // 移除指定值
+                       List<String> updatedDataIdList = dataIdList.stream()
+                               .filter(data -> !data.equals(id))
+                               .collect(Collectors.toList());
+                       // 将列表重新组合为字符串
+                       String updatedDataId = String.join(",", updatedDataIdList);
+                       jdbcTemplate.execute("update u_contract_log set data_id = '" + updatedDataId + "' where id = " + contractLog.getId());
+                   }
+                }
                 //删除关联的工序wbs信息
-                jdbcTemplate.execute("delete from u_contract_log_wbs where business_id = " + id + " and contract_log_id = " + obj.get("id").toString());
+                jdbcTemplate.execute("delete from u_contract_log_wbs where business_id = " + id + " and contract_log_id = " + contractLog.getId().toString());
 
                 //获取对应表信息
-                WbsTreePrivate tableTemp = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, obj.get("table_id")));
+                WbsTreePrivate tableTemp = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, contractLog.getTableId()));
                 if (tableTemp != null && StringUtils.isNotEmpty(tableTemp.getInitTableName())) {
                     //删除实体表对应的数据信息
                     jdbcTemplate.execute("delete from " + tableTemp.getInitTableName() + " where id = " + id);
@@ -3947,7 +4057,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "nodeId", value = "nodeId", required = true),
 
     })
-    public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId,Integer type,Long contractId,Integer classify) {
+    public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId,Integer type,Long contractId,Integer classify,BladeUser b) {
         List<TableFile> fileList = new ArrayList<>();
         if (file != null && file.length >= 1) {
             for (MultipartFile multipartFile : file) {
@@ -3961,7 +4071,7 @@ public class ExcelTabController extends BladeController {
                 tableFile.setContractId(contractId);
                 tableFile.setName(multipartFile.getOriginalFilename());
                 tableFile.setType(type); //10 代表附件
-                if(type==10||type==11||type==12){
+                if(type==10||type==11||type==12||type==20||type==21||type==22){
                 tableFile.setDomainPdfUrl(bladeFile1.getLink());
                 }
                 tableFile.setDomainUrl(bladeFile1.getLink());
@@ -3971,6 +4081,36 @@ public class ExcelTabController extends BladeController {
                 fileList.add(tableFile);
             }
             tableFileService.saveOrUpdateBatch(fileList);
+            String sql="SELECT * FROM m_wbs_tree_contract WHERE p_key_id="+nodeId;
+            WbsTreeContract wbsTreeContract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+            if(ObjectUtil.isNotEmpty(wbsTreeContract.getNodeClass())){
+                if(wbsTreeContract.getNodeClass().equals(Integer.valueOf(2))){
+                InformationQuery iq= informationQueryClient.getInfoByWbsId(wbsTreeContract.getPKeyId());
+                if(iq==null){
+                    iq=new InformationQuery();
+                    iq.setId(SnowFlakeUtil.getId());
+                    iq.setName(wbsTreeContract.getNodeName());
+                    iq.setProjectId(Long.valueOf(wbsTreeContract.getProjectId()));
+                    iq.setContractId(Long.valueOf(wbsTreeContract.getContractId()));
+                    iq.setClassify(classify);
+                    iq.setWbsId(wbsTreeContract.getPKeyId());
+                    iq.setFileUserIdAndName(b.getUserId()+"-"+b.getUserName());
+                    iq.setType(1);
+                    iq.setSourceType(2);
+                    iq.setCreateUser(wbsTreeContract.getCreateUser());
+                    iq.setCreateTime(new Date());
+                    iq.setUpdateUser(b.getUserId());
+                    iq.setUpdateTime(new Date());
+                    iq.setStatus(2);
+                    iq.setIsDeleted(0);
+                    informationQueryClient.insert(iq);
+                }else {
+                    iq.setUpdateTime(new Date());
+                    iq.setUpdateUser(b.getUserId());
+                    informationQueryClient.update(iq);
+                }
+                }
+            }
             return R.data("操作成功");
         } else {
             return R.data("请上传pdf");
@@ -4014,19 +4154,21 @@ public class ExcelTabController extends BladeController {
                 JSONArray array = new JSONArray();
                 if (tableAll != null && tableAll.size() >= 1) {
                     /*只需加载第一张即可,生效会自动补全*/
-                    AppWbsTreeContractVO tab =tableAll.get(0);
-                    Map<String, Object> jo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
-                    String s = new Gson().toJson(jo);
-                    //字符串转jsonobject
-                    JSONObject obj = JSON.parseObject(s);
-                    obj.put("classify", classify);
-                    obj.put("nodeId", noId);
-                    obj.put("contractId", contractId);
-                    obj.put("pkeyId", tab.getPKeyId());
-                    obj.put("projectId", projectId);
-                    obj.put("isCollapseLoad", true);
-                    obj.put("isRenderForm", true);
-                    array.add(obj);
+                    for(AppWbsTreeContractVO tab:tableAll) {
+                      //  AppWbsTreeContractVO tab = tableAll.get(0);
+                        Map<String, Object> jo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
+                        String s = new Gson().toJson(jo);
+                        //字符串转jsonobject
+                        JSONObject obj = JSON.parseObject(s);
+                        obj.put("classify", classify);
+                        obj.put("nodeId", noId);
+                        obj.put("contractId", contractId);
+                        obj.put("pkeyId", tab.getPKeyId());
+                        obj.put("projectId", projectId);
+                        obj.put("isCollapseLoad", true);
+                        obj.put("isRenderForm", true);
+                        array.add(obj);
+                    }
                 }
                 js2.put("orderList", array);
                 js.put("dataInfo", js2);
@@ -4105,6 +4247,106 @@ public class ExcelTabController extends BladeController {
     }
 
 
+   // @Scheduled(cron = "0/20 * * * * ?")
+    public void HtmlCope() {
+        //执行代码
+        String sql = "SELECT * from m_wbs_tree_private_0425 where project_id=1750070685257990145 and wbs_id=1745384228667129857 and type =2 and is_deleted=0 LIMIT 200" ;
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
+        if (maps != null && maps.size() >= 1) {
+            for (Map<String, Object> dataInfo : maps) {
+                if (executor.getQueue().size() <= 40) {
+                    String idkey = dataInfo.get("p_key_id") + "";
+                    Boolean aBoolean = RedisTemplate.hasKey("sign-" + idkey);
+                    if (!aBoolean) {
+                        RedisTemplate.opsForValue().set("sign-" + idkey, "1", 30, TimeUnit.SECONDS);
+                        CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
+                            try {
+                                this.checkHtmlCope(dataInfo);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }, executor);
+                    }
+
+                }
+            }
+        }
+        System.out.println("队列数量" + executor.getQueue().size());
+        System.out.println("活跃数量" + executor.getActiveCount());
+        System.out.println("总共数量" + executor.getTaskCount());
+        System.out.println("完成数量" + executor.getCompletedTaskCount());
+    }
+
+    public void checkHtmlCope (Map < String, Object > dataInfo) throws Exception {
+
+        String pkey_id = dataInfo.get("p_key_id")+"";
+        String sql = "update m_wbs_tree_private_0425 set is_deleted=1 where p_key_id='"+pkey_id+"'";
+        jdbcTemplate.execute(sql);
+        String Html1 = dataInfo.get("html_url")+"";
+        String fileName = Html1.substring(Html1.lastIndexOf("/")+1,Html1.length());
+        String Html2 = Html1.replaceAll("privateUrl", "/privateUrlCopy/1795277868551389185/").replaceAll("//","/");
+        String Html3 = Html1.replaceAll("privateUrl", "/privateUrlCopy/1792760669353865218/").replaceAll("//","/");
+        String url183= "http://183.247.216.148:22776/";
+        String local183 = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";
+        if(Html1.indexOf("/home/")>=0){
+            local183 = "/home/www/wwwroot/Users/hongchuangyanfa/Desktop/";
+       }
+        String url210= "http://fileinfo.hczcxx.cn/";
+        String local210 = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";
+        String saveUrl = "/Users/hongchuangyanfa/Desktop/privateUrl/"+fileName;
+
+        // 先判断 基础路径是否存在
+        String file1 =  Html1.replaceAll(local183,url183);
+        String file2 =  Html2.replaceAll(local183,url183);
+        String file3 =  Html3.replaceAll(local183,url183);
+        String file4 =  Html1.replaceAll(local210,url210).replace("/home","");
+        String file5 =  Html2.replaceAll(local210,url210).replace("/home","");
+        String file6 =  Html3.replaceAll(local210,url210).replace("/home","");
+
+        List<String> dataUrl = new ArrayList<>();
+        dataUrl.add(file2);
+        dataUrl.add(file3);
+      //  dataUrl.add(file4);
+      //  dataUrl.add(file5);
+      //  dataUrl.add(file6);
+        InputStream stream1 = getOSSInputStream2(file1);
+        System.out.println(fileName);
+        if(stream1==null){
+            String sql2 = "update m_wbs_tree_private_0425 set is_deleted=5 where p_key_id='"+pkey_id+"'";
+            jdbcTemplate.execute(sql2);
+
+            for(String fileUrl:dataUrl){
+                InputStream str = getOSSInputStream2(fileUrl);
+                if(str!=null){
+                    OutputStream outputStream = new FileOutputStream(saveUrl);
+                    byte[] bytes = CommonUtil.InputStreamToBytes(str);
+                    outputStream.write(bytes);
+
+                    if (outputStream != null) {
+                        outputStream.close();
+                    }
+                    String sql3 = "update m_wbs_tree_private_0425 set is_deleted=2 where p_key_id='"+pkey_id+"'";
+                    jdbcTemplate.execute(sql3);
+                    return;
+                }
+            }
+        }
+
+
+    }
+
+    public static synchronized InputStream getOSSInputStream2(String urlStr) throws Exception {
+        //获取OSS文件流
+        URL url =new URL(urlStr);
+        final URLConnection conn = url.openConnection();
+        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+        try {
+            return conn.getInputStream();
+        } catch (Exception e){
+            return null;
+        }
+    }
+
   //  @Scheduled(cron = "0/20 * * * * ?")
     public void SignInfo() {
         //执行代码

+ 18 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FormulaController.java

@@ -858,13 +858,30 @@ public class FormulaController {
         return false;
     }
 
-
+    //原评定汇总(2024-10-10之前) 公路评定
     @GetMapping("/evaluate")
     public R<Object> evaluate(@NotNull(message="tablePkeyId 不能为空") Long tablePkeyId){
          BiFunction<String,String,List<Map<String, Object>>> bif= this.service.getTableNamePkIdsMaps();
          return this.service.evaluate(tablePkeyId);
     }
 
+    //评定汇总(2024-10-10之后) 水利评定
+    @GetMapping("/newEvaluate")
+    public R<Object> newEvaluate(@NotNull(message = "tablePkeyId 不能为空") Long tablePkeyId) throws Exception {
+        return this.service.newEvaluate(tablePkeyId);
+    }
+
+    //根据项目ID判断是否是水利项目
+    @GetMapping("/isWaterProject")
+    public R<Boolean> isWaterProject(@NotNull(message = "projectId 不能为空") Long projectId){
+        return R.data(this.service.isWaterProject(projectId));
+    }
+
+    //节点同步工序资料(JS107)
+    @GetMapping("/syncWorkDate")
+    public R<Object> syncWorkDate(@NotNull(message = "节点ID不能为空")Long nodeId){
+        return R.data(this.service.syncWorkDate(nodeId));
+    }
     /*根据p_key_id 获取各个元素的执行公式*/
     @GetMapping("/formulaForNode")
     public R<Object> formulaForNode(@NotNull Long pkeyId,String tableName,String elementName){
@@ -884,6 +901,4 @@ public class FormulaController {
     }
 
 
-
-
 }

+ 97 - 16
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java

@@ -18,25 +18,32 @@ package org.springblade.manager.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.mixsmart.utils.StringUtils;
-import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
-
-import javax.validation.Valid;
-
+import okhttp3.OkHttpClient;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
-import org.springblade.manager.entity.*;
+import org.springblade.manager.entity.ContractInfo;
+import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.entity.SignPfxDeputy;
+import org.springblade.manager.entity.SignPfxFile;
 import org.springblade.manager.feign.ProjectAssignmentUserClient;
 import org.springblade.manager.service.*;
+import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.*;
+import org.springblade.resource.feign.IOSSClient;
+import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.entity.Role;
 import org.springblade.system.feign.IDictBizClient;
@@ -45,14 +52,12 @@ import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springblade.system.vo.RoleVO;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RequestParam;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.multipart.MultipartFile;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
+import javax.validation.Valid;
+import java.io.File;
+import java.io.InputStream;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -85,6 +90,11 @@ public class SignPfxFileController extends BladeController {
 
     private final ProjectAssignmentUserClient projectAssignmentUserClient;
 
+    private final ISignPfxFilePreService pfxFilePreService;
+    private final NewIOSSClient newIOSSClient;
+    private final IOSSClient iossClient;
+    private final OkHttpClient.Builder okHttpClientBuilder;
+
     /**
      * 根据合同段ID获取项目下的所有合同段
      *
@@ -439,13 +449,73 @@ public class SignPfxFileController extends BladeController {
         return R.status(this.signPfxFileService.save(vo));
     }
 
+    /**
+     * 测试删除接口 无用
+     * @param type
+     * @return
+     */
+/*    @GetMapping("/deltest")
+    public R<Boolean> deltest(@RequestParam Integer type) {
+        if(type==1){
+            newIOSSClient.removeFile("https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20241009/51c1e44a42ffefd6451ece7e4716077a.png");
+        }else if(type==2){
+            newIOSSClient.removeFile("357e9df39fafd5b342d36222b5624242.png");
+        }else {
+            newIOSSClient.removeFile("/upload/20241009/51c1e44a42ffefd6451ece7e4716077a.png");
+        }
+        return R.data(true);
+    }*/
+
+    /**
+     * 根据用户设定尺寸压缩图片后上传至oss
+     */
+    @PostMapping("/compressAndUpload")
+    public R<BladeFile> compressAndUpload(@RequestParam MultipartFile file, @RequestParam double wide,@RequestParam double high) throws Exception {
+        String file_path = FileUtils.getSysLocalFileUrl();
+        String localImgPath = file_path + "print//" + SnowFlakeUtil.getId() + ".png";
+        // 检查文件是否存在
+        File newFile = new File(localImgPath);
+        if (!newFile.exists()) {
+            // 如果文件不存在,则创建目录
+            File parentDir = newFile.getParentFile();
+            if (parentDir != null && !parentDir.exists()) {
+                parentDir.mkdirs();
+            }
+        }
+        // 保存文件
+        file.transferTo(newFile);
+        //图片压缩后的地址
+        Long id = SnowFlakeUtil.getId();
+        String compressImgPath = file_path + "/print//" + id + ".png";
+        FileUtils.compressImage(localImgPath, compressImgPath, wide, high);
+        return R.data(newIOSSClient.uploadFile(id+".png", compressImgPath));
+    }
+
+    @PostMapping ("/prePicture")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "预览电签后的图片", notes = "传入signPfxFile")
+    public R prePicture(@RequestParam Optional<MultipartFile> file, @RequestParam Optional<String> fileStr, @RequestParam Optional<String> wide,@RequestParam Optional<String> high) throws Exception {
+        SignPfxFilePreVo signPfxFilePreVo = new SignPfxFilePreVo();
+        signPfxFilePreVo.setFile(file.orElse(null));
+        if(Func.isNotEmpty(wide.orElse(null)) && Func.isNotEmpty(high.orElse(null)) && !"null".equals(wide.get()) && !"null".equals(high.get())){
+            double wideDouble = Double.parseDouble(wide.get());
+            double highDouble = Double.parseDouble(high.get());
+            signPfxFilePreVo.setWide(wideDouble);
+            signPfxFilePreVo.setHigh(highDouble);
+        }else {
+            signPfxFilePreVo.setWide(null);
+            signPfxFilePreVo.setHigh(null);
+        }
+        signPfxFilePreVo.setFileStr(fileStr.orElse(null));
+        return pfxFilePreService.prePicture(signPfxFilePreVo);
+    }
     /**
      * 修改 个人/企业证书信息表
      */
     @PostMapping("/update")
-    @ApiOperationSupport(order = 3)
+    @ApiOperationSupport(order = 5)
     @ApiOperation(value = "修改", notes = "传入signPfxFile")
-    public R<Boolean> update(@Valid @RequestBody SignPfxFileVO vo) {
+    public R<Boolean> update(@Valid @RequestBody SignPfxFileVO vo) throws Exception {
         if (new Integer("2").equals(vo.getCertificateType())||new Integer("3").equals(vo.getCertificateType())) {
             //查询旧数据
             SignPfxFile oldData = this.signPfxFileService.getById(vo.getId());
@@ -457,6 +527,7 @@ public class SignPfxFileController extends BladeController {
             }
 
         }
+        vo.setSignatureFileUrl(compressionAndUpload(vo.getSignatureFileUrl(), vo.getWide(), vo.getHigh()));
         return R.status(this.signPfxFileService.updateById(vo));
     }
 
@@ -497,11 +568,21 @@ public class SignPfxFileController extends BladeController {
      * 删除 个人/企业证书信息表
      */
     @PostMapping("/remove")
-    @ApiOperationSupport(order = 4)
+    @ApiOperationSupport(order = 6)
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
         return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
     }
+    public String compressionAndUpload(String fileStr, double wide, double high) throws Exception {
+        String file_path = FileUtils.getSysLocalFileUrl();
+        InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(fileStr);
+        //图片压缩后的地址
+        Long id = SnowFlakeUtil.getId();
+        String compressImgPath = file_path + "/print//" + id + ".png";
+        FileUtils.compressImage(inputStreamByUrl, compressImgPath, wide, high);
+        BladeFile bladeFile = newIOSSClient.uploadFile(id + ".png", compressImgPath);
+        return bladeFile.getLink();
+    }
 
 
 }

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

@@ -16,6 +16,7 @@
  */
 package org.springblade.manager.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -25,7 +26,9 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
+import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
+import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
@@ -40,6 +43,7 @@ import org.springblade.manager.service.IExcelTabService;
 import org.springblade.manager.service.IWbsTreeContractService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.vo.ExcelTabVO;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -69,11 +73,18 @@ public class TableFileController extends BladeController {
     private final IWbsTreeContractService wbsTreeContractService;
     private final IWbsTreePrivateService wbsTreePrivateService;
 
+    private final InformationQueryClient informationQueryClient;
+
+
+
+
     // excel 基本信息表
     private final IExcelTabService excelTabService;
 
     private final JdbcTemplate jdbcTemplate;
 
+    private final RedisTemplate redisTemplate;
+
     /**
      * 删除 表单附件信息
      */
@@ -83,7 +94,6 @@ public class TableFileController extends BladeController {
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) throws Exception {
         // 查出基本信息
         TableFile tableFile = tableFileService.getById(ids);
-
         // 删除数据
         tableFileService.delDataById(ids, null);
         //如果为节点附件,则不去做其他处理,只删除
@@ -116,6 +126,26 @@ public class TableFileController extends BladeController {
             }
             excelTabService.getBussPdfs(wbsTreeContractP.getPKeyId() + "", classfy, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
         }
+        if (tableFile.getType() == 20 || tableFile.getType() == 21||tableFile.getType() == 22) {
+            //查询当前节点 如果是数字化节点 需要删除上报信息,变成未填报
+            List<TableFileVO> fileVOList = tableFileService.selectTableFileList1(Long.parseLong(tableFile.getTabId()));
+            // 该文本无附件
+            if (fileVOList == null || fileVOList.size() <= 0) {
+                UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.in("p_key_id", tableFile.getTabId());
+                updateWrapper.set("tab_file_type", 1);
+                wbsTreeContractService.update(updateWrapper);
+                WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(new QueryWrapper<WbsTreeContract>().eq("p_key_id", tableFile.getTabId()));
+                if(wbsTreeContract.getNodeClass().equals(Integer.valueOf(2))){
+                    InformationQuery infoByWbsId = informationQueryClient.getInfoByWbsId(Long.valueOf(tableFile.getTabId()));
+                    if(ObjectUtil.isNotEmpty(infoByWbsId)){
+                        String sql="DELETE FROM u_information_query WHERE id="+infoByWbsId.getId();
+                        jdbcTemplate.execute(sql);
+                    }
+                }
+                redisTemplate.delete("blade-manager::contract:wbstree:");
+            }
+        }
         return R.status(true);
     }
 

+ 27 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java

@@ -42,8 +42,6 @@ import org.springblade.manager.service.IWbsTreeContractService;
 import org.springblade.manager.service.impl.WbsTreeContractServiceImpl;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -72,8 +70,6 @@ import java.util.stream.Collectors;
 @Api(value = "合同段wbs树", tags = "合同段wbs树接口")
 public class WbsTreeContractController extends BladeController {
 
-    @Autowired
-    StringRedisTemplate redisTemplate;
     private final JdbcTemplate jdbcTemplate;
     private final IWbsTreeContractService iWbsTreeContractService;
     private final WbsTreeContractServiceImpl wbsTreeContractServiceImpl;
@@ -82,6 +78,15 @@ public class WbsTreeContractController extends BladeController {
 
     private final ExcelTabController excelTabController;
 
+
+    @GetMapping("/diGuiWbs")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "递归修改")
+    public R diGuiWbs(@RequestParam int i){
+        iWbsTreeContractService.diGuiWbs(i);
+        return R.success("成功");
+    }
+
     @GetMapping("/search-node-tables")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "查询当前节点下所有元素表信息", notes = "传入节点primaryKeyId、type、合同段id、项目id")
@@ -283,6 +288,7 @@ public class WbsTreeContractController extends BladeController {
             } else {
                 htmlUrl = tab.getHtmlUrl();
 //                htmlUrl = "C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1783774897227431936.html";
+//                htmlUrl="D:\\web\\html\\1848904722870697984.html";
                 fileName = ObjectUtil.isNotEmpty(tab.getFullName()) ? tab.getFullName() : tab.getNodeName();
             }
 
@@ -299,6 +305,7 @@ public class WbsTreeContractController extends BladeController {
 //            workbook.loadFromHtml(inputStreamByUrl);
 //            workbook.loadFromHtml("D:\\BaiduNetdiskDownload\\1783381225877012480.html");
             workbook.save(byteArrayOutputStream, SaveFormat.XLSX);
+
             //将转换的spireExcel存储到流中
             byte[] excelBytes = byteArrayOutputStream.toByteArray();
 
@@ -315,7 +322,6 @@ public class WbsTreeContractController extends BladeController {
                             //存储需要修改的单元格信息
                             cellsToModify.add(new CellModificationInfo(cell, cell.getStringCellValue().trim()));
                         }
-
                         //获取单元格所属的合并单元格区域
                         CellRangeAddress mergedRegion = findMergedRegion(poiSheet, cell.getRowIndex(), cell.getColumnIndex());
                         if (mergedRegion != null) {
@@ -591,7 +597,8 @@ public class WbsTreeContractController extends BladeController {
         };
         for (String pattern : patterns) {
             Pattern regex = Pattern.compile(pattern);
-            Matcher matcher = regex.matcher(inputDateStr);
+            String inputDateStrNew = inputDateStr.replace(" ", "");
+            Matcher matcher = regex.matcher(inputDateStrNew);
             if (matcher.find()) {
                 String startDateStr = matcher.group(1);
                 String endDateStr = matcher.group(2);
@@ -782,4 +789,18 @@ public class WbsTreeContractController extends BladeController {
         }
     }
 
+    /**
+     * 更新项目下所有的表单中连续日期格式为数组
+     * @return
+     */
+    @GetMapping("/resetTableDate")
+    @ApiOperationSupport(order = 42)
+    @ApiOperation(value = "表单排序", notes = "传入ids")
+    public R resetTableDate(Long projectId) {
+        //生成PDF失败不影响排序
+        wbsTreeContractServiceImpl.resetTableDate(projectId);
+        return R.success("成功");
+    }
+
+
 }

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

@@ -1,15 +1,16 @@
 package org.springblade.manager.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.mixsmart.utils.FormulaUtils;
-import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
-import org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTermType;
+import org.springblade.business.feign.OperationLogClient;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SystemUtils;
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.cache.utils.CacheUtil;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.log.exception.ServiceException;
@@ -21,14 +22,19 @@ import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.manager.dto.*;
+import org.springblade.manager.dto.FormElementDTO;
+import org.springblade.manager.dto.WbsTreeDTO;
+import org.springblade.manager.dto.WbsTreeDTO2;
 import org.springblade.manager.entity.*;
 import org.springblade.manager.excel.WbsFormElementBatchExcel;
 import org.springblade.manager.excel.WbsTreeExcel;
 import org.springblade.manager.mapper.WbsInfoMapper;
 import org.springblade.manager.mapper.WbsTreeContractMapper;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
-import org.springblade.manager.service.*;
+import org.springblade.manager.service.IContractInfoService;
+import org.springblade.manager.service.IProjectInfoService;
+import org.springblade.manager.service.IWbsFormElementService;
+import org.springblade.manager.service.IWbsTreeService;
 import org.springblade.manager.vo.*;
 import org.springblade.system.cache.DictCache;
 import org.springblade.system.entity.Role;
@@ -39,8 +45,6 @@ import org.springblade.system.user.feign.IUserClient;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springblade.core.boot.ctrl.BladeController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
@@ -48,7 +52,6 @@ import javax.validation.Valid;
 import java.io.IOException;
 import java.net.URL;
 import java.util.*;
-import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
@@ -69,6 +72,7 @@ public class WbsTreeController extends BladeController {
     private final JdbcTemplate jdbcTemplate;
     private final IUserClient iUserClient;
     private final ISysClient iSysClient;
+    private final OperationLogClient operationLogClient;
 
     /**
      * 详情
@@ -205,6 +209,14 @@ public class WbsTreeController extends BladeController {
                     }
                 }
             }
+            //校验当前系统级表单是否已经被项目级关联
+            List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
+                    .select(WbsTreePrivate::getPKeyId).eq(WbsTreePrivate::getType, 2).eq(WbsTreePrivate::getId, id));
+            List<WbsTreeContract> wbsTreeContracts = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
+                    .select(WbsTreeContract::getPKeyId).eq(WbsTreeContract::getType, 2).and(obj -> obj.eq(WbsTreeContract::getId, id).or().eq(WbsTreeContract::getOldId, id)));
+            if(ObjectUtil.isNotEmpty(wbsTreePrivates) || ObjectUtil.isNotEmpty(wbsTreeContracts)){
+                throw new ServiceException("当前表单已被项目引用,删除失败");
+            }
 
             if (var) {
                 if (wbsTreeService.removeTableById(id)) {
@@ -220,6 +232,11 @@ public class WbsTreeController extends BladeController {
                             }
                         }
                     }
+                    //保存操作记录
+                    JSONObject json = new JSONObject();
+                    json.put("operationObjIds",id);
+                    json.put("operationObjName", "删除系统级表单");
+                    this.operationLogClient.saveUserOperationLog(4, "后台管理", "系统表单", json);
 
                     //删除对应到项目合同段的表
                     List<String> projectPKeyIds = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()

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

@@ -1,54 +1,57 @@
 package org.springblade.manager.feign;
 
-import com.alibaba.druid.util.DaemonThreadFactory;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.spire.xls.*;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.nodes.Node;
 import org.jsoup.select.Elements;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
+import org.springblade.business.entity.ContractLog;
 import org.springblade.business.entity.InformationQuery;
+import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
-import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.IoUtil;
-import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.core.tool.utils.ResourceUtil;
+import org.springblade.core.tool.utils.*;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.controller.ExcelTabController;
-import org.springblade.manager.entity.ExcelTab;
-import org.springblade.manager.entity.TrialSelfDataRecord;
-import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.manager.entity.*;
 import org.springblade.manager.enums.ExecuteType;
+import org.springblade.manager.mapper.WbsTreePrivateMapper;
+import org.springblade.manager.service.IContractInfoService;
 import org.springblade.manager.service.IExcelTabService;
+import org.springblade.manager.service.IProjectInfoService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.utils.FileUtils;
-import org.springblade.manager.vo.WbsTreePrivateVO4;
 import org.springblade.resource.feign.NewIOSSClient;
-import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.InputStream;
+import java.text.SimpleDateFormat;
 import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @RestController
 @AllArgsConstructor
+@Slf4j
 public class ExcelTabClientImpl implements ExcelTabClient {
 
     private final IExcelTabService excelTabService;
@@ -57,6 +60,10 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     private final InformationQueryClient informationQueryClient;
     private final ExcelTabController excelTabController;
     private final IWbsTreePrivateService wbsTreePrivateService;
+    private final ContractLogClient contractLogClient;
+    private final WbsTreePrivateMapper wbsTreePrivateMapper;
+    private final IProjectInfoService projectInfoService;
+    private final IContractInfoService contractInfoService;
     private static final Logger logger = LoggerFactory.getLogger(ExcelTabClientImpl.class);
 
     @Override
@@ -187,4 +194,598 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         return pdfUrl;
     }
 
+    @Override
+    public R<String> getTheContractLogBusinessData(String pkeyId, String nodePrimaryKeyId, String recordTime, String contractId, Long createUser) throws Exception {
+        //获取配置的路径
+        String file_path = FileUtils.getSysLocalFileUrl();
+        if (StringUtils.isEmpty(recordTime)) {
+            recordTime = DateUtil.format(DateUtil.now(), "yyyy-MM-dd");
+        }
+        List<ContractLog> contractLogList = this.contractLogClient.queryContractLogByPrimaryKeyIdAndRecordTimeAndCreateUserList(nodePrimaryKeyId, recordTime, contractId,createUser);
+        List<String> ids = contractLogList.stream().map(ContractLog::getId).map(String::valueOf).collect(Collectors.toList());
+        if (ids.size() > 0) {
+            //PDF路径
+            List<String> pdfUrls = new ArrayList<>();
+            for (String dataId : ids) {
+                //查询对应的html
+                WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, pkeyId));
+
+                if (tableNode == null) {
+                    return R.fail("该数据下无此节点!");
+                }
+
+                String htmlString = this.getHtmlString(pkeyId);
+
+                if (StringUtils.isEmpty(tableNode.getHtmlUrl()) || StringUtils.isEmpty(htmlString)) {
+                    return R.fail("未获取到元素表信息!");
+                }
+
+                // 获取清表信息
+                ExcelTab excelTab = excelTabService.getById(tableNode.getExcelId());
+                if (excelTab == null) {
+                    return R.fail("失败");
+                }
+
+                //获取数据
+                List<Map<String, Object>> businessDataMapList = this.getTheLogBusinessData(dataId, nodePrimaryKeyId, recordTime, contractId).getData();
+                ProjectInfo projectInfo = projectInfoService.getById(tableNode.getProjectId());
+                //处理数据
+                for (Map<String, Object> dataMap : businessDataMapList) {
+                    // 获取excel流 和 html流
+                    Workbook wb = new Workbook();
+                    wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
+                    //获取工作表
+                    Worksheet sheet = wb.getWorksheets().get(0);
+                    Document doc = Jsoup.parse(htmlString);
+                    Element table = doc.select("table").first();
+                    Elements trs = table.select("tr");
+                    //添加标题
+                    CellRange[] columns = sheet.getMergedCells();
+                    for (int i = 0; i < columns.length; i++) {
+                        CellRange cellRange = columns[i];
+                        System.out.println(cellRange.getText());
+                        if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
+                            String title = projectInfo.getProjectName();
+                            if (title.length() >= 30) {
+                                cellRange.setRowHeight(40);
+                                cellRange.getStyle().setWrapText(true);
+                            }
+                            cellRange.getStyle().getFont().setSize(18);
+                            cellRange.getStyle().setHorizontalAlignment(HorizontalAlignType.Center);
+                            cellRange.setText(projectInfo.getProjectName());
+                            break;
+                        }
+                    }
+
+                    if (ObjectUtil.isNotEmpty(dataMap)) {
+                        for (String val : dataMap.keySet()) {
+                            boolean flag=false;
+                            if (val.indexOf("__") >= 0) {
+                                String[] DataVal = val.split("__");
+                                String[] xy = DataVal[1].split("_");
+                                if (trs.size() > Integer.parseInt(xy[0])) {
+                                    Element trData = trs.get(Integer.parseInt(xy[0]));
+                                    Elements tdDatas = trData.select("td");
+                                    if (tdDatas.size() > Integer.parseInt(xy[1])) {
+                                        Element data = tdDatas.get(Integer.parseInt(xy[1]));
+                                        if(data.html().indexOf("date")>=0){
+                                            flag=true;
+                                        }
+                                        if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 0) {
+                                            int x1, y1;
+
+                                            if (data.html().indexOf("el-tooltip") >= 0) {
+                                                x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
+                                                y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
+                                            } else {
+                                                x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                                y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+                                            }
+                                            if (x1 == 0) {
+                                                x1 = 1;
+                                            }
+                                            String myData = dataMap.get(val) + "";
+                                            if (((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0))&&flag) {
+                                                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+                                                sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
+                                                SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
+                                                if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
+                                                    myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
+                                                    String[] dataVal = myData.split(",");
+                                                    Date Start_dataStr = sdf.parse(dataVal[0]);
+                                                    Date end_dataStr = sdf.parse(dataVal[1]);
+                                                    String StartDate = formatStr.format(Start_dataStr);
+                                                    String endDate = formatStr.format(end_dataStr);
+                                                    if (StartDate.equals(endDate)) {
+                                                        myData = StartDate;
+                                                    } else {
+                                                        myData = StartDate + "-" + endDate;
+                                                    }
+                                                } else {
+                                                    String[] dataStr = myData.split("T")[0].split("-");
+                                                    if (dataStr.length == 3) {
+                                                        myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]));
+                                                    }
+                                                }
+                                            }
+
+                                            if (myData.indexOf("http") >= 0 && (myData.indexOf("aliyuncs") >= 0 ||myData.indexOf("183.247.216.148") >= 0)) {
+                                                Element element = trs.get(y1).select("td").get(x1);
+                                                String[] styles = element.attr("style").split(";");
+                                                int Height = 0;
+                                                for (String sty : styles) {
+                                                    if (sty.indexOf("height:") >= 0) {
+                                                        Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
+                                                    }
+                                                }
+
+                                                BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
+                                                ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
+                                                pic.setHeight(Height);
+                                                sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
+
+                                            } else if (data.html().indexOf("hc-form-checkbox-group") >= 0) {
+                                                CellRange cellRange = sheet.getCellRange(y1, x1);
+                                                String exceVal = cellRange.getValue().replaceAll(" ", "");
+                                                //如果有□ 代表 自动生成  如果没有 代表后期添加 需要显示html 中的值
+                                                if (exceVal.indexOf("□") >= 0) {
+                                                    if (myData.equals("1")) {
+                                                        cellRange.setValue(exceVal.replace("□", "\u2611"));
+                                                    }
+                                                } else {
+                                                    List<Node> nodes = data.childNodes();
+                                                    Node node = nodes.get(nodes.size() - 1);
+                                                    String dataJson = node.attr(":objs");
+                                                    if (StringUtils.isNotEmpty(dataJson)) {
+                                                        JSONArray jsonArray = JSONArray.parseArray(dataJson);
+                                                        List<Integer> idList = Func.toIntList(myData);
+                                                        int indexx = 0;
+                                                        if (idList.get(0) >= 1) {
+                                                            indexx = idList.get(0) - 1;
+                                                        }
+
+                                                        String dataInfo = jsonArray.getJSONObject(indexx).getString("name");
+                                                        for (int inx = 1; inx < idList.size(); inx++) {
+                                                            int valIndex = idList.get(inx) - 1;
+                                                            dataInfo = dataInfo + "," + jsonArray.getJSONObject(valIndex).getString("name");
+                                                        }
+                                                        cellRange.setValue(dataInfo);
+                                                    }
+
+                                                }
+                                            } else {
+                                                final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                                cellRange.setText(myData);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    // 组装电签设置
+                    Elements dqids = table.getElementsByAttribute("dqid");
+                    for (Element element : dqids) {
+                        String dqid = element.attr("dqid");
+                        Elements x11 = element.getElementsByAttribute("x1");
+                        if (x11 != null && x11.size() >= 1) {
+                            Element element1 = x11.get(x11.size() - 1);
+                            int x1 = Func.toInt(element1.attr("x1"));
+                            int y1 = Func.toInt(element1.attr("y1"));
+
+                            CellRange cellRange = sheet.getCellRange(y1, x1);
+                            if (cellRange != null) {
+                                // 创建字体
+                                cellRange.setText(dqid);
+                                cellRange.getCellStyle().getExcelFont().setSize(1);
+                                cellRange.getCellStyle().getExcelFont().setColor(Color.WHITE);
+                            }
+                        }
+                    }
+
+                    Long fileName = SnowFlakeUtil.getId();
+                    String onePdfPath = file_path + "/pdf//" + fileName + ".pdf";
+                    log.info("66666666666666666666666666666666"+onePdfPath);
+                    sheet.saveToPdf(onePdfPath);
+
+                    BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName + ".pdf", onePdfPath);
+                    log.info("7777777777777777777777777777777"+bladeFile);
+                    pdfUrls.add(bladeFile.getLink());
+                    wb.dispose();
+                }
+            }
+            if (pdfUrls.size() > 0) {
+                try {
+                    String mergePdfPath = file_path + "/pdf//" + SnowFlakeUtil.getId() + ".pdf";
+                    File oldMergePdf = ResourceUtil.getFile(mergePdfPath);
+                    if (oldMergePdf.exists()) {
+                        oldMergePdf.delete();
+                    }
+                    FileUtils.mergePdfPublicMethods(pdfUrls, mergePdfPath);
+                    log.info("mergePdfPath111111111111111111111111111111111:"+mergePdfPath);
+                    log.info("pdfUrls222222222222222222222222222222222222222"+pdfUrls+
+                            "55555555555555555555555555555555"+JSONObject.toJSONString(pdfUrls));
+                    BladeFile mergeFile = this.newIOSSClient.uploadFile(SnowFlakeUtil.getId() + new Date().getTime() + ".pdf", mergePdfPath);
+                    log.info("mergeFile3333333333333333333333333333333333333333333"+mergeFile
+                                    +"4444444444444444444444444444444444444444444444444444444444444444444444444444444444444"
+                    +JSONObject.toJSONString(mergeFile));
+                    //修改记录,当天的日志所有表的合并pdf都一样,即ids都修改成一样的
+                    this.contractLogClient.updateTheLogPdfUrlByIds(StringUtils.join(ids, ","), mergeFile.getLink());
+                    return R.data("成功");
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return R.fail("数据异常");
+                }
+            }
+        }
+        return R.data("成功");
+    }
+
+    private String getHtmlString(String pkeyId) throws Exception {
+        WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                .select(WbsTreePrivate::getHtmlUrl)
+                .eq(WbsTreePrivate::getPKeyId, pkeyId));
+        if (wbsTreePrivate == null || wbsTreePrivate.getHtmlUrl() == null) {
+            return "";
+        }
+        String fileUrl = wbsTreePrivate.getHtmlUrl();
+        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
+        String htmlString = IoUtil.readToString(fileInputStream);
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        Document doc = Jsoup.parse(htmlString);
+        return doc.select("table").first() + "";
+    }
+    public R<List<Map<String, Object>>> getTheLogBusinessData(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) {
+        List<Map<String, Object>> resultMapList = new ArrayList<>();
+        //数据结果
+        String logId2 = "";
+
+        //获取对应的记录
+        String dataIds;
+        if (StringUtils.isNotEmpty(theLogId)) {
+            String[] split = theLogId.split(",");
+            List<String> ids = new LinkedList<>();
+            for (String logId : split) {
+                ContractLog contractLog = 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);
+            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 = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodePrimaryKeyId));
+        WbsTreePrivate tableNode2 = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId, node.getProjectId()));
+
+
+        if (StringUtils.isNotEmpty(dataIds)) {
+            for (String dataId : dataIds.split(",")) {
+                Map<String, Object> reData = new HashMap<>();
+                reData.put("",logId2);
+                //检查实体表是否存在
+                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 = " + dataId + " and group_id = " + tableNode2.getPKeyId();
+
+                List<Map<String, Object>> businessDataMap = this.jdbcTemplate.queryForList(querySql);
+
+                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 dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
+                            Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
+                            Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
+                            sgtitle.addAll(sgtitle1);
+
+                            Elements htdtitle = doc.select("el-input[placeholder~=.*合同号.*]");
+                            Elements htdtitle1 = doc.select("el-input[placeholder~=合同段.*]");
+                            htdtitle.addAll(htdtitle1);
+
+                            Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
+
+                            Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+                            Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
+                            bhtitle.addAll(bhtitle1);
+
+
+                            Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
+
+
+                            /**
+                             * 承包单位 承包单位、施工单位:引用施工单位名称 ,
+                             * 监理单位:引用监理单位名称
+                             * 合同段、所属建设项目(合同段):引用合同段编号
+                             *
+                             * 施工单位:施工单位 和 安装单位
+                             *
+                             */
+                            ContractInfo contractInfo = contractInfoService.getById(contractId);
+                            // 施工单位名称
+                            if (dwtitle.size() >= 1) {
+                                int y = Integer.parseInt(dwtitle.attr("trindex"));
+                                if (y <= 10) {
+                                    reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                                }
+
+                            }
+                            if (sgtitle.size() >= 1) {
+                                int y = Integer.parseInt(sgtitle.attr("trindex"));
+                                if (y <= 10) {
+                                    reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                                }
+                            }
+
+                            // 合同段名称
+                            if (htdtitle.size() >= 1) {
+                                for (Element element : htdtitle) {
+                                    int trindex = Integer.parseInt(element.attr("trindex"));
+                                    if (trindex <= 8) {
+                                        reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                                    }
+                                }
+                            }
+                            // 监理单位名称
+                            if (jltitle.size() >= 1) {
+                                for (Element element : jltitle) {
+                                    int trindex = Integer.parseInt(element.attr("trindex"));
+                                    if (trindex <= 10) {
+                                        reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
+                                    }
+                                }
+                            }
+
+                            // 项目名称
+                            if (xmtitle.size() >= 1) {
+                                for (Element element : xmtitle) {
+                                    int trindex = Integer.parseInt(element.attr("trindex"));
+                                    if (trindex <= 6) {
+                                        ProjectInfo projectInfo = projectInfoService.getById(tableNode2.getProjectId());
+                                        reData.put(element.attr("keyName"), projectInfo.getProjectName());
+
+                                    }
+                                }
+                            }
+
+                            // 日期默认值
+                            Elements dateTitle = doc.select("el-date-picker[placeholder~=日期]");
+                            //日期默认
+                            if (dateTitle.size() >= 1) {
+                                for (Element element : dateTitle) {
+                                    int trindex = Integer.parseInt(element.attr("trindex"));
+                                    if (trindex <= 10) {
+                                        reData.put(element.attr("keyName"), recordTime);
+                                    }
+                                }
+                            }
+
+                            // 添加默认值
+                            Elements elements = doc.getElementsByAttribute("defText");
+                            if(Func.isNotEmpty(elements) && elements.size()>=1){
+                                for(Element eleme: elements){
+                                    String id = Func.isNull(eleme.attr("id"))?eleme.attr("keyname"):eleme.attr("id");
+                                    if(Func.isNotEmpty(id)){
+                                        reData.put(id, eleme.attr("defText"));
+                                    }
+                                }
+                            }
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    for (Map<String, Object> mysqlData : businessDataMap) {
+
+                        String querySqlx = "SELECT tree_primary_key_id as primaryKeyId,title as path from u_contract_log_wbs where  business_id ='" + dataId + "' and is_deleted = 0";
+                        List<Map<String, Object>> businessDat = this.jdbcTemplate.queryForList(querySqlx);
+                        reData.put("linkTabIds", businessDat);
+                        for (String key : mysqlData.keySet()) {
+                            String tabVal = mysqlData.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);
+                                        }
+                                        if(tabVal.contains("[")&&tabVal.contains("]")&&tabVal.indexOf(",")==-1){
+                                            String[]strings= new String[]{StringUtils.strip(tabData[0],"[]")};
+                                            reData.put(key+"__"+tabData[1],strings);
+                                        }
+                                        else {
+                                            reData.put(key + "__" + tabData[1], tabData[0]);
+                                        }
+                                    }
+                                } else {
+                                    reData.put(key, tabVal);
+                                }
+                            }
+                        }
+
+                        //移除id和p_key_id
+                        reData.remove("p_key_id");
+                        reData.remove("classify");
+                        reData.remove("contractId");
+                        reData.remove("pkeyId");
+                        reData.remove("projectId");
+
+                    }
+                    if (reData.size() > 0) {
+                        resultMapList.add(reData);
+                    }
+                } else {
+                    Map<String, Object> reData2 = new HashMap<>();
+                    //获取默认值
+
+                }
+            }
+        }else{
+            // 匹配关联
+            Map<String, Object> reData = new HashMap<>();
+            try {
+                if (tableNode2.getHtmlUrl()!=null) {
+                    InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(tableNode2.getHtmlUrl());
+                    String htmlString = IoUtil.readToString(inputStreamByUrl);
+                    Document doc = Jsoup.parse(htmlString);
+
+                    // 模糊匹配
+                    Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
+                    Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
+                    Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
+                    sgtitle.addAll(sgtitle1);
+
+                    Elements htdtitle = doc.select("el-input[placeholder~=.*合同号.*]");
+                    Elements htdtitle1 = doc.select("el-input[placeholder~=合同段.*]");
+                    htdtitle.addAll(htdtitle1);
+
+                    Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
+                    Elements jltit = doc.select("el-input[placeholder~=监理机构.*]");
+                    jltitle.addAll(jltit);
+
+                    Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+                    Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
+                    bhtitle.addAll(bhtitle1);
+
+
+                    Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
+
+                    // 日期默认值
+                    Elements dateTitle = doc.select("el-date-picker[placeholder~=日期]");
+
+
+                    /**
+                     * 承包单位 承包单位、施工单位:引用施工单位名称 ,
+                     * 监理单位:引用监理单位名称
+                     * 合同段、所属建设项目(合同段):引用合同段编号
+                     *
+                     * 施工单位:施工单位 和 安装单位
+                     *
+                     */
+                    ContractInfo contractInfo = contractInfoService.getById(contractId);
+                    // 施工单位名称
+                    if (dwtitle.size() >= 1) {
+                        int y = Integer.parseInt(dwtitle.attr("trindex"));
+                        if (y <= 10) {
+                            reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                        }
+
+                    }
+                    if (sgtitle.size() >= 1) {
+                        int y = Integer.parseInt(sgtitle.attr("trindex"));
+                        if (y <= 10) {
+                            reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                        }
+                    }
+
+                    // 合同段名称
+                    if (htdtitle.size() >= 1) {
+                        for (Element element : htdtitle) {
+                            int trindex = Integer.parseInt(element.attr("trindex"));
+                            if (trindex <= 8) {
+                                reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                            }
+                        }
+                    }
+                    // 监理单位名称
+                    if (jltitle.size() >= 1) {
+                        for (Element element : jltitle) {
+                            int trindex = Integer.parseInt(element.attr("trindex"));
+                            if (trindex <= 10) {
+
+                                reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
+                            }
+                        }
+                    }
+
+                    // 项目名称
+                    if (xmtitle.size() >= 1) {
+                        for (Element element : xmtitle) {
+                            int trindex = Integer.parseInt(element.attr("trindex"));
+                            if (trindex <= 6) {
+                                ProjectInfo projectInfo = projectInfoService.getById(tableNode2.getProjectId());
+                                reData.put(element.attr("keyName"), projectInfo.getProjectName());
+                            }
+                        }
+                    }
+
+                    //日期默认
+                    if (dateTitle.size() >= 1) {
+                        for (Element element : dateTitle) {
+                            int trindex = Integer.parseInt(element.attr("trindex"));
+                            if (trindex <= 10) {
+                                reData.put(element.attr("keyName"), recordTime);
+                            }
+                        }
+                    }
+
+
+                    // 添加默认值
+                    Elements elements = doc.getElementsByAttribute("defText");
+                    if(Func.isNotEmpty(elements) && elements.size()>=1){
+                        for(Element eleme: elements){
+                            String id = Func.isNull(eleme.attr("id"))?eleme.attr("keyname"):eleme.attr("id");
+                            if(Func.isNotEmpty(id)){
+                                reData.put(id, eleme.attr("defText"));
+                            }
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (reData.size() > 0) {
+                resultMapList.add(reData);
+            }
+        }
+        return R.data(resultMapList);
+    }
+
 }

+ 22 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -10,7 +10,11 @@ import lombok.AllArgsConstructor;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.node.ForestNodeMerger;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.entity.*;
+import org.springblade.manager.entity.ContractInfo;
+import org.springblade.manager.entity.ContractRelationJlyz;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.mapper.WbsTreeContractMapper;
 import org.springblade.manager.service.IContractInfoService;
 import org.springblade.manager.service.IWbsTreeContractService;
@@ -145,9 +149,21 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
 //        if (StringUtils.isNotEmpty(node.getPartitionCode())) {
             wrappers.set(WbsTreeContract::getPartitionCode, node.getPartitionCode());
 //        }
+        if(StringUtils.isNotEmpty(node.getClassName())){
+            wrappers.set(WbsTreeContract::getClassName,node.getClassName());
+            wrappers.set(WbsTreeContract::getUnitName,node.getUnitName());
+            wrappers.set(WbsTreeContract::getIsClassifition,node.getIsClassifition());
+        }
+        if(ObjectUtil.isNotEmpty(node.getExcellentNum())&&ObjectUtil.isNotEmpty(node.getUnitNum())){
+            wrappers.set(WbsTreeContract::getExcellentNum,node.getExcellentNum());
+            wrappers.set(WbsTreeContract::getUnitNum,node.getUnitNum());
+        }
         if (StringUtils.isNotEmpty(node.getSort()) && CommonUtil.checkBigDecimal(node.getSort())) {
             wrappers.set(WbsTreeContract::getSort, node.getSort());
         }
+        if(StringUtils.isNotEmpty(node.getDigitizeTime())){
+            wrappers.set(WbsTreeContract::getDigitizeTime,node.getDigitizeTime());
+        }
 
         return this.wbsTreeContractService.update(wrappers.eq(WbsTreeContract::getPKeyId, node.getPKeyId()));
     }
@@ -435,5 +451,11 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
         return list;
     }
 
+    @Override
+    public List<WbsTreeContractTreeVOS> selectContractJLForm(List<Long> removeList) {
+        List<WbsTreeContractTreeVOS> vos =wbsTreeContractMapper.selectContractJLForm(removeList);
+        return vos;
+    }
+
 
 }

+ 3 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorInit.java

@@ -82,8 +82,10 @@ public class ExecutorInit extends FormulaExecutor {
     }
     private MeterPeriodInfo addPeriodInfo(){
         /*加载合同材料、材料清单*/
-        tec.meterInfo.setMaterialsAll(materialFormFc.apply(tec.getContractId()));
+       /* tec.meterInfo.setMaterialsAll(materialFormFc.apply(tec.getContractId())); 中期计量支取关联的部分*/
         if(MeterType.MATERIAL.equals(tec.getMeterType())||MeterType.START.equals(tec.getMeterType())||MeterType.START_JL.equals(tec.getMeterType())){
+            /*加载合同材料、材料清单*/
+            tec.meterInfo.setMaterialsAll(materialFormFc.apply(tec.getContractId()));
             /*加载计量期信息*/
             tec.periodInfo=meterPeriodFc.apply(tec.getReportId());
         }else if(MeterType.INTERIM.equals(tec.getMeterType())||MeterType.INTERIM_JL.equals(tec.getMeterType())){

+ 101 - 22
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -249,6 +249,8 @@ public class ExecutorMeter extends FormulaExecutor {
             this.specialList.add(new InterimSum());
             /*分项工程中期支付汇总*/
             /*this.specialList.add(new SubIMeterPaySw());*/
+            /*材料回扣款预览版*/
+            this.specialList.add(new MaterialWithheldSp());
             this.specialList.add(new SubIPaySum());
             this.specialList.add(new SubIPaySumSw());
             /*施工进度表*/
@@ -1156,7 +1158,10 @@ public class ExecutorMeter extends FormulaExecutor {
                      addGetSetConfig(hj,InterimPaymentCertificate::getCurrentPeriodPay,hj::setCurrentPeriodPay);
                      payItemZj.add(hj);
                      payItemZj.add(new InterimPaymentCertificate("索赔金额",MINUS_ONE));
-                     payItemZj.add(new InterimPaymentCertificate("违约罚金",MINUS_ONE));
+                     InterimPaymentCertificate wyje = new InterimPaymentCertificate("违约罚金",MINUS_ONE);
+                     wyje.setNoApply(1);
+                     payItemZj.add(wyje);
+                    // payItemZj.add(new InterimPaymentCertificate("违约罚金",MINUS_ONE));
                      payItemZj.add(new InterimPaymentCertificate("迟付款利息"));
                      InterimPaymentCertificate startPay =new InterimPaymentCertificate("动员预付款");
                      /*startPay.setContractAmount(StringUtils.handleNull(tec.meterInfo.getBaseInfo().getDyTotalAmount()));*/
@@ -1208,9 +1213,15 @@ public class ExecutorMeter extends FormulaExecutor {
                      /*材料预付款关联*/
                      clsbdfk.setCurrentPeriodPay(materialSum);
                      payItemZj.add(clsbdfk);
-                     payItemZj.add(new InterimPaymentCertificate("扣回材料预付款"));
+
+                     // 扣回材料预付款
+                     InterimPaymentCertificate paymentCer = new InterimPaymentCertificate("扣回材料预付款",MINUS_ONE);
+                     paymentCer.setNoApply(1);
+                     payItemZj.add(paymentCer);
+
                       blj=new InterimPaymentCertificate("保留金",MINUS_ONE);
                      payItemZj.add(blj);
+
                      InterimPaymentCertificate thblj=new InterimPaymentCertificate("返回保留金");
                      thblj.setNoApply(1);
                      payItemZj.add(thblj);
@@ -1297,12 +1308,24 @@ public class ExecutorMeter extends FormulaExecutor {
                              certificate.setCurrentPeriodEndPay(rebateIncentiveAdvPay.getEndPay());
                              certificate.setCurrentPeriodPay(rebateIncentiveAdvPay.getCurrentPay());
                              certificate.setPreviousPeriodEndPay(rebateIncentiveAdvPay.getPreviousPay());
+                         }else if("违约罚金".equals(certificate.getChapterSeq())){
+                             certificate.setCurrentPeriodPay(ic.getCurrentPeriodPay());
+                             ic.setPreviousPeriodEndPay(icPre.getCurrentPeriodEndPay());
+                             ic.setCurrentPeriodEndPay(addFc.apply(ic.getCurrentPeriodPay(),ic.getPreviousPeriodEndPay()));
+                             certificate.setPreviousPeriodEndPay(ic.getPreviousPeriodEndPay());
+                             certificate.setCurrentPeriodEndPay(ic.getCurrentPeriodEndPay());
                          }else if("返回保留金".equals(certificate.getChapterSeq())){
                              certificate.setCurrentPeriodPay(ic.getCurrentPeriodPay());
                              ic.setPreviousPeriodEndPay(icPre.getCurrentPeriodEndPay());
                              ic.setCurrentPeriodEndPay(addFc.apply(ic.getCurrentPeriodPay(),ic.getPreviousPeriodEndPay()));
                              certificate.setPreviousPeriodEndPay(ic.getPreviousPeriodEndPay());
                              certificate.setCurrentPeriodEndPay(ic.getCurrentPeriodEndPay());
+                         }else if("扣回材料预付款".equals(certificate.getChapterSeq())){
+                             certificate.setCurrentPeriodPay(ic.getCurrentPeriodPay());
+                             ic.setPreviousPeriodEndPay(icPre.getCurrentPeriodEndPay());
+                             ic.setCurrentPeriodEndPay(addFc.apply(ic.getCurrentPeriodPay(),ic.getPreviousPeriodEndPay()));
+                             certificate.setPreviousPeriodEndPay(ic.getPreviousPeriodEndPay());
+                             certificate.setCurrentPeriodEndPay(ic.getCurrentPeriodEndPay());
                          }
                          BeanUtils.copyProperties(certificate,ic);
                          /*同时兼容几个表后,支付章名称和章节号有点混乱,需要注意纠正*/
@@ -1318,6 +1341,7 @@ public class ExecutorMeter extends FormulaExecutor {
                      /*分行合计列,合计的时候需要计入手填部分*/
                      fieldGetSet(x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
                      InterimPaymentCertificate finalBlj = blj;
+                     final  InterimPayCertificateItem preBlj=previousMap.get("保留金");
                      dataList.stream().filter(e-> "合计".equals(e.getChapterSeq())).findFirst().ifPresent(t->{
                          AtomicReference<String> currentPay= new AtomicReference<>("0");
                          AtomicReference<String> previousPay= new AtomicReference<>("0");
@@ -1331,7 +1355,11 @@ public class ExecutorMeter extends FormulaExecutor {
                          currentPay.set(addFc.apply(t.getCurrentPeriodPay(), String.valueOf(currentPay.get())));
                          previousPay.set(addFc.apply(t.getPreviousPeriodEndPay(), String.valueOf(previousPay.get())));
                          finalBlj.setCurrentPeriodPay(StringUtils.number2String(multiFc.apply(currentPay.get(),"0.1"),0));
-                         if(BaseUtils.obj2DoubleZero(t.getPreviousPeriodEndPay())>0) {
+                         if(preBlj!=null&&BaseUtils.obj2DoubleZero(preBlj.getCurrentPeriodEndPay())>0){
+                             /*如果上期存在保留金,且保留金的累计值大于零,则直接用来设置成本期保留金的上期末累计*/
+                             finalBlj.setPreviousPeriodEndPay(preBlj.getCurrentPeriodEndPay());
+                         }else if(BaseUtils.obj2DoubleZero(t.getPreviousPeriodEndPay())>0) {
+                             /*存在材料调差,需要获直接取上一期末支付,而不是简单的比例相乘*/
                              finalBlj.setPreviousPeriodEndPay(StringUtils.number2String(multiFc.apply(previousPay.get(), "0.1"),0));
                          }
                          finalBlj.setCurrentPeriodEndPay(addFc.apply(finalBlj.getCurrentPeriodPay(),finalBlj.getPreviousPeriodEndPay()));
@@ -1449,6 +1477,40 @@ public class ExecutorMeter extends FormulaExecutor {
         @Override
         public void parse() {
             builderFormDatas(MaterialWithheld.class);
+            MaterialWithheld mw = new MaterialWithheld();
+
+            mw.setYear(tec.periodInfo.getYear());
+            mw.setMonth(tec.periodInfo.getMonth());
+            /*获取已经计算完成的支付项目信息*/
+            LinkedHashMap<String,InterimPayCertificateItem> itemPaysGroup = tec.meterInfo.getInterimPayCertificateItemGroup().getOrDefault(tec.periodInfo.getReportId(),new LinkedHashMap<>());
+            InterimPayCertificateItem clyfk =itemPaysGroup.get("材料预付款");
+            /*累计*/
+            mw.setCurPeriodEndPayMt(clyfk.getCurrentPeriodEndPay());
+            mw.setCurPeriodEndPayEi("");
+            mw.setCurPeriodEndPaySum(addFc.apply(mw.getCurPeriodEndPayMt(),mw.getCurPeriodEndPayEi()));
+            /*本期*/
+            mw.setCurPeriodPayMt(clyfk.getCurrentPeriodPay());
+            mw.setCurPeriodPayEi("0");
+            mw.setCurPeriodPaySum(addFc.apply(mw.getCurPeriodPayMt(),mw.getCurPeriodPayEi()));
+
+
+            InterimPayCertificateItem kh =itemPaysGroup.get("扣回材料预付款");
+            /*回扣本期累计*/
+            mw.setCurPeriodEndBackMt(kh.getCurrentPeriodEndPay());
+            mw.setCurPeriodEndBackEi("0");
+            mw.setCurPeriodEndBackSum(addFc.apply(mw.getCurPeriodEndBackMt(),mw.getCurPeriodEndBackEi()));
+            /*回扣上期累计*/
+            mw.setPrePeriodEndBackMt(kh.getPreviousPeriodEndPay());
+            mw.setPrePeriodEndBackEi("0");
+            mw.setPrePeriodEndBackSum(addFc.apply(mw.getPrePeriodEndBackMt(),mw.getPrePeriodEndBackEi()));
+            /*回扣笨球*/
+            mw.setCurPeriodBackMt(kh.getCurrentPeriodPay());
+            mw.setCurPeriodBackEi("0");
+            mw.setCurPeriodBackSum(addFc.apply(mw.getCurPeriodBackMt(),mw.getCurPeriodBackEi()));
+            if(!BaseUtils.isZero(mw.getCurPeriodEndPaySum())||!BaseUtils.isZero(mw.getCurPeriodEndBackSum())) {
+                /*任意累积和不为零才显示*/
+                dataList.add(mw);
+            }
             if(dataList.size()>0){
                 putOut();
             }
@@ -1639,22 +1701,38 @@ public class ExecutorMeter extends FormulaExecutor {
                 sis.setContractMoney(itf.getContractMoney());
                 sis.setChangeMoney(itf.getChangeMoney());
                 sis.setPrice(itf.getBidPrice());
-                if(cur!=null&&cur.getContractMoney()!=null) {
-                    FormulaUtils.getScale(cur.getUnit()).ifPresent(scale->{
-                        cur.setCompleted(BaseUtils.str2BigDecimal(cur.getCompleted()).setScale(scale,RoundingMode.HALF_UP));
-                        cur.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(cur.getPrice(),cur.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
-                        if (pre != null) {
-                            pre.setCompleted(BaseUtils.str2BigDecimal(pre.getCompleted()).setScale(scale,RoundingMode.HALF_UP));
-                            pre.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(pre.getPrice(),pre.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
-                            end.setCompleted(BaseUtils.str2BigDecimal(addFc.apply(cur.getCompleted().toString(),pre.getCompleted().toString())).setScale(scale,RoundingMode.HALF_UP));
-                            end.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(end.getPrice(),end.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
-                        }else {
-                            end.setCompleted(cur.getCompleted());
-                            end.setMoney(cur.getMoney());
-                        }
-                    });
-                    sis.setCurrentPeriodPay(cur.getMoney().toPlainString());
-                    sis.setCurrentPeriodCompleted(cur.getCompleted().toPlainString());
+                /*只要存在累计就显示*/
+                if(end!=null&&end.getContractMoney()!=null) {
+                    if(cur!=null) {
+                        /*根据单位保留小数位,同时对总金额进行取整*/
+                        FormulaUtils.getScale(cur.getUnit()).ifPresent(scale -> {
+                            cur.setCompleted(BaseUtils.str2BigDecimal(cur.getCompleted()).setScale(scale, RoundingMode.HALF_UP));
+                            cur.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(cur.getPrice(), cur.getCompleted().toString())).setScale(0, RoundingMode.HALF_UP));
+                            if (pre != null) {
+                                pre.setCompleted(BaseUtils.str2BigDecimal(pre.getCompleted()).setScale(scale, RoundingMode.HALF_UP));
+                                pre.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(pre.getPrice(), pre.getCompleted().toString())).setScale(0, RoundingMode.HALF_UP));
+                                end.setCompleted(BaseUtils.str2BigDecimal(addFc.apply(cur.getCompleted().toString(), pre.getCompleted().toString())).setScale(scale, RoundingMode.HALF_UP));
+                                end.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(end.getPrice(), end.getCompleted().toString())).setScale(0, RoundingMode.HALF_UP));
+                            } else {
+                                end.setCompleted(cur.getCompleted());
+                                end.setMoney(cur.getMoney());
+                            }
+                        });
+
+                    }else{
+                        /*根据单位保留小数位,同时对总金额进行取整*/
+                        FormulaUtils.getScale(pre.getUnit()).ifPresent(scale -> {
+                            pre.setCompleted(BaseUtils.str2BigDecimal(pre.getCompleted()).setScale(scale, RoundingMode.HALF_UP));
+                            pre.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(pre.getPrice(), pre.getCompleted().toString())).setScale(0, RoundingMode.HALF_UP));
+                            end.setCompleted(pre.getCompleted());
+                            end.setMoney(pre.getMoney());
+                        });
+
+                    }
+                    if(cur!=null) {
+                        sis.setCurrentPeriodPay(cur.getMoney().toPlainString());
+                        sis.setCurrentPeriodCompleted(cur.getCompleted().toPlainString());
+                    }
                     if (pre != null) {
                         sis.setPreviousPeriodPay(pre.getMoney().toPlainString());
                         sis.setPreviousPeriodCompleted(pre.getCompleted().toPlainString());
@@ -1810,7 +1888,7 @@ public class ExecutorMeter extends FormulaExecutor {
                 cs.setChapterNumber(k);
                 cs.setContractMoney(sum[0].toPlainString());
                 cs.setChangeMoney(sum[1].toPlainString());
-                cs.setCurrentPeriodPay(StringUtils.handleNull(currentMoney.get(k)));
+                cs.setCurrentPeriodPay(StringUtils.handleNumNull(currentMoney.get(k)));
                 cs.setCurrentPeriodEndPay(StringUtils.handleNull(endMoney.get(k)));
                 cs.setItemPercent(ratioFc.apply(cs.getChangeMoney(), baseInfo.getContractAmount().toString()));
                 cs.setItemProgress(ratioFc.apply(cs.getCurrentPeriodEndPay(), cs.getChangeMoney()));
@@ -1934,8 +2012,9 @@ public class ExecutorMeter extends FormulaExecutor {
                 /*延长时间*/
                 int extended=BaseUtils.obj2IntegerZero(totalDay)-BaseUtils.obj2IntegerZero(contractDay);
                 /*已过去*/
-                String passDay=CustomFunction.join(CustomFunction.daysPassed(baseInfo.getStartDate(), LocalDate.now()),"").toString();
-
+                /*String passDay=CustomFunction.join(CustomFunction.daysPassed(baseInfo.getStartDate(), LocalDate.now()),"").toString();改为过去时间=计量期结束日期-开工日期 20241101 王博念提需求*/
+                LocalDate ld =tec.periodInfo.getEndDate().plusDays(1);
+                String passDay=CustomFunction.join(CustomFunction.daysPassed(baseInfo.getStartDate(), ld),"").toString();
                 String provisionalSum=tec.meterInfo.getBaseInfo().getProvisionalSum();
                 String BOQAmount=tec.meterInfo.getBaseInfo().getBOQAmount();
                 BigDecimal contractTotal=tec.meterInfo.getInventoryForms().stream().map(e->BaseUtils.str2BigDecimal(e.getContractMoney())).reduce(BigDecimal.ZERO,BigDecimal::add);

+ 8 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaTurnPoint.java

@@ -141,14 +141,15 @@ public class FormulaTurnPoint implements FormulaStrategy {
                 Map<String, Object> tmp = new HashMap<>(16);
                 KEYS.forEach(k -> {
                     ElementData ed = map.get(c(k,args));
-                    tmp.put(configMap.get(k), ed.stringValue());
-                    /*V判断*/
-                    if (CD.equals(k)) {
-                        Long pkeyId = tableInfoIds.get(ed.getIndex());
-                        String findStr = "OP['" + cur.getTableName() + "']['" + pkeyId + "@" + cur.getKey() + "__" + ed.getY() + "_" + ed.getX() + "']['TF']";
-                        tmp.put("vertical", StringUtils.handleNull(Expression.parse(findStr).calculate(tec.getConstantMap())));
+                    if(ed!=null){
+                        tmp.put(configMap.get(k), ed.stringValue());
+                        /*V判断*/
+                        if (CD.equals(k)) {
+                            Long pkeyId = tableInfoIds.get(ed.getIndex());
+                            String findStr = "OP['" + cur.getTableName() + "']['" + pkeyId + "@" + cur.getKey() + "__" + ed.getY() + "_" + ed.getX() + "']['TF']";
+                            tmp.put("vertical", StringUtils.handleNull(Expression.parse(findStr).calculate(tec.getConstantMap())));
+                        }
                     }
-
                 });
                 tableData.add(tmp);
         }

+ 118 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaZhiZuo.java

@@ -0,0 +1,118 @@
+package org.springblade.manager.formula.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.mixsmart.utils.StringUtils;
+import lombok.Data;
+import org.springblade.manager.bean.TableInfo;
+import org.springblade.manager.dto.ElementData;
+import org.springblade.manager.dto.FormData;
+import org.springblade.manager.entity.Formula;
+import org.springblade.manager.formula.FormulaStrategy;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
+@Component
+@Data
+public class FormulaZhiZuo implements FormulaStrategy {
+    @Override
+    public void execute(FormData cur, TableElementConverter tec) {
+        String key = cur.getFormula().getRely().substring(cur.getFormula().getRely().indexOf(':') + 1);
+        String s = tec.getTableInfoList().get(0).getDataMap().get(key);
+        String[] strings = s.split("☆");
+        Map<Integer, Double> list = new HashMap<>();
+        for (int i = 0; i < strings.length; i++) {
+            String pattern = "_\\^_(.*?)_";
+            java.util.regex.Pattern r = java.util.regex.Pattern.compile(pattern);
+            java.util.regex.Matcher m = r.matcher(strings[i]);
+            if (m.find()) {
+                // 获取匹配的值
+                Integer mapkey = Integer.parseInt(m.group(1));
+                Double v = Double.valueOf(strings[i].substring(0, strings[i].indexOf("_^_")));
+                list.put(mapkey, v);
+            }
+        }
+        List<ElementData> values = cur.getValues();
+        values.forEach(e->e.setValue(null));
+        TreeMap<Integer, Double> map = new TreeMap<>(list);
+        Map.Entry<Integer, Double> firstEntry = map.firstEntry();
+        Double first = firstEntry.getValue();
+        Double second;
+        Double threed;
+        for (int i = 0; i < map.size(); i++) {
+            if(i>=4){
+                break;
+            }
+            Double v = map.get(firstEntry.getKey() + i + 1);
+            if (ObjectUtil.isNotEmpty(v)) {
+                Double value = first - v;
+                if(value<0){
+                    value=Math.abs(value);
+                }
+                for (int j = i; j < values.size(); j++) {
+                    if(values.get(j).getY()==firstEntry.getKey() + i + 1){
+                        values.get(j).setValue(value);
+                        break;
+                    }
+                }
+            }
+        }
+        if (map.size() >= 5) {
+            Integer key1 = firstEntry.getKey() + 5;
+            second = map.get(key1);
+            if (ObjectUtil.isNotEmpty(second)) {
+                for (int i = 5; i < map.size(); i++) {
+                    if(i>=9){
+                        break;
+                    }
+                    Double v = map.get(key1 + i -4);
+                    if (ObjectUtil.isNotEmpty(v)) {
+                        Double value = second - v;
+                        if(value<0){
+                            value=Math.abs(value);
+                        }
+                        for (int j = i; j < values.size(); j++) {
+                            if(values.get(j).getY()==key1 + i -4){
+                                values.get(j).setValue(value);
+                                break;
+                            }
+                        }
+                    }
+                }
+
+            }
+        }
+        if (map.size() >= 10) {
+            Integer key2 = firstEntry.getKey() + 10;
+            threed = map.get(key2);
+            if (ObjectUtil.isNotEmpty(threed)) {
+                for (int i = 10; i < map.size(); i++) {
+                    Double v = map.get(key2 + i -9);
+                    if (ObjectUtil.isNotEmpty(v)) {
+                        Double value = threed - v;
+                        if(value<0){
+                            value=Math.abs(value);
+                        }
+                        for (int j = i; j < values.size(); j++) {
+                            if(values.get(j).getY()==key2 + i -9){
+                                values.get(j).setValue(value);
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+
+        }
+        System.out.println(values);
+    }
+
+    @Override
+    public boolean accept(FormData fd) {
+        if (!fd.verify()) {
+            return false;
+        }
+        Formula f = fd.getFormula();
+        return "ZHIZUO".equals(f.getNumber());
+    }
+}

+ 10 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFileMapper.xml

@@ -26,6 +26,8 @@
         <result column="is_register" property="isRegister"/>
         <result column="project_contract_role" property="projectContractRole"/>
         <result column="pfx_type" property="pfxType"/>
+        <result column="wide" property="wide"/>
+        <result column="high" property="high"/>
     </resultMap>
 
     <select id="queryPersonalOrEnterpriseCount" resultType="java.lang.Integer">
@@ -104,6 +106,14 @@
         <if test="vo.certificateUserName != null">
             and (spf.certificate_user_name like concat('%',#{vo.certificateUserName},'%') or spf.certificate_id like concat('%',#{vo.certificateUserName},'%') )
         </if>
+        <if test="vo.certificateType !=null">
+             <if test="vo.certificateType==2">
+                 and spf.certificate_type in (2,3)
+             </if>
+            <if test="vo.certificateType!=2">
+                and spf.certificate_type=#{vo.certificateType}
+            </if>
+        </if>
         order by spf.create_time DESC limit #{current},#{size}
     </select>
 

+ 25 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFilePreMapper.java

@@ -0,0 +1,25 @@
+package org.springblade.manager.mapper;
+
+import org.springblade.manager.entity.SignPfxFilePre;
+
+/**
+* @author 17617
+* @description 针对表【m_sign_pfx_file_pre】的数据库操作Mapper
+* @createDate 2024-09-30 16:04:50
+* @Entity org.springblade.manager.entity.SignPfxFilePre
+*/
+public interface SignPfxFilePreMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(SignPfxFilePre record);
+
+    int insertSelective(SignPfxFilePre record);
+
+    SignPfxFilePre selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(SignPfxFilePre record);
+
+    int updateByPrimaryKey(SignPfxFilePre record);
+
+}

+ 75 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignPfxFilePreMapper.xml

@@ -0,0 +1,75 @@
+<?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.SignPfxFilePreMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.manager.entity.SignPfxFilePre">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="signaturePngUrl" column="signature_png_url" jdbcType="VARCHAR"/>
+            <result property="wide" column="wide" jdbcType="DOUBLE"/>
+            <result property="high" column="high" jdbcType="DOUBLE"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,signature_png_url,wide,
+        high
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from m_sign_pfx_file_pre
+        where  id = #{id,jdbcType=BIGINT} 
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from m_sign_pfx_file_pre
+        where  id = #{id,jdbcType=BIGINT} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="org.springblade.manager.entity.SignPfxFilePre" useGeneratedKeys="true">
+        insert into m_sign_pfx_file_pre
+        ( id,signature_png_url,wide
+        ,high)
+        values (#{id,jdbcType=BIGINT},#{signaturePngUrl,jdbcType=VARCHAR},#{wide,jdbcType=DOUBLE}
+        ,#{high,jdbcType=DOUBLE})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="org.springblade.manager.entity.SignPfxFilePre" useGeneratedKeys="true">
+        insert into m_sign_pfx_file_pre
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="signaturePngUrl != null">signature_png_url,</if>
+                <if test="wide != null">wide,</if>
+                <if test="high != null">high,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=BIGINT},</if>
+                <if test="signaturePngUrl != null">#{signaturePngUrl,jdbcType=VARCHAR},</if>
+                <if test="wide != null">#{wide,jdbcType=DOUBLE},</if>
+                <if test="high != null">#{high,jdbcType=DOUBLE},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="org.springblade.manager.entity.SignPfxFilePre">
+        update m_sign_pfx_file_pre
+        <set>
+                <if test="signaturePngUrl != null">
+                    signature_png_url = #{signaturePngUrl,jdbcType=VARCHAR},
+                </if>
+                <if test="wide != null">
+                    wide = #{wide,jdbcType=DOUBLE},
+                </if>
+                <if test="high != null">
+                    high = #{high,jdbcType=DOUBLE},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="org.springblade.manager.entity.SignPfxFilePre">
+        update m_sign_pfx_file_pre
+        set 
+            signature_png_url =  #{signaturePngUrl,jdbcType=VARCHAR},
+            wide =  #{wide,jdbcType=DOUBLE},
+            high =  #{high,jdbcType=DOUBLE}
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
+</mapper>

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

@@ -49,4 +49,6 @@ public interface TableFileMapper extends BaseMapper<TableFile> {
     void delDataById(String id, Long recordId);
 
     List<TableFile> getAllFileByIds(@Param("ids") List<Long> ids,@Param("classify") Integer classify);
+
+    List<TableFileVO> selectTableFileList1(String pKid);
 }

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

@@ -51,6 +51,10 @@
     </delete>
 
     <select id="selectTableFileListByTen" resultMap="TableFileVO">
-        select *,domain_url as url from m_table_file where is_deleted = 0  and classify = #{classify} and type in (10,11,12) and tab_id = #{pKid}
+        select *,domain_url as url from m_table_file where is_deleted = 0  and classify = #{classify} and type in (10,11,12,20,21,22) and tab_id = #{pKid}
+    </select>
+
+    <select id="selectTableFileList1" resultMap="TableFileVO">
+        select *,domain_url as url from m_table_file where is_deleted = 0 and (type=20 or type=21 or type=22) and tab_id = #{pKid}
     </select>
 </mapper>

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

@@ -1,6 +1,5 @@
 package org.springblade.manager.mapper;
 
-import org.apache.ibatis.annotations.CacheNamespace;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.manager.entity.*;
@@ -114,4 +113,10 @@ public interface WbsTreeContractMapper extends EasyBaseMapper<WbsTreeContract> {
     List<APIWbsContractNodeHzrcVo> apiTreeNodeHzrc(@Param("contractId") String contractId,@Param("classType") Integer classType);
 
     List<ArchiveSyncWbsVO> getContractAllNode(@Param("contractId") Long contractId);
+
+    List<WbsTreeContract> projectAllTable(@Param("projectId") Long projectId);
+
+    void batchUpdateTable(@Param("list") List<String> list);
+
+    List<WbsTreeContractTreeVOS> selectContractJLForm(List<Long> removeList);
 }

+ 19 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -216,10 +216,12 @@
     <update id="updateByCondition1">
         UPDATE m_wbs_tree_contract
         SET node_type = #{wbsTP.nodeType}
+        <if test="wbsTP.isClassifition!=null and wbsTP.isClassifition!='' and wbsTP.isClassifition=1">
+        ,is_classifition=#{wbsTP.isClassifition},class_name=#{wbsTP.className},unit_name=#{wbsTP.unitName}
+        </if>
         WHERE project_id = #{wbsTP.projectId}
           AND is_type_private_pid = #{wbsTP.pKeyId}
     </update>
-
     <update id="updateByCondition2">
         UPDATE m_wbs_tree_contract
         SET is_deleted = 0
@@ -761,6 +763,11 @@
             where p_key_id = #{key}
         </foreach>
     </update>
+    <update id="batchUpdateTable">
+        <foreach item="item" collection="list" separator=";">
+            ${item}
+        </foreach>
+    </update>
 
     <select id="selectQueryValueLikeNodeName" resultMap="ResultMap">
         select *
@@ -868,4 +875,15 @@
         from m_wbs_tree_contract where contract_id = #{contractId} and type = 1 and is_deleted = 0
         ORDER BY sort,create_time
     </select>
+    <select id="projectAllTable" resultType="org.springblade.manager.entity.WbsTreeContract">
+        select p_key_id,init_table_name
+        from m_wbs_tree_contract where project_id = #{projectId} and type = 2 and is_deleted = 0
+    </select>
+    <select id="selectContractJLForm" resultType="org.springblade.manager.vo.WbsTreeContractTreeVOS">
+        select id from m_wbs_tree_contract where p_key_id in (
+            <foreach collection="list" item="pkeyId" separator=",">
+                #{pkeyId}
+            </foreach>
+            ) and pdf_url is not null and pdf_url != '' and (table_owner = 4 or table_owner = 5 or table_owner = 6) and is_deleted = 0
+    </select>
 </mapper>

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

@@ -205,6 +205,11 @@
             is_add_conceal     = #{wbsTP.isAddConceal},
             status             = 1,
             is_deleted         = 0
+            <if test="wbsTP.className!=null and wbsTP.className!=''">
+                ,class_name         =#{wbsTP.className},
+                unit_name          =#{wbsTP.unitName},
+                is_classifition    =#{wbsTP.isClassifition}
+            </if>
         where p_key_id = #{pKeyId}
     </update>
 

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

@@ -96,5 +96,8 @@ public interface IFormulaService extends BaseService<Formula> {
     R<Object>formulasForNode(Long pkeyId,String tableName,String elementName);
     /**获取当前节点的所有元素单元格坐标,可以按表和元素名筛选*/
     R<Object>analyzeForm(Long pkeyId,String elementName,Integer type);
+    /** 节点同步工序资料*/
+    R<Object> syncWorkDate(@NotNull(message = "节点ID不能为空") Long nodeId);
+
 
 }

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

@@ -0,0 +1,12 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.manager.vo.SignPfxFilePreVo;
+
+import java.io.IOException;
+
+public interface ISignPfxFilePreService {
+    R picPresave(SignPfxFilePreVo signPfxFilePreVo) throws IOException;
+
+    R prePicture(SignPfxFilePreVo signPfxFilePreVo) throws Exception;
+}

Деякі файли не було показано, через те що забагато файлів було змінено