Преглед изворни кода

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

yangyj пре 2 година
родитељ
комит
d53f71e163
100 измењених фајлова са 4315 додато и 785 уклоњено
  1. 4 3
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/NewIOSSClient.java
  2. 13 6
      blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/NewIOSSClientImpl.java
  3. 29 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialMaterialMobilizationDTO.java
  4. 25 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSampleInfoDTO.java
  5. 39 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialDeviceClassification.java
  6. 135 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialDeviceInfo.java
  7. 137 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialMaterialMobilization.java
  8. 138 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSampleInfo.java
  9. 29 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSamplingRecord.java
  10. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  11. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/QueryProcessDataVO.java
  12. 61 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDeviceInfoVO.java
  13. 47 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialMaterialMobilizationVO.java
  14. 44 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleInfoVO.java
  15. 51 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSamplingRecordVO.java
  16. 23 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialDeviceInfoWarpper.java
  17. 19 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialMaterialMobilizationWarpper.java
  18. 22 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialSampleInfoWarpper.java
  19. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ProjectInfo.java
  20. 50 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TrialClassificationConfiguration.java
  21. 27 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TrialSummaryClassificationConfiguration.java
  22. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTree.java
  23. 11 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreeContract.java
  24. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsTreePrivate.java
  25. 7 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ProjectInfoVO.java
  26. 24 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialClassificationConfigurationTree.java
  27. 18 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialClassificationConfigurationTreeVO.java
  28. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java
  29. 5 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO.java
  30. 5 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeVO.java
  31. 8 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java
  32. 21 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserContractInfoVO.java
  33. 5 0
      blade-service/blade-business/pom.xml
  34. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ArchiveFileController.java
  35. 6 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ImageClassificationFileController.java
  36. 40 5
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  37. 31 24
      blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java
  38. 4 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java
  39. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TreeContractFirstController.java
  40. 55 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDeviceClassificationController.java
  41. 84 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDeviceInfoController.java
  42. 173 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialMaterialController.java
  43. 70 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialDeviceInfoExcel.java
  44. 75 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialMaterialMobilizationExcel.java
  45. 21 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialMaterialMobilizationImporter.java
  46. 75 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialSampleInfoExcel.java
  47. 21 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialSampleInfoImporter.java
  48. 36 7
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  49. 5 3
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.xml
  50. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceClassificationMapper.java
  51. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceClassificationMapper.xml
  52. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceInfoMapper.java
  53. 35 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceInfoMapper.xml
  54. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialMaterialMobilizationMapper.java
  55. 42 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialMaterialMobilizationMapper.xml
  56. 8 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.java
  57. 36 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml
  58. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSamplingRecordMapper.java
  59. 31 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSamplingRecordMapper.xml
  60. 16 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialDeviceClassificationService.java
  61. 24 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialDeviceInfoService.java
  62. 35 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialMaterialMobilizationService.java
  63. 29 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSampleInfoService.java
  64. 7 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSamplingRecordService.java
  65. 7 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  66. 33 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDeviceClassificationServiceImpl.java
  67. 273 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDeviceInfoServiceImpl.java
  68. 352 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java
  69. 330 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java
  70. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSamplingRecordServiceImpl.java
  71. 93 0
      blade-service/blade-business/src/main/java/org/springblade/business/utils/PDFUtil.java
  72. 48 0
      blade-service/blade-business/src/main/java/org/springblade/business/utils/SystemUtils.java
  73. 0 1
      blade-service/blade-business/src/main/resources/application-dev.yml
  74. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  75. 38 16
      blade-service/blade-manager/pom.xml
  76. 3 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeController.java
  77. 27 14
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ContractInfoController.java
  78. 538 143
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  79. 155 388
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExpaileHtml.java
  80. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java
  81. 2 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/LinkdataInfoController.java
  82. 8 15
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java
  83. 12 9
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java
  84. 22 13
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java
  85. 64 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TrialClassificationConfigurationController.java
  86. 58 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TrialSummaryClassificationConfigurationController.java
  87. 5 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsFormElementController.java
  88. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsInfoController.java
  89. 9 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java
  90. 9 9
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java
  91. 63 26
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  92. 0 81
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/WbsExcelUtil.java
  93. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/SignPfxClientImpl.java
  94. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.java
  95. 10 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml
  96. 3 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ProjectInfoMapper.xml
  97. 13 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialClassificationConfigurationMapper.java
  98. 25 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialClassificationConfigurationMapper.xml
  99. 13 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialSummaryClassificationConfigurationMapper.java
  100. 24 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialSummaryClassificationConfigurationMapper.xml

+ 4 - 3
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/NewIOSSClient.java

@@ -9,9 +9,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
 @FeignClient(value = AppConstant.APPLICATION_RESOURCE_NAME)
 public interface NewIOSSClient {
 
@@ -19,6 +16,7 @@ public interface NewIOSSClient {
     String UPLOAD_FILE_INFO = API_PREFIX + "/uploadFileInfo";
     String UPLOAD_FILE_INFO_BYTE = API_PREFIX + "/uploadFileInfoByte";
     String UPLOAD_FILE_INFO_INPUT_STREAM = API_PREFIX + "/uploadFileInfoInputStream";
+    String REMOVE_PDF_FILE = API_PREFIX + "/remove-file";
 
     @PostMapping(value = UPLOAD_FILE_INFO_INPUT_STREAM, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     BladeFile uploadFileByInputStream(MultipartFile file);
@@ -29,4 +27,7 @@ public interface NewIOSSClient {
     @PostMapping(UPLOAD_FILE_INFO_BYTE)
     BladeFile updateFile(@RequestBody byte[] fileByte, @RequestParam String fileName);
 
+    @PostMapping(REMOVE_PDF_FILE)
+    void removeFile(@RequestParam String fileName);
+
 }

+ 13 - 6
blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/NewIOSSClientImpl.java

@@ -3,7 +3,9 @@ package org.springblade.resource.feign;
 import lombok.AllArgsConstructor;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.core.tool.api.R;
 import org.springblade.resource.builder.oss.OssBuilder;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -24,9 +26,9 @@ public class NewIOSSClientImpl implements NewIOSSClient {
 
     @Override
     public BladeFile uploadFileByInputStream(MultipartFile file) {
-        try{
+        try {
             return this.ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream());
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return null;
@@ -34,23 +36,28 @@ public class NewIOSSClientImpl implements NewIOSSClient {
 
     @Override
     public BladeFile updateFile(byte[] fileByte, String fileName) {
-        try{
+        try {
             //获取文件流
             InputStream inputStream = new ByteArrayInputStream(fileByte);
             return this.ossBuilder.template().putFile(fileName, inputStream);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return null;
     }
 
+    @Override
+    public void removeFile(String fileName) {
+        ossBuilder.template().removeFile(fileName);
+    }
+
     @Override
     public BladeFile uploadFile(String fileName, String localFileUrl) {
-        try{
+        try {
             //获取文件流
             InputStream inputStream = new FileInputStream(new File(localFileUrl));
             return this.ossBuilder.template().putFile(fileName, inputStream);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return null;

+ 29 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialMaterialMobilizationDTO.java

@@ -0,0 +1,29 @@
+package org.springblade.business.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 试验进场材料实体
+ */
+@Data
+@TableName("u_trial_material_mobilization")
+@EqualsAndHashCode(callSuper = true)
+public class TrialMaterialMobilizationDTO extends TrialMaterialMobilization {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 数据序号
+     */
+    @ApiModelProperty("数据序号")
+    private Integer dataNumber;
+
+}

+ 25 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSampleInfoDTO.java

@@ -0,0 +1,25 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.TrialSampleInfo;
+
+
+@Data
+public class TrialSampleInfoDTO extends TrialSampleInfo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 进场材料id
+     */
+    @ApiModelProperty("进场材料id")
+    private Long mobilizationId;
+
+    /**
+     * 数据序号
+     */
+    @ApiModelProperty("数据序号")
+    private Integer dataNumber;
+
+
+}

+ 39 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialDeviceClassification.java

@@ -0,0 +1,39 @@
+package org.springblade.business.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 试验设备分类实体
+ */
+@Data
+@TableName("u_trial_device_classification")
+@EqualsAndHashCode(callSuper = true)
+public class TrialDeviceClassification extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    /**
+     * 设备名称
+     */
+    @ApiModelProperty(value = "设备分类名称")
+    private String className;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 135 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialDeviceInfo.java

@@ -0,0 +1,135 @@
+package org.springblade.business.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 试验设备信息实体
+ */
+@Data
+@TableName("u_trial_device_info")
+@EqualsAndHashCode(callSuper = true)
+public class TrialDeviceInfo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 试验室管理人员名称
+     */
+    @ApiModelProperty(value = "试验室管理人员名称")
+    private String managerName;
+
+    /**
+     * 设备分类id
+     */
+    @ApiModelProperty(value = "设备分类id")
+    private Long deviceClassId;
+
+    /**
+     * 设备名称
+     */
+    @ApiModelProperty(value = "设备名称")
+    private String deviceName;
+
+    /**
+     * 设备编号
+     */
+    @ApiModelProperty(value = "设备编号")
+    private String deviceNumber;
+
+    /**
+     * 设备型号
+     */
+    @ApiModelProperty(value = "设备型号")
+    private String deviceModel;
+
+    /**
+     * 生产厂家
+     */
+    @ApiModelProperty(value = "生产厂家")
+    private String manufacturer;
+
+    /**
+     * 生产日期
+     */
+    @ApiModelProperty(value = "生产日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date productionDate;
+
+    /**
+     * 出厂编号
+     */
+    @ApiModelProperty(value = "出厂编号")
+    private String factoryNumber;
+
+    /**
+     * 设备采集编号
+     */
+    @ApiModelProperty(value = "设备采集编号")
+    private String equipmentAcquisitionNumber;
+
+    /**
+     * 进场日期
+     */
+    @ApiModelProperty(value = "进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    /**
+     * 测量范围
+     */
+    @ApiModelProperty(value = "测量范围")
+    private String measuringRange;
+
+    /**
+     * 精准度
+     */
+    @ApiModelProperty(value = "精准度")
+    private String accuracy;
+
+    /**
+     * 校验周期
+     */
+    @ApiModelProperty(value = "校验周期")
+    private Integer calibrationCycle;
+
+    /**
+     * 最近校验时间
+     */
+    @ApiModelProperty(value = "最近校验时间")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date lastCalibrationTime;
+
+    /**
+     * 是否需要校验 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否需要校验 '0'否 '1'是")
+    private Integer isCalibration;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /**
+     * pdfURL
+     */
+    @ApiModelProperty(value = "pdfURL")
+    private String pdfUrl;
+
+
+
+}

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

@@ -0,0 +1,137 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 试验进场材料实体
+ */
+@Data
+@TableName("u_trial_material_mobilization")
+@EqualsAndHashCode(callSuper = true)
+public class TrialMaterialMobilization extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    /**
+     * 记录人id
+     */
+    @ApiModelProperty(value = "记录人id")
+    private Long userId;
+
+    /**
+     * 材料名称
+     */
+    @ApiModelProperty(value = "材料名称")
+    private String materialName;
+
+    /**
+     * 材料类型
+     */
+    @ApiModelProperty(value = "材料类型")
+    private Integer materialType;
+
+    /**
+     * 规格型号
+     */
+    @ApiModelProperty(value = "规格型号")
+    private String specificationModel;
+
+    /**
+     * 规格编号
+     */
+    @ApiModelProperty(value = "材料编号")
+    private String materialNumber;
+
+    /**
+     * 材料单价
+     */
+    @ApiModelProperty(value = "材料单价")
+    private BigDecimal materialPrice;
+
+    /**
+     * 材料数量
+     */
+    @ApiModelProperty(value = "材料数量")
+    private Integer materialCount;
+
+    /**
+     * 计算单位
+     */
+    @ApiModelProperty(value = "计算单位")
+    private String calculationUnit;
+
+    /**
+     * 生产批号
+     */
+    @ApiModelProperty(value = "生产批号")
+    private Integer batchNumber;
+
+    /**
+     * 进场日期
+     */
+    @ApiModelProperty(value = "进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    /**
+     * 拟定部位
+     */
+    @ApiModelProperty(value = "拟定部位")
+    private String proposedPosition;
+
+    /**
+     * 供应商单位
+     */
+    @ApiModelProperty(value = "供应商单位")
+    private String supplierUnit;
+
+    /**
+     * 生产地/厂家
+     */
+    @ApiModelProperty(value = "生产地/厂家")
+    private String placeOfProduction;
+
+    /**
+     * 生产合格证
+     */
+    @ApiModelProperty(value = "生产合格证")
+    private String productionCertificate;
+
+    /**
+     * 厂家质检报告
+     */
+    @ApiModelProperty(value = "厂家质检报告")
+    private String qualityInspectionReport;
+
+    /**
+     * 其他附件
+     */
+    @ApiModelProperty(value = "其他附件")
+    private String otherAccessories;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /**
+     * pdfURL
+     */
+    @ApiModelProperty(value = "pdfURL")
+    private String pdfUrl;
+
+}

+ 138 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSampleInfo.java

@@ -0,0 +1,138 @@
+package org.springblade.business.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 试验样品信息实体
+ */
+@Data
+@TableName("u_trial_sample_info")
+@EqualsAndHashCode(callSuper = true)
+public class TrialSampleInfo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 试验树节点id
+     */
+    @ApiModelProperty(value = "试验树节点id")
+    private Long nodeId;
+
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    /**
+     * 取样人id
+     */
+    @ApiModelProperty(value = "取样人id")
+    private Long userId;
+
+    /**
+     * 样品名称
+     */
+    @ApiModelProperty(value = "样品名称")
+    private String materialName;
+
+    /**
+     * 规格型号
+     */
+    @ApiModelProperty(value = "规格型号")
+    private String specificationModel;
+
+    /**
+     * 样品编号
+     */
+    @ApiModelProperty(value = "样品编号")
+    private String specificationNumber;
+
+    /**
+     * 试样数量
+     */
+    @ApiModelProperty(value = "试样数量")
+    private Integer materialCount;
+
+    /**
+     * 代表数量
+     */
+    @ApiModelProperty(value = "代表数量")
+    private Integer representativeCount;
+
+    /**
+     * 计算单位
+     */
+    @ApiModelProperty(value = "计算单位")
+    private String calculationUnit;
+
+    /**
+     * 生产批号
+     */
+    @ApiModelProperty(value = "生产批号")
+    private Integer batchNumber;
+
+    /**
+     * 拟定部位
+     */
+    @ApiModelProperty(value = "拟定部位")
+    private String proposedPosition;
+
+    /**
+     * 供应商单位
+     */
+    @ApiModelProperty(value = "供应商单位")
+    private String supplierUnit;
+
+    /**
+     * 取样地点
+     */
+    @ApiModelProperty(value = "取样地点")
+    private String samplingLocation;
+
+    /**
+     * 样品描述
+     */
+    @ApiModelProperty(value = "样品描述")
+    private String sampleDescription;
+
+    /**
+     * 进场日期
+     */
+    @ApiModelProperty(value = "进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    /**
+     * 取样日期
+     */
+    @ApiModelProperty(value = "取样日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date samplingDate;
+
+    /**
+     * 是否委外 '0'=否 '1'=是
+     */
+    @ApiModelProperty(value = "是否委外 '0'=否 '1'=是")
+    private Integer isOutsourcing;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /**
+     * pdfURL
+     */
+    @ApiModelProperty(value = "pdfURL")
+    private String pdfUrl;
+
+}

+ 29 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialSamplingRecord.java

@@ -0,0 +1,29 @@
+package org.springblade.business.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+@Data
+@TableName("u_trial_sampling_record")
+@EqualsAndHashCode(callSuper = true)
+public class TrialSamplingRecord extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 进场材料id
+     */
+    @ApiModelProperty(value = "进场材料id")
+    private Long mobilizationId;
+
+    /**
+     * 样品材料id
+     */
+    @ApiModelProperty(value = "样品材料id")
+    private Long sampleInfoId;
+
+}

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

@@ -65,6 +65,8 @@ public class InformationQueryVO extends InformationQuery {
 
 	private String firstTitle;
 
+	private String classifyType;
+
 	@ApiModelProperty("上报批次")
 	private String reportNumber;
 

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

@@ -27,4 +27,6 @@ public class QueryProcessDataVO {
 
     private String firstId;
 
+    private String queryType;
+
 }

+ 61 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDeviceInfoVO.java

@@ -0,0 +1,61 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.TrialDeviceInfo;
+
+
+@Data
+public class TrialDeviceInfoVO extends TrialDeviceInfo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 设备分类类型id
+     */
+    @ApiModelProperty(value = "设备分类类型id")
+    private Long deviceClassId;
+
+    /**
+     * 是否需要校验 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否需要校验 '0'否 '1'是")
+    private Integer isCalibration;
+
+    /**
+     * 状态
+     */
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    /**
+     * 查询输入框 设备名称、设备型号
+     */
+    @ApiModelProperty(value = "查询输入框 设备名称、设备型号")
+    private String queryValue;
+
+    /**
+     * 购置日期 开始时间
+     */
+    @ApiModelProperty(value = "购置日期 开始时间")
+    private String startTime;
+
+    /**
+     * 购置日期 结束时间
+     */
+    @ApiModelProperty(value = "购置日期 结束时间")
+    private String endTime;
+
+    /**
+     * 试验室管理人员名称
+     */
+    @ApiModelProperty(value = "试验室管理人员名称")
+    private String managerName;
+
+    /**
+     * 设备分类名称
+     */
+    @ApiModelProperty(value = "设备分类名称")
+    private String deviceClassName;
+
+
+}

+ 47 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialMaterialMobilizationVO.java

@@ -0,0 +1,47 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.TrialMaterialMobilization;
+
+@Data
+public class TrialMaterialMobilizationVO extends TrialMaterialMobilization {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 材料类型
+     */
+    @ApiModelProperty(value = "材料类型")
+    private Integer materialType;
+
+    /**
+     * 查询输入框 名称、规格、编号
+     */
+    @ApiModelProperty(value = "材料类型 名称、规格、编号")
+    private String queryValue;
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    /**
+     * 记录人
+     */
+    @ApiModelProperty(value = "记录人")
+    private String userName;
+
+    /**
+     * 材料类型名称
+     */
+    @ApiModelProperty(value = "材料类型名称")
+    private String materialName;
+
+}

+ 44 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleInfoVO.java

@@ -0,0 +1,44 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.TrialSampleInfo;
+
+
+@Data
+public class TrialSampleInfoVO extends TrialSampleInfo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 查询输入框 名称、规格、编号
+     */
+    @ApiModelProperty(value = "查询输入框 名称、规格、编号")
+    private String queryValue;
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    /**
+     * 取样人
+     */
+    @ApiModelProperty(value = "取样人")
+    private String userName;
+
+
+    /**
+     * 进场材料id
+     */
+    @ApiModelProperty("进场材料id")
+    private Long mobilizationId;
+
+
+}

+ 51 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSamplingRecordVO.java

@@ -0,0 +1,51 @@
+package org.springblade.business.vo;
+
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.TrialSamplingRecord;
+
+import java.util.Date;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TrialSamplingRecordVO extends TrialSamplingRecord {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 合同段id
+     */
+    private Long contractId;
+
+    /**
+     * 样品编号
+     */
+    private String specificationNumber;
+
+    /**
+     * 样品名称
+     */
+    private String materialName;
+
+    /**
+     * 取样时间
+     */
+    private Date samplingDate;
+
+    /**
+     * 取样人
+     */
+    private String userName;
+
+    /**
+     * 试样数量
+     */
+    private Integer materialCount;
+
+    /**
+     * 是否委外 '0'=否 '1'=是
+     */
+    private Integer isOutsourcing;
+
+}

+ 23 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialDeviceInfoWarpper.java

@@ -0,0 +1,23 @@
+package org.springblade.business.wrapper;
+
+import org.springblade.business.entity.TrialDeviceInfo;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.vo.TrialDeviceInfoVO;
+import org.springblade.business.vo.TrialSampleInfoVO;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+import java.util.Objects;
+
+public class TrialDeviceInfoWarpper extends BaseEntityWrapper<TrialDeviceInfo, TrialDeviceInfoVO> {
+
+    public static TrialDeviceInfoWarpper build() {
+        return new TrialDeviceInfoWarpper();
+    }
+
+    @Override
+    public TrialDeviceInfoVO entityVO(TrialDeviceInfo entity) {
+        return Objects.requireNonNull(BeanUtil.copy(entity, TrialDeviceInfoVO.class));
+    }
+
+}

+ 19 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialMaterialMobilizationWarpper.java

@@ -0,0 +1,19 @@
+package org.springblade.business.wrapper;
+
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.business.vo.TrialMaterialMobilizationVO;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+import java.util.Objects;
+
+public class TrialMaterialMobilizationWarpper extends BaseEntityWrapper<TrialMaterialMobilization, TrialMaterialMobilizationVO> {
+    
+    public static TrialMaterialMobilizationWarpper build(){return new TrialMaterialMobilizationWarpper();}
+
+    @Override
+    public TrialMaterialMobilizationVO entityVO(TrialMaterialMobilization entity) {
+        return Objects.requireNonNull(BeanUtil.copy(entity, TrialMaterialMobilizationVO.class));
+    }
+
+}

+ 22 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/TrialSampleInfoWarpper.java

@@ -0,0 +1,22 @@
+package org.springblade.business.wrapper;
+
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.vo.TrialSampleInfoVO;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+import java.util.Objects;
+
+public class TrialSampleInfoWarpper extends BaseEntityWrapper<TrialSampleInfo, TrialSampleInfoVO> {
+
+    public static TrialSampleInfoWarpper build() {
+        return new TrialSampleInfoWarpper();
+    }
+
+    @Override
+    public TrialSampleInfoVO entityVO(TrialSampleInfo entity) {
+        return Objects.requireNonNull(BeanUtil.copy(entity, TrialSampleInfoVO.class));
+    }
+
+}

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

@@ -126,4 +126,10 @@ public class ProjectInfo extends BaseEntity {
     @ApiModelProperty(value = "wbs私有树引用wbs日志模板id")
     private Long referenceLogWbsTemplateId;
 
+    /**
+     * 是否开启随机数 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否开启随机数 '0'否 '1'是")
+    private Integer isOpenRandomNumber;
+
 }

+ 50 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TrialClassificationConfiguration.java

@@ -0,0 +1,50 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * 试验分类配置表
+ */
+@Data
+@TableName("m_trial_classification_configuration")
+@EqualsAndHashCode(callSuper = true)
+public class TrialClassificationConfiguration extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 节点名
+     */
+    @ApiModelProperty(value = "节点名")
+    private String nodeName;
+
+    /**
+     * 节点类型
+     */
+    @ApiModelProperty(value = "节点类型")
+    private Integer nodeType;
+
+    /**
+     * 父级id
+     */
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+    /**
+     * 祖级id列表
+     */
+    @ApiModelProperty(value = "祖级id列表")
+    private String ancestors;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

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

@@ -0,0 +1,27 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+
+/**
+ * 试验汇总分类配置表
+ */
+@Data
+@TableName("m_trial_summary_classification_configuration")
+@EqualsAndHashCode(callSuper = true)
+public class TrialSummaryClassificationConfiguration extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    private String className;
+
+    private String trialTreeIds;
+
+    private Long excelId;
+
+    private Integer sort;
+
+}

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

@@ -165,4 +165,10 @@ public class WbsTree extends BaseEntity {
     @ApiModelProperty(value = "导入wbs划分匹配字段")
     private String importMatchingInfo;
 
+    /**
+     * 配合比试验ids
+     */
+    @ApiModelProperty(value = "配合比试验ids")
+    private String mixRatioTestIds;
+
 }

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

@@ -239,4 +239,15 @@ public class WbsTreeContract extends BaseEntity {
     @ApiModelProperty(value = "导入wbs划分匹配字段")
     private String importMatchingInfo;
 
+    /**
+     * 是否为隐蔽工程节点 '0'否 '1'是
+     */
+    @ApiModelProperty(value = "是否为隐蔽工程节点 '0'否 '1'是")
+    private Integer isConcealedWorksNode;
+
+    /**
+     * 配合试验比ids
+     */
+  //  private String mixRatioTestIds;
+
 }

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

@@ -176,4 +176,10 @@ public class WbsTreePrivate extends BaseEntity {
     @ApiModelProperty(value = "导入wbs划分匹配字段")
     private String importMatchingInfo;
 
+    /**
+     * 配合试验比ids
+     */
+    private String mixRatioTestIds;
+
+
 }

+ 7 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ProjectInfoVO.java

@@ -26,4 +26,11 @@ public class ProjectInfoVO extends ProjectInfo {
 	@ApiModelProperty("是否是默认项目")
 	private Integer isDefault;
 
+	/**
+	 * 是否开启随机数 '0'否 '1'是
+	 */
+	@ApiModelProperty(value = "是否开启随机数 '0'否 '1'是")
+	private Integer isOpenRandomNumber;
+
+
 }

+ 24 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialClassificationConfigurationTree.java

@@ -0,0 +1,24 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+import org.springblade.core.tool.node.BaseNode;
+
+
+@Data
+public class TrialClassificationConfigurationTree extends BaseNode<TrialClassificationConfigurationTree> {
+
+    private Long id;
+
+    private String nodeName;
+
+    private Integer nodeType;
+
+    private String ancestors;
+
+    private Integer sort;
+
+    private Long parentId;
+
+    private boolean hasChildren;
+
+}

+ 18 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialClassificationConfigurationTreeVO.java

@@ -0,0 +1,18 @@
+package org.springblade.manager.vo;
+
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class TrialClassificationConfigurationTreeVO implements Serializable {
+
+    //外委检测
+    private List<TrialClassificationConfigurationTree> leftTree;
+
+    //第三方检测
+    private List<TrialClassificationConfigurationTree> rightTree;
+
+}

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.checkerframework.checker.units.qual.A;
 import org.springblade.core.tool.node.INode;
 import org.springblade.manager.entity.WbsTreeContract;
 
@@ -89,6 +90,8 @@ public class WbsTreeContractTreeVOS extends WbsTreeContract implements INode<Wbs
     @ApiModelProperty("下级子节点数量")
     private Integer childCount;
 
+    private Long submitCounts;
+
     @Override
     public List<WbsTreeContractTreeVOS> getChildren() {
         if (this.children == null) {

+ 5 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreePrivateVO.java

@@ -53,5 +53,10 @@ public class WbsTreePrivateVO extends WbsTreePrivate implements INode<WbsTreePri
      */
     private String projectName;
 
+    /**
+     * 配合试验比ids
+     */
+    private String mixRatioTestIds;
+
 
 }

+ 5 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeVO.java

@@ -79,4 +79,9 @@ public class WbsTreeVO extends WbsTree implements INode<WbsTreeVO> {
 	 */
 	private String fullName;
 
+	/**
+	 * 试验配合比ids
+	 */
+	private String mixRatioTestIds;
+
 }

+ 8 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java

@@ -26,6 +26,7 @@ import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.entity.UserInfo;
 import org.springblade.system.user.entity.UserOauth;
+import org.springblade.system.user.vo.UserContractInfoVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -58,6 +59,7 @@ public interface IUserClient {
     String UPDATE_USER_ROLE_ID = API_PREFIX + "/user-roleId-update-two";
     String UPDATE_USERS_ROLE_ID = API_PREFIX + "/user-roleId-update-three";
     String USER_INFO_LIST = API_PREFIX + "/find-user-info-list";
+    String USER_INFO_ALL = API_PREFIX + "/get-users-all";
 
     /**
      * 获取所有有效用户
@@ -163,4 +165,10 @@ public interface IUserClient {
     @GetMapping(UPDATE_USERS_ROLE_ID)
     boolean updateUserRoleIdThree(@RequestParam("userIds") List<String> userIds, @RequestParam("roleIds") String roleIds);
 
+    /**
+     * 获取全部userList
+     */
+    @GetMapping(USER_INFO_ALL)
+    List<User> selectUserAll();
+
 }

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

@@ -0,0 +1,21 @@
+package org.springblade.system.user.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+
+/**
+ * 合同段管理人员VO
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UserContractInfoVO extends TenantEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long userId;
+
+    private String userName;
+
+}

+ 5 - 0
blade-service/blade-business/pom.xml

@@ -82,6 +82,11 @@
             <version>5.5.13</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.lowagie</groupId>
+            <artifactId>itext</artifactId>
+            <version>2.1.5</version>
+        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>

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

@@ -225,9 +225,10 @@ public class ArchiveFileController extends BladeController {
 
 				}
 			}
+			return R.data(true);
 		}
 
-		return R.data(true);
+		return R.data(false);
 	}
 
 	/**

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

@@ -21,6 +21,7 @@ import org.springblade.business.service.ImageClassificationShowService;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.ImageClassificationShowVO;
 import org.springblade.business.vo.TreeVo;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.vo.DataVO;
@@ -43,6 +44,7 @@ import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.vo.NewBladeFile;
+import org.springblade.system.cache.ParamCache;
 import org.springblade.system.entity.Dict;
 import org.springblade.system.feign.IDictClient;
 import org.springframework.beans.BeanUtils;
@@ -131,6 +133,9 @@ public class ImageClassificationFileController extends BladeController {
 		//获取固定表格
 		ExcelTab excelTab = this.excelTabClient.getById("1550363881879781377");
 
+		//获取配置的路径
+		String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+
 		List<String> result = new ArrayList<>();
 		if(excelTab != null){
 			//获取数据
@@ -200,7 +205,7 @@ public class ImageClassificationFileController extends BladeController {
 										}
 									}
 
-									String locationFile = "/Users/doc/print/" + SnowFlakeUtil.getId() + ".xlsx";
+									String locationFile = file_path + "/print//" + SnowFlakeUtil.getId() + ".xlsx";
 									outputStream = new FileOutputStream(locationFile);
 									//记录文件删除
 									removeList.add(locationFile);

+ 40 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -18,8 +18,10 @@ import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.RecycleBinClient;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.business.service.IConstructionLedgerService;
+import org.springblade.business.service.IInformationQueryFileService;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.*;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.mp.support.Condition;
@@ -38,6 +40,7 @@ import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.feign.WbsTreePrivateClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.cache.ParamCache;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.feign.IDictBizClient;
 import org.springframework.beans.BeanUtils;
@@ -70,6 +73,8 @@ public class InformationWriteQueryController extends BladeController {
 
 	private final IInformationQueryService informationQueryService;
 
+	private final IInformationQueryFileService informationQueryFileService;
+
 	private final IDictBizClient dictBizClient;
 
 	private final IConstructionLedgerService constructionLedgerService;
@@ -513,11 +518,39 @@ public class InformationWriteQueryController extends BladeController {
     public R<String> batchPrint(@RequestParam String ids) {
 		//获取勾选的数据
     	List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(ids.split(",")));
-    	//获取pdf
-		List<String> pdfList = queries.stream().map(query -> StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl()).distinct().collect(Collectors.toList());
-    	pdfList.removeIf(StringUtils::isEmpty);
+		//pdf集合
+		List<String> pdfList = new ArrayList<>();
+
+		//获取配置的路径
+		String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+
+    	for(InformationQuery query : queries){
+    		switch (query.getType()){
+				case 1:
+					//资料填报
+					pdfList.add(StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
+					break;
+				case 3:
+					//首件,需要查出关联的数据
+					//先存放本表
+					pdfList.add(StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
+					//存放关联表
+					pdfList.add(query.getLinkMergePdfUrl());
+					//查询总结报告
+					InformationQueryFile linkFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
+					if(linkFile != null){
+						pdfList.add(linkFile.getPdfUrl());
+					}
+					break;
+				default:
+					break;
+			}
+		}
+		//去掉空元素
+		pdfList.removeIf(StringUtils::isEmpty);
+
     	//执行合并
-		String mergeName = SnowFlakeUtil.getId() + ".pdf", mergeUrl = "/Users/doc/print/" + mergeName;
+		String mergeName = SnowFlakeUtil.getId() + ".pdf", mergeUrl = file_path + "/print//" + mergeName;
 		FileUtils.mergePdfPublicMethods(pdfList, mergeUrl);
 
 		//上传
@@ -1306,6 +1339,7 @@ public class InformationWriteQueryController extends BladeController {
 							if(treePrivate.getPKeyId().equals(next.getPKeyId())){
 								//删掉重复数据
 								iterator.remove();
+								break;
 							}
 						}
 					}
@@ -1313,6 +1347,7 @@ public class InformationWriteQueryController extends BladeController {
 				//处理完重复数据后,设置进集合中
 				selectedNodeList.addAll(childList);
 			}
+
 			//处理半选
 			this.disposeHalfSelectList(treeContract, halfSelectedNodeList, selectedNodeList);
 
@@ -1639,7 +1674,7 @@ public class InformationWriteQueryController extends BladeController {
 		query.setCurrent(vo.getCurrent());
 		//获取合同段信息
 		ContractInfo contract = this.contractClient.getContractById(vo.getContractId());
-		vo.setClassify(contract.getContractType() == null ? 1 : contract.getContractType());
+		vo.setClassify(StringUtils.isNotEmpty(vo.getClassifyType()) ? new Integer(vo.getClassifyType()) : contract.getContractType() == null ? 1 : new Integer("1").equals(contract.getContractType()) ? 1 : 2);
 
 		//获取所有
 		List<String> submitNodeKeyIds = new ArrayList<>();

+ 31 - 24
blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java

@@ -67,13 +67,15 @@ public class MaterialProgressController extends BladeController {
     @PostMapping("/queryContractTreeMaterialProgress")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "资料进度")
-    public R<MaterialProgressVO> queryContractTreeMaterialProgress(@RequestParam String contractId, @RequestParam String parentId){
+    public R<MaterialProgressVO> queryContractTreeMaterialProgress(@RequestParam String contractId, @RequestParam String parentId, String classifyType){
+        classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
+
         //设置返回对象
         MaterialProgressVO reVO = new MaterialProgressVO();
 
         //获取合同段信息
         ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
-        if(new Integer("2").equals(contract.getContractType())){
+        if("2".equals(classifyType) && contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
             //监理合同段,获取其关联的施工合同段ID
             List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
             for(String sgContractId : sgContractIds){
@@ -81,7 +83,7 @@ public class MaterialProgressController extends BladeController {
                 List<WbsTreeContractTreeVOS> nodeResult = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(sgContractId, 1, StringUtils.isNotEmpty(parentId) ? parentId : "0");
                 if(nodeResult != null && nodeResult.size() > 0){
                     //找到当前节点下的所有填报节点
-                    List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(nodeResult.get(0).getId().toString(), 1, sgContractId);
+                    List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(nodeResult.get(0).getId().toString(), new Integer(classifyType), sgContractId);
 
                     //统计
                     this.countAmount(nodeResult, queryDataResult, sgContractId, reVO);
@@ -94,7 +96,7 @@ public class MaterialProgressController extends BladeController {
             if(nodeResult != null && nodeResult.size() > 0){
 
                 //找到当前节点下的所有填报节点
-                List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractId);
+                List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, new Integer(classifyType), contractId);
                 //统计
                 this.countAmount(nodeResult, queryDataResult, contractId, reVO);
 
@@ -192,13 +194,15 @@ public class MaterialProgressController extends BladeController {
     @PostMapping("/queryImageClassification")
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "声像媒体资料统计")
-    public R<MaterialProgressVO> queryImageClassification(@RequestParam String contractId){
+    public R<MaterialProgressVO> queryImageClassification(@RequestParam String contractId, String classifyType){
+        classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
+
         //设置返回参数
         MaterialProgressVO reVO = new MaterialProgressVO();
 
         //获取合同段信息
         ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
-        if(contract != null && new Integer("2").equals(contract.getContractType())){
+        if("1".equals(classifyType) && contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
             //监理合同段
             List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
             if(sgContractIds != null && sgContractIds.size() > 0){
@@ -251,13 +255,13 @@ public class MaterialProgressController extends BladeController {
     @PostMapping("/queryMaterialProgressStatus")
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "报表资料审批统计")
-    public R<MaterialProgressVO> queryMaterialProgressStatus(@RequestParam String contractId){
+    public R<MaterialProgressVO> queryMaterialProgressStatus(@RequestParam String contractId, String classifyType){
         //设置参数返回
         MaterialProgressVO reVO = new MaterialProgressVO();
 
         //获取合同段信息
         ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
-        if(contract != null && new Integer("2").equals(contract.getContractType())){
+        if(contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
             //监理合同段
             List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
             if(sgContractIds != null && sgContractIds.size() > 0){
@@ -272,7 +276,7 @@ public class MaterialProgressController extends BladeController {
                 }
                 if(countList.size() > 0){
                     //设置参数
-                    this.setTaskParameter(reVO, countList);
+                    this.setTaskParameter(reVO, countList, classifyType);
                     return R.data(reVO);
                 }
             }
@@ -280,7 +284,7 @@ public class MaterialProgressController extends BladeController {
             //找到可填写的
             List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
             if(submitNodeList != null && submitNodeList.size() > 0){
-                this.setTaskParameter(reVO, submitNodeList);
+                this.setTaskParameter(reVO, submitNodeList, classifyType);
                 return R.data(reVO);
             }
         }
@@ -288,7 +292,9 @@ public class MaterialProgressController extends BladeController {
         return R.data(200, null, "未找到数据");
     }
 
-    private void setTaskParameter(MaterialProgressVO reVO, List<WbsTreeContract> submitNodeList){
+    private void setTaskParameter(MaterialProgressVO reVO, List<WbsTreeContract> submitNodeList, String classifyType){
+        classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
+
         //汇总四个填报类型的总数
         List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
         //类型分组
@@ -297,22 +303,22 @@ public class MaterialProgressController extends BladeController {
         //工序资料
         List<InformationQuery> processSubmitList = null;
         if(process.size() > 0){
-            processSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
+            processSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process).eq(InformationQuery::getClassify, classifyType));
         }
         //开工报告
         List<InformationQuery> workStartReportsSubmitList = null;
         if(workStartReports.size() > 0){
-            workStartReportsSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
+            workStartReportsSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports).eq(InformationQuery::getClassify, classifyType));
         }
         //质量评定
         List<InformationQuery> evaluationSubmitList = null;
         if(evaluation.size() > 0){
-            evaluationSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
+            evaluationSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation).eq(InformationQuery::getClassify, classifyType));
         }
         //中间交工
         List<InformationQuery> completionSubmitList = null;
         if(completion.size() > 0){
-            completionSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
+            completionSubmitList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion).eq(InformationQuery::getClassify, classifyType));
         }
 
         //处理工序资料
@@ -350,13 +356,13 @@ public class MaterialProgressController extends BladeController {
     @PostMapping("/queryMaterialProgress")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "查询内业资料进度")
-    public R<MaterialProgressVO> queryMaterialProgress(@RequestParam String contractId){
+    public R<MaterialProgressVO> queryMaterialProgress(@RequestParam String contractId, String classifyType){
         //设置返回
         MaterialProgressVO reVO = new MaterialProgressVO();
 
         //获取合同段信息
         ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
-        if(contract != null && new Integer("2").equals(contract.getContractType())){
+        if(contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
             //监理合同段
             List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
             if(sgContractIds != null && sgContractIds.size() > 0){
@@ -371,7 +377,7 @@ public class MaterialProgressController extends BladeController {
                 }
                 if(countList.size() > 0){
                     //设置参数
-                    this.setParameter(countList, reVO);
+                    this.setParameter(countList, reVO, classifyType);
                 }
                 return R.data(reVO);
             }
@@ -381,7 +387,7 @@ public class MaterialProgressController extends BladeController {
             List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
             if(submitNodeList != null && submitNodeList.size() > 0){
                 //设置参数
-                this.setParameter(submitNodeList, reVO);
+                this.setParameter(submitNodeList, reVO, classifyType);
                 return R.data(reVO);
             }
         }
@@ -392,7 +398,8 @@ public class MaterialProgressController extends BladeController {
     /**
      * 设置参数
      */
-    private void setParameter(List<WbsTreeContract> submitNodeList, MaterialProgressVO reVO){
+    private void setParameter(List<WbsTreeContract> submitNodeList, MaterialProgressVO reVO, String classifyType){
+        classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
         //汇总四个填报类型的总数
         List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
         //类型分组
@@ -402,22 +409,22 @@ public class MaterialProgressController extends BladeController {
         //工序资料
         long processAmount = 0L;
         if(process.size() > 0){
-            processAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process));
+            processAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, process).eq(InformationQuery::getClassify, classifyType));
         }
         //开工报告
         long workStartReportsAmount = 0L;
         if(workStartReports.size() > 0){
-            workStartReportsAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports));
+            workStartReportsAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, workStartReports).eq(InformationQuery::getClassify, classifyType));
         }
         //质量评定
         long evaluationAmount = 0L;
         if(evaluation.size() > 0){
-            evaluationAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation));
+            evaluationAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, evaluation).eq(InformationQuery::getClassify, classifyType));
         }
         //中间交工
         long completionAmount = 0L;
         if(completion.size() > 0){
-            completionAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion));
+            completionAmount = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, completion).eq(InformationQuery::getClassify, classifyType));
         }
 
         reVO.setProcessMaterialList("开工报告", workStartReports.size(), workStartReportsAmount);

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -7,6 +7,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.ConstructionLedger;
 import org.springblade.business.service.IConstructionLedgerService;
 import org.springblade.business.service.IInformationQueryService;
@@ -82,6 +83,9 @@ public class NeiYeController {
             }
 
             if (queryDataResult != null && queryDataResult.size() > 0) {
+                //删除掉首件
+                queryDataResult.removeIf(query -> StringUtils.isNotEmpty(query.getQueryType()) && "3".equals(query.getQueryType()));
+
                 //分组
                 List<List<QueryProcessDataVO>> groupList = CommonUtil.getBatchSize(queryDataResult, queryVO.getSize());
                 List<QueryProcessDataVO> groupQueryList = groupList.get(queryVO.getCurrent() == 0 ? 0 : queryVO.getCurrent() - 1);

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

@@ -89,7 +89,7 @@ public class TreeContractFirstController extends BladeController {
 				}
 			}
 
-			if("0".equals(vos.getParentId())){
+			if("0".equals(vos.getParentId().toString())){
 				//根节点不删除
 				continue;
 			}

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

@@ -0,0 +1,55 @@
+package org.springblade.business.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialDeviceClassification;
+import org.springblade.business.service.ITrialDeviceClassificationService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/device")
+@Api(value = "设备分类", tags = "设备分类接口")
+public class TrialDeviceClassificationController extends BladeController {
+
+    private final ITrialDeviceClassificationService iTrialDeviceClassificationService;
+
+    @PostMapping("/class-submit")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "分类新增或修改", notes = "传入TrialDeviceClassification对象")
+    public R<Object> classSubmit(@Valid @RequestBody TrialDeviceClassification obj) {
+        return R.status(iTrialDeviceClassificationService.classSubmit(obj));
+    }
+
+    @GetMapping("/class-detail")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分类详情", notes = "传入id")
+    public R<TrialDeviceClassification> classDetail(@Valid @RequestParam Long id) {
+        return R.data(iTrialDeviceClassificationService.classDetail(id));
+    }
+
+    @GetMapping("/class-list")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分类列表", notes = "当前合同段id")
+    public R<List<TrialDeviceClassification>> classList(@Valid @RequestParam Long contractId) {
+        return R.data(iTrialDeviceClassificationService.classList(contractId));
+    }
+
+    @GetMapping("/class-remove")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分类删除", notes = "传入id")
+    public R<Object> classRemove(@Valid @RequestParam String id) {
+        return R.status(iTrialDeviceClassificationService.deleteLogic(Func.toLongList(id)));
+    }
+
+
+
+}

+ 84 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDeviceInfoController.java

@@ -0,0 +1,84 @@
+package org.springblade.business.controller;
+
+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 lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialDeviceInfo;
+import org.springblade.business.excel.TrialDeviceInfoExcel;
+import org.springblade.business.service.ITrialDeviceInfoService;
+import org.springblade.business.vo.TrialDeviceInfoVO;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
+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.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/device/info")
+@AllArgsConstructor
+@Api(value = "设备详情", tags = "设备详情接口")
+public class TrialDeviceInfoController extends BladeController {
+
+    private final ITrialDeviceInfoService iTrialDeviceInfoService;
+
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "新增或修改", notes = "传入TrialDeviceInfo对象")
+    public R<Object> submit(@Valid @RequestBody TrialDeviceInfo obj) {
+        return R.status(iTrialDeviceInfoService.submit(obj));
+    }
+
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "详情", notes = "传入id")
+    public R<TrialDeviceInfo> detail(@Valid @RequestBody Long id) {
+        return R.data(iTrialDeviceInfoService.detail(id));
+    }
+
+    @GetMapping("/remove")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "批量删除", notes = "传入ids")
+    public R<Object> remove(@Valid @RequestBody String ids) {
+        return R.status(iTrialDeviceInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "分页条件查询", notes = "传入Query,TrialDeviceInfoVO")
+    public R<IPage<TrialDeviceInfoVO>> page(Query query, TrialDeviceInfoVO obj) {
+        return R.data(iTrialDeviceInfoService.selectPage(Condition.getPage(query), obj));
+    }
+
+    @PostMapping("/print-pdf")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "打印PDF", notes = "传入ids")
+    public R printPdf(String ids, HttpServletResponse response) {
+        return R.data(iTrialDeviceInfoService.printPdf(ids, response));
+    }
+
+    @PostMapping("/read-excel")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "读取excel数据", notes = "传入excel")
+    public R<List<TrialDeviceInfoExcel>> readExcel(MultipartFile file) {
+        List<TrialDeviceInfoExcel> list = ExcelUtil.read(file, TrialDeviceInfoExcel.class);
+        return R.data(list);
+    }
+
+    @PostMapping("/save-batch")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "导入设备数据保存", notes = "传入List<TrialDeviceInfoExcel>")
+    public R<Object> saveBatchDeviceInfo(@RequestBody List<TrialDeviceInfoExcel> list) {
+        return R.status(iTrialDeviceInfoService.saveBatchDeviceInfo(list));
+    }
+
+
+}

+ 173 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialMaterialController.java

@@ -0,0 +1,173 @@
+package org.springblade.business.controller;
+
+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 lombok.AllArgsConstructor;
+import org.springblade.business.dto.TrialMaterialMobilizationDTO;
+import org.springblade.business.dto.TrialSampleInfoDTO;
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.excel.TrialMaterialMobilizationExcel;
+import org.springblade.business.excel.TrialMaterialMobilizationImporter;
+import org.springblade.business.excel.TrialSampleInfoExcel;
+import org.springblade.business.excel.TrialSampleInfoImporter;
+import org.springblade.business.service.ITrialMaterialMobilizationService;
+import org.springblade.business.service.ITrialSampleInfoService;
+import org.springblade.business.vo.TrialMaterialMobilizationVO;
+import org.springblade.business.vo.TrialSampleInfoVO;
+import org.springblade.business.vo.TrialSamplingRecordVO;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
+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.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/material")
+@Api(value = "试验材料管理", tags = "试验材料管理接口")
+public class TrialMaterialController extends BladeController {
+
+    private final ITrialMaterialMobilizationService iTrialMaterialMobilizationService;
+    private final ITrialSampleInfoService iTrialSampleInfoService;
+
+    @GetMapping("/mobilization/verification")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "进场材料校验编号唯一", notes = "传入materialNumber")
+    public R<Object> mobilizationVerification(@Valid @RequestParam String materialNumber, @RequestParam String id) {
+        return R.data(iTrialMaterialMobilizationService.mobilizationVerification(materialNumber, id));
+    }
+
+    @GetMapping("/mobilization/sampling-record")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "材料取样记录", notes = "传入材料id")
+    public R<List<TrialSamplingRecordVO>> samplingRecordList(@Valid @RequestParam Long id) {
+        return R.data(iTrialMaterialMobilizationService.samplingRecordList(id));
+    }
+
+    @GetMapping("/mobilization/detail")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "进场材料详情", notes = "传入id")
+    public R<TrialMaterialMobilization> mobilizationDetail(@Valid @RequestParam Long id) {
+        return R.data(iTrialMaterialMobilizationService.mobilizationDetail(id));
+    }
+
+    @GetMapping("/mobilization/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "进场材料分页条件查询", notes = "传入Query、TrialMaterialMobilizationVO")
+    public R<IPage<TrialMaterialMobilizationVO>> mobilizationPage(Query query, TrialMaterialMobilizationVO obj) {
+        return R.data(iTrialMaterialMobilizationService.selectPage(Condition.getPage(query), obj));
+    }
+
+    @GetMapping("/mobilization/list")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "取样材料关联进场材料时查询的列表", notes = "null")
+    public R<List<TrialMaterialMobilization>> mobilizationList() {
+        return R.data(iTrialMaterialMobilizationService.selectList());
+    }
+
+    @PostMapping("/mobilization/submit")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "进场材料新增或修改", notes = "传入TrialMaterialMobilization对象")
+    public R<Object> mobilizationSubmit(@Valid @RequestBody TrialMaterialMobilization obj) {
+        return R.status(iTrialMaterialMobilizationService.mobilizationSubmit(obj));
+    }
+
+    @PostMapping("/mobilization/remove")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "进场材料批量删除", notes = "传入ids")
+    public R<Object> mobilizationRemove(@Valid @RequestParam String ids) {
+        return R.status(iTrialMaterialMobilizationService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    @PostMapping("/mobilization/copy")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "进场材料批量复制", notes = "传入TrialMaterialMobilizationDTO集合")
+    public R<Object> mobilizationCopy(@Valid @RequestBody List<TrialMaterialMobilizationDTO> dto) {
+        return R.status(iTrialMaterialMobilizationService.mobilizationCopy(dto));
+    }
+
+    @PostMapping("/mobilization/import")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "进场材料导入", notes = "传入excel,合同段contractId")
+    public R mobilizationImport(MultipartFile file, Integer isCovered, Long contractId) {
+        TrialMaterialMobilizationImporter trialMaterialMobilizationImporter = new TrialMaterialMobilizationImporter(iTrialMaterialMobilizationService, isCovered == 1, contractId);
+        ExcelUtil.save(file, trialMaterialMobilizationImporter, TrialMaterialMobilizationExcel.class);
+        return R.success("操作成功");
+    }
+
+    @PostMapping("/mobilization/export-pdf")
+    @ApiOperationSupport(order = 9)
+    @ApiOperation(value = "进场材料批量打印PDF", notes = "传入ids")
+    public R mobilizationExportPdf(@Valid @RequestParam String ids, HttpServletResponse response) {
+        return R.data(iTrialMaterialMobilizationService.mobilizationExportPdf(ids, response));
+    }
+
+    @GetMapping("/sample/detail")
+    @ApiOperationSupport(order = 10)
+    @ApiOperation(value = "样品材料详情", notes = "传入id")
+    public R<TrialSampleInfo> sampleDetail(@Valid @RequestParam Long id) {
+        return R.data(iTrialSampleInfoService.sampleDetail(id));
+    }
+
+    @GetMapping("/sample/page")
+    @ApiOperationSupport(order = 11)
+    @ApiOperation(value = "样品材料分页条件查询", notes = "传入Query、TrialSampleInfoVO")
+    public R<IPage<TrialSampleInfoVO>> mobilizationPage(Query query, TrialSampleInfoVO obj) {
+        return R.data(iTrialSampleInfoService.selectPage(Condition.getPage(query), obj));
+    }
+
+    @PostMapping("/sample/submit")
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "样品材料新增或修改", notes = "传入TrialSampleInfoDTO对象、关联材料信息传材料的mobilizationId")
+    public R<Object> sampleSubmit(@Valid @RequestBody TrialSampleInfoDTO obj) {
+        return R.status(iTrialSampleInfoService.sampleSubmit(obj));
+    }
+
+    @PostMapping("/sample/remove")
+    @ApiOperationSupport(order = 13)
+    @ApiOperation(value = "样品材料批量删除", notes = "传入ids")
+    public R<Object> sampleRemove(@Valid @RequestParam String ids) {
+        return R.status(iTrialSampleInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    @PostMapping("/sample/copy")
+    @ApiOperationSupport(order = 14)
+    @ApiOperation(value = "样品材料批量复制", notes = "传入TrialSampleInfoDTO集合")
+    public R<Object> sampleCopy(@Valid @RequestBody List<TrialSampleInfoDTO> dto) {
+        return R.status(iTrialSampleInfoService.sampleCopy(dto));
+    }
+
+    @PostMapping("/sample/import")
+    @ApiOperationSupport(order = 15)
+    @ApiOperation(value = "样品材料导入", notes = "传入excel,合同段contractId")
+    public R sampleImport(MultipartFile file, Integer isCovered, Long contractId) {
+        TrialSampleInfoImporter trialSampleInfoImporter = new TrialSampleInfoImporter(iTrialSampleInfoService, isCovered == 1, contractId);
+        ExcelUtil.save(file, trialSampleInfoImporter, TrialSampleInfoExcel.class);
+        return R.success("操作成功");
+    }
+
+    @PostMapping("/sample/export-pdf")
+    @ApiOperationSupport(order = 16)
+    @ApiOperation(value = "样品材料批量打印PDF", notes = "传入ids")
+    public R sampleExportPdf(@Valid @RequestParam String ids, HttpServletResponse response) {
+        return R.data(iTrialSampleInfoService.sampleExportPdf(ids, response));
+    }
+
+    @GetMapping("/sample/verification")
+    @ApiOperationSupport(order = 17)
+    @ApiOperation(value = "样品材料校验编号唯一", notes = "传入specificationNumber,id")
+    public R<Object> sampleVerification(@Valid @RequestParam String specificationNumber,@RequestParam String id) {
+        return R.data(iTrialSampleInfoService.sampleVerification(specificationNumber,id));
+    }
+
+}

+ 70 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialDeviceInfoExcel.java

@@ -0,0 +1,70 @@
+package org.springblade.business.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class TrialDeviceInfoExcel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty("设备名称")
+    private String deviceName;
+
+    @ExcelProperty("设备分类名称")
+    private String deviceClassName;
+
+    @ExcelProperty("试验室管理人员名称")
+    private String managerName;
+
+    @ExcelProperty("设备型号")
+    private String deviceModel;
+
+    @ExcelProperty("生产厂家")
+    private String manufacturer;
+
+    @ExcelProperty("生产日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date productionDate;
+
+    @ExcelProperty("出厂编号")
+    private String factoryNumber;
+
+    @ExcelProperty("设备采集编号")
+    private String equipmentAcquisitionNumber;
+
+    @ExcelProperty("进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    @ExcelProperty("测量范围")
+    private String measuringRange;
+
+    @ExcelProperty("精准度")
+    private String accuracy;
+
+    @ExcelProperty("校验周期(月)")
+    private Integer calibrationCycle;
+
+    @ExcelProperty("最近校验时间")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date lastCalibrationTime;
+
+    @ExcelProperty("是否需要校验 否/是")
+    private String isCalibration;
+
+    @ExcelProperty("备注")
+    private String remarks;
+
+
+}

+ 75 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialMaterialMobilizationExcel.java

@@ -0,0 +1,75 @@
+package org.springblade.business.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class TrialMaterialMobilizationExcel implements Serializable {
+
+    @ExcelProperty(value = "id")
+    @ExcelIgnore
+    private Long id;
+
+    @ExcelProperty(value = "记录人")
+    @ExcelIgnore
+    private String userName;
+
+    @ExcelProperty(value = "材料名称")
+    private String materialName;
+
+    @ExcelProperty(value = "材料类型")
+    private Integer materialType;
+
+    @ExcelProperty(value = "规格型号")
+    private String specificationModel;
+
+    @ExcelProperty(value = "材料编号")
+    private String materialNumber;
+
+    @ExcelProperty(value = "材料单价")
+    private BigDecimal materialPrice;
+
+    @ExcelProperty(value = "材料数量")
+    private Integer materialCount;
+
+    @ExcelProperty(value = "计算单位")
+    private String calculationUnit;
+
+    @ExcelProperty(value = "生产批号")
+    private Integer batchNumber;
+
+    @ExcelProperty(value = "进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    @ExcelProperty(value = "拟定部位")
+    private String proposedPosition;
+
+    @ExcelProperty(value = "供应商单位")
+    private String supplierUnit;
+
+    @ExcelProperty(value = "生产地/厂家")
+    private String placeOfProduction;
+
+    @ExcelProperty(value = "生产合格证")
+    private String productionCertificate;
+
+    @ExcelProperty(value = "厂家质检报告")
+    private String qualityInspectionReport;
+
+    @ExcelProperty(value = "其他附件")
+    private String otherAccessories;
+
+}

+ 21 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialMaterialMobilizationImporter.java

@@ -0,0 +1,21 @@
+package org.springblade.business.excel;
+
+import lombok.RequiredArgsConstructor;
+import org.springblade.business.service.ITrialMaterialMobilizationService;
+import org.springblade.core.excel.support.ExcelImporter;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class TrialMaterialMobilizationImporter implements ExcelImporter<TrialMaterialMobilizationExcel> {
+
+    private final ITrialMaterialMobilizationService service;
+    private final Boolean isCovered;
+    private final Long contractId;
+
+    @Override
+    public void save(List<TrialMaterialMobilizationExcel> data) {
+        service.importMobilization(data, isCovered, contractId);
+    }
+
+}

+ 75 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialSampleInfoExcel.java

@@ -0,0 +1,75 @@
+package org.springblade.business.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import javax.validation.Valid;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class TrialSampleInfoExcel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty(value = "id")
+    @ExcelIgnore
+    private Long id;
+
+    @ExcelProperty(value = "取样人")
+    @ExcelIgnore
+    private String userName;
+
+    @ExcelProperty(value = "样品名称")
+    private String materialName;
+
+    @ExcelProperty(value = "规格型号")
+    private String specificationModel;
+
+    @ExcelProperty(value = "样品编号")
+    private String specificationNumber;
+
+    @ExcelProperty(value = "试样数量")
+    private Integer materialCount;
+
+    @ExcelProperty(value = "代表数量")
+    private Integer representativeCount;
+
+    @ExcelProperty(value = "计算单位")
+    private String calculationUnit;
+
+    @ExcelProperty(value = "生产批号")
+    private Integer batchNumber;
+
+    @ExcelProperty(value = "拟定部位")
+    private String proposedPosition;
+
+    @ExcelProperty(value = "供应商单位")
+    private String supplierUnit;
+
+    @ExcelProperty(value = "取样地点")
+    private String samplingLocation;
+
+    @ExcelProperty(value = "样品描述")
+    private String sampleDescription;
+
+    @ExcelProperty(value = "进场日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mobilizationDate;
+
+    @ExcelProperty(value = "取样日期")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date samplingDate;
+
+    @ExcelProperty(value = "是否委外")
+    private Integer isOutsourcing;
+
+}

+ 21 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/TrialSampleInfoImporter.java

@@ -0,0 +1,21 @@
+package org.springblade.business.excel;
+
+import lombok.RequiredArgsConstructor;
+import org.springblade.business.service.ITrialSampleInfoService;
+import org.springblade.core.excel.support.ExcelImporter;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class TrialSampleInfoImporter implements ExcelImporter<TrialSampleInfoExcel> {
+
+    private final ITrialSampleInfoService service;
+    private final Boolean isCovered;
+    private final Long contractId;
+
+    @Override
+    public void save(List<TrialSampleInfoExcel> data) {
+        service.importSample(data, isCovered, contractId);
+    }
+
+}

+ 36 - 7
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -46,6 +46,7 @@
         <result column="firstId" property="firstId"/>
         <result column="nodeType" property="nodeType"/>
         <result column="evaluate" property="evaluate"/>
+        <result column="queryType" property="queryType"/>
     </resultMap>
 
     <resultMap id="queryContractTreeMap" type="org.springblade.manager.vo.WbsTreeContractTreeVOS">
@@ -67,12 +68,15 @@
         <result column="colorStatus" property="colorStatus"/>
         <result column="type" property="type"/>
         <result column="partitionCode" property="partitionCode"/>
+        <result column="isConcealedWorksNode" property="isConcealedWorksNode"/>
+        <result column="submitCounts" property="submitCounts"/>
     </resultMap>
 
     <resultMap id="intResultMap" type="java.lang.Integer"/>
 
     <select id="queryContractTreeSupervision" resultMap="queryContractTreeMap">
         SELECT
+            wtc.is_concealed_works_node AS "isConcealedWorksNode",
             wtc.p_key_id AS primaryKeyId,
             wtc.id,
             CASE wtc.parent_id
@@ -99,13 +103,15 @@
                 (select count(tcf.id) from u_tree_contract_first AS tcf where tcf.is_deleted = 0 and tcf.wbs_node_id = wtc.p_key_id)
             WHEN 0 THEN 'false'
             ELSE 'true' END AS isFirst,
-            querys.nodeStatus AS colorStatus
+            querys.nodeStatus AS colorStatus,
+            querys.submitCounts AS submitCounts
         FROM
             m_wbs_tree_contract AS wtc
         LEFT JOIN u_contract_tree_drawings AS ctd ON ctd.is_deleted = 0 and ctd.process_id = wtc.p_key_id
         LEFT JOIN (
             SELECT
                 querys.pKeyId AS pKeyId,
+                querys.submitCounts AS submitCounts,
                 CASE
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus NOT LIKE CONCAT('%',2,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',3,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',4,'%')) THEN 1
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%') OR querys.nodeStatus LIKE CONCAT('%',4,'%')) THEN 2
@@ -116,6 +122,7 @@
             (
                 SELECT
                     wtc.p_key_id AS pKeyId,
+                    count(iq.id) AS submitCounts,
                     group_concat(
                                 CASE
                                 WHEN iq.status is null THEN 1
@@ -125,7 +132,14 @@
                             ) AS nodeStatus
                 FROM
                     m_wbs_tree_contract AS wtc
-                LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', wtc.id, '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                <choose>
+                    <when test="parentId == '0'">
+                        LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', '0', '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                    </when>
+                    <otherwise>
+                        LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', wtc.id, '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                    </otherwise>
+                </choose>
                 LEFT JOIN u_information_query AS iq ON (iq.wbs_id = wtc1.p_key_id OR iq.wbs_id = wtc.p_key_id) AND classify = #{classify} AND iq.type != 3
                 WHERE
                     wtc.contract_id IN
@@ -151,6 +165,7 @@
 
     <select id="queryContractTree" resultMap="queryContractTreeMap">
         SELECT
+            wtc.is_concealed_works_node AS "isConcealedWorksNode",
             wtc.p_key_id AS primaryKeyId,
             wtc.id,
             CASE wtc.parent_id
@@ -177,13 +192,15 @@
                 (select count(tcf.id) from u_tree_contract_first AS tcf where tcf.is_deleted = 0 and tcf.wbs_node_id = wtc.p_key_id)
             WHEN 0 THEN 'false'
             ELSE 'true' END AS isFirst,
-            querys.nodeStatus AS colorStatus
+            querys.nodeStatus AS colorStatus,
+            querys.submitCounts AS submitCounts
         FROM
             m_wbs_tree_contract AS wtc
         LEFT JOIN u_contract_tree_drawings AS ctd ON ctd.is_deleted = 0 and ctd.process_id = wtc.p_key_id
         LEFT JOIN (
             SELECT
                 querys.pKeyId AS pKeyId,
+                querys.submitCounts AS submitCounts,
                 CASE
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus NOT LIKE CONCAT('%',2,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',3,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',4,'%')) THEN 1
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%') OR querys.nodeStatus LIKE CONCAT('%',4,'%')) THEN 2
@@ -194,6 +211,7 @@
             (
                 SELECT
                     wtc.p_key_id AS pKeyId,
+                    count(iq.id) AS submitCounts,
                     group_concat(
                                 CASE
                                 WHEN iq.status is null THEN 1
@@ -204,7 +222,14 @@
                             ) AS nodeStatus
                 FROM
                     m_wbs_tree_contract AS wtc
-                LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', wtc.id, '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                <choose>
+                    <when test="parentId == '0' || parentId == 0 || parentId == '' || parentId == null">
+                        LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', '0', '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                    </when>
+                    <otherwise>
+                        LEFT JOIN m_wbs_tree_contract AS wtc1 ON wtc1.ancestors like concat('%', wtc.id, '%') AND wtc1.is_deleted = 0 and wtc1.contract_id = wtc.contract_id AND wtc1.major_data_type IN(1,2,3,4)
+                    </otherwise>
+                </choose>
                 LEFT JOIN u_information_query AS iq ON (iq.wbs_id = wtc1.p_key_id OR iq.wbs_id = wtc.p_key_id) AND iq.classify = #{classify} AND iq.type != 3
                 WHERE
                     wtc.contract_id = #{contractId}
@@ -247,7 +272,8 @@
                 and tc.parent_id = wtc.parent_id
                 and tc.contract_id = wtc.contract_id
                 and NOT EXISTS (select 1 from u_information_query as q where iq.id = q.id and q.status > iq.status) LIMIT 1
-            ) AS evaluate
+            ) AS evaluate,
+            uiq.type AS queryType
         FROM
             m_wbs_tree_contract AS wtc
         LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = #{classify} and uiq.is_deleted = 0
@@ -281,7 +307,8 @@
                 and tc.parent_id = wtc.parent_id
                 and tc.contract_id = wtc.contract_id
                 and NOT EXISTS (select 1 from u_information_query as q where iq.id = q.id and q.status > iq.status) LIMIT 1
-            ) AS evaluate
+            ) AS evaluate,
+            uiq.type AS queryType
         FROM
             m_wbs_tree_contract AS wtc
         LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = #{classify} and uiq.is_deleted = 0
@@ -299,7 +326,9 @@
     </select>
 
     <select id="getReportNumberByContractId" resultMap="intResultMap">
-        select report_number from u_information_query where is_deleted = 0 and contract_id = #{contractId} and classify = #{classify} and report_number is not null group by report_number order by report_number ASC
+        select report_number from u_information_query where
+        is_deleted = 0 and contract_id = #{contractId}
+        and classify = #{classify} and report_number is not null group by report_number order by report_number ASC
     </select>
 
     <select id="queryFileUserByContractId" resultMap="informationQueryResultMap">

+ 5 - 3
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.xml

@@ -37,12 +37,14 @@
           process_instance_id,
           approval_type,
           status,
-          batch
-        from u_task where form_data_id like #{formDataId} and status in(1,2) and is_deleted = 0 order by create_time DESC limit 1
+          batch,
+          project_id,
+          contract_id
+        from u_task where form_data_id like concat('%',#{formDataId},'%') and status in(1,2) and is_deleted = 0 order by create_time DESC limit 1
     </select>
 
     <select id="queryBatchList" resultMap="taskResultMap">
-        select batch from u_task where is_deleted = 0 and project_id = #{projectId}
+        select batch from u_task where is_deleted = 0 and status = 1 and project_id = #{projectId}
         <if test="contractId != null and contractId != ''">
             and contract_id = #{contractId}
         </if>

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceClassificationMapper.java

@@ -0,0 +1,7 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.entity.TrialDeviceClassification;
+
+public interface TrialDeviceClassificationMapper extends BaseMapper<TrialDeviceClassification> {
+}

+ 20 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceClassificationMapper.xml

@@ -0,0 +1,20 @@
+<?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.business.mapper.TrialDeviceClassificationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.TrialDeviceClassification">
+        <result column="id" property="id"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="class_name" property="className"/>
+        <result column="sort" property="sort"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+</mapper>

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceInfoMapper.java

@@ -0,0 +1,7 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.entity.TrialDeviceInfo;
+
+public interface TrialDeviceInfoMapper extends BaseMapper<TrialDeviceInfo> {
+}

+ 35 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialDeviceInfoMapper.xml

@@ -0,0 +1,35 @@
+<?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.business.mapper.TrialDeviceInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.TrialDeviceInfo">
+        <result column="id" property="id"/>
+        <result column="manager_id" property="managerId"/>
+        <result column="device_class_id" property="deviceClassId"/>
+        <result column="device_name" property="deviceName"/>
+        <result column="device_type" property="deviceType"/>
+        <result column="device_number" property="deviceNumber"/>
+        <result column="device_model" property="deviceModel"/>
+        <result column="manufacturer" property="manufacturer"/>
+        <result column="production_date" property="productionDate"/>
+        <result column="factory_number" property="factoryNumber"/>
+        <result column="equipment_acquisition_number" property="equipmentAcquisitionNumber"/>
+        <result column="mobilization_date" property="mobilizationDate"/>
+        <result column="measuring_range" property="measuringRange"/>
+        <result column="accuracy" property="accuracy"/>
+        <result column="calibration_cycle" property="calibrationCycle"/>
+        <result column="lastCalibration_time" property="lastCalibrationTime"/>
+        <result column="is_calibration" property="isCalibration"/>
+        <result column="remarks" property="remarks"/>
+        <result column="sort" property="sort"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+</mapper>

+ 14 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialMaterialMobilizationMapper.java

@@ -0,0 +1,14 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.TrialMaterialMobilization;
+
+import java.util.List;
+
+public interface TrialMaterialMobilizationMapper extends BaseMapper<TrialMaterialMobilization> {
+
+    List<TrialMaterialMobilization> selectPages(IPage<TrialMaterialMobilization> page,@Param("obj") TrialMaterialMobilization obj);
+
+}

+ 42 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialMaterialMobilizationMapper.xml

@@ -0,0 +1,42 @@
+<?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.business.mapper.TrialMaterialMobilizationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.TrialMaterialMobilization">
+        <result column="id" property="id"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="user_id" property="userId"/>
+        <result column="material_name" property="materialName"/>
+        <result column="material_type" property="materialType"/>
+        <result column="specification_model" property="specificationModel"/>
+        <result column="material_number" property="materialNumber"/>
+        <result column="material_price" property="materialPrice"/>
+        <result column="material_count" property="materialCount"/>
+        <result column="calculation_unit" property="calculationUnit"/>
+        <result column="batch_number" property="batchNumber"/>
+        <result column="mobilization_date" property="mobilizationDate"/>
+        <result column="proposed_position" property="proposedPosition"/>
+        <result column="supplier_unit" property="supplierUnit"/>
+        <result column="place_of_production" property="placeOfProduction"/>
+        <result column="production_certificate" property="productionCertificate"/>
+        <result column="quality_inspection_report" property="qualityInspectionReport"/>
+        <result column="other_accessories" property="otherAccessories"/>
+        <result column="sort" property="sort"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <select id="selectPages" resultType="org.springblade.business.entity.TrialMaterialMobilization">
+        SELECT * FROM u_trial_material_mobilization WHERE is_deleted = 0
+        <if test="obj.materialType != null">
+            AND material_type = #{obj.materialType}
+        </if>
+    </select>
+
+</mapper>

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.java

@@ -0,0 +1,8 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.entity.TrialSampleInfo;
+
+public interface TrialSampleInfoMapper extends BaseMapper<TrialSampleInfo> {
+
+}

+ 36 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml

@@ -0,0 +1,36 @@
+<?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.business.mapper.TrialSampleInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.TrialSampleInfo">
+        <result column="id" property="id"/>
+        <result column="node_id" property="nodeId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="user_id" property="userId"/>
+        <result column="material_name" property="materialName"/>
+        <result column="specification_model" property="specificationModel"/>
+        <result column="specification_number" property="specificationNumber"/>
+        <result column="material_count" property="materialCount"/>
+        <result column="representative_count" property="representativeCount"/>
+        <result column="calculation_unit" property="calculationUnit"/>
+        <result column="batch_number" property="batchNumber"/>
+        <result column="supplier_unit" property="supplierUnit"/>
+        <result column="sampling_location" property="samplingLocation"/>
+        <result column="mobilization_date" property="mobilizationDate"/>
+        <result column="proposed_position" property="proposedPosition"/>
+        <result column="sample_description" property="sampleDescription"/>
+        <result column="sampling_date" property="samplingDate"/>
+        <result column="is_outsourcing" property="isOutsourcing"/>
+        <result column="sort" property="sort"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+
+</mapper>

+ 20 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSamplingRecordMapper.java

@@ -0,0 +1,20 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.entity.TrialSamplingRecord;
+
+import java.util.List;
+
+public interface TrialSamplingRecordMapper extends BaseMapper<TrialSamplingRecord> {
+
+    TrialSamplingRecord selectByMobilizationIdAndSampleInfoId(Long mobilizationId, Long id);
+
+    void deleteBySampleInfoId(Long id);
+
+    void insertRecord(Long id, Long mobilizationId, Long sampleInfoId);
+
+    List<TrialSamplingRecord> selectListByMobilizationId(Long mobilizationId);
+
+    List<TrialSamplingRecord> selectAll();
+
+}

+ 31 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSamplingRecordMapper.xml

@@ -0,0 +1,31 @@
+<?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.business.mapper.TrialSamplingRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.TrialSamplingRecord">
+        <result column="id" property="id"/>
+        <result column="mobilization_id" property="mobilizationId"/>
+    </resultMap>
+
+    <insert id="insertRecord">
+        insert into u_trial_sampling_record (id,mobilization_id,sample_info_id) values (#{id},#{mobilizationId},#{sampleInfoId})
+    </insert>
+
+    <delete id="deleteBySampleInfoId">
+        delete from u_trial_sampling_record where sample_info_id = #{id}
+    </delete>
+
+    <select id="selectByMobilizationIdAndSampleInfoId" resultType="org.springblade.business.entity.TrialSamplingRecord">
+        select * from u_trial_sampling_record where mobilization_id = #{mobilizationId} and sample_info_id = #{id}
+    </select>
+
+    <select id="selectListByMobilizationId" resultType="org.springblade.business.entity.TrialSamplingRecord">
+        select * from u_trial_sampling_record where mobilization_id = #{mobilizationId}
+    </select>
+
+    <select id="selectAll" resultType="org.springblade.business.entity.TrialSamplingRecord">
+        select * from u_trial_sampling_record
+    </select>
+
+</mapper>

+ 16 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialDeviceClassificationService.java

@@ -0,0 +1,16 @@
+package org.springblade.business.service;
+
+import org.springblade.business.entity.TrialDeviceClassification;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+public interface ITrialDeviceClassificationService extends BaseService<TrialDeviceClassification> {
+
+    boolean classSubmit(TrialDeviceClassification obj);
+
+    TrialDeviceClassification classDetail(Long id);
+
+    List<TrialDeviceClassification> classList(Long contractId);
+
+}

+ 24 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialDeviceInfoService.java

@@ -0,0 +1,24 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.TrialDeviceInfo;
+import org.springblade.business.excel.TrialDeviceInfoExcel;
+import org.springblade.business.vo.TrialDeviceInfoVO;
+import org.springblade.core.mp.base.BaseService;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+public interface ITrialDeviceInfoService extends BaseService<TrialDeviceInfo> {
+
+    boolean submit(TrialDeviceInfo obj);
+
+    TrialDeviceInfo detail(Long id);
+
+    IPage<TrialDeviceInfoVO> selectPage(IPage<TrialDeviceInfo> page, TrialDeviceInfoVO obj);
+
+    String printPdf(String ids, HttpServletResponse response);
+
+    boolean saveBatchDeviceInfo(List<TrialDeviceInfoExcel> list);
+
+}

+ 35 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialMaterialMobilizationService.java

@@ -0,0 +1,35 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.dto.TrialMaterialMobilizationDTO;
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.business.excel.TrialMaterialMobilizationExcel;
+import org.springblade.business.vo.TrialMaterialMobilizationVO;
+import org.springblade.business.vo.TrialSamplingRecordVO;
+import org.springblade.core.mp.base.BaseService;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+
+public interface ITrialMaterialMobilizationService extends BaseService<TrialMaterialMobilization> {
+
+    boolean mobilizationVerification(String number, String id);
+
+    boolean mobilizationSubmit(TrialMaterialMobilization obj);
+
+    TrialMaterialMobilization mobilizationDetail(Long id);
+
+    boolean mobilizationCopy(List<TrialMaterialMobilizationDTO> dto);
+
+    IPage<TrialMaterialMobilizationVO> selectPage(IPage<TrialMaterialMobilization> page, TrialMaterialMobilizationVO obj);
+
+    List<TrialMaterialMobilization> selectList();
+
+    void importMobilization(List<TrialMaterialMobilizationExcel> data, Boolean isCovered, Long contractId);
+
+    String mobilizationExportPdf(String ids, HttpServletResponse response);
+
+    List<TrialSamplingRecordVO> samplingRecordList(Long id);
+
+}

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

@@ -0,0 +1,29 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.dto.TrialSampleInfoDTO;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.excel.TrialSampleInfoExcel;
+import org.springblade.business.vo.TrialSampleInfoVO;
+import org.springblade.core.mp.base.BaseService;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+public interface ITrialSampleInfoService extends BaseService<TrialSampleInfo> {
+
+    TrialSampleInfo sampleDetail(Long id);
+
+    IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfo> page, TrialSampleInfoVO obj);
+
+    boolean sampleSubmit(TrialSampleInfoDTO obj);
+
+    boolean sampleCopy(List<TrialSampleInfoDTO> dto);
+
+    void importSample(List<TrialSampleInfoExcel> data, Boolean isCovered, Long contractId);
+
+    String sampleExportPdf(String ids, HttpServletResponse response);
+
+    boolean sampleVerification(String specificationNumber,String id);
+
+}

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSamplingRecordService.java

@@ -0,0 +1,7 @@
+package org.springblade.business.service;
+
+import org.springblade.business.entity.TrialSamplingRecord;
+import org.springblade.core.mp.base.BaseService;
+
+public interface ITrialSamplingRecordService extends BaseService<TrialSamplingRecord> {
+}

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

@@ -78,6 +78,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     private final IInformationQueryService informationQueryService;
 
+    private final IInformationQueryFileService informationQueryFileService;
+
     private final IContractLogService contractLogService;
 
     private final IMessageWarningService messageWarningService;
@@ -200,12 +202,16 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //封面
                     vo.setApprovalFileList(query.getName(), StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
                 }
-                //不是审批时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
+                //不是签章时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
                 if(!isTask){
                     //关联资料
                     if(StringUtils.isNotEmpty(query.getLinkMergePdfUrl())){
                         vo.setApprovalFileList("首件关联资料", query.getLinkMergePdfUrl());
                     }
+                    InformationQueryFile queryFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
+                    if(queryFile != null){
+                        vo.setApprovalFileList(queryFile.getName(), queryFile.getPdfUrl());
+                    }
                 }
 
             } else {

+ 33 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDeviceClassificationServiceImpl.java

@@ -0,0 +1,33 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialDeviceClassification;
+import org.springblade.business.mapper.TrialDeviceClassificationMapper;
+import org.springblade.business.service.ITrialDeviceClassificationService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class TrialDeviceClassificationServiceImpl extends BaseServiceImpl<TrialDeviceClassificationMapper, TrialDeviceClassification> implements ITrialDeviceClassificationService {
+    @Override
+    public boolean classSubmit(TrialDeviceClassification obj) {
+        return this.saveOrUpdate(obj);
+    }
+
+    @Override
+    public TrialDeviceClassification classDetail(Long id) {
+        return baseMapper.selectById(id);
+    }
+
+    @Override
+    public List<TrialDeviceClassification> classList(Long contractId) {
+        return baseMapper.selectList(Wrappers.<TrialDeviceClassification>query().lambda()
+                .eq(TrialDeviceClassification::getContractId, contractId)
+                .eq(TrialDeviceClassification::getStatus, 1).orderBy(true, true, TrialDeviceClassification::getCreateTime));
+    }
+
+}

+ 273 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDeviceInfoServiceImpl.java

@@ -0,0 +1,273 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.lowagie.text.Document;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Font;
+import com.lowagie.text.Paragraph;
+import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfWriter;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.springblade.business.entity.TrialDeviceClassification;
+import org.springblade.business.entity.TrialDeviceInfo;
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.excel.TrialDeviceInfoExcel;
+import org.springblade.business.mapper.TrialDeviceClassificationMapper;
+import org.springblade.business.mapper.TrialDeviceInfoMapper;
+import org.springblade.business.service.ITrialDeviceInfoService;
+import org.springblade.business.utils.PDFUtil;
+import org.springblade.business.utils.SystemUtils;
+import org.springblade.business.vo.TrialDeviceInfoVO;
+import org.springblade.business.wrapper.TrialDeviceInfoWarpper;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.user.entity.User;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class TrialDeviceInfoServiceImpl extends BaseServiceImpl<TrialDeviceInfoMapper, TrialDeviceInfo> implements ITrialDeviceInfoService {
+
+    private final NewIOSSClient newIOSSClient;
+    private final TrialDeviceClassificationMapper trialDeviceClassificationMapper;
+
+    @Override
+    public boolean submit(TrialDeviceInfo obj) {
+        if (ObjectUtil.isNotEmpty(obj.getId())) {
+            TrialDeviceInfo trialDeviceInfo = baseMapper.selectById(obj.getId());
+            if (!trialDeviceInfo.getLastCalibrationTime().equals(obj.getLastCalibrationTime())) {
+                //如果修改了最近校验时间,那么每次编辑默认修改校验为0=否
+                obj.setIsCalibration(0);
+            }
+        }
+        return this.saveOrUpdate(obj);
+    }
+
+    @Override
+    public TrialDeviceInfo detail(Long id) {
+        return baseMapper.selectById(id);
+    }
+
+    @Override
+    public IPage<TrialDeviceInfoVO> selectPage(IPage<TrialDeviceInfo> page, TrialDeviceInfoVO obj) {
+        QueryWrapper<TrialDeviceInfo> queryWrapper = Condition.getQueryWrapper(obj);
+        if (ObjectUtil.isNotEmpty(obj.getDeviceClassId())) {
+            queryWrapper.lambda().eq(TrialDeviceInfo::getDeviceClassId, obj.getDeviceClassId());
+        }
+        if (ObjectUtil.isNotEmpty(obj.getIsCalibration())) {
+            queryWrapper.lambda().eq(TrialDeviceInfo::getIsCalibration, obj.getIsCalibration());
+        }
+        if (ObjectUtil.isNotEmpty(obj.getStatus())) {
+            queryWrapper.lambda().eq(TrialDeviceInfo::getStatus, obj.getStatus());
+        }
+        if (ObjectUtil.isNotEmpty(obj.getQueryValue())) {
+            queryWrapper.lambda().like(TrialDeviceInfo::getDeviceName, obj.getQueryValue());
+            queryWrapper.lambda().or().like(TrialDeviceInfo::getDeviceNumber, obj.getQueryValue());
+        }
+        if (StringUtils.isNotEmpty(obj.getStartTime()) && StringUtils.isNotEmpty(obj.getEndTime())) {
+            String endTime = obj.getEndTime();
+            endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd HH:mm:ss"), 1), "yyyy-MM-dd HH:mm:ss");
+            queryWrapper.lambda().between(TrialDeviceInfo::getCreateTime, obj.getStartTime(), endTime);
+        }
+        IPage<TrialDeviceInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, true, TrialDeviceInfo::getCreateTime));
+        IPage<TrialDeviceInfoVO> trialDeviceInfoVOIPage = TrialDeviceInfoWarpper.build().pageVO(pages);
+        List<TrialDeviceInfoVO> records = trialDeviceInfoVOIPage.getRecords();
+        return trialDeviceInfoVOIPage.setRecords(records);
+    }
+
+    @Override
+    public String printPdf(String ids, HttpServletResponse response) {
+        try {
+            String fileName = java.net.URLEncoder.encode(DateUtil.time() + ".pdf", "UTF-8");
+            response.reset();
+            response.setHeader("Content-Disposition", "inline; filename=" + java.net.URLEncoder.encode(fileName, "UTF-8"));
+
+            //构造数据
+            List<TrialDeviceInfo> pdfData = baseMapper.selectBatchIds(Func.toLongList(ids));
+            //获取设备分类数据
+            List<TrialDeviceClassification> deviceClassificationList = trialDeviceClassificationMapper.selectList(Wrappers.<TrialDeviceClassification>query().lambda());
+
+            //删除旧PDF
+            List<String> pdfUrls = pdfData.stream().map(TrialDeviceInfo::getPdfUrl).distinct().collect(Collectors.toList());
+            for (String pdfUrl : pdfUrls) {
+                //格式 https: //xxx.com//upload/20221101/xxx.pdf
+                String pdfName = pdfUrl.split("//")[2].split("/")[2];
+                newIOSSClient.removeFile(pdfName);
+            }
+
+            //创建文档,设置页面大小、左右上下边距
+            Document document = new Document();
+
+            BaseFont bfChinese = null;
+            String pdfUrl = null;
+            //处理中文显示问题,使用资源字体
+            if (SystemUtils.isWindows()) {
+                //windows
+                pdfUrl = "C:\\pdfFiles\\";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("C:/WINDOWS/Fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+            if (SystemUtils.isLinux()) {
+                //linux
+                pdfUrl = "/home/pdfFiles";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("/usr/share/fonts/my-fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+
+            FileOutputStream fileOutputStream = new FileOutputStream(pdfUrl + fileName);
+
+            //Font dateTitle = new Font(bfChinese, 7, Font.NORMAL);
+            //Font title = new Font(bfChinese, 12, Font.BOLD);//文字加粗
+            Font textFont = new Font(bfChinese, 7, Font.NORMAL);//文字正常
+
+            //设置分页
+            PdfWriter.getInstance(document, fileOutputStream);
+
+            //打开文档
+            document.open();
+
+            //标题
+            PdfPTable tableTitle = new PdfPTable(3);
+            //生成一个9列的表格
+            PdfPTable table = new PdfPTable(18);
+
+            //定义每个单元格的宽度
+            float[] widthsHeaderTitle = {1f, 1f, 1f};
+            float[] widthsHeader = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+
+            float lineHeight = (float) 20.0;
+
+            //设置表格每一格的宽度
+            tableTitle.setWidths(widthsHeaderTitle);
+            table.setWidths(widthsHeader);
+
+            //设置表格总体宽度
+            tableTitle.setWidthPercentage(100);
+            table.setWidthPercentage(100);
+
+            int colSpan = 1;
+
+            /*SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = new Date(System.currentTimeMillis());
+            //添加标题
+            PDFUtil.createTableCellLeft("导出人:XXX", textFont, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellCenter("XXX表", title, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellRight(formatter.format(date), dateTitle, tableTitle, lineHeight, colSpan);*/
+
+            document.add(tableTitle);
+            document.add(new Paragraph("\n"));
+
+            String[] array = {"ID", "设备名称", "设备分类", "设备编号", "设备型号", "生产厂家", "出厂日期", "出厂编号", "进场日期", "测量范围",
+                    "精准度", "校准周期(月)", "最近校验时间", "状态", "是否需要校验", "设备采集编号", "设备管理人员", "备注"};
+            for (String s : array) {
+                PDFUtil.createTableCell(s, textFont, table, lineHeight, colSpan);
+            }
+            for (TrialDeviceInfo pdfDatum : pdfData) {
+                for (TrialDeviceClassification classification : deviceClassificationList) {
+                    PDFUtil.createTableCell(String.valueOf(pdfDatum.getId()), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getDeviceName(), textFont, table, lineHeight, colSpan);
+                    if (classification.getId().equals(pdfDatum.getDeviceClassId())) {
+                        PDFUtil.createTableCell(classification.getClassName(), textFont, table, lineHeight, colSpan);
+                    }
+                    PDFUtil.createTableCell(pdfDatum.getDeviceNumber(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getDeviceModel(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getManufacturer(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getProductionDate().toString(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getFactoryNumber(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getEquipmentAcquisitionNumber(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getAccuracy(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getMeasuringRange(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getLastCalibrationTime().toString(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getStatus().equals(0) ? "已停用" : "启用中", textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getIsCalibration().equals(0) ? "否" : "是", textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getEquipmentAcquisitionNumber(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getManagerName(), textFont, table, lineHeight, colSpan);
+                    PDFUtil.createTableCell(pdfDatum.getRemarks(), textFont, table, lineHeight, colSpan);
+                }
+            }
+
+            document.add(table);
+            document.close();
+            BladeFile bladeFile;
+            try {
+                document.close();
+                fileOutputStream.close();
+
+                //存储OSS
+                File file = new File(pdfUrl + fileName);
+                String canonicalPath = file.getCanonicalPath();
+                String name = file.getName();
+                bladeFile = newIOSSClient.uploadFile(name, canonicalPath);
+
+                //修改URL
+                for (TrialDeviceInfo trialDeviceInfo : pdfData) {
+                    trialDeviceInfo.setPdfUrl(bladeFile.getLink());
+                }
+                this.updateBatchById(pdfData);
+
+                //删除本地缓存
+                if (file.exists()) {
+                    file.delete();
+                }
+
+                return bladeFile.getLink();
+
+            } catch (ClassCastException e) {
+                e.printStackTrace();
+            }
+
+        } catch (DocumentException | IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public boolean saveBatchDeviceInfo(List<TrialDeviceInfoExcel> list) {
+        List<TrialDeviceClassification> deviceClassifications = trialDeviceClassificationMapper.selectList(Wrappers.<TrialDeviceClassification>query().lambda());
+        List<TrialDeviceInfo> listData = new ArrayList<>();
+        for (TrialDeviceInfoExcel trialDeviceInfoExcel : list) {
+            for (TrialDeviceClassification deviceClassification : deviceClassifications) {
+                if (trialDeviceInfoExcel.getManagerName().equals(deviceClassification.getClassName())) {
+                    TrialDeviceInfo trialDeviceInfo = BeanUtil.copyProperties(trialDeviceInfoExcel, TrialDeviceInfo.class);
+                    if (trialDeviceInfo != null) {
+                        trialDeviceInfo.setDeviceClassId(deviceClassification.getId());
+                        listData.add(trialDeviceInfo);
+                    }
+                }
+            }
+        }
+        this.saveBatch(listData);
+        return true;
+    }
+
+
+}

+ 352 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java

@@ -0,0 +1,352 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.lowagie.text.Document;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Font;
+import com.lowagie.text.Paragraph;
+import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfWriter;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.springblade.business.dto.TrialMaterialMobilizationDTO;
+import org.springblade.business.entity.TrialMaterialMobilization;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.entity.TrialSamplingRecord;
+import org.springblade.business.excel.TrialMaterialMobilizationExcel;
+import org.springblade.business.mapper.TrialMaterialMobilizationMapper;
+import org.springblade.business.mapper.TrialSampleInfoMapper;
+import org.springblade.business.mapper.TrialSamplingRecordMapper;
+import org.springblade.business.service.ITrialMaterialMobilizationService;
+import org.springblade.business.utils.PDFUtil;
+import org.springblade.business.utils.SystemUtils;
+import org.springblade.business.vo.TrialMaterialMobilizationVO;
+import org.springblade.business.vo.TrialSamplingRecordVO;
+import org.springblade.business.wrapper.TrialMaterialMobilizationWarpper;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.*;
+import org.springblade.resource.feign.NewIOSSClient;
+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.mock.web.MockMultipartFile;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialMaterialMobilizationMapper, TrialMaterialMobilization> implements ITrialMaterialMobilizationService {
+
+    private final IUserClient iUserClient;
+    private final IDictClient iDictClient;
+    private final TrialSampleInfoMapper trialSampleInfoMapper;
+    private final TrialSamplingRecordMapper trialSamplingRecordMapper;
+    private final NewIOSSClient newIOSSClient;
+
+    @Override
+    public boolean mobilizationVerification(String number, String id) {
+        List<TrialMaterialMobilization> list = baseMapper.selectList(Wrappers.<TrialMaterialMobilization>query().lambda());
+        if (StringUtils.isEmpty(id)) {
+            TrialMaterialMobilization trialMaterialMobilization1 = list.stream().filter(f -> f.getMaterialNumber().equals(number)).findAny().orElse(null);
+            return trialMaterialMobilization1 != null;
+        } else {
+            TrialMaterialMobilization trialMaterialMobilization = list.stream().filter(f -> f.getId().equals(Long.parseLong(id))).findAny().orElse(null);
+            assert trialMaterialMobilization != null;
+            if (!trialMaterialMobilization.getMaterialNumber().equals(number)) {
+                TrialMaterialMobilization trialMaterialMobilization1 = list.stream().filter(f -> f.getMaterialNumber().equals(number)).findAny().orElse(null);
+                return trialMaterialMobilization1 != null;
+            }
+            return false;
+        }
+    }
+
+    @Override
+    public boolean mobilizationSubmit(TrialMaterialMobilization obj) {
+        if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
+            throw new ServiceException("获取用户信息失败");
+        }
+        obj.setUserId(SecureUtil.getUserId());
+        return this.saveOrUpdate(obj);
+    }
+
+    @Override
+    public TrialMaterialMobilization mobilizationDetail(Long id) {
+        return baseMapper.selectById(id);
+    }
+
+    @Override
+    public boolean mobilizationCopy(List<TrialMaterialMobilizationDTO> dto) throws ServiceException {
+        long count = dto.stream().map(TrialMaterialMobilizationDTO::getMaterialNumber).distinct().count();
+        if (count < dto.size()) {
+            throw new ServiceException("当前有数据的编号重复,请重新填写");
+        }
+        List<TrialMaterialMobilization> list = new ArrayList<>();
+        for (TrialMaterialMobilizationDTO trialMaterialMobilizationDTO : dto) {
+            trialMaterialMobilizationDTO.setId(SnowFlakeUtil.getId());
+            list.add(trialMaterialMobilizationDTO);
+        }
+        return this.saveBatch(list);
+    }
+
+    @Override
+    public IPage<TrialMaterialMobilizationVO> selectPage(IPage<TrialMaterialMobilization> page, TrialMaterialMobilizationVO obj) {
+        QueryWrapper<TrialMaterialMobilization> queryWrapper = Condition.getQueryWrapper(obj);
+        if (ObjectUtil.isNotEmpty(obj.getMaterialType())) {
+            queryWrapper.lambda().eq(TrialMaterialMobilization::getMaterialType, obj.getMaterialType());
+        }
+        if (StringUtils.isNotEmpty(obj.getStartTime()) && StringUtils.isNotEmpty(obj.getEndTime())) {
+            String endTime = obj.getEndTime();
+            endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd HH:mm:ss"), 1), "yyyy-MM-dd HH:mm:ss");
+            queryWrapper.lambda().between(TrialMaterialMobilization::getCreateTime, obj.getStartTime(), endTime);
+        }
+        if (ObjectUtil.isNotEmpty(obj.getQueryValue())) {
+            queryWrapper.lambda().like(TrialMaterialMobilization::getMaterialName, obj.getQueryValue());
+            queryWrapper.lambda().or().like(TrialMaterialMobilization::getSpecificationModel, obj.getQueryValue());
+            queryWrapper.lambda().or().like(TrialMaterialMobilization::getMaterialNumber, obj.getQueryValue());
+        }
+        IPage<TrialMaterialMobilization> pages = this.page(page, queryWrapper.lambda().orderBy(true, true, TrialMaterialMobilization::getCreateTime));
+
+        IPage<TrialMaterialMobilizationVO> trialMaterialMobilizationVOIPage = TrialMaterialMobilizationWarpper.build().pageVO(pages);
+        List<TrialMaterialMobilizationVO> records = trialMaterialMobilizationVOIPage.getRecords();
+        for (TrialMaterialMobilizationVO record : records) {
+            R<User> userR = iUserClient.userInfoById(record.getUserId());
+            record.setUserName(userR.getData().getName());
+        }
+        return trialMaterialMobilizationVOIPage.setRecords(records);
+    }
+
+    @Override
+    public List<TrialMaterialMobilization> selectList() {
+        return baseMapper.selectList(Wrappers.<TrialMaterialMobilization>query().lambda().eq(TrialMaterialMobilization::getStatus, 1));
+    }
+
+    @Override
+    public void importMobilization(List<TrialMaterialMobilizationExcel> data, Boolean isCovered, Long contractId) {
+        List<TrialMaterialMobilization> list = new ArrayList<>();
+        if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
+            throw new ServiceException("获取用户信息失败");
+        }
+        data.forEach(excel -> {
+            TrialMaterialMobilization trialMaterialMobilization = BeanUtil.copyProperties(excel, TrialMaterialMobilization.class);
+            assert trialMaterialMobilization != null;
+            trialMaterialMobilization.setUserId(SecureUtil.getUserId());
+            trialMaterialMobilization.setContractId(contractId);
+            list.add(trialMaterialMobilization);
+        });
+        if (isCovered) {
+            this.saveOrUpdateBatch(list);
+        } else {
+            this.saveBatch(list);
+        }
+    }
+
+    @Override
+    public String mobilizationExportPdf(String ids, HttpServletResponse response) {
+        try {
+            String fileName = java.net.URLEncoder.encode(DateUtil.time() + ".pdf", "UTF-8");
+            response.reset();
+            response.setHeader("Content-Disposition", "inline; filename=" + java.net.URLEncoder.encode(fileName, "UTF-8"));
+
+            //构造数据
+            List<TrialMaterialMobilization> list = baseMapper.selectBatchIds(Func.toLongList(ids));
+
+            //材料类型
+            R<List<Dict>> typeList = iDictClient.getList("material_type");
+
+            //获取所有用户信息
+            List<User> userList = iUserClient.selectUserAll();
+
+            //删除旧PDF
+            List<String> pdfUrls = list.stream().map(TrialMaterialMobilization::getPdfUrl).distinct().collect(Collectors.toList());
+            for (String pdfUrl : pdfUrls) {
+                //格式 https: //xxx.com//upload/20221101/xxx.pdf
+                String pdfName = pdfUrl.split("//")[2].split("/")[2];
+                newIOSSClient.removeFile(pdfName);
+            }
+
+            List<TrialMaterialMobilizationVO> pdfData = new ArrayList<>();
+            for (TrialMaterialMobilization trialMaterialMobilization : list) {
+
+                for (User user : userList) {
+                    if (trialMaterialMobilization.getUserId().equals(user.getId())) {
+                        TrialMaterialMobilizationVO trialMaterialMobilizationVO = BeanUtil.copyProperties(trialMaterialMobilization, TrialMaterialMobilizationVO.class);
+                        assert trialMaterialMobilizationVO != null;
+                        trialMaterialMobilizationVO.setUserName(user.getName());
+                        pdfData.add(trialMaterialMobilizationVO);
+                    }
+                }
+            }
+
+            //创建文档,设置页面大小、左右上下边距
+            Document document = new Document();
+            BaseFont bfChinese = null;
+            String pdfUrl = null;
+            //处理中文显示问题,使用资源字体
+            if (SystemUtils.isWindows()) {
+                //windows
+                pdfUrl = "C:\\pdfFiles\\";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("C:/WINDOWS/Fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+            if (SystemUtils.isLinux()) {
+                //linux
+                pdfUrl = "/home/pdfFiles";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("/usr/share/fonts/my-fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+
+            FileOutputStream fileOutputStream = new FileOutputStream(pdfUrl + fileName);
+
+            //Font dateTitle = new Font(bfChinese, 7, Font.NORMAL);
+            //Font title = new Font(bfChinese, 12, Font.BOLD);//文字加粗
+            Font textFont = new Font(bfChinese, 7, Font.NORMAL);//文字正常
+
+            //设置分页
+            PdfWriter.getInstance(document, fileOutputStream);
+
+            //打开文档
+            document.open();
+
+            //标题
+            PdfPTable tableTitle = new PdfPTable(3);
+            //生成一个13列的表格
+            PdfPTable table = new PdfPTable(13);
+
+            //定义每个单元格的宽度
+            float[] widthsHeaderTitle = {1f, 1f, 1f};
+            float[] widthsHeader = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+
+            float lineHeight = (float) 20.0;
+
+            //设置表格每一格的宽度
+            tableTitle.setWidths(widthsHeaderTitle);
+            table.setWidths(widthsHeader);
+
+            //设置表格总体宽度
+            tableTitle.setWidthPercentage(100);
+            table.setWidthPercentage(100);
+
+            int colSpan = 1;
+
+            /*SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = new Date(System.currentTimeMillis());
+            //添加标题
+            PDFUtil.createTableCellLeft("导出人:XXX", textFont, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellCenter("XXX表", title, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellRight(formatter.format(date), dateTitle, tableTitle, lineHeight, colSpan);*/
+
+            document.add(tableTitle);
+            document.add(new Paragraph("\n"));
+
+            String[] array = {"材料编号", "进场日期", "材料名称", "材料类型", "规格型号", "供应商单位", "材料单价", "材料数量",
+                    "计算单位", "生产批号", "上产地/厂家", "拟用部位", "记录人"};
+            for (String s : array) {
+                PDFUtil.createTableCell(s, textFont, table, lineHeight, colSpan);
+            }
+            for (TrialMaterialMobilizationVO pdfDatum : pdfData) {
+                PDFUtil.createTableCell(pdfDatum.getMaterialNumber(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(DateUtil.formatDate(pdfDatum.getMobilizationDate()), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getMaterialName(), textFont, table, lineHeight, colSpan);
+
+                for (Dict type : typeList.getData()) {
+                    if (type.getDictKey().equals(pdfDatum.getMaterialType().toString())) {
+                        PDFUtil.createTableCell(type.getDictValue(), textFont, table, lineHeight, colSpan);
+                    }
+                }
+
+                PDFUtil.createTableCell(pdfDatum.getSpecificationModel(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getSupplierUnit(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getMaterialPrice().toString(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getMaterialCount().toString(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getCalculationUnit(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getBatchNumber().toString(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getPlaceOfProduction(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getProposedPosition(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getUserName(), textFont, table, lineHeight, colSpan);
+            }
+            document.add(table);
+
+            BladeFile bladeFile;
+            try {
+                document.close();
+                fileOutputStream.close();
+
+                //存储OSS
+                File file = new File(pdfUrl + fileName);
+                String canonicalPath = file.getCanonicalPath();
+                String name = file.getName();
+                bladeFile = newIOSSClient.uploadFile(name, canonicalPath);
+
+                //修改URL
+                for (TrialMaterialMobilization trialMaterialMobilization : list) {
+                    trialMaterialMobilization.setPdfUrl(bladeFile.getLink());
+                }
+                this.updateBatchById(list);
+
+                //删除本地缓存
+                if (file.exists()) {
+                    file.delete();
+                }
+
+                return bladeFile.getLink();
+
+            } catch (ClassCastException e) {
+                e.printStackTrace();
+            }
+
+        } catch (DocumentException | IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public List<TrialSamplingRecordVO> samplingRecordList(Long id) {
+        //获取关联信息
+        List<TrialSamplingRecord> trialSamplingRecords = trialSamplingRecordMapper.selectListByMobilizationId(id);
+        //获取样品信息
+        List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectList(Wrappers.<TrialSampleInfo>query().lambda());
+        List<TrialSamplingRecordVO> list = new ArrayList<>();
+        for (TrialSamplingRecord trialSamplingRecord : trialSamplingRecords) {
+            for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
+                if (trialSampleInfo.getId().equals(trialSamplingRecord.getSampleInfoId())) {
+                    R<User> userR = iUserClient.userInfoById(trialSampleInfo.getUserId());
+                    TrialSamplingRecordVO trialSamplingRecordVO = BeanUtil.copyProperties(trialSampleInfo, TrialSamplingRecordVO.class);
+                    if (trialSamplingRecordVO != null) {
+                        trialSamplingRecordVO.setUserName(userR.getData().getName());
+                        list.add(trialSamplingRecordVO);
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+
+}

+ 330 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -0,0 +1,330 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.lowagie.text.Document;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Font;
+import com.lowagie.text.Paragraph;
+import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfWriter;
+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.TrialMaterialMobilization;
+import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.entity.TrialSamplingRecord;
+import org.springblade.business.excel.TrialSampleInfoExcel;
+import org.springblade.business.mapper.TrialSampleInfoMapper;
+import org.springblade.business.mapper.TrialSamplingRecordMapper;
+import org.springblade.business.service.ITrialSampleInfoService;
+import org.springblade.business.utils.PDFUtil;
+import org.springblade.business.utils.SystemUtils;
+import org.springblade.business.vo.TrialSampleInfoVO;
+import org.springblade.business.wrapper.TrialSampleInfoWarpper;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.*;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoMapper, TrialSampleInfo> implements ITrialSampleInfoService {
+
+    private final IUserClient iUserClient;
+    private final NewIOSSClient newIOSSClient;
+    private final TrialSamplingRecordMapper trialSamplingRecordMapper;
+
+    @Override
+    public boolean sampleVerification(String specificationNumber, String id) {
+        List<TrialSampleInfo> list = baseMapper.selectList(Wrappers.<TrialSampleInfo>query().lambda());
+        if (StringUtils.isEmpty(id)) {
+            TrialSampleInfo trialSampleInfo = list.stream().filter(f -> f.getSpecificationNumber().equals(specificationNumber)).findAny().orElse(null);
+            return trialSampleInfo != null;
+        } else {
+            TrialSampleInfo trialSampleInfo = list.stream().filter(f -> f.getId().equals(Long.parseLong(id))).findAny().orElse(null);
+            assert trialSampleInfo != null;
+            if (!trialSampleInfo.getSpecificationNumber().equals(specificationNumber)) {
+                TrialSampleInfo trialSampleInfo1 = list.stream().filter(f -> f.getSpecificationNumber().equals(specificationNumber)).findAny().orElse(null);
+                return trialSampleInfo1 != null;
+            }
+            return false;
+        }
+    }
+
+    @Override
+    public TrialSampleInfo sampleDetail(Long id) {
+        return baseMapper.selectById(id);
+    }
+
+    @Override
+    public IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfo> page, TrialSampleInfoVO obj) {
+        QueryWrapper<TrialSampleInfo> queryWrapper = Condition.getQueryWrapper(obj);
+        if (StringUtils.isNotEmpty(String.valueOf(obj.getNodeId()))) {
+            queryWrapper.lambda().eq(TrialSampleInfo::getNodeId, obj.getNodeId());
+        }
+        if (StringUtils.isNotEmpty(obj.getStartTime()) && StringUtils.isNotEmpty(obj.getEndTime())) {
+            String endTime = obj.getEndTime();
+            endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd HH:mm:ss"), 1), "yyyy-MM-dd HH:mm:ss");
+            queryWrapper.lambda().between(TrialSampleInfo::getCreateTime, obj.getStartTime(), endTime);
+        }
+        if (ObjectUtil.isNotEmpty(obj.getQueryValue())) {
+            queryWrapper.lambda().like(TrialSampleInfo::getMaterialName, obj.getQueryValue());
+            queryWrapper.lambda().or().like(TrialSampleInfo::getSpecificationModel, obj.getQueryValue());
+            queryWrapper.lambda().or().like(TrialSampleInfo::getSpecificationNumber, obj.getQueryValue());
+        }
+        IPage<TrialSampleInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, true, TrialSampleInfo::getCreateTime));
+        IPage<TrialSampleInfoVO> trialMaterialMobilizationVOIPage = TrialSampleInfoWarpper.build().pageVO(pages);
+        List<TrialSampleInfoVO> records = trialMaterialMobilizationVOIPage.getRecords();
+        List<TrialSamplingRecord> list = trialSamplingRecordMapper.selectAll();
+        List<User> userList = iUserClient.selectUserAll();
+        for (TrialSampleInfoVO record : records) {
+            for (User user : userList) {
+                if (record.getUserId().equals(user.getId())) {
+                    record.setUserName(user.getName());
+                }
+            }
+            for (TrialSamplingRecord trialSamplingRecord : list) {
+                if (record.getId().equals(trialSamplingRecord.getSampleInfoId())) {
+                    record.setMobilizationId(trialSamplingRecord.getMobilizationId());
+                }
+            }
+        }
+        return trialMaterialMobilizationVOIPage.setRecords(records);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean sampleSubmit(TrialSampleInfoDTO obj) {
+        if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
+            throw new ServiceException("获取用户信息失败");
+        }
+        obj.setUserId(SecureUtil.getUserId());
+
+        this.saveOrUpdate(obj);
+
+        //新增或者修改成功后关联样品取样信息
+        if (obj.getId() != null && obj.getMobilizationId() != null) {
+            //获取当前选择的样品信息
+            TrialSamplingRecord trialSamplingRecord = trialSamplingRecordMapper.selectByMobilizationIdAndSampleInfoId(obj.getMobilizationId(), obj.getId());
+            if (trialSamplingRecord != null) {
+                //存在不新增
+                return true;
+            } else {
+                //删除旧记录
+                trialSamplingRecordMapper.deleteBySampleInfoId(obj.getId());
+                //新增记录
+                trialSamplingRecordMapper.insertRecord(SnowFlakeUtil.getId(), obj.getMobilizationId(), obj.getId());
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public boolean sampleCopy(List<TrialSampleInfoDTO> dto) {
+        long count = dto.stream().map(TrialSampleInfoDTO::getSpecificationNumber).distinct().count();
+        if (count < dto.size()) {
+            throw new ServiceException("当前有数据的编号重复,请重新填写");
+        }
+        List<TrialSampleInfo> list = new ArrayList<>();
+        for (TrialSampleInfoDTO trialSampleInfoDTO : dto) {
+            trialSampleInfoDTO.setId(SnowFlakeUtil.getId());
+            list.add(trialSampleInfoDTO);
+        }
+        return this.saveBatch(list);
+    }
+
+    @Override
+    public void importSample(List<TrialSampleInfoExcel> data, Boolean isCovered, Long contractId) {
+        List<TrialSampleInfo> list = new ArrayList<>();
+        if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
+            throw new ServiceException("获取用户信息失败");
+        }
+        data.forEach(excel -> {
+            TrialSampleInfo trialSampleInfo = BeanUtil.copyProperties(excel, TrialSampleInfo.class);
+            assert trialSampleInfo != null;
+            trialSampleInfo.setUserId(SecureUtil.getUserId());
+            trialSampleInfo.setContractId(contractId);
+            list.add(trialSampleInfo);
+        });
+        if (isCovered) {
+            this.saveOrUpdateBatch(list);
+        } else {
+            this.saveBatch(list);
+        }
+    }
+
+    @Override
+    public String sampleExportPdf(String ids, HttpServletResponse response) {
+        try {
+            String fileName = java.net.URLEncoder.encode(DateUtil.time() + ".pdf", "UTF-8");
+            response.reset();
+            response.setHeader("Content-Disposition", "inline; filename=" + java.net.URLEncoder.encode(fileName, "UTF-8"));
+
+            //构造数据
+            List<TrialSampleInfo> list = baseMapper.selectBatchIds(Func.toLongList(ids));
+
+            //获取所有用户信息
+            List<User> userList = iUserClient.selectUserAll();
+
+            //删除旧PDF
+            List<String> pdfUrls = list.stream().map(TrialSampleInfo::getPdfUrl).distinct().collect(Collectors.toList());
+            for (String pdfUrl : pdfUrls) {
+                //格式 https: //xxx.com//upload/20221101/xxx.pdf
+                String pdfName = pdfUrl.split("//")[2].split("/")[2];
+                newIOSSClient.removeFile(pdfName);
+            }
+
+            List<TrialSampleInfoVO> pdfData = new ArrayList<>();
+            for (TrialSampleInfo trialSampleInfo : list) {
+                for (User user : userList) {
+                    if (trialSampleInfo.getUserId().equals(user.getId())) {
+                        TrialSampleInfoVO trialSampleInfoVO = BeanUtil.copyProperties(trialSampleInfo, TrialSampleInfoVO.class);
+                        assert trialSampleInfoVO != null;
+                        trialSampleInfoVO.setUserName(user.getName());
+                        pdfData.add(trialSampleInfoVO);
+                    }
+                }
+            }
+
+            //创建文档,设置页面大小、左右上下边距
+            Document document = new Document();
+            BaseFont bfChinese = null;
+            String pdfUrl = null;
+            //处理中文显示问题,使用资源字体
+            if (SystemUtils.isWindows()) {
+                //windows
+                pdfUrl = "C:\\pdfFiles\\";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("C:/WINDOWS/Fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+            if (SystemUtils.isLinux()) {
+                //linux
+                pdfUrl = "/home/pdfFiles";
+                File file = new File(pdfUrl);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                bfChinese = BaseFont.createFont("/usr/share/fonts/my-fonts/SIMYOU.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
+            }
+
+            FileOutputStream fileOutputStream = new FileOutputStream(pdfUrl + fileName);
+
+            //Font dateTitle = new Font(bfChinese, 7, Font.NORMAL);
+            //Font title = new Font(bfChinese, 12, Font.BOLD);//文字加粗
+            Font textFont = new Font(bfChinese, 7, Font.NORMAL);//文字正常
+
+            //设置分页
+            PdfWriter.getInstance(document, fileOutputStream);
+
+            //打开文档
+            document.open();
+
+            //标题
+            PdfPTable tableTitle = new PdfPTable(3);
+            //生成一个9列的表格
+            PdfPTable table = new PdfPTable(9);
+
+            //定义每个单元格的宽度
+            float[] widthsHeaderTitle = {1f, 1f, 1f};
+            float[] widthsHeader = {1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f};
+
+            float lineHeight = (float) 20.0;
+
+            //设置表格每一格的宽度
+            tableTitle.setWidths(widthsHeaderTitle);
+            table.setWidths(widthsHeader);
+
+            //设置表格总体宽度
+            tableTitle.setWidthPercentage(100);
+            table.setWidthPercentage(100);
+
+            int colSpan = 1;
+
+            /*SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = new Date(System.currentTimeMillis());
+            //添加标题
+            PDFUtil.createTableCellLeft("导出人:XXX", textFont, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellCenter("XXX表", title, tableTitle, lineHeight, colSpan);
+            PDFUtil.createTableCellRight(formatter.format(date), dateTitle, tableTitle, lineHeight, colSpan);*/
+
+            document.add(tableTitle);
+            document.add(new Paragraph("\n"));
+
+            String[] array = {"样品名称", "取样日期", "样品编号", "规格型号", "试样数量", "计算单位", "拟用部位", "代表数量", "取样人"};
+            for (String s : array) {
+                PDFUtil.createTableCell(s, textFont, table, lineHeight, colSpan);
+            }
+            for (TrialSampleInfoVO pdfDatum : pdfData) {
+                PDFUtil.createTableCell(pdfDatum.getMaterialName(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(DateUtil.formatDate(pdfDatum.getSamplingDate()), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(String.valueOf(pdfDatum.getId()), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getSpecificationModel(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(String.valueOf(pdfDatum.getMaterialCount()), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getCalculationUnit(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getProposedPosition(), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(String.valueOf(pdfDatum.getRepresentativeCount()), textFont, table, lineHeight, colSpan);
+                PDFUtil.createTableCell(pdfDatum.getUserName(), textFont, table, lineHeight, colSpan);
+            }
+            document.add(table);
+            document.close();
+
+            BladeFile bladeFile;
+            try {
+                document.close();
+                fileOutputStream.close();
+
+                //存储OSS
+                File file = new File(pdfUrl + fileName);
+                String canonicalPath = file.getCanonicalPath();
+                String name = file.getName();
+                bladeFile = newIOSSClient.uploadFile(name, canonicalPath);
+
+                //修改URL
+                for (TrialSampleInfo trialSampleInfo : list) {
+                    trialSampleInfo.setPdfUrl(bladeFile.getLink());
+                }
+                this.updateBatchById(list);
+
+                //删除本地缓存
+                if (file.exists()) {
+                    file.delete();
+                }
+
+                return bladeFile.getLink();
+
+            } catch (ClassCastException e) {
+                e.printStackTrace();
+            }
+
+        } catch (DocumentException | IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+}

+ 14 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSamplingRecordServiceImpl.java

@@ -0,0 +1,14 @@
+package org.springblade.business.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialSamplingRecord;
+import org.springblade.business.mapper.TrialSamplingRecordMapper;
+import org.springblade.business.service.ITrialSamplingRecordService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class TrialSamplingRecordServiceImpl extends BaseServiceImpl<TrialSamplingRecordMapper, TrialSamplingRecord> implements ITrialSamplingRecordService {
+
+}

+ 93 - 0
blade-service/blade-business/src/main/java/org/springblade/business/utils/PDFUtil.java

@@ -0,0 +1,93 @@
+package org.springblade.business.utils;
+
+import com.lowagie.text.*;
+import com.lowagie.text.Font;
+import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfPCell;
+import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfWriter;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.List;
+
+public class PDFUtil {
+
+    public static void createTableCell(String text, Font font, PdfPTable table, float lineHeight, int colSapn) {
+        PdfPCell cell;
+        cell = new PdfPCell(new Paragraph(text, font));
+        //合并单元格列
+        cell.setColspan(colSapn);
+        //设置水平居中
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        //设置垂直居中
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setFixedHeight(lineHeight);
+        //将单元格内容添加到表格中
+        table.addCell(cell);
+    }
+
+    public static void createTableCellLeft(String text, Font font, PdfPTable table, float lineHeight, int colSapn) {
+        PdfPCell cell;
+        cell = new PdfPCell(new Paragraph(text, font));
+        //合并单元格列
+        cell.setColspan(colSapn);
+        //设置水平
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        //设置垂直
+        cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
+        cell.setFixedHeight(lineHeight);
+        cell.setBorderWidthRight(0);
+        cell.setBorderWidthBottom(0);
+        cell.setBorderWidthLeft(0);
+        cell.setBorderWidthTop(0);
+        //将单元格内容添加到表格中
+        table.addCell(cell);
+    }
+
+    public static void createTableCellCenter(String text, Font font, PdfPTable table, float lineHeight, int colSapn) {
+        PdfPCell cell;
+        cell = new PdfPCell(new Paragraph(text, font));
+        //合并单元格列
+        cell.setColspan(colSapn);
+        //设置水平居中
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        //设置垂直居中
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setFixedHeight(lineHeight);
+        cell.setBorderWidthLeft(0);
+        cell.setBorderWidthRight(0);
+        cell.setBorderWidthBottom(0);
+        cell.setBorderWidthTop(0);
+
+        //将单元格内容添加到表格中
+        table.addCell(cell);
+
+    }
+
+    public static void createTableCellRight(String text, Font font, PdfPTable table, float lineHeight, int colSapn) {
+        PdfPCell cell;
+        cell = new PdfPCell(new Paragraph(text, font));
+        //合并单元格列
+        cell.setColspan(colSapn);
+        //设置水平
+        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+        //设置垂直
+        cell.setVerticalAlignment(Element.ALIGN_TOP);
+        cell.setFixedHeight(lineHeight);
+        //将单元格内容添加到表格中
+        //去除边框
+        cell.setBorderWidthLeft(0);
+        cell.setBorderWidthBottom(0);
+        cell.setBorderWidthRight(0);
+        cell.setBorderWidthTop(0);
+        table.addCell(cell);
+    }
+
+}
+
+

+ 48 - 0
blade-service/blade-business/src/main/java/org/springblade/business/utils/SystemUtils.java

@@ -0,0 +1,48 @@
+package org.springblade.business.utils;
+
+public class SystemUtils {
+
+    /**
+     * 判断操作系统是否是 Windows
+     *
+     * @return true:操作系统是 Windows
+     *         false:其它操作系统
+     */
+    public static boolean isWindows() {
+        String osName = getOsName();
+
+        return osName != null && osName.startsWith("Windows");
+    }
+
+    /**
+     * 判断操作系统是否是 MacOS
+     *
+     * @return true:操作系统是 MacOS
+     *         false:其它操作系统
+     */
+    public static boolean isMacOs() {
+        String osName = getOsName();
+
+        return osName != null && osName.startsWith("Mac");
+    }
+
+    /**
+     * 判断操作系统是否是 Linux
+     *
+     * @return true:操作系统是 Linux
+     *         false:其它操作系统
+     */
+    public static boolean isLinux() {
+        String osName = getOsName();
+
+        return (osName != null && osName.startsWith("Linux")) || (!isWindows() && !isMacOs());
+    }
+
+    /**
+     * 获取操作系统名称
+     * @return os.name 属性值
+     */
+    public static String getOsName() {
+        return System.getProperty("os.name");
+    }
+}

+ 0 - 1
blade-service/blade-business/src/main/resources/application-dev.yml

@@ -8,4 +8,3 @@ spring:
     url: ${blade.datasource.dev.url}
     username: ${blade.datasource.dev.username}
     password: ${blade.datasource.dev.password}
-

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

@@ -231,7 +231,7 @@ public class EVisaServiceImpl implements EVisaService {
                         if(eVisaConfig.getString("type").equals(next.getPfxType())){
                             //设置签章策略
                             SealStrategyVO vo = new SealStrategyVO();
-                            vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + next.getCertificatePassword());
+                            vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + next.getId());
                             vo.setSealPassword(next.getCertificatePassword());
                             vo.setSealPerson(next.getCertificateUserName() + System.currentTimeMillis());
                             //设置签字文件
@@ -667,7 +667,7 @@ public class EVisaServiceImpl implements EVisaService {
                 return responseHeadBean.getMessage();
             } else if(responseHeadBean.getMessage().contains("is exist")) {
                 logger.info("【电签模块】{}", responseHeadBean.getMessage());
-                return "successfully";
+                return "error";
             }
         }catch (Exception e){
             e.printStackTrace();

+ 38 - 16
blade-service/blade-manager/pom.xml

@@ -11,7 +11,7 @@
 
     <artifactId>blade-manager</artifactId>
     <name>${project.artifactId}</name>
-<version>${bladex.project.version}</version>
+    <version>${bladex.project.version}</version>
     <packaging>jar</packaging>
 
     <repositories>
@@ -86,19 +86,6 @@
             <version>5.3.1</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.itextpdf</groupId>
-            <artifactId>html2pdf</artifactId>
-            <version>2.1.4</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.itextpdf</groupId>
-            <artifactId>itextpdf</artifactId>
-            <version>5.5.13</version>
-            <scope>compile</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.jsoup</groupId>
             <artifactId>jsoup</artifactId>
@@ -157,7 +144,42 @@
             <groupId>me.zhyd.oauth</groupId>
             <artifactId>JustAuth</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>com.aspose</groupId>
+            <artifactId>aspose-cells</artifactId>
+            <version>20.4</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
-
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>dockerfile-maven-plugin</artifactId>
+                <configuration>
+                    <username>${docker.username}</username>
+                    <password>${docker.password}</password>
+                    <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
+                    <tag>${project.version}</tag>
+                    <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                    <buildArgs>
+                        <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
+                    </buildArgs>
+                    <skip>false</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+                <source>${java.version}</source>
+                <target>${java.version}</target>
+                <encoding>${project.build.sourceEncoding}</encoding>
+                <compilerArguments>
+                    <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar:${java.home}/lib/jsse.jar</bootclasspath>
+                </compilerArguments>
+            </configuration>
+        </plugin>
+        </plugins>
+    </build>
 </project>

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

@@ -141,7 +141,7 @@ public class ArchiveTreeController extends BladeController {
     /**
      * 保存/修改上传文件显示配置树
      */
-    @PostMapping("/submitDisplayConfigTree")
+    @PostMapping("/submit-display-config-tree")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "保存/修改上传文件显示配置树", notes = "传入ids")
     @ApiImplicitParams(value = {
@@ -154,7 +154,7 @@ public class ArchiveTreeController extends BladeController {
     /**
      * 获取归档树同级节点
      */
-    @GetMapping("/getSameGradeNode")
+    @GetMapping("/get-same-grade-node")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "获取归档树同级节点", notes = "传入节点id")
     public R<List<ArchiveTree>> getSameGradeNode(@RequestParam String id) {
@@ -164,7 +164,7 @@ public class ArchiveTreeController extends BladeController {
     /**
      * 提交归档树手动排序
      */
-    @PostMapping("/submitArchiveTreeSort")
+    @PostMapping("/submit-tree-sort")
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "提交归档树手动排序", notes = "List<ArchiveTreeSortDTO>集合")
     public R submitArchiveTreeSort(@RequestBody List<ArchiveTreeSortDTO> listSort) {

+ 27 - 14
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ContractInfoController.java

@@ -26,6 +26,7 @@ import org.springblade.manager.service.SaveUserInfoByProjectService;
 import org.springblade.manager.vo.*;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springblade.system.user.vo.UserContractInfoVO;
 import org.springblade.system.user.vo.UserVO2;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -75,7 +76,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 根据项目id查询当前所有合同
      */
-    @GetMapping("/getContractInfoByPid")
+    @GetMapping("/get-contractInfo")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "根据项目id查询当前所有合同", notes = "传入pid")
     public R<List<ContractInfo>> findContractInfoByPid(String pid) {
@@ -129,7 +130,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 删除文件
      */
-    @GetMapping("/deleteFile")
+    @GetMapping("/delete-file")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "删除文件", notes = "传入文件url")
     public R deleteFile(@Valid @RequestParam("url") String url) {
@@ -180,7 +181,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 查询角色的岗位
      */
-    @GetMapping("/getJobByRoleId")
+    @GetMapping("/get-jobs")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "查询角色下的岗位", notes = "传入id")
     public R<List<CRolePostVO>> findJobByRoleId(@ApiParam(value = "id", required = true)
@@ -196,7 +197,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 根据用户列表
      */
-    @GetMapping("/getUserList")
+    @GetMapping("/get-user-list")
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "", notes = "")
     public R<List<User>> findUserList() {
@@ -211,7 +212,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 根据项目id、合同id、角色id查询当前运维的用户
      */
-    @GetMapping("/getUserListByCondition")
+    @GetMapping("/get-user-list-by-condition")
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "查询当前项目角色下的运维用户列表", notes = "传入项目id、角色id、合同id(非必传)、size每页数量、current当前页")
     public R<IPage<User>> findUserListByCondition(FindAllUserByConditionDTO values, Query query) {
@@ -223,7 +224,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 保存-项目分配维护人员
      */
-    @PostMapping("/saveUserInfoByProject")
+    @PostMapping("/save-userInfo-by-project")
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "保存-项目分配维护人员", notes = "传入项目id、合同id、字典主键id、用户id List集合")
     public R saveUserInfoByProject(@RequestBody List<SaveUserInfoByProjectDTO> list) {
@@ -292,7 +293,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 根据项目id、合同id、岗位id查询当前分配的用户-查询当前项目合同岗位下的用户
      */
-    @GetMapping("/getAllUserByCondition")
+    @GetMapping("/get-all-user-by-condition")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "查询当前项目合同岗位下的用户", notes = "传入项目id、合同id、岗位id、size每页数量、current当前页")
     public R<IPage<UserVO2>> findAllUserByCondition(FindAllUserByConditionDTO values, Query query) {
@@ -304,7 +305,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 保存-项目合同段分配人员
      */
-    @PostMapping("/saveUserInfoByProjectTow")
+    @PostMapping("/save-userInfo-by-project-tow")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "保存-项目合同段分配人员", notes = "传入项目id、合同id、岗位处roleId、用户id")
     @Transactional(rollbackFor = Exception.class)
@@ -336,7 +337,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 项目分配用户删除
      */
-    @PostMapping("/removeUsersByIds")
+    @PostMapping("/remove-users-by-ids")
     @ApiOperationSupport(order = 14)
     @ApiOperation(value = "项目分配用户删除", notes = "传入当前列表用户的ids")
     @Transactional(rollbackFor = Exception.class)
@@ -374,7 +375,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 项目分配用户逻辑删除当前项目下所有合同段角色信息
      */
-    @PostMapping("/removeUserProjectInfoAndRoleById")
+    @PostMapping("/remove-userProjectInfo-role-byId")
     @ApiOperationSupport(order = 14)
     @ApiOperation(value = "逻辑删除当前项目下所有合同段角色信息", notes = "传入dataInfo内的一个id")
     public R removeUserProjectInfoAndRoleById(@ApiParam(value = "dataInfo内的一个id", required = true) @RequestParam String id) {
@@ -392,7 +393,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 重置密码
      */
-    @PostMapping("/resetPasswordByUserId")
+    @PostMapping("/reset-password-by-userId")
     @ApiOperationSupport(order = 16)
     @ApiOperation(value = "重置密码", notes = "传入当前用户的userId,默认重置密码123456")
     public R updatePasswordByUserId(@ApiParam(value = "用户userId", required = true) @RequestParam String userId) {
@@ -406,7 +407,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 保存或修改分配合同段wbs树
      */
-    @PostMapping("/submitWbsTreeInContract")
+    @PostMapping("/submit-wbsTree-contract")
     @ApiOperationSupport(order = 17)
     @ApiOperation(value = "保存或修改分配合同段wbs树", notes = "传入WbsTreeContractDTO")
     public R submitWbsTreeInContract(@RequestBody WbsTreeContractDTO wbsTreeContractDTO) {
@@ -458,7 +459,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 查询所有施工合同wbs树根节点(新建监理或业主合同段时,加载当前项目下的施工WBS树,分配时使用)
      */
-    @GetMapping("/treeAllConstruction")
+    @GetMapping("/tree-all-construction")
     @ApiOperationSupport(order = 19)
     @ApiOperation(value = "查询所有施工合同wbs树根节点", notes = "传入wbsId,项目id")
     @ApiImplicitParams(value = {
@@ -498,7 +499,7 @@ public class ContractInfoController extends BladeController {
     /**
      * 查询监理or业主合同段关联信息
      */
-    @GetMapping("/getContractRelationInfo")
+    @GetMapping("/get-contract-relationInfo")
     @ApiOperationSupport(order = 21)
     @ApiOperation(value = "查询监理or业主合同段关联信息", notes = "合同段id")
     @ApiImplicitParam(name = "contractId", value = "合同段id")
@@ -507,5 +508,17 @@ public class ContractInfoController extends BladeController {
         return R.data(list);
     }
 
+    /**
+     * 获取当前合同段所有管理人员信息
+     */
+    @GetMapping("/get-contract-userList")
+    @ApiOperationSupport(order = 22)
+    @ApiOperation(value = "获取当前合同段所有管理人员信息", notes = "传入合同段id")
+    public R<List<UserContractInfoVO>> getContractUserInfo(@RequestParam String contractId) {
+        List<UserContractInfoVO> list = contractInfoService.getContractUserInfo(contractId);
+        return R.data(list);
+    }
+
+
 
 }

+ 538 - 143
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -8,11 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.itextpdf.html2pdf.ConverterProperties;
-import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
-import com.itextpdf.io.font.FontProgram;
-import com.itextpdf.io.font.FontProgramFactory;
-import com.itextpdf.layout.font.FontProvider;
+
 import com.spire.xls.*;
 import com.spire.xls.core.spreadsheet.HTMLOptions;
 import io.swagger.annotations.*;
@@ -387,16 +383,14 @@ public class ExcelTabController extends BladeController {
             String ancestors = parent.getAlias() + StringPool.COMMA + excelTab.getParentId();
             excelTab.setAlias(ancestors);
         }
-        excelTabService.saveOrUpdate(excelTab);
         // 关联清表信息计算
-
         List<ExcelTabWbsTypeVO> linkDataInfo = wbsExclTabParmVO.getLinkDataInfo();
-
         if (linkDataInfo != null && linkDataInfo.size() >= 1) {
             // 判断是否上传excle
             if ((excelTab.getFileUrl() != null || excelTab.getFileUrl() != "") && excelTab.getFileType() != 3) {
                 return R.fail("请上传清表!");
             }
+            excelTabService.saveOrUpdate(excelTab);
             for (ExcelTabWbsTypeVO info : linkDataInfo) {
                 String[] pk_id = info.getLinkIds().split(",");
                 for (String pkInfo : pk_id) {
@@ -411,10 +405,11 @@ public class ExcelTabController extends BladeController {
 
                     updateWrapper.set("is_link_table", Integer.parseInt(pk_type[1]));
                     updateWrapper.set("excel_id", excelTab.getId());
-
                     wbsTreePrivateService.update(updateWrapper);
                 }
             }
+        }else{
+            excelTabService.saveOrUpdate(excelTab);
         }
 
         return R.success("添加成功!");
@@ -460,7 +455,6 @@ public class ExcelTabController extends BladeController {
         updateWrapper.set("excel_id", exceTabId);
 
 
-
         // 复制模版htmlURL
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
         String filecode = SnowFlakeUtil.getId() + "";
@@ -589,33 +583,59 @@ public class ExcelTabController extends BladeController {
         htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
         htmlString = htmlString.replaceAll("title", "titlexx");
 
-
-
-        // 解析 style
+        // 远程搜索配置
         Document doc = Jsoup.parse(htmlString);
+        int maxCol = doc.select("Col").size();
         Element table = doc.select("table").first();
         Elements hc = doc.select("hc-form-select-search");
-        if(hc.size()>=1){
-           for(int i =0;i<hc.size();i++){
-               Element datax = hc.get(i);
-               datax.removeAttr("pkeyId");
-               datax.removeAttr("contractId");
-               datax.attr("pkeyId",pkeyId+"");
-               datax.attr("contractId",wbsTreeContract.getContractId());
-           }
+        if (hc.size() >= 1) {
+            for (int i = 0; i < hc.size(); i++) {
+                Element datax = hc.get(i);
+                datax.removeAttr("pkeyId");
+                datax.removeAttr("contractId");
+                datax.attr("pkeyId", pkeyId + "");
+                datax.attr("contractId", wbsTreeContract.getContractId());
+            }
         }
 
-         ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+        // 标题解决
+        ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
         // 添加标题显示
-        Elements dwtitle = doc.getElementsByAttributeValueMatching("style","18.0pt");
-        if(dwtitle.size()==1){
-
-        }else if(dwtitle.size()>=2){
-            for (int i = 0;i<dwtitle.size();i++){
-                Element dw = dwtitle.get(i);
-                if(StringUtils.isEmpty(dw.text())){
-                    dw.text(projectInfo.getProjectName());
-                };
+       // Elements dwtitle = doc.getElementsByAttributeValueMatching("style", "18.0pt");
+        Elements trs = table.select("tr");
+        for (int i = 0; i < 6; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            for (int j = 0; j < tds.size(); j++) {
+                Element data = tds.get(j);
+                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                String style = data.attr("style");
+                if(style.indexOf("font-size")>=0){
+                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:")+10,style.indexOf(".0pt")));
+                    if (StringUtils.isNotEmpty(data.text())  && fontsize>=12) {
+                        trs.get(i-1).select("td").get(0).text(projectInfo.getProjectName());
+                    }
+                }
+            }
+
+
+        }
+
+        // 获取公式颜色
+
+        String tabName = wbsTreeContract.getInitTableName();
+        // 字段查询 获取公式字段
+        String colkeys = "SELECT e_key from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_formula c where c.is_deleted=0) ";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colkeys);
+
+        if (maps != null) {
+            for (Map<String, Object> keys : maps) {
+                String key = keys.get("e_key") + "__";
+                Elements gscolor = doc.select("el-input[keyname~=^" + key + "]");
+                for (Element element : gscolor) {
+                    System.out.println(element.parent());
+                    element.parent().attr("gscolor", "11");
+                }
             }
         }
         doc.select("Col").remove();
@@ -656,60 +676,6 @@ public class ExcelTabController extends BladeController {
     }
 
 
-    /**
-     * 首件表单获取 html页面
-     */
-    @GetMapping("/get-first-excel-html")
-    @ApiOperationSupport(order = 15)
-    @ApiOperation(value = "首件表单获取html页面", notes = "首件表单获取html页面")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
-    })
-    public R getFirstExcelHtml(Long projectId) throws IOException, InterruptedException {
-
-        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                .eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getTableType, "111"));
-        if (wbsTreeContract == null) {
-            return R.fail("该数据下无此节点!");
-        }
-        if (wbsTreeContract.getHtmlUrl() == null) {
-            return R.fail("请上传清表!");
-        }
-
-        File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
-        FileInputStream fileInputStream = new FileInputStream(file1);
-        String htmlString = IoUtil.readToString(fileInputStream);
-        // 解析 style
-        Document doc = Jsoup.parse(htmlString);
-        Element table = doc.select("table").first();
-        doc.select("Col").remove();
-        fileInputStream.close();
-        JSONObject reData = new JSONObject();
-        reData.put("id", wbsTreeContract.getPKeyId());
-        reData.put("data", table);
-        return R.data(table + "");
-    }
-
-
-    public static void main11(String[] args) throws Exception {
-
-        String thmlUrl = "/Users/hongchuangyanfa/Desktop/1574226461517152256.html";
-
-        String osUrl = "https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220926/255f87504cd9f4ba61d888d044d1342c.xlsx";
-        InputStream redio = CommonUtil.getOSSInputStream(osUrl);
-        Workbook wb = new Workbook();
-        wb.loadFromMHtml(redio);
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
-
-        sheet.saveToHtml(thmlUrl);
-
-        // expailHtmlInfo(thmlUrl,1L);
-    }
-
-
-
-
     // 上传解析 html
     public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
 
@@ -980,7 +946,6 @@ public class ExcelTabController extends BladeController {
                             }
                         }
 
-
                         if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
                             inputText = inputText.substring(0, inputText.lastIndexOf("_"));
                         }
@@ -1274,7 +1239,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R copeBussTab(Long pkeyId) throws FileNotFoundException {
+    public R copeBussTab(Long pkeyId){
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
 
@@ -1306,34 +1271,43 @@ public class ExcelTabController extends BladeController {
 
 
         String tabName = wbsTreeContract.getInitTableName();
+
+        // 字段查询 并去掉公式字段
+
+        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
+        Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
+        colkeys = stringObjectMap.get("colkeys") + "";
         // 复制表数据
-        String querySql = "select * from " + tabName + " where p_key_id=" + pkeyId;
-        Map<String, Object> dataMap2 = jdbcTemplate.queryForMap(querySql);
+        String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
+        List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
+        if (dataList != null && dataList.size()>=1) {
+            Map<String, Object> dataMap2 = dataList.get(0);
 
-        dataMap2.remove("p_key_id");
-        dataMap2.remove("id");
+            dataMap2.remove("p_key_id");
+            dataMap2.remove("id");
 
-        // sql 组装
-        String sqlInfo = "";
+            // sql 组装
+            String sqlInfo = "";
 
-        sqlInfo = "INSERT INTO " + tabName + " ( ";
+            sqlInfo = "INSERT INTO " + tabName + " ( ";
 
-        String keyStr = "id,p_key_id,";
-        String valStr = SnowFlakeUtil.getId() + "," + wbsTreeContract.getPKeyId() + ",";
+            String keyStr = "id,p_key_id,";
+            String valStr = SnowFlakeUtil.getId() + "," + wbsTreeContract.getPKeyId() + ",";
 
-        for (String keys : dataMap2.keySet()) {
-            if (!(dataMap2.get(keys) + "").equals("null")) {
-                keyStr += keys + ",";
-                valStr += "'" + dataMap2.get(keys) + "',";
+            for (String keys : dataMap2.keySet()) {
+                if (!(dataMap2.get(keys) + "").equals("null")) {
+                    keyStr += keys + ",";
+                    valStr += "'" + dataMap2.get(keys) + "',";
+                }
             }
-        }
-        keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
-        valStr = valStr.substring(0, valStr.lastIndexOf(","));
+            keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
+            valStr = valStr.substring(0, valStr.lastIndexOf(","));
 
-        sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
+            sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
 
-        //huangjn 保存成功后调用生成资料查询列表数据
-        jdbcTemplate.execute(sqlInfo);
+            //huangjn 保存成功后调用生成资料查询列表数据
+            jdbcTemplate.execute(sqlInfo);
+        }
         wbsTreeContractService.save(wbsTreeContract);
         return R.data("成功");
     }
@@ -1357,7 +1331,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "classify", value = "classify", required = true),
             @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
     })
-    public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId,String nodeId, String contractId,String projectId,String classify) {
+    public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
 
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
@@ -1403,7 +1377,7 @@ public class ExcelTabController extends BladeController {
         wbsTreeContractService.update(updateWrapper);
         // 合并后
 
-        excelTabService.getBussPdfs(nodeId,classify,contractId,projectId);
+        excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
 
         return R.data(tableFile.getId());
     }
@@ -1438,7 +1412,7 @@ public class ExcelTabController extends BladeController {
         String sql = "select pdf_url, e_visa_pdf_url from u_information_query  where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
         Object pdfUrl = stringObjectMap.get("pdf_url");
-        if(stringObjectMap.get("e_visa_pdf_url") != null){
+        if (stringObjectMap.get("e_visa_pdf_url") != null) {
             //优先使用电签的PDF
             pdfUrl = stringObjectMap.get("e_visa_pdf_url");
         }
@@ -1459,26 +1433,6 @@ public class ExcelTabController extends BladeController {
         return R.status(this.excelTabService.removeBussTabInfoById(pkeyid));
     }
 
-    /**
-     * 设置BaseFont
-     *
-     * @param fontPath 字体路径
-     * @return
-     */
-    private static ConverterProperties creatBaseFont(String fontPath) {
-        ConverterProperties properties = new ConverterProperties();
-        FontProvider fontProvider = new DefaultFontProvider();
-        FontProgram fontProgram;
-        try {
-            fontProgram = FontProgramFactory.createFont(fontPath);
-            fontProvider.addFont(fontProgram);
-            properties.setFontProvider(fontProvider);
-        } catch (IOException e) {
-            System.out.println("creat base font erro");
-        }
-        return properties;
-    }
-
 
     @PostMapping("/save_buss_data")
     @ApiOperationSupport(order = 13)
@@ -1498,7 +1452,7 @@ public class ExcelTabController extends BladeController {
         String classify = tableInfo1.getString("classify");
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
         try {
-            this.excelTabService.formulaFillData(tableInfoList,Long.parseLong(nodeid));
+            this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeid));
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -1800,6 +1754,13 @@ public class ExcelTabController extends BladeController {
                     //数据结果
                     Map<String, Object> reData = new HashMap<>();
 
+                    String id = mysqlData.get("id")+"" ;
+                    String querySqlx = "SELECT tree_primary_key_id as primaryKeyId,title as path from u_contract_log_wbs where  business_id ='"+id+"'";
+                    List<Map<String, Object>> businessDat = this.jdbcTemplate.queryForList(querySqlx);
+                    if(businessDat!=null){
+                        reData.put("linkTabIds",businessDat);
+                    }
+
                     for (String key : mysqlData.keySet()) {
                         String tabVal = mysqlData.get(key) + "";
                         // 时间段处理
@@ -1842,13 +1803,11 @@ public class ExcelTabController extends BladeController {
                     }
 
                     // 移除Id 和 p_key_id
-//                    reData.remove("id");
                     reData.remove("p_key_id");
                     reData.remove("classify");
                     reData.remove("contractId");
                     reData.remove("pkeyId");
                     reData.remove("projectId");
-
                     resultMapList.add(reData);
                 }
             }
@@ -1894,7 +1853,7 @@ public class ExcelTabController extends BladeController {
                 return R.fail("目标日期下未找到当前用户填报的数据,请重新选择");
             }
 
-            for(JSONObject targetJson : targetJsonList){
+            for (JSONObject targetJson : targetJsonList) {
 
                 //获取目标数据所在数据表
                 WbsTreePrivate table = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, targetJson.getString("tableId")));
@@ -1916,14 +1875,14 @@ public class ExcelTabController extends BladeController {
                             List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
                             //重置业务ID
                             value = SnowFlakeUtil.getId();
-                            if(wbsJsonList != null && wbsJsonList.size() > 0){
-                                if(oneGroupLogWbsList.size() == 0){
+                            if (wbsJsonList != null && wbsJsonList.size() > 0) {
+                                if (oneGroupLogWbsList.size() == 0) {
                                     oneGroupLogWbsList.addAll(wbsJsonList);
                                 }
                             } else {
                                 wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
                             }
-                            for(JSONObject json : wbsJsonList){
+                            for (JSONObject json : wbsJsonList) {
                                 json.put("businessId", value);
                             }
 
@@ -2054,6 +2013,206 @@ public class ExcelTabController extends BladeController {
         return R.data(300, null, "未找到对应的业务数据");
     }
 
+    /**
+     * 预览首件PDF
+     */
+    @GetMapping("/get-first-pdf-info")
+    @ApiOperationSupport(order = 28)
+    @ApiOperation(value = "获取首件填报记录")
+    @ApiImplicitParam(name = "firstId", value = "首件列表ID")
+    public R<String> getFirstPdfInfo(String firstId) {
+        if (StringUtils.isNotEmpty(firstId)) {
+            //PDF路径集合
+            List<String> pdfUrls = new ArrayList<>();
+
+            //获取配置的路径
+            String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+            //获取数据
+            JSONObject firstJson = this.informationQueryClient.queryFirstBusinessDataByFirstId(firstId);
+            if (firstJson != null) {
+                if (StringUtils.isNotEmpty(firstJson.getString("eVisaPdfUrl")) || StringUtils.isNotEmpty(firstJson.getString("pdfUrl"))) {
+                    pdfUrls.add(StringUtils.isNotEmpty(firstJson.getString("eVisaPdfUrl")) ? firstJson.getString("eVisaPdfUrl") : firstJson.getString("pdfUrl"));
+                } else {
+                    //没有生成拼接的记录,生成
+                    //获取html
+                    WbsTreeContract tableNode = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, firstJson.getString("tableId")));
+
+                    if (tableNode == null) {
+                        return R.fail("该数据下无此节点!");
+                    }
+
+                    if (StringUtils.isEmpty(tableNode.getHtmlUrl())) {
+                        return R.fail("请关联清表!");
+                    }
+
+                    // 获取清表信息
+                    ExcelTab excelTab = excelTabService.getById(tableNode.getExcelId());
+                    if (excelTab == null) {
+                        return R.fail("失败");
+                    }
+
+                    List<Map<String, Object>> businessDataMapList = this.getFirstBusinessData(firstId).getData();
+
+                    try {
+                        //处理数据
+                        for (Map<String, Object> dataMap : businessDataMapList) {
+                            // 获取excel流 和 html流
+                            Workbook wb = new Workbook();
+                            wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
+                            //获取工作表
+                            Worksheet sheet = wb.getWorksheets().get(0);
+
+                            // 数据不为空 &&
+                            if (StringUtils.isNotEmpty(tableNode.getHtmlUrl())) {
+                                File htmlFile = ResourceUtil.getFile(tableNode.getHtmlUrl());
+                                if (htmlFile.exists()) {
+                                    String htmlString = IoUtil.readToString(new FileInputStream(htmlFile));
+                                    Document doc = Jsoup.parse(htmlString);
+                                    Element table = doc.select("table").first();
+                                    Elements trs = table.select("tr");
+
+                                    if (ObjectUtil.isNotEmpty(dataMap)) {
+                                        for (String val : dataMap.keySet()) {
+                                            if (val.indexOf("__") >= 0) {
+                                                String DataVal[] = val.split("__");
+                                                String[] xy = DataVal[1].split("_");
+                                                Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
+
+                                                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) {
+                                                        if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
+                                                            myData = myData.replace("[", "").replace("]", "");
+                                                            String[] dataVal = myData.split(",");
+                                                            String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
+                                                            String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
+
+                                                            String end_dataStr[] = dataVal[1].split("T")[0].split("-");
+                                                            String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
+
+                                                            if (StartDate.equals(endDate)) {
+                                                                myData = StartDate;
+                                                            } else {
+                                                                myData = StartDate + "-" + endDate;
+                                                            }
+                                                        } else {
+                                                            String dataStr[] = myData.split("T")[0].split("-");
+                                                            myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
+                                                        }
+                                                    }
+
+                                                    if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 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 {
+                                                        final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                                        cellRange.setText(myData);
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+
+                                    // 组装电签设置
+                                    QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
+                                    queryWrapper.eq("type", 2);
+                                    queryWrapper.eq("tab_id", tableNode.getPKeyId());
+
+                                    final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
+                                    if (textdictInfos != null && !textdictInfos.isEmpty()) {
+                                        textdictInfos.forEach(e -> {
+                                            String key = e.getColKey();
+                                            String keys[] = key.split("__");
+                                            String[] trtd = keys[1].split("_");
+                                            Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
+                                            int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                            if (x1 == 0) {
+                                                x1 = 1;
+                                            }
+                                            int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+
+                                            final CellRange cellRange = sheet.getCellRange(y1, x1);
+
+                                            cellRange.setText(e.getId() + "");
+                                            cellRange.getCellStyle().getFont().setColor(Color.white);
+
+                                        });
+                                    }
+                                }
+                            }
+
+                            Long fileName = SnowFlakeUtil.getId();
+                            String onePdfPath = file_path + "/pdf//" + fileName + ".pdf";
+
+                            sheet.saveToPdf(onePdfPath);
+
+                            BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName + ".pdf", onePdfPath);
+
+                            pdfUrls.add(bladeFile.getLink());
+
+                            wb.dispose();
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+
+                if (pdfUrls.size() > 0) {
+                    try {
+                        //关联的数据
+                        if (StringUtils.isNotEmpty(firstJson.getString("linkMergePdfUrl"))) {
+                            pdfUrls.add(firstJson.getString("linkMergePdfUrl"));
+                        }
+                        //总结报告,暂时无
+
+                        //上传
+                        String mergePdfPath = file_path + "/pdf//" + firstId + ".pdf";
+                        File oldMergePdf = ResourceUtil.getFile(mergePdfPath);
+                        if (oldMergePdf.exists()) {
+                            oldMergePdf.delete();
+                        }
+                        //合并
+                        FileUtils.mergePdfPublicMethods(pdfUrls, mergePdfPath);
+                        //上传
+                        BladeFile mergeFile = this.newIOSSClient.uploadFile(firstId + '-' + new Date().getTime() + ".pdf", mergePdfPath);
+
+                        //返回
+                        return R.data(mergeFile.getLink());
+
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+
+        return R.data(300, null, "未找到数据");
+    }
+
     @PostMapping("/save_log_first_buss_data")
     @ApiOperationSupport(order = 29)
     @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
@@ -2067,14 +2226,14 @@ public class ExcelTabController extends BladeController {
         }
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
         try {
-            this.excelTabService.formulaFillData(tableInfoList,null);
+            this.excelTabService.formulaFillData(tableInfoList, null);
         } catch (Exception e) {
             e.printStackTrace();
         }
 
         // 保存数据到数据库
         String isFirst = tableInfoList.get(0).getIsFirst();
-        if(StringUtils.isNotEmpty(isFirst)){
+        if (StringUtils.isNotEmpty(isFirst)) {
             //保存首件
             return R.data(this.excelTabService.saveOrUpdateFirst(tableInfoList));
         } else {
@@ -2091,7 +2250,7 @@ public class ExcelTabController extends BladeController {
     @ApiOperationSupport(order = 31)
     @ApiOperation(value = "下载excel数据")
     @ApiImplicitParam(name = "fileId", value = "fileId")
-    public void downExcelFile(HttpServletResponse response,String fileId) throws Exception {
+    public void downExcelFile(HttpServletResponse response, String fileId) throws Exception {
         ExcelTab excelTab = excelTabService.getById(fileId);
 
         String fileName = URLEncoder.encode(excelTab.getName(), Charsets.UTF_8.name());
@@ -2118,16 +2277,252 @@ public class ExcelTabController extends BladeController {
 
     public R getFirstExcelHtml() throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String sql ="SELECT n.p_key_id,excelId from (SELECT p_key_id,(SELECT id from m_excel_tab x where x.alias like '%1542045893564796930%' and x.name =m.full_name) as excelId  from m_wbs_tree_private m where m.project_id = '1578599210897772545' and m.type='2'  and m.p_key_id!='1578599432939634723' ) n where excelId is not null ";
+        String sql = "SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201')  and is_deleted=0 and file_type=3 ";
         List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
         System.out.println(dataInof.size());
         for (int i = 0; i < dataInof.size(); i++) {
-            String p_key_id = dataInof.get(i).get("p_key_id") + "";
-            Long excelId = Long.parseLong(dataInof.get(i).get("excelId") + "");
-            this.saveLinkeTab(excelId, Long.valueOf(p_key_id));
+            String file_url = dataInof.get(i).get("file_url") + "";
+            Long p_key_id = Long.parseLong(dataInof.get(i).get("id") + "");
+            String html_url = dataInof.get(i).get("html_url") + "";
+
+            ExcelTab detail = excelTabService.getById(p_key_id);
+            // 解析excel
+            Workbook wb = new Workbook();
+            wb.loadFromMHtml(CommonUtil.getOSSInputStream(file_url));
+            //
+            HTMLOptions options = new HTMLOptions();
+            options.setImageEmbedded(true);
+            //获取工作表
+            Worksheet sheet = wb.getWorksheets().get(0);
+            Thread.sleep(100);
+            sheet.saveToHtml(html_url, options);
+            Thread.sleep(100);
+            this.expailHtmlInfo(html_url, p_key_id);
+            Thread.sleep(100);
+            EexpaileInfo(html_url, p_key_id);
             System.out.println(i);
         }
 
         return R.data("");
     }
+
+    // 水利水电
+    public void EexpaileInfo(String htmlUrl, long pk_id) throws FileNotFoundException {
+        //   String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
+        // 样式集合
+        Document doc = Jsoup.parse(htmlString);
+        //解析
+        Element table = doc.select("table").first();
+        Elements trs = table.select("tr");
+        List<ExctabCell> colTitle = new ArrayList<>();
+        int sgY = 0;
+        int sgY_st = 0;
+        int jlY = 0;
+
+        String titt = "";
+        String first = "";
+        String end = "";
+        for (int i = 6; i <= trs.size() - 1; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            if (tds.size() >= 1) {
+                String titName = tds.get(0).text().replaceAll(" ", "");
+                if (titName.equals("施工单位自评意见")) {
+                    sgY = i + Integer.parseInt(tds.get(0).attr("rowspan"));
+                    titt = "施工单位自评意见";
+                }
+
+                if (titName.equals("监理单位复核意见")) {
+                    sgY = i + Integer.parseInt(tds.get(0).attr("rowspan"));
+                    titt = "监理单位复核意见";
+                }
+
+                if (sgY >= 1 && i < sgY - 1) {
+                    for (int j = 0; j < tds.size(); j++) {
+                        String tdStr = "";
+                        String trTitleName = "";
+                        Element element = tds.get(j);
+
+                        first += element.text();
+
+                        // 中间计算方式
+                        if (element.html().indexOf("el-input") >= 0) {
+                            // 获取开始的标题
+                            ExctabCell exctabCell = new ExctabCell();
+                            exctabCell.setExctabId(pk_id);
+                            exctabCell.setIsDeleted(0);
+
+                            exctabCell.setCreateTime(new Date());
+                            exctabCell.setTextElementType(99);
+
+                            for (int k = i; k < sgY; k++) {
+                                Element atr = trs.get(k);
+                                Elements atds = atr.select("td");
+                                int m = 0;
+                                if (k == i) {
+                                    m = j + 1;
+                                } else {
+                                    m = 0;
+                                }
+                                for (int l = m; l < atds.size(); l++) {
+                                    Element element1 = atds.get(l);
+                                    if (element1.html().indexOf("el-input") >= 0) {
+                                        break;
+                                    } else {
+                                        end = end + element1.text();
+                                    }
+                                }
+                            }
+
+                            tdStr = first + end;
+
+                            if (first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
+                                trTitleName = titt + "_合格率";
+                            }
+
+                            if (first.indexOf("不合格点的质量") >= 0 && end.indexOf("有关规范或设计要求") >= 0) {
+                                trTitleName = titt + "_是否符合有关规范或设计要求的限值";
+                            }
+
+                            if (first.indexOf("各项报验资料") >= 0 && end.indexOf("的要求") >= 0 && end.indexOf("SL") >= 0) {
+                                if (end.indexOf("。") >= 0) {
+                                    end = end.substring(0, end.indexOf("。"));
+                                }
+                                trTitleName = titt + "_报验资料是否满足" + end;
+                            }
+
+                            if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
+                                if (first.indexOf("。") >= 0) {
+                                    first = first.substring(first.indexOf("。") + 1, first.length());
+                                }
+                                trTitleName = titt + "_" + first.substring(0, first.length() - 2);
+                            }
+                            // 2
+                            if (first.indexOf("合格") >= 0 && first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
+                                trTitleName = titt + "_" + first.substring(first.indexOf("其中优良") + 2, first.indexOf("占") + 1) + "比";
+                            }
+                            if (first.indexOf("主要工序达到") >= 0 && end.indexOf("等级") >= 0) {
+                                trTitleName = titt + "工序等级";
+                            }
+                            // 3
+                            if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 && first.indexOf("符合") >= 0) {
+                                trTitleName = titt + "_设计要求";
+                            }
+                            if (end.indexOf("100%合格") >= 0) {
+                                trTitleName = titt + "_合格数量";
+                            }
+
+                            System.out.println(i + "," + j + "=" + trTitleName);
+                            first = "";
+                            end = "";
+                            exctabCell.setTextInfo(trTitleName);
+                            exctabCell.setXys(i + "_" + j);
+                            exctabCellService.save(exctabCell);
+                        }
+                        element.removeAttr("title");
+                        element.attr("title", trTitleName);
+
+                    }
+                }
+
+                if ((sgY >= 1 && i == sgY - 1) || (jlY >= 1 && i == jlY - 1)) {
+
+
+                    if (tds.get(0).html().indexOf("el-input") >= 0) {
+
+                        ExctabCell exctabCell = new ExctabCell();
+                        exctabCell.setExctabId(pk_id);
+                        exctabCell.setIsDeleted(0);
+                        exctabCell.setCreateTime(new Date());
+                        exctabCell.setTextElementType(99);
+                        tds.get(0).removeAttr("title");
+                        if (titt.indexOf("施工") >= 0) {
+                            exctabCell.setTextInfo("施工单位合同章");
+                            tds.get(0).attr("title", "施工单位合同章");
+                        }
+                        if (titt.indexOf("监理") >= 0) {
+                            exctabCell.setTextInfo("监理单位合同章");
+                            tds.get(0).attr("title", "监理单位合同章");
+                        }
+                        exctabCell.setXys(i + "_" + 0);
+                        exctabCellService.save(exctabCell);
+                    }
+                    if (tds.get(1).html().indexOf("el-input") >= 0) {
+                        ExctabCell exctabCell = new ExctabCell();
+                        exctabCell.setExctabId(pk_id);
+                        exctabCell.setIsDeleted(0);
+
+                        exctabCell.setCreateTime(new Date());
+                        exctabCell.setTextElementType(99);
+                        tds.get(1).removeAttr("title");
+
+                        if (titt.indexOf("施工") >= 0) {
+                            tds.get(1).attr("title", "施工单位个人签字");
+                            exctabCell.setTextInfo("施工单位个人签字");
+                        }
+                        if (titt.indexOf("监理") >= 0) {
+                            tds.get(1).attr("title", "监理单位个人签字");
+                            exctabCell.setTextInfo("监理单位个人签字");
+                        }
+                        exctabCell.setXys(i + "_" + 1);
+                        exctabCellService.save(exctabCell);
+                    }
+                    if (tds.get(2).html().indexOf("el-date-picker") >= 0) {
+                        ExctabCell exctabCell = new ExctabCell();
+                        exctabCell.setExctabId(pk_id);
+                        exctabCell.setIsDeleted(0);
+
+                        exctabCell.setCreateTime(new Date());
+                        exctabCell.setTextElementType(99);
+                        tds.get(2).removeAttr("title");
+                        if (titt.indexOf("施工") >= 0) {
+                            tds.get(2).attr("title", "日期施工单位");
+                            exctabCell.setTextInfo("日期施工单位");
+                        }
+                        if (titt.indexOf("监理") >= 0) {
+                            tds.get(2).attr("title", "日期监理单位");
+                            exctabCell.setTextInfo("日期监理单位");
+                        }
+                        exctabCell.setXys(i + "_" + 2);
+                        exctabCellService.save(exctabCell);
+                    }
+
+                    titt = "";
+                }
+            }
+        }
+
+        File writefile = new File(htmlUrl);
+        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+        System.out.println("完成");
+    }
+
+
+    /**
+     * 表单填写 图片添加 并压缩
+     *
+     * @param file
+     * @return
+     */
+    @SneakyThrows
+    @PostMapping("/add-buss-imginfo")
+    @ApiOperationSupport(order = 32)
+    @ApiOperation(value = "表单填写图片上传", notes = "表单填写图片上传")
+    public R addBussFile(@RequestParam MultipartFile file) {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        BladeFile bladeFile = new BladeFile();
+        if (file.getSize() >= 1024) {
+            String filecode = SnowFlakeUtil.getId() + "";
+            String imgUrl = file_path + "/pdf/" + filecode + ".jpg";
+            FileUtils.CompressImage(imgUrl, file.getInputStream());
+            bladeFile = this.newIOSSClient.uploadFile(file.getOriginalFilename(), imgUrl);
+            File imgFile = ResourceUtil.getFile(imgUrl);
+            imgFile.delete();
+        } else {
+            bladeFile = this.newIOSSClient.uploadFileByInputStream(file);
+        }
+        return R.data(bladeFile);
+    }
+
 }

+ 155 - 388
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExpaileHtml.java

@@ -1,446 +1,213 @@
 package org.springblade.manager.controller;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.spire.xls.CellRange;
-import com.spire.xls.Workbook;
-import com.spire.xls.Worksheet;
+
+import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
-import org.springblade.core.tool.utils.*;
+import org.springblade.core.tool.utils.FileUtil;
+import org.springblade.core.tool.utils.IoUtil;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.List;
 
 public class ExpaileHtml {
 
-    // private final IExctabCellService exctabCellService;
-
-    public static void main11(String[] args) throws Exception {
+    public static void main11(String[] args) throws FileNotFoundException {
 
- /*       Workbook wb = new Workbook();
-        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/C14.4.xlsx");
-        wb.loadFromMHtml(new FileInputStream(file1));
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
 
-         CellRange[] columns = sheet.getMergedCells();
-         for (int i = 0; i< columns.length; i++){
-             if(columns[i].getStyle().getFont().getSize()>=17){
-                 System.out.println("哈哈");
-                 break;
+        String sdata ="2022年11月10日";
+        String edata ="2022年11月10日";
+      //  System.out.println(sdata.equals());
+/*
+        List<File> list = FileUtil.list("/Users/hongchuangyanfa/Desktop/123456/");
+         int i = 0;
+         for(File file:list){
+
+             System.out.println(file.getName());
+             if(file.getName().length()>=16 ){
+                 System.out.println(file.getPath()+"__"+(i++));
+                 EexpaileInfo(file.getPath());
              }
-
          }*/
 
-        String data = "__";
-        System.out.println(data.length());
-/*
-        System.out.println("xcc");
-        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Desktop/privateUrl/1572868137710256128.html");
-        String htmlString = IoUtil.readToString(new FileInputStream(file1));
+        String html_url = "/Users/hongchuangyanfa/Desktop/privateUrl/1582298975938019328.html";
+        testinfo22(html_url);
+    }
+
+
+
+    public static void testinfo22(String htmlUrl) throws FileNotFoundException {
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
+        // 样式集合
         Document doc = Jsoup.parse(htmlString);
+         Elements select = doc.select("el-input[placeholder~=.*合同段.*]");
+         int trindex = Integer.parseInt(select.attr("tdindex"));
+
+        System.out.println(trindex);
+        System.out.println(select.size());
+    }
 
+    public static void testinfo(String htmlUrl) throws FileNotFoundException {
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
+        // 样式集合
+        Document doc = Jsoup.parse(htmlString);
         //解析
         Element table = doc.select("table").first();
+        int maxCol = doc.select("Col").size();
         Elements trs = table.select("tr");
-        Element element = trs.get(4).select("td").get(1);
-        JSONArray objs = new JSONArray();
-        Integer [] data= new Integer[2];
-        data[0]=1;
-        data[1]=2;
-
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("key",1);
-        jsonObject.put("name","小明");
-        objs.add(jsonObject);
-        String checkbox = "<hc-form-checkbox-group :datas='"+Arrays.asList(data)+"' :objs="+objs+" > </hc-form-checkbox-group>";
-       // element.empty().append(checkbox);
-
-        System.out.println(Arrays.asList(data));
-        System.out.println(objs);
-        System.out.println(checkbox);
-        element.empty().append(checkbox);
-        File writefile = new File("/Users/hongchuangyanfa/Desktop/123654.html");
-        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
-*/
-
-/*        List<String> data = new ArrayList<>();
-        List<String> data2 = new ArrayList<>();
-        data.add("1:2");
-
-
-        String[] intArray = new String[data.size()];
-        int lastMax = 0;
-        for (int h = 0; h < data.size() ; h++) {
-            int mx1 = Integer.parseInt(data.get(h).split(":")[0]);
-            int mx2 = Integer.parseInt(data.get(h).split(":")[1]);
-            if(data2.size()==0){
-                data2.add(data.get(0));
-
-            }else{
-                if(lastMax+1==mx1){
-                  int minVal =  Integer.parseInt(data2.get(data2.size()-1).split(":")[0]);
-                    data2.remove(data2.size()-1);
-                    data2.add(minVal+":"+mx2);
-                }else{
-                    data2.add(data.get(h));
+        for (int i = 0; i <= 6; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+
+            for (int j = 0; j < tds.size(); j++) {
+                Element data = tds.get(j);
+                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                String style = data.attr("style");
+                if(style.indexOf("font-size")>=0){
+                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:")+10,style.indexOf(".0pt")));
+                    if (StringUtils.isNotEmpty(data.text()) && colspan >= maxCol - 1 && fontsize>=12) {
+
+                        System.out.println(data.text());
+                    }
                 }
+
             }
-            lastMax = mx2;
         }
-
-
-        System.out.println("开始");
-        for (String s : data2) {
-            System.out.println(s);
-        }*/
-
-
-       /* String  thmlUrl = "/Users/hongchuangyanfa/Desktop/C10.1.xlsx" ;
-        String  thmlUrl2 = "/Users/hongchuangyanfa/Desktop/C10.2.pdf" ;
-        File file1 = ResourceUtil.getFile(thmlUrl);
-
-        Workbook wb = new Workbook();
-        wb.loadFromMHtml(new FileInputStream(file1));
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
-    //    System.out.println(sheet.getLastColumn());
-        sheet.getCellRange(20,1).setText("1111");
-        System.out.println(sheet.getCellRange(20,1).getText());
-        sheet.saveToPdf(thmlUrl2);*/
-
-        //指定URL路径
-        // String url = "/Users/hongchuangyanfa/Desktop/privateUrl/1560160597855698944.html";
-        //String url = "/Users/hongchuangyanfa/Desktop/privateUrl/1560108472350015488.html";
-
-        //指定输出文档路径
-        // String fileName = "/Users/hongchuangyanfa/Desktop/pdf/UrlToPdf.pdf";
-
-        //指定插件路径
-        //   String pluginPath = "/Users/hongchuangyanfa/tool/plugins_mac";
-
-        //设置插件路径
-        //   HtmlConverter.setPluginPath(pluginPath);
-        //将URL转换为PDF595×842
-        // HtmlConverter.convert(url, fileName, true, 1000000, new Size(842,595), new PdfMargins(0));
-        //   HtmlConverter.convert(url, fileName, true, 1000000, new Size(595,842), new PdfMargins(50,0,50,50 ));
-
-
-        //
-        // HTMLOptions options = new HTMLOptions();
-        // options.setTextMode();
-/*        Workbook wb = new Workbook();
-        wb.loadFromMHtml(file.getInputStream());
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
-        Workbook wb = new Workbook();
-        wb.loadFromMHtml(file.getInputStream());
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
-        sheet.saveToHtml(thmlUrl);
-        sheet.saveToHtml(thmlUrl);
-
-        Worksheet sheet = wb.getWorksheets().get(0);
-        HTMLOptions options = new HTMLOptions();
-        options.setImageEmbedded(true);
-        sheet.saveToHtml("F:\\ToHtmlWithImageEmbeded.html", options);*/
-
     }
-
-    // 清表上传解析方案
-    public static void expailHtmlInfo(String thmlUrl) throws FileNotFoundException {
-
-        // 读取
-        File file1 = ResourceUtil.getFile(thmlUrl);
-        String htmlString = IoUtil.readToString(new FileInputStream(file1));
-
-        /*
-           解析
-           1 解析样式
-           2 计算坐标
-           3 计算区域位置
-         */
+    public static void EexpaileInfo(String htmlUrl) throws FileNotFoundException {
+     //   String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
         // 样式集合
         Document doc = Jsoup.parse(htmlString);
-        // 解析 style
-        Map<String, String> styleMap = getHtmlStyle(doc);
-
         //解析
         Element table = doc.select("table").first();
         Elements trs = table.select("tr");
 
-        // 获取总行列数
-        int maxCol = doc.select("Col").size();
-        String[] rowData = new String[trs.size() + 1];
-
-        // 行的状态
-        boolean index_state = false;
-        // 区域划分表示
-        int xy_type = 1;
-
-        // 解析 excel元素集合
-        Set<String> colTitleSet = new HashSet<>();
+        int sgY = 0;
+        int sgY_st = 0;
+        int jlY = 0;
 
-//      标题集合信息
-        List<Map<String, String>> zikey = new ArrayList<>();
-        for (int i = 0; i <= trs.size() - 1; i++) {
+        String titt = "";
+        String first = "";
+        String end = "";
+        for (int i = 6; i <= trs.size() - 1; i++) {
             Element tr = trs.get(i);
             Elements tds = tr.select("td");
-            String xyInof = getTrInfo(tds, styleMap, index_state, xy_type, maxCol);
-            xy_type = Integer.parseInt(xyInof.split(",")[0]);
-            tr.attr("xy_type", xyInof);
-            index_state = Boolean.parseBoolean(xyInof.split(",")[1]);
-            boolean isMaxCol = Integer.parseInt(xyInof.split(",")[2]) == maxCol;
-            // 计算单元格坐标
-            int x = 0;
-            for (int j = 0; j < tds.size(); j++) {
-                {
-                    Element data = tds.get(j);
-                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
-                    int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
-                    Map<String, String> textObject = new HashMap<>();
-                    // 计算
-                    int x1 = 0;
-                    int x2 = 0;
-                    int y1 = 0;
-                    int y2 = 0;
-
-                    String textInfo = data.text().trim().replaceAll(" ", "");
-
-                    y1 = i + 1;
-                    //x 移位 算法
-                    String getRowInfo = rowData[y1];
-                    if (getRowInfo != null) {
-                        String[] dataInfo2 = getRowInfo.split(",");
-                        if (getRowInfo.indexOf("1") >= 0 && j == 0) {
-                            x = Integer.parseInt(dataInfo2[0].split(":")[1]);
-                        } else {
-                            for (int m = 0; m < dataInfo2.length; m++) {
-                                int mx1 = Integer.parseInt(dataInfo2[m].split(":")[0]);
-                                int mx2 = Integer.parseInt(dataInfo2[m].split(":")[1]);
-                                if ((mx1 - x) == 1 && mx1 > x) {
-                                    x = mx2;
-                                }
-                            }
-                        }
-                    }
+            if (tds.size() >= 1) {
+                String titName = tds.get(0).text().replaceAll(" ", "");
+                if (titName.equals("施工单位自评意见")) {
+                    sgY = i + Integer.parseInt(tds.get(0).attr("rowspan"));
+                    titt = "施工单位自评意见";
+                }
 
-                    // X 坐标
-                    if (colspan == 0) {
-                        x1 = x + 1;
-                        x2 = x + 1;
-                        x = x + 1;
-                    } else {
-                        x1 = x + 1;
-                        x2 = x + colspan;
-                        x = x + colspan;
-                    }
+                if (titName.equals("监理单位复核意见")) {
+                    sgY = i + Integer.parseInt(tds.get(0).attr("rowspan"));
+                    titt = "监理单位复核意见";
+                }
 
-                    //x y 坐标
-                    if (rowspan == 0) {
-                        y2 = i + 1;
-                    } else {
-                        y2 = i + rowspan;
-                        for (int k = 0; k < rowspan - 1; k++) {
-                            String dataInfo = rowData[k + 2 + i];
-                            if (dataInfo == null) {
-                                dataInfo = x1 + ":" + x2;
-                            } else {
-                                String[] dataInfo2 = dataInfo.split(",");
-                                String dataInfo3 = dataInfo2[dataInfo2.length - 1];
-                                int mx1 = Integer.parseInt(dataInfo3.split(":")[0]);
-                                int mx2 = Integer.parseInt(dataInfo3.split(":")[1]);
-                                if (mx2 + 1 == x1) {
-                                    dataInfo = dataInfo + "," + mx1 + ":" + x2;
-                                } else {
-                                    dataInfo = dataInfo + "," + x1 + ":" + x2;
+                if (sgY >= 1 && i < sgY - 1) {
+                    for (int j = 0; j < tds.size(); j++) {
+                        String tdStr = "";
+                        String trTitleName = "";
+                        Element element = tds.get(j);
+
+                        first +=element.text();
+
+                        // 中间计算方式
+                        if (element.html().indexOf("el-input") >= 0) {
+                            // 获取开始的标题
+
+                            for(int k=i ;k<sgY ; k++){
+                                Element atr = trs.get(k);
+                                Elements atds = atr.select("td");
+                                int m = 0;
+                                if(k==i){
+                                    m=j+1;
+                                }else{
+                                    m = 0;
+                                }
+                                for(int l=m;l<atds.size();l++){
+                                     Element element1 = atds.get(l);
+                                     if(element1.html().indexOf("el-input")>=0){
+                                       break;
+                                     }else{
+                                         end = end+element1.text();
+                                     }
                                 }
                             }
-                            rowData[k + 2 + i] = dataInfo;
-                        }
-                    }
 
+                            tdStr = first+end;
 
-                    //  System.out.println(x1+"_"+x2+"_"+y1+"_"+y2+"_"+textInfo);
-                    //  data.text(textInfo.replaceAll(" ",""));
-                    if (!textInfo.isEmpty() && !textInfo.equals("/") && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
-                        Map<String, String> dataInfo = new HashMap<String, String>();
-                        dataInfo.put("name", textInfo);
-                        dataInfo.put("x1", x1 + "");
-                        dataInfo.put("x2", x2 + "");
-                        dataInfo.put("y1", y1 + "");
-                        dataInfo.put("y2", y2 + "");
-                        dataInfo.put("xytype", xy_type + "");
-                        zikey.add(dataInfo);
-                    } else { //空行
-                        List<Map<String, String>> left = new ArrayList<>();
-                        List<Map<String, String>> top = new ArrayList<>();
-                        for (int k = 0; k < zikey.size(); k++) {
-                            String name = zikey.get(k).get("name");
-                            //  String name2 = zikey.get(k).get("name").replaceAll("[^\u4E00-\u9FA5]", "");
-                            int xx1 = Integer.parseInt(zikey.get(k).get("x1"));
-                            int xx2 = Integer.parseInt(zikey.get(k).get("x2"));
-                            int yy1 = Integer.parseInt(zikey.get(k).get("y1"));
-                            int yy2 = Integer.parseInt(zikey.get(k).get("y2"));
-                            int xytype2 = Integer.parseInt(zikey.get(k).get("xytype"));
-                            // 左匹配
-                            if (yy1 <= y1 && yy2 >= y2 && xx2 < x1 && xytype2 == xy_type) {
-                                left.add(zikey.get(k));
-                            }
-                            //向 上 匹配
-                            if (index_state) {
-                                if (xx1 <= x1 && xx2 >= x2 && yy2 < y1 && xytype2 == xy_type) {
-                                    top.add(zikey.get(k));
-                                }
-                            }
-                        }
-                        String inputText = "";
-                        // 特征值赛选 规则
-                        for (int k = 0; k < left.size(); k++) { // 左计算
-                            String name = left.get(k).get("name");//.replaceAll("[^\u4E00-\u9FA5]", "");
-                            int xx1 = Integer.parseInt(left.get(k).get("x1"));
-                            int xx2 = Integer.parseInt(left.get(k).get("x2"));
-                            int yy1 = Integer.parseInt(left.get(k).get("y1"));
-                            int yy2 = Integer.parseInt(left.get(k).get("y2"));
-                            if (index_state) { // 正向规则匹配
-                                inputText += name + "_";
-                            } else {
-                                if (x1 - xx2 <= 1 && y1 == yy2) {
-                                    inputText = name;
-                                }
+                            if ( first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
+                                trTitleName = titt + "_合格率";
                             }
-                        }
 
-                        // 特征值赛选 规则
-                        if (top != null && top.size() >= 1) {
-                            for (int k = 0; k < top.size(); k++) { // 向上计算
-                                String name = top.get(k).get("name");//.replaceAll("[^\u4E00-\u9FA5]", "");
-                                int xx1 = Integer.parseInt(top.get(k).get("x1"));
-                                int xx2 = Integer.parseInt(top.get(k).get("x2"));
-                                int yy1 = Integer.parseInt(top.get(k).get("y1"));
-                                int yy2 = Integer.parseInt(top.get(k).get("y2"));
-                                inputText += name + "_";
+                            if (first.indexOf("不合格点的质量") >= 0 && end.indexOf("有关规范或设计要求") >= 0) {
+                                trTitleName = titt + "_是否符合有关规范或设计要求的限值";
                             }
-                        }
 
-                        if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
-                            inputText = inputText.substring(0, inputText.lastIndexOf("_"));
-                        }
+                            if (first.indexOf("各项报验资料") >= 0 && end.indexOf("的要求") >= 0 && end.indexOf("SL") >= 0) {
+                                if(end.indexOf("。")>=0){
+                                    end= end.substring(0,end.indexOf("。"));
+                                }
+                                trTitleName = titt + "_报验资料是否满足" + end;
+                            }
 
-                        // 计算当前 输入框 标题匹配原则(左 - 上- 下)
-                        //  System.out.println(x1+"_"+x2+","+y1+"_"+y2+"=="+textInfo+"=left"+left.toString() +"===top"+top.toString()+"__index_state="+index_state+"inputtext="+inputText);
-
-                        // 设置文本信息
-                        if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
-                            data.empty().append("<input type='time' style='width:100%;height:100%' placeholder=''> </input>");
-                            colTitleSet.add(inputText + "签字时间");
-                        } else {
-                            if (index_state) {
-                                data.empty().append("<input type='text' style='width:100%;height:100%' placeholder='" + inputText + "' > </input>");
-                            } else {
-                                if (j == 0) {
-                                    if (colspan == maxCol && i >= 1 && i <= 2) {
-                                        data.empty().append("<input type='text' style='width:100%;height:100%' placeholder='" + inputText + "'> </input>");
-                                    }
-                                } else {
-                                    Element bforData = tds.get(j - 1);
-                                    if (!bforData.text().isEmpty()) {
-                                        data.empty().append("<input type='text' style='width:100%;height:100%' placeholder='" + inputText + "'> </input>");
-                                    }
+                            if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
+                                if(first.indexOf("。")>=0){
+                                    first= first.substring(first.indexOf("。")+1,first.length());
                                 }
+                                trTitleName = titt + "_" + first.substring(0, first.length() - 2);
+                            }
+                            // 2
+                            if (first.indexOf("合格")>=0 &&first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
+                                trTitleName = titt + "_"+first.substring(first.indexOf("其中优良")+2,first.indexOf("占")+1)+"比";
+                            }
+                            if (first.indexOf("主要工序达到") >= 0 && end.indexOf("等级") >= 0) {
+                                trTitleName = titt + "工序等级";
                             }
-                            colTitleSet.add(inputText);
+                            // 3
+                            if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 &&  first.indexOf("符合") >= 0) {
+                                trTitleName = titt + "_设计要求";
+                            }
+                            if (end.indexOf("100%合格") >= 0 ) {
+                                trTitleName = titt + "_合格数量";
+                            }
+
+                            System.out.println(i+","+j+"="+trTitleName);
+                            first="";
+                            end = "";
                         }
+                        element.removeAttr("title");
+                        element.attr("title", trTitleName);
                     }
-                    // data.text(textInfo.replaceAll(" ",""));
                 }
-            }
-        }
-
-        for (String keys : colTitleSet) {
-            System.out.println(keys.replaceAll("[^(\u4E00-\u9FA5_)]", ""));
-        }
-
-        // 保存
-        File writefile = new File("/Users/hongchuangyanfa/Desktop/123654.html");
-        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
-    }
-
-
-    //计算区域坐标
-    public static String getTrInfo(Elements tds, Map<String, String> styleMap, boolean index_state, Integer xy_type, int maxCol) {
 
-        int x_width = 0;
-        int y_width = 0;
-        int text_width = 0;
-        int width = 0;
-
-        //区域计算
-        for (int j = 0; j < tds.size(); j++) {
-            Element data = tds.get(j);
-            String keyId = data.attr("class");
-
-            int colspan = data.attr("COLSPAN").equals("") ? 1 : Integer.parseInt(data.attr("COLSPAN"));
-            String classInfo = styleMap.get(keyId);
-            if (classInfo == null) {
-                classInfo = data.attr("style");
-            } else {
-                data.removeAttr("class");
-                data.attr("style", styleMap.get(keyId).replaceAll("break-word", "inherit"));
-            }
-
-            // 计算线开始
-            if (classInfo.indexOf("border-left-style") >= 0 && classInfo.indexOf("border-top-style") >= 0 && classInfo.indexOf("border-bottom-style") >= 0 && classInfo.indexOf("border-right-style") >= 0) {
-                x_width += colspan;
-            }
-
-            // 计算结束
-            if (classInfo.indexOf("border-left-style") < 0 && (classInfo.indexOf("border-top-style") < 0 || classInfo.indexOf("border-top-style") >= 0) && classInfo.indexOf("border-bottom-style") < 0 && classInfo.indexOf("border-right-style") < 0) {
-                y_width += colspan;
-            }
-
-            String name = data.text().replaceAll("[^\u4E00-\u9FA5]", "");
-            if (!name.isEmpty()) {
-                text_width += colspan;
-            }
-            width += colspan;
-        }
-
-        // 在区域内
-        if (index_state) {
-            //是否需要改变
-            if (maxCol == y_width) {
-                index_state = false;
-                xy_type += 1;
-            }
-            if (maxCol == text_width) {
-                xy_type += 1;
-            }
-        } else { // 区域外
-            if (maxCol == x_width) {
-                index_state = true;
-                xy_type += 1;
+                if ((sgY >= 1 && i == sgY - 1) || (jlY >= 1 && i == jlY - 1)) {
+                    if (tds.get(0).html().indexOf("el-input") >= 0) {
+                        tds.get(0).removeAttr("title");
+                        tds.get(0).attr("title", "施工单位合同章");
+                    }
+                    if (tds.get(1).html().indexOf("el-input") >= 0) {
+                        tds.get(1).removeAttr("title");
+                        tds.get(1).attr("title", "施工单位个人签字");
+                    }
+                    if (tds.get(2).html().indexOf("el-date-picker") >= 0) {
+                        tds.get(2).removeAttr("title");
+                        tds.get(2).attr("title", "日期施工单位");
+                    }
+                    titt = "";
+                }
             }
         }
-        return xy_type + "," + index_state + "," + width;
-    }
 
-    // 获取解析样式
-    public static Map<String, String> getHtmlStyle(Document doc) {
-        Map<String, String> styleMap = new HashMap<>();
-        Element style = doc.select("style").first();
-        Matcher cssMatcher = Pattern.compile("(\\w+)\\s*[{]([^}]+)[}]").matcher(style.html());
-        while (cssMatcher.find()) {
-            styleMap.put(cssMatcher.group(1), cssMatcher.group(2));
-        }
-        return styleMap;
+     //   File writefile = new File(htmlUrl);
+      //  FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+        System.out.println("完成");
     }
-
 }
+

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

@@ -103,6 +103,8 @@ public class FirstController extends BladeController {
         File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
         FileInputStream fileInputStream = new FileInputStream(file1);
         String htmlString =   IoUtil.readToString(fileInputStream);
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        htmlString = htmlString.replaceAll("title", "titlexx");
         // 解析 style
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();

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

@@ -202,6 +202,7 @@ public class LinkdataInfoController extends BladeController {
 				element1.removeAttr("@focus");
 				element1 = element.children().get(0).children().get(0);
 			}
+
 			element1.removeAttr("placeholder");
 			element1.removeAttr("keyName");
 			element1.removeAttr("weighing");
@@ -211,7 +212,7 @@ public class LinkdataInfoController extends BladeController {
 			element1.attr("placeholder",enName).attr("keyName",dataInfo2);
 			element1.attr("weighing","100");
 			element1.attr("v-model","formData."+dataInfo2);
-			element1.attr("@focus","getInformation('"+enName+"',"+linkdataInfo.getTrIndex()+","+linkdataInfo.getTdIndex()+")");
+			element.attr("@click","getInformation('"+enName+"',"+linkdataInfo.getTrIndex()+","+linkdataInfo.getTdIndex()+")");
 			System.out.println(element1);
 		}
 

+ 8 - 15
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java

@@ -163,7 +163,7 @@ public class ProjectInfoController extends BladeController {
     /**
      * 查询业务条数
      */
-    @GetMapping("/getListContractInfoCount")
+    @GetMapping("/get-list-contractInfo-count")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "统计合同数", notes = "null")
     public List<ContractlnfoCountVO> selectContractInfoCount() {
@@ -173,7 +173,7 @@ public class ProjectInfoController extends BladeController {
     /**
      * 项目私有库分配wbs树下拉框列表type=1质检 =2实验
      */
-    @GetMapping("/getWbsTreeList")
+    @GetMapping("/get-wbsTree-list")
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "项目合同段私有库分配wbs树下拉框列表", notes = "null")
     public R<WbsTreeAllListVO> findWbsTreeList(Integer type) {
@@ -209,28 +209,21 @@ public class ProjectInfoController extends BladeController {
     /**
      * 保存或修改分配项目级wbs树
      */
-    @PostMapping("/submitWbsTreeInProject")
+    @PostMapping("/submit-wbsTree-project")
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "保存或修改分配项目级wbs树", notes = "传入WbsTreeContractDTO")
-    public R submitWbsTreeInProject(@RequestBody WbsTreeContractDTO pawDTO) {
-        if (pawDTO.getWbsType() == 1) {
-            if (wbsTreeService.submitWbsTreeInProject(pawDTO)) {
-                return R.success("关联质检项目级树成功");
-            }
-        } else if (pawDTO.getWbsType() == 2) {
-            throw new ServiceException("当前试验功能未开放");
-        }
-        return R.fail("操作失败");
+    public R<Object> submitWbsTreeInProject(@RequestBody WbsTreeContractDTO pawDTO) {
+        return R.status(wbsTreeService.submitWbsTreeInProject(pawDTO));
     }
 
     /**
      * 根据用户id查询项目合同岗位列表信息(用于展示在用户编辑、详情中)
      */
-    @GetMapping("/getProjectAndContractList")
+    @GetMapping("/get-project-contract-list")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "根据用户id查询项目合同岗位列表信息", notes = "传入用户id")
-    public R<List<Map>> findProjectAndContractList(Long userId) {
-        List<Map> result = wbsTreeService.findProjectAndContractList(userId);
+    public R<List<Map<String, Object>>> findProjectAndContractList(Long userId) {
+        List<Map<String, Object>> result = wbsTreeService.findProjectAndContractList(userId);
         return R.data(result);
     }
 

+ 12 - 9
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java

@@ -241,15 +241,18 @@ public class SignPfxFileController extends BladeController {
 					Iterator<SaveUserInfoByProjectDTO> iterator = contractUserList.iterator();
 					while (iterator.hasNext()){
 						SaveUserInfoByProjectDTO next = iterator.next();
-
-						if(next.getRoleId().equals(childVo.getId().toString())){
-							//角色相符
-							SignPfxFile userSignPfx = this.signPfxFileService.getOne(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, next.getUserId()));
-							if(userSignPfx == null){
-								iterator.remove();
-								continue;
+						try{
+							if(next.getRoleId() != null && next.getRoleId().equals(childVo.getId().toString())){
+								//角色相符
+								SignPfxFile userSignPfx = this.signPfxFileService.getOne(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, next.getUserId()));
+								if(userSignPfx == null){
+									iterator.remove();
+									continue;
+								}
+								childPfxUserVo.getSignPfxFileList().add(userSignPfx);
 							}
-							childPfxUserVo.getSignPfxFileList().add(userSignPfx);
+						}catch (Exception e){
+							e.printStackTrace();
 						}
 					}
 					//设置子集
@@ -277,7 +280,7 @@ public class SignPfxFileController extends BladeController {
 				while (iterator.hasNext()){
 					SaveUserInfoByProjectDTO next = iterator.next();
 
-					if(next.getRoleId().equals(adminVo.getRoleId().toString())){
+					if(next.getRoleId() != null && next.getRoleId().equals(adminVo.getRoleId().toString())){
 						//角色相符
 						SignPfxFile userSignPfx = this.signPfxFileService.getOne(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, next.getUserId()));
 						if(userSignPfx == null){

+ 22 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -215,7 +215,7 @@ public class TextdictInfoController extends BladeController {
         String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
 
         String vmode = "formData." + keyname;
-        if (textdictInfo.getTextId().equals("input")) { // 单选
+        if (textdictInfo.getTextId().equals("input")) { // 文本
             element.empty().append("<el-input type='text' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
         } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
             int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
@@ -225,39 +225,48 @@ public class TextdictInfoController extends BladeController {
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
-                    selectText += "<el-option  key='" + i + "' label='" + optionList.get(i).getDictValue() + "'   value='" + i + "' > </el-option>";
+                    selectText += "<el-option  key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "'   value='" + optionList.get(i).getDictValue() + "' > </el-option>";
             }
             selectText += "</el-select>";
             element.empty().append(selectText);
         } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
 
-            String radioText = "<template v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
+            String radioText = "<el-radio-group  v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
-                    radioText += " <el-radio v-model=" + vmode + "  label=" + i + ">" + optionList.get(i).getDictValue() + "</el-radio>";
+                    radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
             }
-            radioText += "</template>";
+            radioText += "</el-radio-group >";
             element.empty().append(radioText);
         } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
-                Integer[] data = new Integer[optionList.size()];
                 JSONArray objs = new JSONArray();
-
                 for (int i = 0; i < optionList.size(); i++){
-                    data[i]=i+1;
                     JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("key",i+1);
+                    jsonObject.put("key",optionList.get(i).getDictValue());
                     jsonObject.put("name",optionList.get(i).getDictValue());
                     objs.add(jsonObject);
                 }
                 String checkbox = "<hc-form-checkbox-group :objs="+objs+"  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
                 element.empty().append(checkbox);
             }
-        } else if (textdictInfo.getTextId().equals("date")) { // 日期
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
-        } else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
+        } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY-MM-DD HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+        } else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY-MM-DD' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+        } else if (textdictInfo.getTextId().equals("dateHMS")) { // 日期--时分秒
+            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        } else if (textdictInfo.getTextId().equals("dateSM")) { // 日期--时分
+            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        }else if (textdictInfo.getTextId().equals("dateMDHM")) { // 日期--月日时分
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM-DD HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        }else if (textdictInfo.getTextId().equals("dateDHM")) { // 日期--日时分
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        }
+
+        else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
             element.empty().append("<el-date-picker  v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
             element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
         } else if (textdictInfo.getTextId().equals("img")) {
@@ -349,7 +358,7 @@ public class TextdictInfoController extends BladeController {
             textdictInfoService.saveOrUpdate(textdictInfo);
             element.removeAttr("dqId");
             element.attr("dqId", textdictInfo.getId() + "");
-            element.children().get(0).attr("readonly","true");
+            element.children().get(0).attr(":readonly","true");
         }
 
         // 写入 excel

+ 64 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TrialClassificationConfigurationController.java

@@ -0,0 +1,64 @@
+package org.springblade.manager.controller;
+
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.cache.utils.CacheUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.support.Kv;
+import org.springblade.manager.entity.TrialClassificationConfiguration;
+import org.springblade.manager.service.ITrialClassificationConfigurationService;
+import org.springblade.manager.vo.TrialClassificationConfigurationTreeVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
+
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/trial")
+@Api(value = "试验分类配置", tags = "试验分类配置接口")
+public class TrialClassificationConfigurationController extends BladeController {
+
+    private final ITrialClassificationConfigurationService iTrialClassificationConfigurationService;
+
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入节点id")
+    @RequestMapping(value = "/detail", method = RequestMethod.GET)
+    public R<TrialClassificationConfiguration> detail(@Valid @RequestParam Long id) {
+        return R.data(iTrialClassificationConfigurationService.detail(id));
+    }
+
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "新增或修改", notes = "传入TrialClassificationConfiguration对象")
+    @RequestMapping(value = "/submit", method = RequestMethod.POST)
+    public R<Object> submit(@Valid @RequestBody TrialClassificationConfiguration obj) {
+        if (iTrialClassificationConfigurationService.submit(obj)) {
+            CacheUtil.clear(SYS_CACHE);
+            Kv kv = Kv.create().set("id", String.valueOf(obj.getId()));
+            return R.data(kv);
+        }
+        return R.fail("操作失败");
+    }
+
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "删除节点", notes = "传入节点id")
+    @RequestMapping(value = "/remove", method = RequestMethod.GET)
+    public R<Object> remove(@Valid @RequestParam Long id) {
+        return R.status(iTrialClassificationConfigurationService.removeById(id));
+    }
+
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "加载外委、第三方树", notes = "null")
+    @RequestMapping(value = "/tree-all", method = RequestMethod.GET)
+    public R<TrialClassificationConfigurationTreeVO> treeAll() {
+        return R.data(iTrialClassificationConfigurationService.treeAll());
+    }
+
+
+}

+ 58 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TrialSummaryClassificationConfigurationController.java

@@ -0,0 +1,58 @@
+package org.springblade.manager.controller;
+
+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 lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.manager.entity.TrialSummaryClassificationConfiguration;
+import org.springblade.manager.service.ITrialSummaryClassificationConfigurationService;
+import org.springblade.manager.vo.ContractInfoVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/trial/summary")
+@Api(value = "试验汇总分类配置", tags = "试验汇总分类配置接口")
+public class TrialSummaryClassificationConfigurationController extends BladeController {
+
+    private final ITrialSummaryClassificationConfigurationService iTrialSummaryClassificationConfigurationService;
+
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入id")
+    @RequestMapping(value = "/detail", method = RequestMethod.GET)
+    public R<TrialSummaryClassificationConfiguration> detail(@Valid @RequestParam Long id) {
+        return R.data(iTrialSummaryClassificationConfigurationService.detail(id));
+    }
+
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "新增或修改", notes = "传入TrialSummaryClassificationConfiguration对象")
+    @RequestMapping(value = "/submit", method = RequestMethod.POST)
+    public R<Object> submit(@Valid @RequestBody TrialSummaryClassificationConfiguration obj) {
+        return R.status(iTrialSummaryClassificationConfigurationService.submit(obj));
+    }
+
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "删除节点", notes = "传入节点id")
+    @RequestMapping(value = "/remove", method = RequestMethod.GET)
+    public R<Object> remove(@Valid @RequestParam Long id) {
+        return R.status(iTrialSummaryClassificationConfigurationService.removeById(id));
+    }
+
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "分页查询", notes = "")
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    public R<IPage<Object>> page(Query query, TrialSummaryClassificationConfiguration obj) {
+        IPage<Object> pages = iTrialSummaryClassificationConfigurationService.selectContractInfoPage(Condition.getPage(query), obj);
+        return R.data(pages);
+    }
+
+
+}

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

@@ -84,7 +84,7 @@ public class WbsFormElementController extends BladeController {
     /**
      * 批量新增wbs元素 同步实体表
      */
-    @PostMapping("/submitBatch")
+    @PostMapping("/submit-batch")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "批量新增wbs元素", notes = "传入wbsFormElementList")
     public R submitBatch(@RequestBody WbsFormElementVO2 wbsFormElementVO2) {
@@ -160,7 +160,7 @@ public class WbsFormElementController extends BladeController {
      */
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "查询当前节点下所有表单", notes = "传入该节点id")
-    @RequestMapping(value = "/getWbsTreeTableSameLevel", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-table-same-level", method = RequestMethod.GET)
     public R<List<WbsFormElementDTO2>> findWbsTreeTableSameLevel(@RequestParam("id") String id) {
         List<WbsFormElementDTO2> trees = wbsFormElementService.findWbsTreeTableSameLevel(id);
         return R.data(trees);
@@ -171,7 +171,7 @@ public class WbsFormElementController extends BladeController {
      */
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "wbs树节点手动排序", notes = "WbsFormElementDTO2集合,id=表单id")
-    @RequestMapping(value = "/submitWbsTreeTableSort", method = RequestMethod.POST)
+    @RequestMapping(value = "/submit-table-sort", method = RequestMethod.POST)
     public R wbsTreeTableSort(@RequestBody List<WbsFormElementDTO2> wbsTreeDTO) {
         boolean b = wbsFormElementService.wbsTreeTableSort(wbsTreeDTO);
         return R.status(b);
@@ -183,7 +183,7 @@ public class WbsFormElementController extends BladeController {
      */
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "提交清表关联公有Wbs树并创建元素", notes = "节点id、表名、元素DTO")
-    @RequestMapping(value = "/submitExcelRelationWbsTreeAndElement", method = RequestMethod.POST)
+    @RequestMapping(value = "/submit-excel-relation-wbsTree-element", method = RequestMethod.POST)
     public R submitExcelRelationWbsTreeAndElement(@RequestBody FormElementDTO2 formElementDTO) {
         return R.status(wbsFormElementService.submitExcelRelationWbsTreeAndElement(formElementDTO));
     }
@@ -206,7 +206,7 @@ public class WbsFormElementController extends BladeController {
      */
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "元素识别关联公共WBS模板-查询节点下已关联的所有表单", notes = "传入节点id、清表id")
-    @RequestMapping(value = "/getNodeTables", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-node-tables", method = RequestMethod.GET)
     public R<List<WbsNodeTableVO>> searchNodeTables(String nodeId, String excelTabId) {
         List<WbsNodeTableVO> list = wbsFormElementService.searchNodeTables(nodeId, excelTabId);
         if (list.size() > 0) {

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

@@ -158,7 +158,7 @@ public class WbsInfoController extends BladeController {
     /**
      * 根据类型查找
      */
-    @GetMapping("/getByWbsType")
+    @GetMapping("/get-wbs-type")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "根据类型查找", notes = "传入type,1=质检 2=实验 3=计量")
     public R<List<WbsInfo>> findByWbsType(String type) {

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

@@ -23,7 +23,7 @@ public class WbsTreeContractController extends BladeController {
 
     private final IWbsTreeContractService iWbsTreeContractService;
 
-    @GetMapping("/searchNodeAllTable")
+    @GetMapping("/search-node-tables")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "查询当前节点下所有元素表信息", notes = "传入节点primaryKeyId、type、合同段id、项目id")
     public R searchNodeAllTable(String primaryKeyId, String type, String contractId, String projectId) {
@@ -34,7 +34,7 @@ public class WbsTreeContractController extends BladeController {
         return R.fail(200, "未查询到数据");
     }
 
-    @GetMapping("/searchParentAllNode")
+    @GetMapping("/search-parent-nodes")
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "获取当前节点的父集合", notes = "获取当前节点的父集合")
     @ApiImplicitParams(value = {
@@ -74,4 +74,11 @@ public class WbsTreeContractController extends BladeController {
         return R.status(iWbsTreeContractService.submitRelation(wbsTreeContractDTO2));
     }
 
+    @GetMapping("/concealed-works-node")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "标记/取消隐蔽工程节点", notes = "传入节点pKeyId")
+    public R concealedWorksNode(@RequestParam String pKeyId) {
+        return R.status(iWbsTreeContractService.concealedWorksNode(pKeyId));
+    }
+
 }

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

@@ -152,7 +152,7 @@ public class WbsTreeController extends BladeController {
     /**
      * 查询当前节点下所有表单(根据节点ID查询当前表单)
      */
-    @GetMapping("/getByNodeTable")
+    @GetMapping("/get-node-table")
     @ApiOperationSupport(order = 6)
     @ApiOperation(value = "查询当前节点下所有表单", notes = "传入父节点id")
     public R<List<WbsNodeTableVO>> selectByNodeTable(@ApiParam(value = "父节点id", required = true) @RequestParam String id) {
@@ -166,7 +166,7 @@ public class WbsTreeController extends BladeController {
     /**
      * 删除表单
      */
-    @GetMapping("/removeTableById")
+    @GetMapping("/remove-table")
     @ApiOperationSupport(order = 7)
     @ApiOperation(value = "表单删除", notes = "传入id")
     @ApiImplicitParam(name = "id", value = "表单id", required = true)
@@ -192,7 +192,7 @@ public class WbsTreeController extends BladeController {
     /**
      * 根据表单id查询所有元素
      */
-    @GetMapping("/getFormElements")
+    @GetMapping("/get-table-elements")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "根据表单id查询所有元素", notes = "传入表单id")
     @ApiImplicitParam(name = "id", value = "表单id", required = true)
@@ -211,7 +211,7 @@ public class WbsTreeController extends BladeController {
     /**
      * 新增表单与元素
      */
-    @PostMapping("/saveFormAndElement")
+    @PostMapping("/save-table-element")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "表单与元素新增", notes = "传入FormElementDTO")
     public R saveFormElement(@RequestBody FormElementDTO formElementDTO) {
@@ -222,7 +222,7 @@ public class WbsTreeController extends BladeController {
     /**
      * 编辑表单元素批量修改
      */
-    @PostMapping("/updateBatchElements")
+    @PostMapping("/update-batch-elements")
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "编辑表单元素批量修改", notes = "传入WbsFormElement")
     @ApiImplicitParam(name = "ids", value = "元素的id集合", required = true)
@@ -265,7 +265,7 @@ public class WbsTreeController extends BladeController {
      */
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "查询当前节点所有同级节点", notes = "传入该节点parentId")
-    @RequestMapping(value = "/getWbsTreeSameLevel", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-same-level", method = RequestMethod.GET)
     public R<List<WbsTreeDTO2>> findWbsTreeSameLevel(@RequestParam("parentId") String parentId) {
         List<WbsTreeDTO2> trees = wbsTreeService.findWbsTreeSameLevel(parentId);
         return R.data(trees);
@@ -276,7 +276,7 @@ public class WbsTreeController extends BladeController {
      */
     @ApiOperationSupport(order = 14)
     @ApiOperation(value = "wbs树节点手动排序", notes = "WbsTreeDTO2集合,id=节点id,sort=节点顺序")
-    @RequestMapping(value = "/submitWbsTreeSort", method = RequestMethod.POST)
+    @RequestMapping(value = "/submit-sort", method = RequestMethod.POST)
     public R wbsTreeSort(@RequestBody List<WbsTreeDTO2> wbsTreeDTO) {
         boolean b = wbsTreeService.wbsTreeSort(wbsTreeDTO);
         return R.status(b);
@@ -323,7 +323,7 @@ public class WbsTreeController extends BladeController {
      */
     @ApiOperationSupport(order = 17)
     @ApiOperation(value = "批量修改节点下元素表基本信息", notes = "传入List<WbsTree>")
-    @RequestMapping(value = "/updateBatchNodeTableInfo", method = RequestMethod.POST)
+    @RequestMapping(value = "/update-batch-node-tableInfo", method = RequestMethod.POST)
     public R updateBatchNodeTableInfo(@RequestBody List<WbsTree> WbsTrees) {
         return R.status(wbsTreeService.updateBatchById(WbsTrees));
     }
@@ -333,7 +333,7 @@ public class WbsTreeController extends BladeController {
      */
     @ApiOperationSupport(order = 18)
     @ApiOperation(value = "查询公有wbs节点元素表与节点参数", notes = "传入父节点id")
-    @RequestMapping(value = "/getNodeTabAndParam", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-node-table-param", method = RequestMethod.GET)
     public R<WbsNodeTabAndParamVO> getNodeTabAndParam(@ApiParam(value = "父节点id", required = true) @RequestParam String id) {
         WbsNodeTabAndParamVO rs = wbsTreeService.getNodeTabAndParam(id);
         return R.data(rs);

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

@@ -71,19 +71,29 @@ public class WbsTreePrivateController extends BladeController {
             //记录需要修改的对象
             List<WbsTreePrivate> updateList = new ArrayList<>();
 
+            //记录需要删除的对象
+            List<WbsTreePrivate> removeList = new ArrayList<>();
+
             //模板节点
             List<String> wbsTreeIds = new ArrayList<>(Arrays.asList(vo.getWbsTreeIds().split(",")));
 
             if (wbsTreeIds.size() > 0) {
                 //获取模板节点
                 List<WbsTree> wbsTreeList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().in(WbsTree::getId, wbsTreeIds));
-                //获取这些模板下的表格元素
-                List<WbsTree> wbsTreeTableList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().in(WbsTree::getParentId, wbsTreeIds).eq(WbsTree::getType, 2));
-                if (wbsTreeTableList != null && wbsTreeTableList.size() > 0) {
-                    wbsTreeList.addAll(wbsTreeTableList);
-                }
 
                 if (oldDataList != null && oldDataList.size() > 0) {
+                    //判断哪些节点是本次删除的
+                    Iterator<WbsTreePrivate> oldIterator = oldDataList.iterator();
+
+                    while (oldIterator.hasNext()){
+                        WbsTreePrivate next = oldIterator.next();
+                        if(!wbsTreeIds.contains(next.getId().toString())){
+                            //不包含,删除
+                            removeList.add(next);
+                            oldIterator.remove();
+                        }
+                    }
+
                     //检查哪些节点是重复的或修改的,删除
                     Iterator<WbsTree> iterator = wbsTreeList.iterator();
                     while (iterator.hasNext()) {
@@ -91,16 +101,20 @@ public class WbsTreePrivateController extends BladeController {
                         for (WbsTreePrivate oldPrivate : oldDataList) {
                             if (oldPrivate.getId().equals(next.getId())) {
                                 if (
-                                        (StringUtils.isNotEmpty(next.getFullName(), oldPrivate.getFullName()) && !next.getFullName().equals(oldPrivate.getFullName()))
-                                                || (StringUtils.isNotEmpty(next.getNodeName(), oldPrivate.getNodeName()) && !next.getNodeName().equals(oldPrivate.getNodeName()))
-                                                || (StringUtils.isNotEmpty(next.getMajorDataType(), oldPrivate.getMajorDataType()) && !next.getMajorDataType().equals(oldPrivate.getMajorDataType()))
-                                                || (StringUtils.isNotEmpty(next.getNodeType(), oldPrivate.getNodeType()) && !next.getNodeType().equals(oldPrivate.getNodeType()))
+                                        (StringUtils.isNotEmpty(next.getFullName()) && !next.getFullName().equals(oldPrivate.getFullName()))
+                                                || (StringUtils.isNotEmpty(next.getNodeName()) && !next.getNodeName().equals(oldPrivate.getNodeName()))
+                                                || (StringUtils.isNotEmpty(next.getMajorDataType()) && !next.getMajorDataType().equals(oldPrivate.getMajorDataType()))
+                                                || (StringUtils.isNotEmpty(next.getNodeType()) && !next.getNodeType().equals(oldPrivate.getNodeType()))
+                                        || (StringUtils.isNotEmpty(next.getUniqueCode()) && !next.getUniqueCode().equals(oldPrivate.getUniqueCode()))
+                                        || (StringUtils.isNotEmpty(next.getPartitionCode()) && !next.getUniqueCode().equals(oldPrivate.getPartitionCode()))
                                 ) {
                                     //需要修改
                                     oldPrivate.setFullName(next.getFullName());
                                     oldPrivate.setNodeName(next.getNodeName());
                                     oldPrivate.setNodeType(next.getNodeType());
                                     oldPrivate.setMajorDataType(next.getMajorDataType());
+                                    oldPrivate.setUniqueCode(next.getUniqueCode());
+                                    oldPrivate.setPartitionCode(next.getPartitionCode());
 
                                     updateList.add(oldPrivate);
                                 }
@@ -112,16 +126,25 @@ public class WbsTreePrivateController extends BladeController {
                     }
                 }
 
-                //复制数据
-                for (WbsTree tree : wbsTreeList) {
-                    WbsTreePrivate treePrivate = new WbsTreePrivate();
-                    BeanUtils.copyProperties(tree, treePrivate);
-                    treePrivate.setWbsType("4");
-                    treePrivate.setProjectId(vo.getProjectId());
-                    treePrivate.setPKeyId(SnowFlakeUtil.getId());
-                    treePrivate.setCreateTime(now);
+                if(wbsTreeList.size() > 0){
+                    //获取这些模板下的表格元素
+                    List<Long> addNodeIds = wbsTreeList.stream().map(WbsTree::getId).distinct().collect(Collectors.toList());
+                    List<WbsTree> wbsTreeTableList = this.wbsTreeService.list(Wrappers.<WbsTree>lambdaQuery().in(WbsTree::getParentId, addNodeIds).eq(WbsTree::getType, 2));
+                    if (wbsTreeTableList != null && wbsTreeTableList.size() > 0) {
+                        wbsTreeList.addAll(wbsTreeTableList);
+                    }
+
+                    //复制数据
+                    for (WbsTree tree : wbsTreeList) {
+                        WbsTreePrivate treePrivate = new WbsTreePrivate();
+                        BeanUtils.copyProperties(tree, treePrivate);
+                        treePrivate.setWbsType("4");
+                        treePrivate.setProjectId(vo.getProjectId());
+                        treePrivate.setPKeyId(SnowFlakeUtil.getId());
+                        treePrivate.setCreateTime(now);
 
-                    saveTreePrivateList.add(treePrivate);
+                        saveTreePrivateList.add(treePrivate);
+                    }
                 }
             }
 
@@ -193,9 +216,23 @@ public class WbsTreePrivateController extends BladeController {
                             .set(WbsTreePrivate::getFullName, treePrivate.getFullName())
                             .set(WbsTreePrivate::getNodeType, treePrivate.getNodeType())
                             .set(WbsTreePrivate::getMajorDataType, treePrivate.getMajorDataType())
+                            .set(WbsTreePrivate::getUniqueCode, treePrivate.getUniqueCode())
+                            .set(WbsTreePrivate::getPartitionCode, treePrivate.getPartitionCode())
                             .eq(WbsTreePrivate::getPKeyId, treePrivate.getPKeyId()));
                 }
             }
+            if(removeList.size() > 0){
+                List<Long> removePKeyIds = removeList.stream().map(WbsTreePrivate::getPKeyId).distinct().collect(Collectors.toList());
+                //同时删除其下的表格
+                List<Long> removeIds = removeList.stream().map(WbsTreePrivate::getId).distinct().collect(Collectors.toList());
+                this.wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate()
+                        .set(WbsTreePrivate::getIsDeleted, 1)
+                        .in(WbsTreePrivate::getParentId, removeIds).eq(WbsTreePrivate::getProjectId, removeList.get(0).getProjectId()));
+                //最后删除节点
+                this.wbsTreePrivateService.update(Wrappers.<WbsTreePrivate>lambdaUpdate()
+                        .set(WbsTreePrivate::getIsDeleted, 1)
+                        .in(WbsTreePrivate::getPKeyId, removePKeyIds));
+            }
 
             return R.data(200, true, "保存成功");
         } else {
@@ -270,7 +307,7 @@ public class WbsTreePrivateController extends BladeController {
     /**
      * 查询当前节点下所有表单(根据节点ID查询当前表单)
      */
-    @GetMapping("/getNodeTableByCondition")
+    @GetMapping("/get-node-tables")
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "查询当前节点下所有元素表", notes = "传入父节点id、wbsId、projectId")
     public R<List<WbsNodeTableVO>> findNodeTableByCondition(@RequestParam("parentId") String parentId,
@@ -284,7 +321,7 @@ public class WbsTreePrivateController extends BladeController {
     }
 
 
-    @GetMapping("/removeTableByCondition")
+    @GetMapping("/remove-table")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "删除节点下的元素表", notes = "传入表单id、wbsId、projectId")
     public R removeTableByCondition(@RequestParam("id") String id,
@@ -353,7 +390,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 7)
     @ApiOperation(value = "查询当前节点所有同级节点", notes = "传入项目id、当前节点parentId")
-    @RequestMapping(value = "/getWbsTreePrivateSameLevel", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-node-same-level", method = RequestMethod.GET)
     public R<List<WbsTreePrivateDTO2>> findWbsTreePrivateSameLevel(@RequestParam("projectId") String projectId,
                                                                    @RequestParam("parentId") String parentId,
                                                                    @RequestParam("wbsId") String wbsId) {
@@ -365,7 +402,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "wbs私有树节点手动排序", notes = "WbsTreeDTO2集合,pKeyId=节点pKeyId")
-    @RequestMapping(value = "/submitWbsTreePrivateSort", method = RequestMethod.POST)
+    @RequestMapping(value = "/submit-sort", method = RequestMethod.POST)
     public R wbsTreePrivateSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
         return R.status(wbsTreePrivateService.wbsTreePrivateSort(wbsTreeDTO));
     }
@@ -376,7 +413,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "wbs私有树表单手动排序", notes = "WbsTreeDTO2集合,pKeyId=表单pKeyId")
-    @RequestMapping(value = "/submitWbsTreePrivateTableSort", method = RequestMethod.POST)
+    @RequestMapping(value = "/submit-table-sort", method = RequestMethod.POST)
     public R wbsTreePrivateTableSort(@RequestBody List<WbsTreePrivateDTO2> wbsTreeDTO) {
         return R.status(wbsTreePrivateService.wbsTreePrivateTableSort(wbsTreeDTO));
     }
@@ -386,7 +423,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 10)
     @ApiOperation(value = "批量修改wbs私有树节点下元素表基本信息", notes = "传入List<WbsTreePrivate>")
-    @RequestMapping(value = "/updateBatchNodeTableInfo", method = RequestMethod.POST)
+    @RequestMapping(value = "/update-batch-node-tableInfo", method = RequestMethod.POST)
     public R updateBatchNodeTableInfo(@RequestBody List<WbsTreePrivateDTO3> wbsTreePrivates) {
         return R.status(wbsTreePrivateService.updateBatchByPid(wbsTreePrivates));
     }
@@ -396,7 +433,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "隐藏/启用表单", notes = "传入pKeyId")
-    @RequestMapping(value = "/updateStatus", method = RequestMethod.GET)
+    @RequestMapping(value = "/update-status", method = RequestMethod.GET)
     public R updateStatus(@RequestParam String pKeyId) {
         return R.status(wbsTreePrivateService.updateStatus(pKeyId));
     }
@@ -406,7 +443,7 @@ public class WbsTreePrivateController extends BladeController {
      */
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "查询私有wbs节点元素表与节点参数", notes = "传入节点parentId、wbsId、projectId")
-    @RequestMapping(value = "/getNodeTabAndParam", method = RequestMethod.GET)
+    @RequestMapping(value = "/get-node-table-param", method = RequestMethod.GET)
     public R<WbsNodeTabAndParamVO> getNodeTabAndParam(@RequestParam("parentId") String parentId,
                                                       @RequestParam("wbsId") String wbsId,
                                                       @RequestParam("projectId") String projectId) {

+ 0 - 81
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/WbsExcelUtil.java

@@ -22,87 +22,6 @@ import java.util.stream.Collectors;
 
 public class WbsExcelUtil {
 
-    /*public static void main(String[] args) throws IOException, ClassNotFoundException {
-        WbsExcelUtil excelUtil = new WbsExcelUtil();
-        //读取excel数据
-        ArrayList<Map<String, String>> result = excelUtil.readExcelToObj("C:\\Users\\泓创开发\\Desktop\\excel节点模板\\隧道工程.xls");
-        //result.forEach(System.out::println);
-
-        //构造
-        List<ImportWbsNodeVO> list = new ArrayList<>();
-        int rowNumber = 1;
-        for (Map<String, String> row : result) { //行
-
-            List<String> parentCode = new ArrayList<>();
-            Map<String, ImportWbsNodeVO> mapCol = new HashMap<>();
-
-            for (Map.Entry<String, String> col : row.entrySet()) { //列
-                ImportWbsNodeVO wbsNodeVO = new ImportWbsNodeVO();
-                if (col.getValue().equals("")) {
-                    continue;
-                }
-
-                if (mapCol.size() > 0) {
-                    wbsNodeVO.setRow(rowNumber);
-                    wbsNodeVO.setId(SnowFlakeUtil.getId());
-                    wbsNodeVO.setNodeName(col.getValue());
-                    wbsNodeVO.setNodeType(col.getKey());
-                    wbsNodeVO.setAncestors(null);
-                    wbsNodeVO.setCode(rowNumber + "-" + col.getKey());
-
-                    parentCode.add(wbsNodeVO.getCode());
-                    Iterator<String> iterator = parentCode.iterator();
-                    while (iterator.hasNext()) {
-                        String next = iterator.next();
-                        if (!next.equals(wbsNodeVO.getCode())) {
-                            wbsNodeVO.setParentCode(next);
-                            if (wbsNodeVO.getParentCode() != null) {
-                                iterator.remove();
-                            }
-                        }
-                    }
-
-                    //获取上级obj
-                    Iterator<Map.Entry<String, ImportWbsNodeVO>> iteratorMap = mapCol.entrySet().iterator();
-                    while (iteratorMap.hasNext()) {
-                        Map.Entry<String, ImportWbsNodeVO> importWbsNodeVOEntry = iteratorMap.next();
-                        if (wbsNodeVO.getParentCode().equals(importWbsNodeVOEntry.getValue().getCode())) {
-                            wbsNodeVO.setParentId(importWbsNodeVOEntry.getValue().getId());
-                        }
-                    }
-
-                    mapCol.put(wbsNodeVO.getNodeType(), wbsNodeVO);
-
-                } else {
-                    wbsNodeVO.setRow(rowNumber);
-                    wbsNodeVO.setId(SnowFlakeUtil.getId());
-                    wbsNodeVO.setNodeName(col.getValue());
-                    wbsNodeVO.setNodeType(col.getKey());
-                    wbsNodeVO.setParentId(0L);
-                    wbsNodeVO.setAncestors(null);
-                    wbsNodeVO.setCode(rowNumber + "-" + col.getKey());
-
-                    parentCode.add(wbsNodeVO.getCode());
-                    Iterator<String> iterator = parentCode.iterator();
-                    while (iterator.hasNext()) {
-                        String next = iterator.next();
-                        if (!next.equals(wbsNodeVO.getCode())) {
-                            wbsNodeVO.setParentCode(next);
-                            if (wbsNodeVO.getParentCode() != null) {
-                                iterator.remove();
-                            }
-                        }
-                    }
-                    mapCol.put(wbsNodeVO.getNodeType(), wbsNodeVO);
-                }
-                list.add(wbsNodeVO);
-            }
-            rowNumber++;
-        }
-
-        list.forEach(System.out::println);
-
-    }*/
 
     /**
      * 读取excel数据

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

@@ -19,10 +19,10 @@ public class SignPfxClientImpl implements SignPfxClient {
 
         if(StringUtils.isNotEmpty(userId)){
             //查询个人章
-            return this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getCertificateUserId, userId));
+            return this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getIsRegister, "1").eq(SignPfxFile::getCertificateUserId, userId));
         } else if(StringUtils.isNotEmpty(contractId)){
             //查询项目章
-            return this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().like(SignPfxFile::getProjectContractRole, contractId));
+            return this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().eq(SignPfxFile::getIsRegister, "1").like(SignPfxFile::getProjectContractRole, contractId));
         }
         return null;
     }

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

@@ -4,11 +4,13 @@ import org.apache.ibatis.annotations.Param;
 import org.springblade.manager.dto.FindAllUserByConditionDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractRelationJlyz;
+import org.springblade.manager.entity.SaveUserInfoByProject;
 import org.springblade.manager.entity.WbsTree;
 import org.springblade.manager.vo.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.system.user.entity.User;
+import org.springblade.system.user.vo.UserContractInfoVO;
 import org.springblade.system.user.vo.UserVO2;
 
 import java.util.List;
@@ -74,5 +76,8 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
     List<ContractInfo> selectContractIdByProjectId(String projectId);
 
+    List<SaveUserInfoByProject> selectContractUserInfo(String contractId);
+
+    List<UserContractInfoVO> userListByIds(@Param("ids") List<String> ids);
 
 }

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

@@ -395,5 +395,15 @@
         ORDER BY d.create_time,d.sort
     </select>
 
+    <select id="selectContractUserInfo" resultType="org.springblade.manager.entity.SaveUserInfoByProject">
+        select * from m_project_assignment_user where contract_id = #{contractId} and is_deleted = 0 and status = 1
+    </select>
+
+    <select id="userListByIds" resultType="org.springblade.system.user.vo.UserContractInfoVO">
+        select id as userId,`name` as userName from blade_user where id in
+        <foreach collection="ids" item="ids" index="ids" open="(" separator="," close=")">
+            #{ids}
+        </foreach>
+    </select>
 
 </mapper>

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ProjectInfoMapper.xml

@@ -32,6 +32,7 @@
         <result column="reference_wbs_template_id" property="referenceWbsTemplateId"/>
         <result column="reference_wbs_template_type" property="referenceWbsTemplateType"/>
         <result column="reference_log_wbs_template_id" property="referenceLogWbsTemplateId"/>
+        <result column="is_open_random_number" property="isOpenRandomNumber"/>
     </resultMap>
 
     <resultMap id="singPfxManagementResultMap" type="org.springblade.manager.vo.SingPfxManagementVO">
@@ -79,7 +80,7 @@
     </select>
 
     <select id="selectProjectList" resultMap="projectInfoResultMap">
-        select id, project_name, project_alias, project_number from m_project_info where is_deleted = 0 and id in
+        select * from m_project_info where is_deleted = 0 and id in
         <foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
             #{projectId}
         </foreach>
@@ -95,10 +96,10 @@
         AND status = 1
     </update>
 
-
     <select id="selectProjectInfoPage" resultMap="projectInfoResultMap">
         select * from m_project_info where is_deleted = 0
     </select>
+
     <select id="selectOneAndWbsTypeById" resultType="org.springblade.manager.entity.ProjectInfo">
         SELECT *,
         (select wbs_type from m_wbs_info )

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialClassificationConfigurationMapper.java

@@ -0,0 +1,13 @@
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.manager.entity.TrialClassificationConfiguration;
+import org.springblade.manager.vo.TrialClassificationConfigurationTree;
+
+import java.util.List;
+
+public interface TrialClassificationConfigurationMapper extends BaseMapper<TrialClassificationConfiguration> {
+
+    List<TrialClassificationConfigurationTree> treeAll();
+
+}

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

@@ -0,0 +1,25 @@
+<?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.TrialClassificationConfigurationMapper">
+    <resultMap id="ResultMap" type="org.springblade.manager.entity.TrialClassificationConfiguration">
+        <result column="id" property="id"/>
+        <result column="node_name" property="nodeName"/>
+        <result column="node_type" property="nodeType"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="sort" property="sort"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <select id="treeAll" resultType="org.springblade.manager.vo.TrialClassificationConfigurationTree">
+        SELECT * FROM m_trial_classification_configuration WHERE is_deleted = 0 AND status = 1 ORDER BY sort
+    </select>
+
+
+</mapper>

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialSummaryClassificationConfigurationMapper.java

@@ -0,0 +1,13 @@
+package org.springblade.manager.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.manager.entity.TrialSummaryClassificationConfiguration;
+
+import java.util.List;
+
+public interface TrialSummaryClassificationConfigurationMapper extends BaseMapper<TrialSummaryClassificationConfiguration> {
+
+    List<Object> selectContractInfoPage(IPage<Object> page, TrialSummaryClassificationConfiguration obj);
+
+}

+ 24 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TrialSummaryClassificationConfigurationMapper.xml

@@ -0,0 +1,24 @@
+<?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.TrialSummaryClassificationConfigurationMapper">
+    <resultMap id="ResultMap" type="org.springblade.manager.entity.TrialSummaryClassificationConfiguration">
+        <result column="id" property="id"/>
+        <result column="class_name" property="className"/>
+        <result column="excel_id" property="excelId"/>
+        <result column="trial_tree_ids" property="trialTreeIds"/>
+        <result column="sort" property="sort"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <select id="selectContractInfoPage"
+            resultType="org.springblade.manager.entity.TrialSummaryClassificationConfiguration">
+        select * from m_trial_summary_classification_configuration where is_deleted = 0 and status =1
+    </select>
+
+</mapper>

Неке датотеке нису приказане због велике количине промена