Ver código fonte

Merge branch 'cr' of http://219.151.181.73:3000/zhuwei/bladex into test-merge-02

# Conflicts:
#	blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsParamClientImpl.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
LHB 3 meses atrás
pai
commit
ecf113406b
68 arquivos alterados com 3521 adições e 26 exclusões
  1. 1 1
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/NewIOSSClient.java
  2. 5 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/BladeOssRuleRe.java
  3. 22 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/PrivateStandardDTO.java
  4. 25 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/StandardInfoDTO.java
  5. 32 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/StandardInfoJoinDTO.java
  6. 31 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/StandardInfoPrivateJoinDTO.java
  7. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialAutoNumberDTO.java
  8. 6 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialMaterialMobilizationDTO.java
  9. 37 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialNumberRuleDTO.java
  10. 6 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSampleInfoDTO.java
  11. 11 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialSelfInspectionRecordDTO.java
  12. 121 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/PrivateStandard.java
  13. 118 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardFile.java
  14. 107 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfo.java
  15. 58 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfoJoin.java
  16. 98 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfoPrivateJoin.java
  17. 56 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialAutoNumber.java
  18. 77 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialNumberRule.java
  19. 17 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoDtoVo.java
  20. 22 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoPrivateJoinVO.java
  21. 23 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoVO.java
  22. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialAutoNumberVO.java
  23. 36 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialNumberRuleVO.java
  24. 17 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialNumberRuleVO1.java
  25. 2 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java
  26. 152 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/PrivateStandardController.java
  27. 199 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/StandardInfoController.java
  28. 129 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialAutoNumberController.java
  29. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java
  30. 3 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialMaterialController.java
  31. 250 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialNumberRuleController.java
  32. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/PrivateStandardMapper.java
  33. 35 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/PrivateStandardMapper.xml
  34. 18 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardFileMapper.java
  35. 23 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardFileMapper.xml
  36. 28 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoJoinMapper.java
  37. 31 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoJoinMapper.xml
  38. 36 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoMapper.java
  39. 193 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoMapper.xml
  40. 28 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoPrivateJoinMapper.java
  41. 33 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoPrivateJoinMapper.xml
  42. 44 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialAutoNumberMapper.java
  43. 22 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialAutoNumberMapper.xml
  44. 46 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialNumberRuleMapper.java
  45. 34 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialNumberRuleMapper.xml
  46. 41 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialAutoNumberService.java
  47. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialMaterialMobilizationService.java
  48. 55 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialNumberRuleService.java
  49. 1 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java
  50. 23 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/PrivateStandardService.java
  51. 13 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/StandardFileService.java
  52. 10 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoJoinService.java
  53. 10 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoPrivateJoinService.java
  54. 46 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoService.java
  55. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ArchiveFileServiceImpl.java
  56. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  57. 212 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/PrivateStandardServiceImpl.java
  58. 22 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/StandardFileServiceImpl.java
  59. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/StandardInfoJoinServiceImpl.java
  60. 45 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialAutoNumberServiceImpl.java
  61. 17 6
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java
  62. 338 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialNumberRuleServiceImpl.java
  63. 12 4
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java
  64. 36 10
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  65. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/UStandardInfoPrivateJoinServiceImpl.java
  66. 270 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/UStandardInfoServiceImpl.java
  67. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TableInfoServiceImpl.java
  68. 2 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

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

@@ -28,7 +28,7 @@ public interface NewIOSSClient {
     @PostMapping(value = UPLOAD_FILE_INFO_INPUT_STREAM, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     BladeFile uploadFileByInputStream(MultipartFile file);
 
-    @PostMapping(value = UPLOAD_FILE_INFO_INPUT_STREAM2)
+    @PostMapping(value = UPLOAD_FILE_INFO_INPUT_STREAM2,  consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
     BladeFile uploadFileByInputStream2(@RequestParam String OriginalFilename,@RequestParam InputStream inputStream);
 
     @PostMapping(UPLOAD_FILE_INFO)

+ 5 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/BladeOssRuleRe.java

@@ -19,6 +19,11 @@ class BladeOssRuleRe implements OssRule {
     }
 
     public String fileName(String originalFilename) {
+        //试验-规范管理
+        if(originalFilename.contains("standard")){
+            String[] split = originalFilename.split("\\|");
+            return "upload/" + split[0] + "/" + DateUtil.today() + "/" + FileUtil.getNameWithoutExtension(split[1]) + "." + FileUtil.getFileExtension(split[1]);
+        }
         return "upload/" + DateUtil.today() + "/" + FileUtil.getNameWithoutExtension(originalFilename) + "." + FileUtil.getFileExtension(originalFilename);
     }
 

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

@@ -0,0 +1,22 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.PrivateStandard;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * @author LHB
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "规范文件夹及规范文件对象")
+public class PrivateStandardDTO extends PrivateStandard {
+    /**
+     * 文件
+     */
+    private MultipartFile[] files;
+}

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

@@ -0,0 +1,25 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.StandardInfo;
+
+import java.util.List;
+
+/**
+ * 试验规范信息DTO
+ *
+ * @author LHB
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "试验规范信息DTO")
+public class StandardInfoDTO extends StandardInfo {
+    /**
+     * 基础信息
+     */
+    @ApiModelProperty(value = "基础信息", required = true)
+    private List<StandardInfo> info;
+}

+ 32 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/StandardInfoJoinDTO.java

@@ -0,0 +1,32 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 条件设置
+ *
+ * @author LHB
+ */
+@Data
+@ApiModel(description = "新增对象")
+public class StandardInfoJoinDTO {
+    /**
+     * 主关联id
+     */
+    @ApiModelProperty(value = "主关联id", required = true)
+    @NotNull(message = "主关联id不能为空")
+    private Long leftId;
+
+    /**
+     * 副连接id
+     */
+    @ApiModelProperty(value = "副连接id集合", required = true)
+    @NotEmpty(message = "副连接id不能为空")
+    private List<Long> rightIds;
+}

+ 31 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/StandardInfoPrivateJoinDTO.java

@@ -0,0 +1,31 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 与表单的关联对象
+ * @author LHB
+ */
+@Data
+@ApiModel(description = "新增对象")
+public class StandardInfoPrivateJoinDTO {
+    /**
+     * 主关联id
+     */
+    @NotNull(message = "主关联id不能为空")
+    @ApiModelProperty(value = "主关联id")
+    private Long leftId;
+    /**
+     * 副连接id
+     */
+    @NotEmpty(message = "副连接信息不能为空")
+    @ApiModelProperty(value = "副连接信息集合")
+    private List<StandardInfoPrivateJoin> rightIds;
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialAutoNumberDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.TrialAutoNumber;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TrialAutoNumberDTO extends TrialAutoNumber {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -26,4 +26,10 @@ public class TrialMaterialMobilizationDTO extends TrialMaterialMobilization {
     @ApiModelProperty("数据序号")
     private Integer dataNumber;
 
+    @ApiModelProperty("旧编号")
+    private String trialAutoNumber;
+
+    @ApiModelProperty("自增流水号")
+    private String autoIncrementNumber;
+
 }

+ 37 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TrialNumberRuleDTO.java

@@ -0,0 +1,37 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.TrialNumberRule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TrialNumberRuleDTO extends TrialNumberRule {
+	private static final long serialVersionUID = 1L;
+
+    private Long nodeId;
+
+
+}

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

@@ -21,5 +21,11 @@ public class TrialSampleInfoDTO extends TrialSampleInfo {
     @ApiModelProperty("数据序号")
     private Integer dataNumber;
 
+    @ApiModelProperty("旧编号")
+    private String trialAutoNumber;
+
+    @ApiModelProperty("自增流水号")
+    private String autoIncrementNumber;
+
 
 }

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

@@ -29,4 +29,15 @@ public class TrialSelfInspectionRecordDTO extends TrialSelfInspectionRecord {
     @ApiModelProperty(value = "是否批量保存 0=单保存,1=批量保存")
     private Integer isBatchSave;
 
+    @ApiModelProperty(value = "记录表自增流水号")
+    private String recordAutoNumber;
+
+    @ApiModelProperty(value = "报告单自增流水号")
+    private String reportAutoNumber;
+
+    @ApiModelProperty(value = "旧记录编号")
+    private String oldRecordNumber;
+    @ApiModelProperty(value = "旧报告编号")
+    private String oldReportNumber;
+
 }

+ 121 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/PrivateStandard.java

@@ -0,0 +1,121 @@
+package org.springblade.business.entity;
+
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 规范文件夹及规范文件表
+ *
+ * @author LHB
+ * @TableName u_wbs_private_standard
+ */
+@TableName(value = "u_wbs_private_standard")
+@Data
+@ApiModel(description = "规范文件夹及规范文件对象")
+public class PrivateStandard {
+    /**
+     *
+     */
+    @TableId
+    @ApiModelProperty(value = "主键", required = true)
+    private Long id;
+
+    /**
+     * 名称(规范文件夹名称及规范名称)
+     */
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    /**
+     * 父级节点id
+     * type = 2 必传
+     */
+    @ApiModelProperty(value = "父级节点id(type = 2 必传)")
+    private Long parentId;
+
+    /**
+     * 项目试验节点id
+     * type = 1 必传
+     */
+    @ApiModelProperty(value = "项目试验节点id(type = 1 必传)")
+    private Long privateId;
+
+    /**
+     * 类型(1-规范文件夹,2-规范文件)
+     */
+    @ApiModelProperty(value = "类型(1-规范文件夹,2-规范文件)", required = true)
+    @NotNull(message = "类型不能为空")
+    private Integer type;
+
+    /**
+     * 下达日期(年月日)
+     * type = 2 必传
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ApiModelProperty(value = "下达日期(年月日)(type = 2 必传)")
+    private Date issueDate;
+
+    /**
+     * 实施日期(年月日)
+     * type = 2 必传
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ApiModelProperty(value = "实施日期(年月日)(type = 2 必传)")
+    private Date actualizeDate;
+
+    /**
+     * 是否删除(0-正常,1-已删除)
+     */
+    @ApiModelProperty(value = "是否删除(0-正常,1-已删除)")
+    private Integer isDeleted = 0;
+    /**
+     * 状态(1-正常,2-过期)
+     */
+    @ApiModelProperty(value = "状态(1-正常,2-过期)")
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间", hidden = true)
+    private LocalDateTime createTime;
+
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人", hidden = true)
+    private Long createUser;
+
+    /**
+     * 修改时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间", hidden = true)
+    private LocalDateTime updateTime;
+
+    /**
+     * 修改人
+     */
+    @ApiModelProperty(value = "修改人", hidden = true)
+    private Long updateUser;
+}

+ 118 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardFile.java

@@ -0,0 +1,118 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 规范文件表
+ * @TableName u_standard_file
+ */
+@TableName(value ="u_standard_file")
+@Data
+public class StandardFile {
+    /**
+     * 
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 规范id
+     */
+    private Long standardId;
+
+    /**
+     * 文件名称
+     */
+    private String fileName;
+
+    /**
+     * 规范文件路径
+     */
+    private String standardFileUrl;
+
+    /**
+     *  是否删除(0-正常,1-已删除)
+     */
+    private Integer isDeleted;
+
+    /**
+     *  创建时间
+     */
+    private Date createTime;
+
+    /**
+     *  创建人
+     */
+    private Long createUser;
+
+    /**
+     *  修改时间
+     */
+    private Date updateTime;
+
+    /**
+     *  修改人
+     */
+    private Long updateUser;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        StandardFile other = (StandardFile) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getStandardId() == null ? other.getStandardId() == null : this.getStandardId().equals(other.getStandardId()))
+            && (this.getFileName() == null ? other.getFileName() == null : this.getFileName().equals(other.getFileName()))
+            && (this.getStandardFileUrl() == null ? other.getStandardFileUrl() == null : this.getStandardFileUrl().equals(other.getStandardFileUrl()))
+            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
+            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getStandardId() == null) ? 0 : getStandardId().hashCode());
+        result = prime * result + ((getFileName() == null) ? 0 : getFileName().hashCode());
+        result = prime * result + ((getStandardFileUrl() == null) ? 0 : getStandardFileUrl().hashCode());
+        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
+        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", standardId=").append(standardId);
+        sb.append(", fileName=").append(fileName);
+        sb.append(", standardFileUrl=").append(standardFileUrl);
+        sb.append(", isDeleted=").append(isDeleted);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", createUser=").append(createUser);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", updateUser=").append(updateUser);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 107 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfo.java

@@ -0,0 +1,107 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.util.Date;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.Range;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 规范参数管理-基础信息
+ *
+ * @author LHB
+ * @TableName u_standard_info
+ */
+@TableName(value = "u_standard_info")
+@Data
+@ApiModel(description = "规范参数管理-基础信息")
+public class StandardInfo {
+    /**
+     *
+     */
+    @TableId
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    /**
+     * 名称(样品信息名称)
+     */
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称(样品信息名称)")
+    private String name;
+    /**
+     * 符号
+     */
+    @ApiModelProperty(value = "符号")
+    private String symbol;
+
+    /**
+     * 父级节点id
+     */
+    @ApiModelProperty(value = "父级节点id")
+    private Long parentId;
+
+    /**
+     * 规范文件id
+     */
+    @ApiModelProperty(value = "规范文件id")
+    private Long standardId;
+
+    /**
+     * 类型(1-样品信息,2-技术指标)
+     */
+    @ApiModelProperty(value = "类型(1-样品信息,2-技术指标)")
+    @NotNull(message = "类型不能为空")
+    @Range(min = 1, max = 2, message = "类型只能为1或2")
+    private Integer type;
+
+    /**
+     * 是否删除(0-正常,1-已删除)
+     */
+    @ApiModelProperty(value = "是否删除(0-正常,1-已删除)")
+    private Integer isDeleted;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间", hidden = true)
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人", hidden = true)
+    private Long createUser;
+
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间", hidden = true)
+    private Date updateTime;
+
+    /**
+     * 修改人
+     */
+    @ApiModelProperty(value = "修改人", hidden = true)
+    private Long updateUser;
+
+    /**
+     * 符号名称
+     */
+    @TableField(exist = false)
+    private String symbolName;
+
+    /**
+     * 父级名称
+     */
+    @TableField(exist = false)
+    private String parentName;
+}

+ 58 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfoJoin.java

@@ -0,0 +1,58 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 样品信息关联表
+ * @author LHB
+ * @TableName u_standard_info_join
+ */
+@TableName(value ="u_standard_info_join")
+@Data
+public class StandardInfoJoin {
+    /**
+     * 
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 规范基础信息关联主id
+     */
+    private Long standardInfoLeftId;
+
+    /**
+     * 规范基础信息关联副id
+     */
+    private Long standardInfoRightId;
+
+    /**
+     *  是否删除(0-正常,1-已删除)
+     */
+    private Integer isDeleted;
+
+    /**
+     *  创建时间
+     */
+    private Date createTime;
+
+    /**
+     *  创建人
+     */
+    private Long createUser;
+
+    /**
+     *  修改时间
+     */
+    private Date updateTime;
+
+    /**
+     *  修改人
+     */
+    private Long updateUser;
+
+
+}

+ 98 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/StandardInfoPrivateJoin.java

@@ -0,0 +1,98 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 样品信息与试验表 关联表
+ * @author LHB
+ * @TableName u_standard_info_private_join
+ */
+@TableName(value ="u_standard_info_private_join")
+@Data
+
+@ApiModel(description = "副连接信息集合")
+public class StandardInfoPrivateJoin {
+    /**
+     * 
+     */
+    @TableId
+    @ApiModelProperty(value = "主键", required = true)
+    private Long id;
+
+    /**
+     * 规范基础信息关联主id
+     */
+    @NotNull(message = "规范基础信息关联主id不能为空")
+    @ApiModelProperty(value = "规范基础信息关联主id", hidden = true)
+    private Long standardInfoId;
+
+    /**
+     * 试验wbs表单id
+     */
+    @NotNull(message = "试验wbs表单id不能为空")
+    @ApiModelProperty(value = "试验wbs表单id", required = true)
+    private Long privateId;
+
+    /**
+     * 元素key
+     */
+    @NotBlank(message = "元素key不能为空")
+    @ApiModelProperty(value = "元素key", required = true)
+    private String colKey;
+
+    /**
+     * 元素名称
+     */
+    @NotBlank(message = "元素名称不能为空")
+    @ApiModelProperty(value = "元素名称", required = true)
+    private String colName;
+
+    /**
+     *  是否删除(0-正常,1-已删除)
+     */
+    @ApiModelProperty(value = "是否删除(0-正常,1-已删除)")
+    private Integer isDeleted;
+
+    /**
+     *  创建时间
+     */
+    @ApiModelProperty(value = "创建时间", hidden = true)
+    private Date createTime;
+
+    /**
+     *  创建人
+     */
+    @ApiModelProperty(value = "创建人", hidden = true)
+    private Long createUser;
+
+    /**
+     *  修改时间
+     */
+    @ApiModelProperty(value = "修改时间", hidden = true)
+    private Date updateTime;
+
+    /**
+     *  修改人
+     */
+    @ApiModelProperty(value = "修改人", hidden = true)
+    private Long updateUser;
+
+
+    /**
+     * 表单名称(展示用)
+     */
+    @ApiModelProperty(value = "表单名称(展示用)")
+    @TableField(exist = false)
+    private String privateName;
+
+}

+ 56 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialAutoNumber.java

@@ -0,0 +1,56 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@TableName("u_trial_auto_number")
+@EqualsAndHashCode(callSuper = true)
+public class TrialAutoNumber extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 自增的流水号
+	*/
+		private String autoIncrementNumber;
+	/**
+	* 来源主表的主键ID
+	*/
+		private Long formDataId;
+	/**
+	* 1材料 2样品 3委托单 4记录表 5报告表
+	*/
+		private Integer type;
+    /**
+     * 试验编号规则ID
+      */
+        private Long numberRuleId;
+
+
+}

+ 77 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TrialNumberRule.java

@@ -0,0 +1,77 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@TableName("u_trial_number_rule")
+@EqualsAndHashCode(callSuper = true)
+public class TrialNumberRule extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 项目ID
+	*/
+    @ApiModelProperty("项目ID")
+		private Long projectId;
+	/**
+	* 合同段ID
+	*/
+    @ApiModelProperty("合同段ID")
+		private Long contractId;
+	/**
+	* 编号规则 1材料 2样品 3委托单 4记录表 5报告表
+	*/
+    @ApiModelProperty("编号规则 1材料 2样品 3委托单 4记录表 5报告表")
+		private Integer type;
+	/**
+	* 编号规则
+	*/
+    @ApiModelProperty("编号规则")
+		private Integer rule;
+	/**
+	* 数据填充
+	*/
+    @ApiModelProperty("数据填充")
+		private String data;
+	/**
+	* 是否自增
+	*/
+    @ApiModelProperty("是否自增0否1是")
+		private Integer isAutoIncrement;
+    /**
+     * 排序
+      */
+    @ApiModelProperty("排序")
+        private Integer sort;
+
+
+}

+ 17 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoDtoVo.java

@@ -0,0 +1,17 @@
+package org.springblade.business.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.dto.StandardInfoDTO;
+
+/**
+ * @author LHB
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class StandardInfoDtoVo extends StandardInfoDTO {
+    /**
+     * 符号拼接名称
+     */
+    private String symbolName;
+}

+ 22 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoPrivateJoinVO.java

@@ -0,0 +1,22 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.StandardInfo;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+
+import java.util.List;
+
+/**
+ * @author LHB
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "关联元素对象-视图")
+public class StandardInfoPrivateJoinVO extends StandardInfo {
+
+    @ApiModelProperty(value = "关联元素副元素集合")
+    private List<StandardInfoPrivateJoin> privateJoins;
+}

+ 23 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/StandardInfoVO.java

@@ -0,0 +1,23 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.StandardInfo;
+
+import java.util.List;
+
+/**
+ * @author LHB
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "条件设置对象")
+public class StandardInfoVO extends StandardInfo {
+    /**
+     * 副连接对象
+     */
+    @ApiModelProperty(value = "副连接对象集合")
+    private List<StandardInfo> standardInfos;
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialAutoNumberVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.TrialAutoNumber;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TrialAutoNumberVO extends TrialAutoNumber {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialNumberRuleVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.TrialNumberRule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TrialNumberRuleVO extends TrialNumberRule {
+	private static final long serialVersionUID = 1L;
+
+    private String trialNumber;
+
+}

+ 17 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialNumberRuleVO1.java

@@ -0,0 +1,17 @@
+package org.springblade.business.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springblade.business.entity.TrialNumberRule;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TrialNumberRuleVO1 {
+    private List<TrialNumberRule> list=new ArrayList<>();
+    private String trialNumber;
+}

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

@@ -133,4 +133,6 @@ public class WbsTreeContractLazyVO implements Serializable {
     @ApiModelProperty(value = "关联后管节点ID")
     private Long isTypePrivatePid;
 
+
+
 }

+ 152 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/PrivateStandardController.java

@@ -0,0 +1,152 @@
+package org.springblade.business.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springblade.business.dto.PrivateStandardDTO;
+import org.springblade.business.entity.PrivateStandard;
+import org.springblade.business.service.PrivateStandardService;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.api.R;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 规范文件夹及规范文件表(UWbsPrivateStandard)表控制层
+ *
+ * @author makejava
+ * @since 2025-06-10 11:09:22
+ */
+@RestController
+@RequestMapping("PrivateStandard")
+@Api(tags = "试验-规范管理-规范文件夹及规范文件接口")
+public class PrivateStandardController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private PrivateStandardService privateStandardService;
+
+    /**
+     * 分页查询所有数据
+     *
+     * @param query               分页对象
+     * @param privateStandard 查询实体
+     * @return 所有数据
+     */
+    @GetMapping("page")
+    @ApiOperation(value = "分页查询所有数据", notes = "传入分页对象和高级查询对象")
+    public R<IPage<PrivateStandard>> selectAll(Query query, PrivateStandard privateStandard) {
+        try {
+            Page page = new Page(query.getCurrent(), query.getSize());
+            IPage<PrivateStandard> resultPage = this.privateStandardService.page(page, new QueryWrapper<>(privateStandard));
+            return R.data(resultPage);
+        } catch (Exception e) {
+            // 可根据实际需求记录日志或返回特定错误信息
+            return R.fail("查询失败");
+        }
+    }
+
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @ApiOperation(value = "通过主键查询单条数据", notes = "传入主键Id")
+    @ApiImplicitParam(name = "id", value = "主键id", required = true)
+    @GetMapping("/getById")
+    public R<PrivateStandard> selectOne(Long id) {
+        PrivateStandard byId = this.privateStandardService.getById(id);
+        return R.data(byId);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param privateStandard 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("add")
+    @ApiOperation(value = "新增数据", notes = "privateStandard")
+    @ApiImplicitParam(name = "privateStandard", value = "实体对象", required = true)
+    public R<Boolean> insert(@RequestPart("data") @Validated PrivateStandardDTO privateStandard,@RequestPart("files") MultipartFile[] files) {
+        privateStandard.setId(SnowFlakeUtil.getId());
+        privateStandard.setFiles(files);
+        if (privateStandard.getType() != 1 && privateStandard.getType() != 2) {
+            return R.fail("类型错误");
+        }
+        if (privateStandard.getType() == 1) {
+            privateStandard.setParentId(0L);
+            if (privateStandard.getPrivateId() == null) {
+                return R.fail("节点不能为空");
+            }
+        } else {
+            if (privateStandard.getParentId() == null) {
+                return R.fail("父级节点不能为空");
+            }
+            if (privateStandard.getIssueDate() == null) {
+                return R.fail("下达日期不能为空");
+            }
+            if (privateStandard.getActualizeDate() == null) {
+                return R.fail("实施日期不能为空");
+            }
+        }
+        boolean save = this.privateStandardService.insert(privateStandard);
+        return R.data(save);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param privateStandards 实体对象
+     * @return 修改结果
+     */
+    @ApiOperation(value = "修改数据")
+    @PostMapping("edit")
+    @ApiImplicitParam(name = "privateStandards", value = "实体对象", required = true)
+    public R<Boolean> update(@RequestBody @Validated List<PrivateStandardDTO> privateStandards) {
+        BladeUser user = SecureUtil.getUser();
+        privateStandards.forEach(f -> f.setUpdateUser(user.getUserId()));
+        boolean b = this.privateStandardService.update(privateStandards);
+        return R.data(b);
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @ApiOperation(value = "删除数据")
+    @GetMapping("/delete")
+    @ApiImplicitParam(name = "id", value = "主键id", required = true)
+    public R<Boolean> delete(Long id) {
+        boolean b = this.privateStandardService.delete(id);
+        return R.data(b);
+    }
+
+    /**
+     * 删除文件
+     */
+    @ApiOperation(value = "删除文件")
+    @GetMapping("/deleteFile")
+    @ApiImplicitParam(name = "id", value = "文件Id", required = true)
+    public R<Boolean> deleteFile(Long id) {
+        boolean b = this.privateStandardService.deleteFile(id);
+        return R.data(b);
+    }
+}
+

+ 199 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/StandardInfoController.java

@@ -0,0 +1,199 @@
+package org.springblade.business.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springblade.business.dto.StandardInfoDTO;
+import org.springblade.business.dto.StandardInfoJoinDTO;
+import org.springblade.business.dto.StandardInfoPrivateJoinDTO;
+import org.springblade.business.entity.StandardInfo;
+import org.springblade.business.service.StandardInfoService;
+import org.springblade.business.vo.StandardInfoDtoVo;
+import org.springblade.business.vo.StandardInfoPrivateJoinVO;
+import org.springblade.business.vo.StandardInfoVO;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 规范参数管理-基础信息(UStandardInfo)表控制层
+ *
+ * @author makejava
+ * @since 2025-06-11 10:03:01
+ */
+@RestController
+@RequestMapping("uStandardInfo")
+@Api(tags = "试验-规范管理-基础信息接口")
+public class StandardInfoController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private StandardInfoService uStandardInfoService;
+
+    /**
+     * 分页查询所有数据
+     *
+     * @param query         分页对象
+     * @param standardInfo 查询实体
+     * @return 所有数据
+     */
+    @GetMapping("page")
+    @ApiOperation(value = "分页查询所有数据", notes = "传入分页对象和高级查询对象")
+    public R<IPage<StandardInfoDtoVo>> selectAll(Query query, StandardInfo standardInfo) {
+        IPage<StandardInfoDtoVo> page = this.uStandardInfoService.selectMyPage(query, standardInfo);
+        return R.data(page);
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/getById")
+    @ApiOperation(value = "通过主键查询单条数据", notes = "传入主键Id")
+    @ApiImplicitParam(name = "id", value = "主键", required = true)
+    public R<StandardInfoDTO> selectOne(Long id) {
+        StandardInfoDTO dto = this.uStandardInfoService.selectOne(id);
+        return R.data(dto);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param standardInfo 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("add")
+    @ApiOperation(value = "新增数据")
+    public R<Boolean> insert(@RequestBody @Validated StandardInfoDTO standardInfo) {
+        Boolean b = this.uStandardInfoService.insert(standardInfo);
+        return R.data(b);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param standardInfo 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("edit")
+    @ApiOperation(value = "修改数据")
+    public R<Boolean> update(@RequestBody @Validated StandardInfoDTO standardInfo) {
+        Boolean b = this.uStandardInfoService.edit(standardInfo);
+        return R.data(b);
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @ApiOperation(value = "删除数据")
+    @ApiImplicitParam(name = "id", value = "主键", required = true)
+    @GetMapping("/delete")
+    public R<Boolean> delete(Long id) {
+        Boolean b = this.uStandardInfoService.delete(id);
+        return R.data(b);
+    }
+
+
+    /**
+     * 条件设置
+     *
+     * @param standardInfoJoins 条件设置对象
+     * @return 结果
+     */
+    @ApiOperation(value = "条件设置")
+    @PostMapping("saveConditionSet")
+    public R<Boolean> setCondition(@RequestBody @Validated List<StandardInfoJoinDTO> standardInfoJoins) {
+        Boolean b = this.uStandardInfoService.setCondition(standardInfoJoins);
+        return R.data(b);
+    }
+
+    /**
+     * 关联元素
+     *
+     * @param standardInfoPrivateJoins 关联元素对象
+     * @return 结果
+     */
+    @ApiOperation(value = "关联元素")
+    @PostMapping("saveElementJoin")
+    public R<Boolean> setElementJoin(@RequestBody @Validated List<StandardInfoPrivateJoinDTO> standardInfoPrivateJoins) {
+        Boolean b = this.uStandardInfoService.setElementJoin(standardInfoPrivateJoins);
+        return R.data(b);
+    }
+
+    /**
+     * 删除条件设置
+     * @param leftId 主关联id
+     * @return 删除结果
+     */
+    @ApiOperation(value = "删除条件设置")
+    @ApiImplicitParam(name = "leftId", value = "主关联id", required = true)
+    @GetMapping("deleteConditionSet")
+    public R<Boolean> deleteConditionSet(Long leftId) {
+        Boolean b = this.uStandardInfoService.deleteConditionSet(leftId);
+        return R.data(b);
+    }
+
+    /**
+     * 删除关联元素
+     * @param leftId 主关联id
+     * @return 删除结果
+     */
+    @ApiOperation(value = "删除关联元素")
+    @ApiImplicitParam(name = "leftId", value = "主关联id", required = true)
+    @GetMapping("deleteElementJoin")
+    public R<Boolean> deleteElementJoin(Long leftId) {
+        Boolean b = this.uStandardInfoService.deleteElementJoin(leftId);
+        return R.data(b);
+    }
+
+    /**
+     * 查询条件设置
+     * @param id 规范文件id
+     */
+    @ApiOperation(value = "查询条件设置")
+    @ApiImplicitParam(name = "id", value = "规范文件id", required = true)
+    @GetMapping("getConditionSet")
+    public R<List<StandardInfoVO>> getConditionSet(Long id) {
+        List<StandardInfoVO> list = this.uStandardInfoService.getConditionSet(id);
+        return R.data(list);
+    }
+
+    /**
+     * 查询关联元素
+     * @param id 规范文件id
+     */
+    @ApiOperation(value = "查询关联元素")
+    @ApiImplicitParam(name = "id", value = "规范文件id", required = true)
+    @GetMapping("getElementJoin")
+    public R<List<StandardInfoPrivateJoinVO>> getElementJoin(Long id) {
+        List<StandardInfoPrivateJoinVO> list = this.uStandardInfoService.getElementJoin(id);
+        return R.data(list);
+    }
+
+    /**
+     * 效果预览
+     * @param ids standardInfo type=1的子级id集合
+     */
+    @ApiOperation(value = "效果预览")
+    @ApiImplicitParam(name = "ids", value = "standardInfo type=2的id集合", required = true)
+    @GetMapping("effectPreview")
+    public R<List<StandardInfoPrivateJoinVO>> effectPreview(String ids) {
+        List<StandardInfoPrivateJoinVO> list = this.uStandardInfoService.effectPreview(ids);
+        return R.data(list);
+    }
+
+
+}
+

+ 129 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialAutoNumberController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+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.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.TrialAutoNumber;
+import org.springblade.business.vo.TrialAutoNumberVO;
+import org.springblade.business.service.ITrialAutoNumberService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/trialautonumber")
+@Api(value = "试验编号自增", tags = "试验编号自增")
+public class TrialAutoNumberController extends BladeController {
+
+	private final ITrialAutoNumberService trialAutoNumberService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入trialAutoNumber")
+	public R<TrialAutoNumber> detail(TrialAutoNumber trialAutoNumber) {
+		TrialAutoNumber detail = trialAutoNumberService.getOne(Condition.getQueryWrapper(trialAutoNumber));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入trialAutoNumber")
+	public R<IPage<TrialAutoNumber>> list(TrialAutoNumber trialAutoNumber, Query query) {
+		IPage<TrialAutoNumber> pages = trialAutoNumberService.page(Condition.getPage(query), Condition.getQueryWrapper(trialAutoNumber));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入trialAutoNumber")
+	public R<IPage<TrialAutoNumberVO>> page(TrialAutoNumberVO trialAutoNumber, Query query) {
+		IPage<TrialAutoNumberVO> pages = trialAutoNumberService.selectTrialAutoNumberPage(Condition.getPage(query), trialAutoNumber);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入trialAutoNumber")
+	public R save(@Valid @RequestBody TrialAutoNumber trialAutoNumber) {
+		return R.status(trialAutoNumberService.save(trialAutoNumber));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入trialAutoNumber")
+	public R update(@Valid @RequestBody TrialAutoNumber trialAutoNumber) {
+		return R.status(trialAutoNumberService.updateById(trialAutoNumber));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入trialAutoNumber")
+	public R submit(@Valid @RequestBody TrialAutoNumber trialAutoNumber) {
+		return R.status(trialAutoNumberService.saveOrUpdate(trialAutoNumber));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(trialAutoNumberService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+
+
+}

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

@@ -25,6 +25,7 @@ import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ResourceUtil;
@@ -174,6 +175,8 @@ public class TrialDetectionController extends BladeController {
         jdbcTemplate.execute(sql5);
         String sql6 = "delete from u_information_query where wbs_id in(" + ids + ") and type = 2";
         jdbcTemplate.execute(sql6);
+        String sql7="update u_trial_auto_number set is_deleted=0 where form_data_id in ("+ids+")";
+        jdbcTemplate.execute(sql7);
         return R.status(true);
     }
 

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

@@ -90,7 +90,7 @@ public class TrialMaterialController extends BladeController {
     @PostMapping("/mobilization/submit")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "进场材料新增或修改", notes = "传入TrialMaterialMobilization对象")
-    public R<Object> mobilizationSubmit(@Valid @RequestBody TrialMaterialMobilization obj) {
+    public R<Object> mobilizationSubmit(@Valid @RequestBody TrialMaterialMobilizationDTO obj) {
         return R.status(iTrialMaterialMobilizationService.mobilizationSubmit(obj));
     }
 
@@ -153,8 +153,10 @@ public class TrialMaterialController extends BladeController {
         if(b){
             //删除关联表中的额数据
             String sqlForDelTrailSampleRecord = "delete from u_trial_sampling_record where sample_info_id in ("+ids+")";
+            String update="update u_trial_auto_number set is_deleted=1 where form_data_id in ("+ids+")";
             try {
                 jdbcTemplate.execute(sqlForDelTrailSampleRecord);
+                jdbcTemplate.update(update);
             } catch (DataAccessException e) {
                 log.error("删除关联表中的额数据失败", e);
                 throw new RuntimeException(e);

+ 250 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialNumberRuleController.java

@@ -0,0 +1,250 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.models.auth.In;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.business.dto.TrialNumberRuleDTO;
+import org.springblade.business.mapper.TrialNumberRuleMapper;
+import org.springblade.business.vo.TrialNumberRuleVO1;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.manager.entity.WbsTreePrivate;
+import org.springframework.beans.BeanUtils;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.TrialNumberRule;
+import org.springblade.business.vo.TrialNumberRuleVO;
+import org.springblade.business.service.ITrialNumberRuleService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.io.FileNotFoundException;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/trialnumberrule")
+@Api(value = "试验编号规则", tags = "试验编号规则")
+public class TrialNumberRuleController extends BladeController {
+
+	private final ITrialNumberRuleService trialNumberRuleService;
+    private final TrialNumberRuleMapper  trialNumberRuleMapper;
+
+	/**
+	 * 详情
+	 */
+//	@GetMapping("/detail")
+//	@ApiOperationSupport(order = 1)
+//	@ApiOperation(value = "详情", notes = "传入trialNumberRule")
+//	public R<TrialNumberRule> detail(TrialNumberRule trialNumberRule) {
+//		TrialNumberRule detail = trialNumberRuleService.getOne(Condition.getQueryWrapper(trialNumberRule));
+//		return R.data(detail);
+//	}
+//
+//	/**
+//	 * 分页
+//	 */
+//	@GetMapping("/list")
+//	@ApiOperationSupport(order = 2)
+//	@ApiOperation(value = "分页", notes = "传入trialNumberRule")
+//	public R<IPage<TrialNumberRule>> list(TrialNumberRule trialNumberRule, Query query) {
+//		IPage<TrialNumberRule> pages = trialNumberRuleService.page(Condition.getPage(query), Condition.getQueryWrapper(trialNumberRule));
+//		return R.data(pages);
+//	}
+
+	/**
+	 * 自定义分页
+	 */
+//	@GetMapping("/page")
+//	@ApiOperationSupport(order = 3)
+//	@ApiOperation(value = "分页", notes = "传入trialNumberRule")
+//	public R<IPage<TrialNumberRuleVO>> page(TrialNumberRuleVO trialNumberRule, Query query) {
+//		IPage<TrialNumberRuleVO> pages = trialNumberRuleService.selectTrialNumberRulePage(Condition.getPage(query), trialNumberRule);
+//		return R.data(pages);
+//	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入trialNumberRule")
+	public R<String> save(@Valid @RequestBody TrialNumberRule trialNumberRule) {
+        Integer maxSort=trialNumberRuleMapper.selectMaxSort(trialNumberRule.getProjectId(),trialNumberRule.getContractId(),trialNumberRule.getType());
+        trialNumberRule.setSort(maxSort+1);
+        if(trialNumberRule.getContractId()==null||trialNumberRule.getContractId()==0L){
+            trialNumberRule.setStatus(1);
+        }else {
+            trialNumberRule.setStatus(2);
+        }
+        trialNumberRuleService.save(trialNumberRule);
+        trialNumberRuleService.clearTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(),trialNumberRule.getType());
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(), trialNumberRule.getType(), null, false);
+		return R.data(map.get("trialNumber"));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入trialNumberRule")
+	public R<String> update(@Valid @RequestBody TrialNumberRule trialNumberRule) {
+        if(trialNumberRule.getRule()==6){
+            TrialNumberRule trialNumberRule1 = trialNumberRuleService.getById(trialNumberRule.getId());
+            if(trialNumberRule.getContractId()!=null&&trialNumberRule.getContractId()!=0L){
+                if(!StringUtils.equals(trialNumberRule1.getData(),trialNumberRule.getData())){
+                    trialNumberRuleMapper.updateAutoIncrement(trialNumberRule.getId());
+                }
+            }
+        }
+        trialNumberRuleService.updateById(trialNumberRule);
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(), trialNumberRule.getType(), null, false);
+		return R.data(map.get("trialNumber"));
+	}
+
+	/**
+	 * 调整排序
+	 */
+	@PostMapping("/sort")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "调整排序", notes = "传入List<TrialNumberRule>")
+	public R<String> sort(@Valid @RequestBody List<TrialNumberRule> trialNumberRules) {
+        for (int i = 0; i < trialNumberRules.size(); i++) {
+            trialNumberRules.get(i).setSort(i+1);
+        }
+        trialNumberRuleService.saveOrUpdateBatch(trialNumberRules);
+        trialNumberRuleService.clearTrialNumber(trialNumberRules.get(0).getProjectId(),trialNumberRules.get(0).getContractId(),trialNumberRules.get(0).getType());
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(trialNumberRules.get(0).getProjectId(),trialNumberRules.get(0).getContractId(), trialNumberRules.get(0).getType(), null, false);
+        return R.data(map.get("trialNumber"));
+	}
+
+
+    /**
+     * 新增或修改
+     */
+//    @PostMapping("/submit")
+//    @ApiOperationSupport(order = 6)
+//    @ApiOperation(value = "新增或修改", notes = "传入trialNumberRule")
+//    public R<String> submit(@Valid @RequestBody TrialNumberRule trialNumberRule,BladeUser bladeUser) {
+//
+//
+//
+//
+//        return null;
+//    }
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R<String> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        String[] idss = ids.split(",");
+        TrialNumberRule trialNumberRule = trialNumberRuleService.getById(idss[0]);
+        trialNumberRuleService.clearTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(),trialNumberRule.getType());
+        trialNumberRuleService.deleteLogic(Func.toLongList(ids));
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(), trialNumberRule.getType(), null, false);
+		return R.data(map.get("trialNumber"));
+	}
+
+
+
+
+    /**
+     * type 1材料 2样品  4记录表 5报告表
+     * 委托单另外一个方法单独获取
+     */
+    @GetMapping("/getTrialNumber")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "获取试验编号", notes = "传入projectId,contractId,type,nodeId")
+    public R<String> getTrialNumber(Long projectId,Long contractId, Integer type, Long nodeId){
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(projectId,contractId, type, nodeId, true);
+        return  R.data(map.get("trialNumber"));
+    }
+    @GetMapping("/getEntrustNumber")
+    @ApiOperationSupport(order = 11)
+    @ApiOperation(value = "获取委托单编号")
+    public R<Map<String, String>>getEntrustNumber(Long pkeyId,Long contractId) throws FileNotFoundException {
+        return R.data(trialNumberRuleService.getEntrustNumber(pkeyId,contractId));
+    }
+
+    /**
+     * 获取试验编号规则
+     * @param
+     * @param contractId
+     * @param type
+     * @return
+     */
+    @GetMapping("/getTrialNumberRule")
+    @ApiOperationSupport(order = 9)
+    @ApiOperation(value = "获取试验编号规则", notes = "传入projectId,contractId(后管查询传0),type")
+    public R<TrialNumberRuleVO1> getTrialNumberRule(Long projectId,Long contractId, Integer type){
+        return R.data(trialNumberRuleService.getTrialNumberRule(projectId,contractId,type));
+    }
+
+    @GetMapping("/reTrialNumberRule")
+    @ApiOperationSupport(order = 10)
+    @ApiOperation(value = "重置试验编号规则")
+    public R<String> reTrialNumberRule(Long projectId, Long contractId, Integer type){
+        List<TrialNumberRule> trialNumberRules = trialNumberRuleService.getBaseMapper().selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getProjectId, projectId).eq(TrialNumberRule::getContractId, contractId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,2).orderByAsc(TrialNumberRule::getSort));
+        String ids = trialNumberRules.stream()
+            .map(o -> o.getId().toString())
+            .collect(Collectors.joining(","));
+        TrialNumberRule trialNumberRule = trialNumberRules.get(0);
+        trialNumberRuleService.clearTrialNumber(trialNumberRule.getProjectId(),trialNumberRule.getContractId(),trialNumberRule.getType());
+        trialNumberRuleService.deleteLogic(Func.toLongList(ids));
+        List<TrialNumberRule> rules = trialNumberRuleService.getBaseMapper().selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getProjectId, projectId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus, 1).orderByAsc(TrialNumberRule::getSort));
+        for (TrialNumberRule rule : rules) {
+            rule.setId(SnowFlakeUtil.getId());
+            rule.setStatus(2);
+            rule.setContractId(contractId);
+        }
+        trialNumberRuleService.saveOrUpdateBatch(rules);
+        Map<String, String> map = trialNumberRuleService.getTrialNumber(projectId,contractId, type, null, false);
+        return R.data(map.get("trialNumber"));
+    }
+
+
+
+
+}

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

@@ -0,0 +1,20 @@
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.PrivateStandard;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author LHB
+* @description 针对表【u_wbs_private_standard(规范文件夹及规范文件表)】的数据库操作Mapper
+* @createDate 2025-06-10 10:48:37
+* @Entity generator.domain.UWbsPrivateStandard
+*/
+public interface PrivateStandardMapper extends BaseMapper<PrivateStandard> {
+
+    void updateStatus(@Param("parentId") Long parentId);
+}
+
+
+
+

+ 35 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/PrivateStandardMapper.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.PrivateStandardMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.business.entity.PrivateStandard">
+            <id property="id" column="id" />
+            <result property="name" column="name" />
+            <result property="parentId" column="parent_id" />
+            <result property="privateId" column="private_id" />
+            <result property="type" column="type" />
+            <result property="issueDate" column="issue_date" />
+            <result property="actualizeDate" column="actualize_date" />
+            <result property="isDeleted" column="is_deleted" />
+            <result property="createTime" column="create_time" />
+            <result property="createUser" column="create_user" />
+            <result property="updateTime" column="update_time" />
+            <result property="updateUser" column="update_user" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,name,parent_id,private_id,type,issue_date,
+        actualize_date,is_deleted,create_time,create_user,
+        update_time,update_user
+    </sql>
+    <update id="updateStatus">
+        UPDATE u_wbs_private_standard
+        SET `status` = 2,
+            `name` = concat( NAME, '-已过期' )
+        WHERE
+            parent_id = #{parentId}
+          AND STATUS = 1
+    </update>
+</mapper>

+ 18 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardFileMapper.java

@@ -0,0 +1,18 @@
+package org.springblade.business.mapper;
+
+import org.springblade.business.entity.StandardFile;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_file(规范文件表)】的数据库操作Mapper
+* @createDate 2025-06-13 09:24:14
+* @Entity generator.domain.UStandardFile
+*/
+public interface StandardFileMapper extends BaseMapper<StandardFile> {
+
+}
+
+
+
+

+ 23 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardFileMapper.xml

@@ -0,0 +1,23 @@
+<?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.StandardFileMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.business.entity.StandardFile">
+            <id property="id" column="id" />
+            <result property="standardId" column="standard_id" />
+            <result property="fileName" column="file_name" />
+            <result property="standardFileUrl" column="standard_file_url" />
+            <result property="isDeleted" column="is_deleted" />
+            <result property="createTime" column="create_time" />
+            <result property="createUser" column="create_user" />
+            <result property="updateTime" column="update_time" />
+            <result property="updateUser" column="update_user" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,standard_id,file_name,standard_file_url,is_deleted,create_time,
+        create_user,update_time,update_user
+    </sql>
+</mapper>

+ 28 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoJoinMapper.java

@@ -0,0 +1,28 @@
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.StandardInfoJoin;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_info_join(样品信息关联表)】的数据库操作Mapper
+* @createDate 2025-06-11 09:57:39
+* @Entity org.springblade.business.entity.UStandardInfoJoin
+*/
+public interface StandardInfoJoinMapper extends BaseMapper<StandardInfoJoin> {
+
+    /**
+     * 软删除
+     * @param userId 用户 id
+     * @param isDeleted 删除状态
+     * @param standardId 规范文件id
+     */
+    void updateJoin(@Param("userId") Long userId,
+                    @Param("isDeleted") int isDeleted,
+                    @Param("standardId") Long standardId);
+}
+
+
+
+

+ 31 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoJoinMapper.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.StandardInfoJoinMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.business.entity.StandardInfoJoin">
+            <id property="id" column="id" />
+            <result property="standardInfoLeftId" column="standard_info_left_id" />
+            <result property="standardInfoRightId" column="standard_info_right_id" />
+            <result property="isDeleted" column="is_deleted" />
+            <result property="createTime" column="create_time" />
+            <result property="createUser" column="create_user" />
+            <result property="updateTime" column="update_time" />
+            <result property="updateUser" column="update_user" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,standard_info_left_id,standard_info_right_id,is_deleted,create_time,create_user,
+        update_time,update_user
+    </sql>
+    <update id="updateJoin">
+        UPDATE u_standard_info_join a
+            INNER JOIN u_standard_info b ON a.standard_info_left_id = b.id
+        SET a.is_deleted = #{isDeleted},
+            a.update_user = #{userId}
+        WHERE
+            b.is_deleted = 0
+          AND b.standard_id = #{standardId}
+    </update>
+</mapper>

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

@@ -0,0 +1,36 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.dto.StandardInfoDTO;
+import org.springblade.business.entity.StandardInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.business.vo.StandardInfoDtoVo;
+import org.springblade.business.vo.StandardInfoPrivateJoinVO;
+import org.springblade.business.vo.StandardInfoVO;
+
+import java.util.List;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_info(规范参数管理-基础信息)】的数据库操作Mapper
+* @createDate 2025-06-11 09:57:39
+* @Entity org.springblade.business.entity.UStandardInfo
+*/
+public interface StandardInfoMapper extends BaseMapper<StandardInfo> {
+
+    IPage<StandardInfoDtoVo> selectMyPage(Page<StandardInfoDtoVo> page, @Param("query") StandardInfo standardInfo);
+
+    StandardInfoDTO selectMyOne(@Param("id") Long id);
+
+    List<StandardInfoVO> getConditionSet(@Param("id") Long id);
+
+    List<StandardInfoPrivateJoinVO> getElementJoin(@Param("id") Long id);
+
+    List<StandardInfoPrivateJoinVO> effectPreview(@Param("rightIds") List<Long> rightIds);
+}
+
+
+
+

+ 193 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoMapper.xml

@@ -0,0 +1,193 @@
+<?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.StandardInfoMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.business.entity.StandardInfo">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="symbol" column="symbol"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="type" column="type"/>
+        <result property="isDeleted" column="is_deleted"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createUser" column="create_user"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateUser" column="update_user"/>
+    </resultMap>
+    <resultMap id="BaseResultPageMap" type="org.springblade.business.vo.StandardInfoDtoVo">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="symbol" column="symbol"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="standardId" column="standard_id"/>
+        <result property="type" column="type"/>
+        <result property="isDeleted" column="is_deleted"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createUser" column="create_user"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateUser" column="update_user"/>
+        <result property="symbolName" column="symbolName"/>
+        <collection property="info" ofType="org.springblade.business.entity.StandardInfo" select="findByParentId" column="{parentId=id}">
+        </collection>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id
+        ,name,symbol,parent_id,standard_id,type,is_deleted,create_time,
+        create_user,update_time,update_user
+    </sql>
+    <select id="selectMyPage" resultMap="BaseResultPageMap">
+        SELECT
+            <include refid="Base_Column_List"/>,concat(symbol,name) symbolName
+        FROM
+            u_standard_info
+        <where>
+            is_deleted = 0
+            <if test="query.type != null">
+                AND type = #{query.type}
+            </if>
+            <choose>
+                <when test="query.parentId != null">
+                    AND parent_id = #{query.parentId}
+                </when>
+                <otherwise>
+                    AND parent_id = 0
+                </otherwise>
+            </choose>
+            <if test="query.standardId != null">
+                AND standard_id =  #{query.standardId}
+            </if>
+        </where>
+    </select>
+    <select id="selectMyOne" resultMap="BaseResultPageMap">
+        SELECT
+            <include refid="Base_Column_List"/>,concat(symbol,name) symbolName
+        FROM
+            u_standard_info
+        WHERE
+            is_deleted = 0 AND
+            id = #{id}
+    </select>
+    <select id="findByParentId" resultType="org.springblade.business.entity.StandardInfo">
+        select
+            <include refid="Base_Column_List"/>,concat(symbol,name) symbolName
+        FROM
+            u_standard_info
+        WHERE
+            is_deleted = 0
+            AND parent_id = #{parentId}
+    </select>
+
+
+
+
+    <!-- ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` -->
+
+    <resultMap id="BaseResultConditionSet" type="org.springblade.business.vo.StandardInfoVO">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="type" column="type"/>
+        <collection property="standardInfos" ofType="org.springblade.business.entity.StandardInfo" select="findByJoinLeftId" column="{leftId=id}">
+        </collection>
+    </resultMap>
+    <sql id="Base_Column_Join_List">
+        a.id,
+        a.`name`,
+        a.parent_id,
+        a.standard_id,
+        a.`type`,
+        a.is_deleted,
+        a.create_time,
+        a.create_user,
+        a.update_time,
+        a.update_user
+    </sql>
+
+    <select id="getConditionSet" resultMap="BaseResultConditionSet">
+        select
+            <include refid="Base_Column_Join_List"/>
+        from
+            u_standard_info a
+            INNER JOIN u_standard_info_join b on a.id = b.standard_info_left_id and a.is_deleted = b.is_deleted
+        where
+            a.standard_id = #{id} and a.is_deleted = 0
+        GROUP BY
+            b.standard_info_left_id
+    </select>
+    <select id="findByJoinLeftId" resultType="org.springblade.business.entity.StandardInfo">
+        SELECT
+            <include refid="Base_Column_Join_List"/>, c.name parentName
+        FROM
+            u_standard_info a
+            INNER JOIN u_standard_info_join b ON a.id = b.standard_info_right_id AND a.is_deleted = b.is_deleted
+            INNER JOIN u_standard_info c ON a.parent_id = c.id AND a.is_deleted = c.is_deleted
+        WHERE
+            b.standard_info_left_id = #{leftId} and a.is_deleted = 0
+    </select>
+
+    <!-- ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` -->
+
+    <resultMap id="BaseResultElementJoin" type="org.springblade.business.vo.StandardInfoPrivateJoinVO">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="type" column="type"/>
+        <collection property="privateJoins" ofType="org.springblade.business.entity.StandardInfoPrivateJoin" select="findByPrivateJoinLeftId" column="{leftId=id}">
+        </collection>
+    </resultMap>
+
+    <sql id="Base_Private_Column_List">
+        a.id,
+        a.standard_info_id,
+        a.private_id,
+        a.col_key,
+        a.col_name,
+        a.is_deleted,
+        a.create_time,
+        a.create_user,
+        a.update_time,
+        a.update_user
+    </sql>
+    <select id="getElementJoin" resultMap="BaseResultElementJoin">
+        select
+            <include refid="Base_Column_Join_List"/>
+        from
+            u_standard_info a
+            INNER JOIN u_standard_info_private_join b on a.id = b.standard_info_id and a.is_deleted = b.is_deleted
+        where
+            a.standard_id = #{id} and a.is_deleted = 0
+        GROUP BY
+            b.standard_info_id
+    </select>
+
+    <select id="findByPrivateJoinLeftId" resultType="org.springblade.business.entity.StandardInfoPrivateJoin">
+        SELECT
+            <include refid="Base_Private_Column_List"/>,
+            b.node_name privateName
+        FROM
+            u_standard_info_private_join a
+            INNER JOIN m_wbs_tree_private b ON a.private_id = b.p_key_id AND a.is_deleted = b.is_deleted
+        WHERE
+            a.standard_info_id = #{leftId}
+          AND a.is_deleted = 0
+    </select>
+    <select id="effectPreview" resultMap="BaseResultElementJoin">
+        SELECT
+            a.*
+        FROM
+            u_standard_info a
+                INNER JOIN u_standard_info_join b ON a.id = b.standard_info_left_id
+                AND a.is_deleted = b.is_deleted
+        WHERE
+            a.is_deleted = 0
+            AND b.standard_info_right_id in
+            <foreach item="item" collection="rightIds" separator="," open="(" close=")" index="index">
+                #{item}
+            </foreach>
+        GROUP BY
+            b.standard_info_left_id
+    </select>
+</mapper>

+ 28 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoPrivateJoinMapper.java

@@ -0,0 +1,28 @@
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_info_private_join(样品信息与试验表 关联表)】的数据库操作Mapper
+* @createDate 2025-06-11 09:57:39
+* @Entity org.springblade.business.entity.UStandardInfoPrivateJoin
+*/
+public interface StandardInfoPrivateJoinMapper extends BaseMapper<StandardInfoPrivateJoin> {
+
+    /**
+     * 软删除
+     * @param userId 用户 id
+     * @param isDeleted 删除状态
+     * @param standardId 规范文件id
+     */
+    void updateJoin(@Param("userId") Long userId,
+                    @Param("isDeleted") int isDeleted,
+                    @Param("standardId") Long standardId);
+}
+
+
+
+

+ 33 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/StandardInfoPrivateJoinMapper.xml

@@ -0,0 +1,33 @@
+<?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.StandardInfoPrivateJoinMapper">
+
+    <resultMap id="BaseResultMap" type="org.springblade.business.entity.StandardInfoPrivateJoin">
+            <id property="id" column="id" />
+            <result property="standardInfoId" column="standard_info_id" />
+            <result property="privateId" column="private_id" />
+            <result property="colKey" column="col_key" />
+            <result property="colName" column="col_name" />
+            <result property="isDeleted" column="is_deleted" />
+            <result property="createTime" column="create_time" />
+            <result property="createUser" column="create_user" />
+            <result property="updateTime" column="update_time" />
+            <result property="updateUser" column="update_user" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,standard_info_id,private_id,col_key,col_name,is_deleted,
+        create_time,create_user,update_time,update_user
+    </sql>
+    <update id="updateJoin">
+        UPDATE u_standard_info_private_join a
+            INNER JOIN u_standard_info b ON a.standard_info_id = b.id
+        SET a.is_deleted = #{isDeleted},
+            a.update_user = #{userId}
+        WHERE
+            b.is_deleted = 0
+          AND b.standard_id = #{standardId}
+    </update>
+</mapper>

+ 44 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialAutoNumberMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.TrialAutoNumber;
+import org.springblade.business.vo.TrialAutoNumberVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+public interface TrialAutoNumberMapper extends BaseMapper<TrialAutoNumber> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param trialAutoNumber
+	 * @return
+	 */
+	List<TrialAutoNumberVO> selectTrialAutoNumberPage(IPage page, TrialAutoNumberVO trialAutoNumber);
+
+    void clearTrialAutoNumber(@Param("nameRuleId") Long nameRuleId);
+}

+ 22 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialAutoNumberMapper.xml

@@ -0,0 +1,22 @@
+<?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.TrialAutoNumberMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="trialAutoNumberResultMap" type="org.springblade.business.entity.TrialAutoNumber">
+        <result column="id" property="id"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="auto_increment_number" property="autoIncrementNumber"/>
+        <result column="form_data_id" property="formDataId"/>
+        <result column="type" property="type"/>
+    </resultMap>
+    <update id="clearTrialAutoNumber">
+        update u_trial_auto_number set is_deleted = 1 where name_rule_id = #{nameRuleId}
+    </update>
+
+
+    <select id="selectTrialAutoNumberPage" resultMap="trialAutoNumberResultMap">
+        select * from u_trial_auto_number where is_deleted = 0
+    </select>
+
+</mapper>

+ 46 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialNumberRuleMapper.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.TrialNumberRule;
+import org.springblade.business.vo.TrialNumberRuleVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+public interface TrialNumberRuleMapper extends BaseMapper<TrialNumberRule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param trialNumberRule
+	 * @return
+	 */
+	List<TrialNumberRuleVO> selectTrialNumberRulePage(IPage page, TrialNumberRuleVO trialNumberRule);
+
+    Integer selectMaxSort(@Param("projectId") Long projectId, @Param("contractId") Long contractId, @Param("type") Integer type);
+
+    void updateAutoIncrement(@Param("id") Long id);
+}

+ 34 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialNumberRuleMapper.xml

@@ -0,0 +1,34 @@
+<?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.TrialNumberRuleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="trialNumberRuleResultMap" type="org.springblade.business.entity.TrialNumberRule">
+        <result column="id" property="id"/>
+        <result column="create_time" property="createTime"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="type" property="type"/>
+        <result column="rule" property="rule"/>
+        <result column="data" property="data"/>
+        <result column="is_auto_increment" property="isAutoIncrement"/>
+    </resultMap>
+    <update id="updateAutoIncrement">
+        update u_trial_number_rule set is_deleted=0 where number_rule_id = #{id}
+    </update>
+
+
+    <select id="selectTrialNumberRulePage" resultMap="trialNumberRuleResultMap">
+        select * from u_trial_number_rule where is_deleted = 0
+    </select>
+    <select id="selectMaxSort" resultType="java.lang.Integer">
+        select IFNULL(MAX(sort), 0) from u_trial_number_rule where project_id = #{projectId} and contract_id = #{contractId} and type = #{type}
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialAutoNumberService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.TrialAutoNumber;
+import org.springblade.business.vo.TrialAutoNumberVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+public interface ITrialAutoNumberService extends BaseService<TrialAutoNumber> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param trialAutoNumber
+	 * @return
+	 */
+	IPage<TrialAutoNumberVO> selectTrialAutoNumberPage(IPage<TrialAutoNumberVO> page, TrialAutoNumberVO trialAutoNumber);
+
+}

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

@@ -17,7 +17,7 @@ public interface ITrialMaterialMobilizationService extends BaseService<TrialMate
 
     boolean mobilizationVerification(String number, String id, String contractId);
 
-    boolean mobilizationSubmit(TrialMaterialMobilization obj);
+    boolean mobilizationSubmit(TrialMaterialMobilizationDTO obj);
 
     TrialMaterialMobilization mobilizationDetail(Long id);
 

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

@@ -0,0 +1,55 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import cn.hutool.core.lang.hash.Hash;
+import org.springblade.business.entity.TrialNumberRule;
+import org.springblade.business.vo.TrialNumberRuleVO;
+import org.springblade.business.vo.TrialNumberRuleVO1;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.secure.BladeUser;
+
+import java.io.FileNotFoundException;
+import java.util.Map;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+public interface ITrialNumberRuleService extends BaseService<TrialNumberRule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param trialNumberRule
+	 * @return
+	 */
+	IPage<TrialNumberRuleVO> selectTrialNumberRulePage(IPage<TrialNumberRuleVO> page, TrialNumberRuleVO trialNumberRule);
+
+    Map<String,String> getTrialNumber(Long projectId,Long contractId, Integer type, Long nodeId, Boolean isSaveRedis);
+
+    TrialNumberRuleVO1 getTrialNumberRule(Long project,Long contractId, Integer type);
+    //编号规则发生改变,清空对应的编号
+    boolean clearTrialNumber(Long projectId, Long contractId, Integer type);
+
+
+    Map<String, String> getEntrustNumber(Long pkeyId,Long contractId) throws FileNotFoundException;
+}

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

@@ -5,6 +5,7 @@ import org.springblade.business.dto.*;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.vo.*;
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springframework.web.multipart.MultipartFile;
 

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

@@ -0,0 +1,23 @@
+package org.springblade.business.service;
+
+import org.springblade.business.dto.PrivateStandardDTO;
+import org.springblade.business.entity.PrivateStandard;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+* @author LHB
+* @description 针对表【u_wbs_private_standard(规范文件夹及规范文件表)】的数据库操作Service
+* @createDate 2025-06-10 10:48:37
+*/
+public interface PrivateStandardService extends IService<PrivateStandard> {
+
+    boolean delete(Long id);
+
+    boolean insert(PrivateStandardDTO uWbsPrivateStandard);
+
+    boolean update(List<PrivateStandardDTO> privateStandards);
+
+    boolean deleteFile(Long id);
+}

+ 13 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/StandardFileService.java

@@ -0,0 +1,13 @@
+package org.springblade.business.service;
+
+import org.springblade.business.entity.StandardFile;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_file(规范文件表)】的数据库操作Service
+* @createDate 2025-06-13 09:24:14
+*/
+public interface StandardFileService extends IService<StandardFile> {
+
+}

+ 10 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoJoinService.java

@@ -0,0 +1,10 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.business.entity.StandardInfoJoin;
+
+/**
+ * @author LHB
+ */
+public interface StandardInfoJoinService extends IService<StandardInfoJoin> {
+}

+ 10 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoPrivateJoinService.java

@@ -0,0 +1,10 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+
+/**
+ * @author LHB
+ */
+public interface StandardInfoPrivateJoinService extends IService<StandardInfoPrivateJoin> {
+}

+ 46 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/StandardInfoService.java

@@ -0,0 +1,46 @@
+package org.springblade.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.dto.StandardInfoJoinDTO;
+import org.springblade.business.dto.StandardInfoPrivateJoinDTO;
+import org.springblade.business.dto.StandardInfoDTO;
+import org.springblade.business.entity.StandardInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.business.vo.StandardInfoDtoVo;
+import org.springblade.business.vo.StandardInfoPrivateJoinVO;
+import org.springblade.business.vo.StandardInfoVO;
+import org.springblade.core.mp.support.Query;
+
+import java.util.List;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_info(规范参数管理-基础信息)】的数据库操作Service
+* @createDate 2025-06-11 09:57:39
+*/
+public interface StandardInfoService extends IService<StandardInfo> {
+
+    IPage<StandardInfoDtoVo> selectMyPage(Query query, StandardInfo standardInfo);
+
+    StandardInfoDTO selectOne(Long id);
+
+    Boolean insert(StandardInfoDTO uStandardInfo);
+
+    Boolean edit(StandardInfoDTO uStandardInfo);
+
+    Boolean delete(Long id);
+
+    Boolean setCondition(List<StandardInfoJoinDTO> standardInfoJoins);
+
+    Boolean setElementJoin(List<StandardInfoPrivateJoinDTO> standardInfoPrivateJoins);
+
+    Boolean deleteConditionSet(Long leftId);
+
+    Boolean deleteElementJoin(Long leftId);
+
+    List<StandardInfoVO> getConditionSet(Long id);
+
+    List<StandardInfoPrivateJoinVO> getElementJoin(Long id);
+
+    List<StandardInfoPrivateJoinVO> effectPreview(String ids);
+}

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

@@ -42,7 +42,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
 
     private ExecutorService executorService;
     private final ArchiveInspectionInfoClient archiveInspectionInfoClient;
-    private final JdbcTemplate   jdbcTemplate;
+    private final JdbcTemplate  jdbcTemplate;
 
 
     @Override

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

@@ -34,6 +34,7 @@ import org.springblade.business.vo.LoadDataInfoVO;
 import org.springblade.business.vo.TrialSampleDataInfoVO;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.redis.cache.BladeRedis;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
@@ -68,6 +69,8 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 	private final EntrustInfoMapper entrustInfoMapper;
     private final IInformationQueryService informationQueryService;
 	private final OperationLogClient operationLogClient;
+    private final TrialNumberRuleServiceImpl trialNumberRuleService;
+    private final BladeRedis bladeRedis;
 
     @Override
 	public IPage<EntrustInfoVO> selectEntrustInfoPage(IPage<EntrustInfoVO> page, EntrustInfoVO entrustInfo) {
@@ -194,6 +197,15 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
             entrustInfo.setId(Long.parseLong(dataInfo.get("id").toString()));
         }
         this.saveOrUpdate(entrustInfo);
+        String autoIncrementNumber=dataInfo.get("autoIncrementNumber")==null?"":dataInfo.get("autoIncrementNumber").toString();
+        String trialAutoNumber=dataInfo.get("trialAutoNumber")==null?"":dataInfo.get("trialAutoNumber").toString();
+        String entrustNo=entrustInfo.getEntrustNo()==null?"":entrustInfo.getEntrustNo();
+        if(StringUtils.isNotEmpty(autoIncrementNumber)){
+            if(trialAutoNumber.equals(entrustNo)){
+                trialNumberRuleService.checkSave(Long.parseLong(entrustInfo.getContractId()), 3, entrustInfo.getId(), autoIncrementNumber);
+            }
+            bladeRedis.del("trialAutoNumber:" + entrustInfo.getContractId() + ":" + 3 + ":" + entrustInfo.getId() + ":" + "lock:" + autoIncrementNumber);
+        }
 		dataInfo.put("groupId",entrustInfo.getId());
 		dataInfo.put("pkeyId", dataInfo.getString("nodeErTreeId"));
         if(StringUtils.isEmpty(entrustInfo.getEntrustNo())){
@@ -203,6 +215,8 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
             entrustInfo.setEntrustName("");
         }
         dataInfo.put("entrustInfoName",entrustInfo.getEntrustNo()+entrustInfo.getEntrustName());
+        dataInfo.remove("autoIncrementNumber");
+        dataInfo.remove("trialAutoNumber");
         String pdfUrl = excelTabClient.saveEntrustTabData(dataInfo);
         return R.data(200,pdfUrl,"操作成功");
 	}

+ 212 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/PrivateStandardServiceImpl.java

@@ -0,0 +1,212 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.business.entity.StandardFile;
+import org.springblade.business.service.StandardFileService;
+import org.springblade.business.dto.PrivateStandardDTO;
+import org.springblade.business.entity.PrivateStandard;
+import org.springblade.business.entity.StandardInfo;
+import org.springblade.business.mapper.StandardInfoJoinMapper;
+import org.springblade.business.mapper.StandardInfoMapper;
+import org.springblade.business.mapper.StandardInfoPrivateJoinMapper;
+import org.springblade.business.service.PrivateStandardService;
+import org.springblade.business.mapper.PrivateStandardMapper;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author LHB
+ * @description 针对表【u_wbs_private_standard(规范文件夹及规范文件表)】的数据库操作Service实现
+ * @createDate 2025-06-10 10:48:37
+ */
+@Service
+public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMapper, PrivateStandard>
+        implements PrivateStandardService {
+    @Resource
+    private StandardInfoMapper standardInfoMapper;
+    @Resource
+    private StandardInfoJoinMapper standardInfoJoinMapper;
+    @Resource
+    private StandardInfoPrivateJoinMapper standardInfoPrivateJoinMapper;
+
+    @Resource
+    private StandardFileService standardFileService;
+
+    /**
+     * 对象存储构建类
+     */
+    @Resource
+    private NewIOSSClient newIOSSClient;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean insert(PrivateStandardDTO uWbsPrivateStandard) {
+        BladeUser user = SecureUtil.getUser();
+        uWbsPrivateStandard.setCreateUser(user.getUserId());
+        Boolean isUploadFile = false;
+        if (uWbsPrivateStandard.getType() == 2 && uWbsPrivateStandard.getFiles().length > 0) {
+            isUploadFile = true;
+        }
+
+        //先上传文件,上传成功在执行添加
+        if (isUploadFile) {
+            List<StandardFile> standardFiles = new ArrayList<>();
+            MultipartFile[] files = uWbsPrivateStandard.getFiles();
+
+            try {
+                for (MultipartFile file : files) {
+                    StandardFile standardFile = new StandardFile();
+                    standardFile.setId(SnowFlakeUtil.getId());
+                    standardFile.setStandardId(uWbsPrivateStandard.getId());
+                    standardFile.setCreateUser(user.getUserId());
+
+
+                    String originalFilename = file.getOriginalFilename();
+                    standardFile.setFileName(originalFilename);
+                    originalFilename = "standard/" + uWbsPrivateStandard.getId() + "|" + originalFilename;
+
+
+
+                    //Oss上传 传特殊文件名 在oss中做特殊路径处理
+                    BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream2(file.getOriginalFilename(), file.getInputStream());
+
+                    standardFile.setStandardFileUrl(bladeFile.getLink());
+                    standardFiles.add(standardFile);
+                }
+            } catch (Exception e) {
+                //删除之前上传的文件
+                for (StandardFile standardFile : standardFiles) {
+                    this.newIOSSClient.removeFile(standardFile.getStandardFileUrl());
+                }
+                e.printStackTrace();
+                throw new ServiceException("文件上传失败!请检查Oss");
+            }
+            standardFileService.saveBatch(standardFiles);
+        }
+
+        if (uWbsPrivateStandard.getType() == 2) {
+            //修改之前的规则为过期
+            baseMapper.updateStatus(uWbsPrivateStandard.getParentId());
+        }
+        return baseMapper.insert(uWbsPrivateStandard) > 0;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean update(List<PrivateStandardDTO> privateStandards) {
+        BladeUser user = SecureUtil.getUser();
+
+        List<PrivateStandard> privateStandards1 = new ArrayList<>();
+
+        for (PrivateStandardDTO privateStandard : privateStandards) {
+            List<StandardFile> standardFiles = new ArrayList<>();
+            MultipartFile[] files = privateStandard.getFiles();
+
+            try {
+                for (MultipartFile file : files) {
+                    StandardFile standardFile = new StandardFile();
+                    standardFile.setId(SnowFlakeUtil.getId());
+                    standardFile.setStandardId(privateStandard.getId());
+                    standardFile.setCreateUser(user.getUserId());
+
+
+                    String originalFilename = file.getOriginalFilename();
+                    standardFile.setFileName(originalFilename);
+                    originalFilename = "standard/" + privateStandard.getId() + "|" + originalFilename;
+
+                    //Oss上传 传特殊文件名 在oss中做特殊路径处理
+                    BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream2(originalFilename, file.getInputStream());
+
+                    standardFile.setStandardFileUrl(bladeFile.getLink());
+                    standardFiles.add(standardFile);
+                }
+            } catch (Exception e) {
+                //删除之前上传的文件
+                for (StandardFile standardFile : standardFiles) {
+                    this.newIOSSClient.removeFile(standardFile.getStandardFileUrl());
+                }
+                e.printStackTrace();
+                throw new ServiceException("文件上传失败!请检查Oss");
+            }
+
+            standardFileService.saveBatch(standardFiles);
+
+
+            PrivateStandard privateStandard1 = BeanUtil.copyProperties(privateStandard, PrivateStandard.class);
+            privateStandards1.add(privateStandard1);
+        }
+
+        this.updateBatchById(privateStandards1);
+
+        return false;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean delete(Long id) {
+
+        try {
+            //获取当前用户
+            BladeUser user = SecureUtil.getUser();
+            int update = baseMapper.update(null, Wrappers.<PrivateStandard>lambdaUpdate()
+                    .set(PrivateStandard::getIsDeleted, 1)
+                    .set(PrivateStandard::getUpdateUser, user.getUserId())
+                    .eq(PrivateStandard::getId, id)
+                    .or()
+                    .eq(PrivateStandard::getParentId, id)
+            );
+            //TODO 后续还要删除规范详细信息
+
+
+            int update1 = standardInfoMapper.update(null, Wrappers.<StandardInfo>lambdaUpdate()
+                    .set(StandardInfo::getIsDeleted, 1)
+                    .set(StandardInfo::getUpdateUser, user.getUserId())
+                    .eq(StandardInfo::getStandardId, id));
+            //TODO 还要删除关联信息
+            standardInfoJoinMapper.updateJoin(user.getUserId(), 1, id);
+            //TODo 还要删除与表单的关联信息
+            standardInfoPrivateJoinMapper.updateJoin(user.getUserId(), 1, id);
+            return update > 0;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("删除失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteFile(Long id) {
+        StandardFile byId = standardFileService.getById(id);
+        if (byId != null) {
+            try {
+                this.newIOSSClient.removeFile(byId.getStandardFileUrl());
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new ServiceException("文件删除失败,Oss异常");
+            }
+            standardFileService.update(Wrappers.<StandardFile>lambdaUpdate()
+                    .set(StandardFile::getIsDeleted, 1)
+                    .set(StandardFile::getUpdateUser, SecureUtil.getUser().getUserId())
+                    .eq(StandardFile::getId, id));
+            return true;
+        }
+        return false;
+    }
+}
+
+
+
+

+ 22 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/StandardFileServiceImpl.java

@@ -0,0 +1,22 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.business.entity.StandardFile;
+import org.springblade.business.service.StandardFileService;
+import org.springblade.business.mapper.StandardFileMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author LHB
+* @description 针对表【u_standard_file(规范文件表)】的数据库操作Service实现
+* @createDate 2025-06-13 09:24:14
+*/
+@Service
+public class StandardFileServiceImpl extends ServiceImpl<StandardFileMapper, StandardFile>
+    implements StandardFileService {
+
+}
+
+
+
+

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

@@ -0,0 +1,14 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.business.entity.StandardInfoJoin;
+import org.springblade.business.mapper.StandardInfoJoinMapper;
+import org.springblade.business.service.StandardInfoJoinService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author LHB
+ */
+@Service
+public class StandardInfoJoinServiceImpl extends ServiceImpl<StandardInfoJoinMapper, StandardInfoJoin> implements StandardInfoJoinService {
+}

+ 45 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialAutoNumberServiceImpl.java

@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.springblade.business.entity.TrialAutoNumber;
+import org.springblade.business.vo.TrialAutoNumberVO;
+import org.springblade.business.mapper.TrialAutoNumberMapper;
+import org.springblade.business.service.ITrialAutoNumberService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Service
+public class TrialAutoNumberServiceImpl extends BaseServiceImpl<TrialAutoNumberMapper, TrialAutoNumber> implements ITrialAutoNumberService {
+
+	@Override
+	public IPage<TrialAutoNumberVO> selectTrialAutoNumberPage(IPage<TrialAutoNumberVO> page, TrialAutoNumberVO trialAutoNumber) {
+		return page.setRecords(baseMapper.selectTrialAutoNumberPage(page, trialAutoNumber));
+	}
+
+    public void clearTrialAutoNumber(Long nameRuleId){
+        baseMapper.clearTrialAutoNumber(nameRuleId);
+    }
+
+}

+ 17 - 6
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialMaterialMobilizationServiceImpl.java

@@ -11,10 +11,6 @@ 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.fileupload.disk.DiskFileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.springblade.business.dto.TrialMaterialMobilizationDTO;
@@ -37,6 +33,7 @@ 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.redis.cache.BladeRedis;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
@@ -72,6 +69,8 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
     private final NewIOSSClient newIOSSClient;
     private final JdbcTemplate jdbcTemplate;
     private final CommonFileClient commonFileClient;
+    private final TrialNumberRuleServiceImpl trialNumberRuleService;
+    private final BladeRedis bladeRedis;
 
     @Override
     public boolean mobilizationVerification(String number, String id, String contractId) {
@@ -92,12 +91,20 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
     }
 
     @Override
-    public boolean mobilizationSubmit(TrialMaterialMobilization obj) {
+    public boolean mobilizationSubmit(TrialMaterialMobilizationDTO obj) {
         if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
             throw new ServiceException("获取用户信息失败");
         }
         obj.setUserId(SecureUtil.getUserId());
-        return this.saveOrUpdate(obj);
+        this.saveOrUpdate(obj);
+        if(obj.getAutoIncrementNumber()!=null){
+            if(obj.getTrialAutoNumber().equals(obj.getMaterialNumber())){
+                trialNumberRuleService.checkSave(obj.getContractId(), 1, obj.getId(), obj.getAutoIncrementNumber());
+            }
+            bladeRedis.del("trialAutoNumber:" + obj.getContractId() + ":" + 1 + ":" + obj.getId() + ":" + "lock:" + obj.getAutoIncrementNumber());
+        }
+
+        return true;
     }
 
     @Override
@@ -485,6 +492,10 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
             return R.fail("所选数据均存在取样记录,不允许删除");
         }
         boolean b = super.deleteLogic(newIdList);
+        if(b){
+          String update="update u_trial_auto_number set is_deleted=1 where form_data_id in ("+ids+")";
+          jdbcTemplate.update(update);
+        }
         return  b?R.success("删除成功"):R.fail("删除失败");
     }
 }

+ 338 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialNumberRuleServiceImpl.java

@@ -0,0 +1,338 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springblade.business.entity.TrialAutoNumber;
+import org.springblade.business.entity.TrialNumberRule;
+import org.springblade.business.vo.TrialNumberRuleVO;
+import org.springblade.business.mapper.TrialNumberRuleMapper;
+import org.springblade.business.service.ITrialNumberRuleService;
+import org.springblade.business.vo.TrialNumberRuleVO1;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.redis.cache.BladeRedis;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.utils.IoUtil;
+import org.springblade.core.tool.utils.ResourceUtil;
+import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.system.cache.ParamCache;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.SingleColumnRowMapper;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2025-06-10
+ */
+@Service
+public class TrialNumberRuleServiceImpl extends BaseServiceImpl<TrialNumberRuleMapper, TrialNumberRule> implements ITrialNumberRuleService {
+
+    @Resource
+    private JdbcTemplate jdbcTemplate;
+    @Resource
+    private BladeRedis bladeRedis;
+    @Resource
+    private  TrialAutoNumberServiceImpl trialAutoNumberService;
+
+
+    @Override
+	public IPage<TrialNumberRuleVO> selectTrialNumberRulePage(IPage<TrialNumberRuleVO> page, TrialNumberRuleVO trialNumberRule) {
+		return page.setRecords(baseMapper.selectTrialNumberRulePage(page, trialNumberRule));
+	}
+
+    @Override
+    public Map<String,String> getTrialNumber(Long projectId,Long contractId, Integer type,Long nodeId,Boolean isSaveRedis) {
+        HashMap<String, String> map = new HashMap<>();
+        StringBuilder trialNumber = new StringBuilder();
+        List<TrialNumberRule> rules;
+        if(contractId==null||contractId==0L){
+            rules = baseMapper.selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getProjectId, projectId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,1).orderByAsc(TrialNumberRule::getSort));
+        }else {
+             rules = baseMapper.selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getContractId, contractId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,2).orderByAsc(TrialNumberRule::getSort));
+        }
+        for (TrialNumberRule rule : rules) {
+            if(rule.getRule()==1){
+                trialNumber.append(rule.getData());
+            } else if (rule.getRule()==2) {
+                if(contractId!=null&&contractId!=0L){
+                    String sql1="select contract_number from m_contract_info where id="+contractId;
+                    String result = jdbcTemplate.query(sql1, rs -> {
+                        if (rs.next()) {
+                            return rs.getString(1);
+                        } else {
+                            return "";
+                        }
+                    });
+                    trialNumber.append(result);
+                }else {
+                    trialNumber.append("合同段编号");
+                }
+            } else if (rule.getRule()==3) {
+                if (nodeId!=null) {
+                    String sql2="select unique_code from m_wbs_tree_private where p_key_id="+nodeId+" and is_deleted=0";
+                    String  result = jdbcTemplate.query(sql2, rs -> {
+                        if (rs.next()) {
+                            return rs.getString(1);
+                        } else {
+                            return "";
+                        }
+                    });
+                    trialNumber.append(result);
+                }
+            } else if (rule.getRule()==4) {
+                String currentYearStr = String.valueOf(LocalDate.now().getYear());
+                trialNumber.append(currentYearStr);
+            } else if (rule.getRule()==5) {
+                int currentMonthValue = LocalDate.now().getMonthValue();
+                String currentMonthStr = String.format("%02d", currentMonthValue);
+                trialNumber.append(currentMonthStr);
+            } else if (rule.getRule()==6) {
+                if(rule.getIsAutoIncrement()!=null&&rule.getIsAutoIncrement()==1){
+                    String autoIncrementNumber="";
+                    //如果是需要自增的 先要查出当前数据库中自增编号的最大值
+                    String sql3 = "SELECT auto_increment_number FROM u_trial_auto_number where type="+type+" and is_deleted=0 ORDER BY auto_increment_number DESC LIMIT 1";
+                    String maxNumber = jdbcTemplate.query(sql3, rs -> {
+                        if (rs.next()) {
+                            return rs.getObject(1, String.class);
+                        } else {
+                            return rule.getData();
+                        }
+                    });
+                    String sql4="select auto_increment_number FROM u_trial_auto_number where type="+type+" and is_deleted=0  ORDER BY auto_increment_number ASC";
+                    List<String> autoNumbers = jdbcTemplate.query(sql4, new SingleColumnRowMapper<>(String.class));
+                    //判断自增的流水号是否是连续的 是连续的就在最大值加1,不是连续的先使用缺失的编号
+                    List<String> missingNumbers = findMissingNumberPatterns(autoNumbers);
+                    if(missingNumbers.isEmpty()){
+                        while (true){
+                            maxNumber=incrementFormattedNumberWithCheck(maxNumber);
+                            Object o = bladeRedis.get("trialAutoNumber:" + contractId + ":" + type + ":" + nodeId + ":" + "lock:" + maxNumber);
+                            if(o==null){
+                                break;
+                            }
+                        }
+                        autoIncrementNumber=maxNumber;
+                    }else {
+                        for (int i = 0; i < missingNumbers.size(); i++) {
+                            autoIncrementNumber=missingNumbers.get(i);
+                            Object o = bladeRedis.get("trialAutoNumber:" + contractId + ":" + type + ":" + nodeId + ":" + "lock:" + autoIncrementNumber);
+                            if(o==null){
+                                break;
+                            }
+                            autoIncrementNumber="";
+                        }
+                        if(autoIncrementNumber.equals("")){
+                            while (true){
+                                maxNumber=incrementFormattedNumberWithCheck(maxNumber);
+                                Object o = bladeRedis.get("trialAutoNumber:" + contractId + ":" + type + ":" + nodeId + ":" + "lock:" + maxNumber);
+                                if(o==null){
+                                    break;
+                                }
+                            }
+                            autoIncrementNumber=String.valueOf(maxNumber);
+                        }
+                    }
+                      if (isSaveRedis) {
+                        bladeRedis.setEx("trialAutoNumber:" + contractId + ":" + type + ":" + nodeId + ":" + "lock:" + autoIncrementNumber , autoIncrementNumber,30 * 60 * 1000L);
+                      }
+                    map.put("autoIncrementNumber",autoIncrementNumber);
+                    trialNumber.append(autoIncrementNumber);
+                }
+                else {
+                    trialNumber.append(rule.getData());
+                }
+            }
+        }
+        map.put("trialNumber",trialNumber.toString());
+        return map;
+    }
+
+    public String incrementFormattedNumberWithCheck(String data) {
+        if (data == null || data.isEmpty()) {
+            return "0";
+        }
+
+        int length = data.length();
+        int number = Integer.parseInt(data);
+        number += 1;
+
+        // 检查自增后的数字位数是否超过原始数据的长度
+        if (String.valueOf(number).length() > length) {
+            throw new ServiceException("自增后的编号超出原始格式位数限制:" + data);
+        }
+
+        return String.format("%0" + length + "d", number);
+    }
+
+    public List<String> findMissingNumberPatterns(List<String> autoNumbersStr) {
+        if (autoNumbersStr == null || autoNumbersStr.size() <= 1) {
+            return Collections.emptyList();
+        }
+
+        // 提取数字和最大长度
+        List<Long> numbers = new ArrayList<>();
+        int maxLength = 0;
+
+        for (String s : autoNumbersStr) {
+            try {
+                Long num = Long.parseLong(s);
+                numbers.add(num);
+                maxLength = Math.max(maxLength, s.length());
+            } catch (NumberFormatException ignored) {
+            }
+        }
+
+        if (numbers.size() <= 1) {
+            return Collections.emptyList();
+        }
+
+        // 排序
+        numbers.sort(Long::compareTo);
+
+        long start = numbers.get(0);
+        long end = numbers.get(numbers.size() - 1);
+        Set<Long> numberSet = new HashSet<>(numbers);
+
+        List<String> missing = new ArrayList<>();
+
+        for (long i = start; i <= end; i++) {
+            if (!numberSet.contains(i)) {
+                // 使用原始最长字符串的长度进行格式化
+                String formatted = String.format("%0" + maxLength + "d", i);
+                missing.add(formatted);
+            }
+        }
+
+        return missing;
+    }
+
+    @Override
+    public TrialNumberRuleVO1 getTrialNumberRule(Long projectId,Long contractId, Integer type) {
+        TrialNumberRuleVO1 vo1 = new TrialNumberRuleVO1();
+        List<TrialNumberRule> trialNumberRules;
+        if(contractId==0L){
+            trialNumberRules = baseMapper.selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getProjectId, projectId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,1).orderByAsc(TrialNumberRule::getSort));
+        }else {
+            trialNumberRules = baseMapper.selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getContractId, contractId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,2).orderByAsc(TrialNumberRule::getSort));
+        }
+        if(trialNumberRules!=null){
+            Map<String, String> map = getTrialNumber(projectId,contractId, type, null, false);
+            vo1.setList(trialNumberRules);
+            vo1.setTrialNumber(map.get("trialNumber"));
+            return vo1;
+        }
+        return null;
+    }
+
+    /**
+     * type 1材料 2样品 3委托单 4记录表 5报告表
+     * @param projectId
+     * @param contractId
+     * @param type
+     * @return
+     */
+    @Override
+    public boolean clearTrialNumber(Long projectId, Long contractId, Integer type) {
+        if(contractId!=null&&contractId!=0L){
+            String update;
+            if(type==1){
+                update="update u_trial_material_mobilization set material_number = NULL where contract_id="+contractId;
+            } else if (type==2) {
+                update="update u_trial_sample_info set specification_number = NULL where contract_id="+contractId;
+            } else if (type==3) {
+                update="update u_entrust_info set entrust_no IS NULL where contract_id="+contractId+" and status=1";
+            } else if (type==4) {
+                update="update u_trial_self_inspection_record set record_no = NULL where contract_id="+contractId+" and task_status='未上报'";
+            }else{
+                update="update u_trial_self_inspection_record set report_no = NULL where contract_id="+contractId+" and task_status='未上报'";
+            }
+            jdbcTemplate.execute(update);
+        }
+        return true;
+    }
+
+    @Override
+    public Map<String, String> getEntrustNumber(Long pkeyId,Long contractId) throws FileNotFoundException {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
+        String sql="Select html_url from m_wbs_tree_private where p_key_id="+pkeyId;
+        WbsTreePrivate wbsTreePrivate = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+        String fileUrl = wbsTreePrivate.getHtmlUrl();
+        File file1 = ResourceUtil.getFile(fileUrl);
+        InputStream fileInputStream;
+        if (file1.exists()) {
+            fileInputStream = new FileInputStream(file1);
+        } else {
+            String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
+            fileInputStream = CommonUtil.getOSSInputStream(path);
+        }
+        String htmlString = IoUtil.readToString(fileInputStream);
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        htmlString = htmlString.replaceAll("title", "titlexx");
+        Document doc = Jsoup.parse(htmlString);
+        Elements elementsWithPlaceholderxx = doc.select("el-input[placeholder~=.*委托单编号.*]");
+        if(!elementsWithPlaceholderxx.isEmpty()){
+            Element first = elementsWithPlaceholderxx.first();
+            String key = first.attr("id");
+            Map<String, String> map = getTrialNumber(Long.valueOf(wbsTreePrivate.getProjectId()),contractId, 3, pkeyId, true);
+            map.put(key,map.get("trialNumber"));
+            return map;
+        }
+        return null;
+    }
+
+
+    public void checkSave(Long contractId,Integer type,Long formDataId,String autoNumber){
+        List<TrialNumberRule> list = baseMapper.selectList(Wrappers.<TrialNumberRule>query().lambda().eq(TrialNumberRule::getContractId, contractId).eq(TrialNumberRule::getType, type).eq(TrialNumberRule::getStatus,2).orderByAsc(TrialNumberRule::getSort));
+            if(list!=null&&list.size()>0){
+                List<TrialNumberRule> collect = list.stream().filter(o -> o.getRule() == 6 && o.getIsAutoIncrement() == 1).collect(Collectors.toList());
+                if(!collect.isEmpty()){
+                    TrialAutoNumber one = trialAutoNumberService.getOne(Wrappers.lambdaQuery(TrialAutoNumber.class).eq(TrialAutoNumber::getFormDataId, formDataId).eq(TrialAutoNumber::getType, 4));
+                    if(one==null){
+                        TrialAutoNumber trialAutoNumber = new TrialAutoNumber();
+                        trialAutoNumber.setId(SnowFlakeUtil.getId());
+                        trialAutoNumber.setType(type);
+                        trialAutoNumber.setNumberRuleId(collect.get(0).getId());
+                        trialAutoNumber.setFormDataId(formDataId);
+                        trialAutoNumber.setAutoIncrementNumber(autoNumber);
+                        trialAutoNumberService.save(trialAutoNumber);
+                    }
+                }
+            }
+    }
+
+}

+ 12 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -37,6 +37,7 @@ 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.redis.cache.BladeRedis;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.utils.*;
 import org.springblade.resource.feign.NewIOSSClient;
@@ -65,6 +66,8 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
     private final TrialSamplingRecordMapper trialSamplingRecordMapper;
     private final JdbcTemplate jdbcTemplate;
     private final IEntrustInfoService entrustInfoService;
+    private final TrialNumberRuleServiceImpl trialNumberRuleService;
+    private final BladeRedis bladeRedis;
 
     @Override
     public boolean sampleVerification(String specificationNumber, String id, String contractId, String nodeId) {
@@ -133,10 +136,9 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
     @Override
     public boolean sampleSubmit(TrialSampleInfoDTO obj) {
         //如果样品编号为空,那么就自动生成
-        if (ObjectUtil.isEmpty(obj.getSpecificationNumber())) {
-            this.buildNumber(obj);
-        }
-
+//        if (ObjectUtil.isEmpty(obj.getSpecificationNumber())) {
+//            this.buildNumber(obj);
+//        }
         TrialSampleInfo trialSampleInfo = BeanUtil.copyProperties(obj, TrialSampleInfo.class);
         if (trialSampleInfo != null) {
             if (ObjectUtils.isEmpty(trialSampleInfo.getMaterialCount())) {
@@ -146,6 +148,12 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
                 trialSampleInfo.setRepresentativeCount("0");
             }
             this.saveOrUpdate(trialSampleInfo);
+            if(obj.getAutoIncrementNumber()!=null){
+                if(obj.getTrialAutoNumber().equals(obj.getSpecificationNumber())){
+                    trialNumberRuleService.checkSave(obj.getContractId(), 2, obj.getId(), obj.getAutoIncrementNumber());
+                }
+                bladeRedis.del("trialAutoNumber:" + obj.getContractId() + ":" + 2 + ":" + obj.getId() + ":" + "lock:" + obj.getAutoIncrementNumber());
+            }
 
             if (trialSampleInfo.getId() != null && obj.getMobilizationId() != null && obj.getMobilizationId() != -1) {
                 TrialSamplingRecord trialSamplingRecord = trialSamplingRecordMapper.selectByMobilizationIdAndSampleInfoId(obj.getMobilizationId(), trialSampleInfo.getId());

+ 36 - 10
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -39,6 +39,8 @@ 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.redis.cache.BladeRedis;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.entity.*;
@@ -92,7 +94,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
     private final TrialDeviceUseServiceImpl trialDeviceUseService;
     private final InformationQueryServiceImpl informationQueryService;
     private final TrialDetectionDataServiceImpl trialDetectionDataService;
-    private final IEntrustInfoService entrustInfoService;
+    private final BladeRedis bladeRedis;
+    private final TrialAutoNumberServiceImpl trialAutoNumberService;
+    private final TrialNumberRuleServiceImpl trialNumberRuleService;
 
     @Override
     public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
@@ -1087,21 +1091,21 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         //------初始当前填报的表pKeyIds------
         this.initTrialTabIds(dto);
 
-        if(!this.judgingParameters(dto)){
-            //------初始编号信息------
-            this.initBuildNumber(dto);
-        }
+//        if(!this.judgingParameters(dto)){
+//            //------初始编号信息------
+//            this.initBuildNumber(dto);
+//        }
         this.saveOrUpdate(dto);
+
         if (ObjectUtil.isNotEmpty(dto.getId())) {
             //------获取最新试验记录------
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
             //如果传递了编号就修改对应记录的值 以第一张表的数据为准
             this.updateRecordNoOrReportNo(obj, dto);
             //------编辑时记录表编号或报告单编号为Null的重新生成------
-            if(!this.judgingParameters(dto)){
-                this.reBuildNumber(obj, dto);
-            }
-
+//            if(!this.judgingParameters(dto)){
+//                this.reBuildNumber(obj, dto);
+//            }
             //------保存实体表数据、试验记录信息、生成PDF------
             this.submitTrialData(obj, dto);
 
@@ -1114,12 +1118,34 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             //------关联新增设备使用记录信息------
             this.trialDeviceUseService.addDeviceUseInfo(dto);
         }
-
         // ---- 修改样品单号信息 --------
         if(dto!=null && Func.isNotEmpty(dto.getEntrustId())){
             //修改项目节点基础信息
             jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='"+dto.getEntrustId()+"'");
         }
+        String[] strings = dto.getTableType().split(",");
+        if(dto.getRecordAutoNumber()!=null||dto.getReportAutoNumber()!=null){
+            if (dto.getOldRecordNumber()!=null&&dto.getOldRecordNumber().equals(dto.getRecordNo())||dto.getOldReportNumber()!=null&&dto.getOldReportNumber().equals(dto.getReportNo())) {
+                if(strings.length==1){
+                    if(strings[0].equals("1")){
+                        trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),4,dto.getId(),dto.getRecordAutoNumber());
+                    }else {
+                        trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),5,dto.getId(),dto.getReportAutoNumber());
+                    }
+                }else {
+                    trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),4,dto.getId(),dto.getRecordAutoNumber());
+                    trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),5,dto.getId(),dto.getReportAutoNumber());
+                }
+            }
+            if(strings.length==1&&strings[0].equals("1")){
+                bladeRedis.del("trialAutoNumber:" + dto.getContractId() + ":" + 4 + ":" + dto.getId() + ":" + "lock:" + dto.getRecordAutoNumber());
+            }else if(strings.length==1&&strings[0].equals("2")){
+                bladeRedis.del("trialAutoNumber:" + dto.getContractId() + ":" + 5 + ":" + dto.getId() + ":" + "lock:" + dto.getReportAutoNumber());
+            }else {
+                bladeRedis.del("trialAutoNumber:" + dto.getContractId() + ":" + 4 + ":" + dto.getId() + ":" + "lock:" + dto.getRecordAutoNumber());
+                bladeRedis.del("trialAutoNumber:" + dto.getContractId() + ":" + 5 + ":" + dto.getId() + ":" + "lock:" + dto.getReportAutoNumber());
+            }
+        }
         return dto.getId().toString();
     }
 

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

@@ -0,0 +1,14 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+import org.springblade.business.mapper.StandardInfoPrivateJoinMapper;
+import org.springblade.business.service.StandardInfoPrivateJoinService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author LHB
+ */
+@Service
+public class UStandardInfoPrivateJoinServiceImpl extends ServiceImpl<StandardInfoPrivateJoinMapper, StandardInfoPrivateJoin> implements StandardInfoPrivateJoinService {
+}

+ 270 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/UStandardInfoServiceImpl.java

@@ -0,0 +1,270 @@
+package org.springblade.business.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.business.dto.StandardInfoJoinDTO;
+import org.springblade.business.dto.StandardInfoPrivateJoinDTO;
+import org.springblade.business.dto.StandardInfoDTO;
+import org.springblade.business.entity.StandardInfo;
+import org.springblade.business.entity.StandardInfoJoin;
+import org.springblade.business.entity.StandardInfoPrivateJoin;
+import org.springblade.business.mapper.StandardInfoMapper;
+import org.springblade.business.service.StandardInfoJoinService;
+import org.springblade.business.service.StandardInfoPrivateJoinService;
+import org.springblade.business.service.StandardInfoService;
+import org.springblade.business.vo.StandardInfoDtoVo;
+import org.springblade.business.vo.StandardInfoPrivateJoinVO;
+import org.springblade.business.vo.StandardInfoVO;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springframework.beans.BeansException;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author LHB
+ * @description 针对表【u_standard_info(规范参数管理-基础信息)】的数据库操作Service实现
+ * @createDate 2025-06-11 09:57:39
+ */
+@Service
+public class UStandardInfoServiceImpl extends ServiceImpl<StandardInfoMapper, StandardInfo>
+        implements StandardInfoService {
+
+    /**
+     * 关联表
+     */
+    @Resource
+    private StandardInfoJoinService standardInfoJoinService;
+
+    /**
+     * 与表单的关联关系
+     */
+    @Resource
+    private StandardInfoPrivateJoinService standardInfoPrivateJoinService;
+
+
+    @Override
+    public IPage<StandardInfoDtoVo> selectMyPage(Query query, StandardInfo standardInfo) {
+        return baseMapper.selectMyPage(new Page<StandardInfoDtoVo>(query.getCurrent(), query.getSize()), standardInfo);
+    }
+
+    @Override
+    public StandardInfoDTO selectOne(Long id) {
+        return baseMapper.selectMyOne(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean insert(StandardInfoDTO uStandardInfo) {
+        try {
+            //获取当前用户
+            BladeUser user = SecureUtil.getUser();
+            uStandardInfo.setId(SnowFlakeUtil.getId());
+            uStandardInfo.setCreateUser(user.getUserId());
+
+            List<StandardInfo> info = uStandardInfo.getInfo();
+
+            //给集合设置id、父级id、创建人
+            info.forEach(item -> {
+                item.setId(SnowFlakeUtil.getId());
+                item.setParentId(uStandardInfo.getId());
+                item.setStandardId(uStandardInfo.getStandardId());
+                item.setCreateUser(user.getUserId());
+            });
+
+            //把父级对象转出来单独保存
+            StandardInfo parent = BeanUtil.copyProperties(uStandardInfo, StandardInfo.class);
+            baseMapper.insert(parent);
+            //通过mybatis-plus 批量新增
+            this.saveBatch(info);
+
+            return true;
+        } catch (BeansException e) {
+            e.printStackTrace();
+            throw new ServiceException("添加失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean edit(StandardInfoDTO uStandardInfo) {
+        try {
+            //获取当前用户
+            BladeUser user = SecureUtil.getUser();
+            uStandardInfo.setUpdateUser(user.getUserId());
+
+            List<StandardInfo> info = uStandardInfo.getInfo();
+            info.forEach(item -> {
+                if (item.getId() == null) {
+                    //新增的子集合设置id、父级id、创建人
+                    item.setId(SnowFlakeUtil.getId());
+                    item.setParentId(uStandardInfo.getId());
+                    item.setStandardId(uStandardInfo.getStandardId());
+                    item.setCreateUser(user.getUserId());
+                } else {
+                    //更新的子集合 添加更新人
+                    item.setUpdateUser(user.getUserId());
+                }
+            });
+            //更新父级对象
+            StandardInfo parent = BeanUtil.copyProperties(uStandardInfo, StandardInfo.class);
+            baseMapper.updateById(parent);
+            //批量更新
+            this.saveOrUpdateBatch(info);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("更新失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(Long id) {
+        try {
+            //查询关联表 如果有关联关系不允许删除
+            long joinCount = standardInfoJoinService.count(Wrappers.<StandardInfoJoin>lambdaQuery()
+                    .eq(StandardInfoJoin::getStandardInfoRightId, id)
+                    .or()
+                    .eq(StandardInfoJoin::getStandardInfoLeftId, id));
+            if (joinCount > 0) {
+                throw new ServiceException("当前数据正在【条件设置】中使用,无法删除");
+            }
+            //查询与表单的关联表
+            long privateJoinCount = standardInfoPrivateJoinService.count(Wrappers.<StandardInfoPrivateJoin>lambdaQuery()
+                    .eq(StandardInfoPrivateJoin::getStandardInfoId, id));
+            if (privateJoinCount > 0) {
+                throw new ServiceException("当前数据正在【关联元素】中使用,无法删除");
+            }
+
+            int update = baseMapper.update(null, Wrappers.<StandardInfo>lambdaUpdate()
+                    .set(StandardInfo::getIsDeleted, 1)
+                    .eq(StandardInfo::getId, id)
+                    .or()
+                    .eq(StandardInfo::getParentId, id));
+            return update > 0;
+        } catch (ServiceException e) {
+            e.printStackTrace();
+            throw new ServiceException("删除失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean setCondition(List<StandardInfoJoinDTO> standardInfoJoins) {
+        BladeUser user = SecureUtil.getUser();
+        List<StandardInfoJoin> saveData = new ArrayList<>();
+        try {
+            for (StandardInfoJoinDTO standardInfoJoin : standardInfoJoins) {
+                Long leftId = standardInfoJoin.getLeftId();
+                List<Long> rightIds = standardInfoJoin.getRightIds();
+                for (Long rightId : rightIds) {
+                    StandardInfoJoin uStandardInfoJoin = new StandardInfoJoin();
+                    uStandardInfoJoin.setId(SnowFlakeUtil.getId());
+                    uStandardInfoJoin.setStandardInfoLeftId(leftId);
+                    uStandardInfoJoin.setStandardInfoRightId(rightId);
+                    uStandardInfoJoin.setCreateUser(user.getUserId());
+                    saveData.add(uStandardInfoJoin);
+                }
+                //先删除之前的关联关系
+                standardInfoJoinService.remove(Wrappers.<StandardInfoJoin>lambdaQuery()
+                        .eq(StandardInfoJoin::getStandardInfoLeftId,leftId));
+            }
+            //新增
+            return standardInfoJoinService.saveBatch(saveData);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("条件设置失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean setElementJoin(List<StandardInfoPrivateJoinDTO> standardInfoPrivateJoins) {
+        BladeUser user = SecureUtil.getUser();
+        List<StandardInfoPrivateJoin> saveData = new ArrayList<>();
+
+        try {
+            for (StandardInfoPrivateJoinDTO standardInfoPrivateJoin : standardInfoPrivateJoins) {
+                Long leftId = standardInfoPrivateJoin.getLeftId();
+                List<StandardInfoPrivateJoin> rightIds = standardInfoPrivateJoin.getRightIds();
+                rightIds.forEach(f -> {
+                    f.setId(SnowFlakeUtil.getId());
+                    f.setStandardInfoId(leftId);
+                    f.setCreateUser(user.getUserId());
+                });
+                saveData.addAll(rightIds);
+                //删除之前的关联关系
+                standardInfoPrivateJoinService.remove(Wrappers.<StandardInfoPrivateJoin>lambdaQuery()
+                        .eq(StandardInfoPrivateJoin::getStandardInfoId,leftId));
+            }
+            return standardInfoPrivateJoinService.saveBatch(saveData);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("元素关联失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteConditionSet(Long leftId) {
+        BladeUser user = SecureUtil.getUser();
+        try {
+            return standardInfoJoinService.update(Wrappers.<StandardInfoJoin>lambdaUpdate()
+                    .set(StandardInfoJoin::getIsDeleted, 1)
+                    .set(StandardInfoJoin::getUpdateUser, user.getUserId())
+                    .eq(StandardInfoJoin::getStandardInfoLeftId, leftId));
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("删除失败");
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteElementJoin(Long leftId) {
+        BladeUser user = SecureUtil.getUser();
+        try {
+            return standardInfoPrivateJoinService.update(Wrappers.<StandardInfoPrivateJoin>lambdaUpdate()
+                    .set(StandardInfoPrivateJoin::getIsDeleted, 1)
+                    .set(StandardInfoPrivateJoin::getUpdateUser, user.getUserId())
+                    .eq(StandardInfoPrivateJoin::getStandardInfoId, leftId));
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("删除失败");
+        }
+    }
+
+    @Override
+    public List<StandardInfoVO> getConditionSet(Long id) {
+        return baseMapper.getConditionSet(id);
+    }
+
+    @Override
+    public List<StandardInfoPrivateJoinVO> getElementJoin(Long id) {
+        return baseMapper.getElementJoin(id);
+
+    }
+
+    @Override
+    public List<StandardInfoPrivateJoinVO> effectPreview(String ids) {
+        List<Long> collect = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
+        return baseMapper.effectPreview(collect);
+    }
+}
+
+
+
+

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

@@ -56,7 +56,7 @@ public class TableInfoServiceImpl extends BaseServiceImpl<TableInfoMapper, Table
      * 十分钟执行一次
      * 替换动态表中的阿里云地址
      */
-    @Scheduled(cron = "0 */10 * * * ?")
+    //@Scheduled(cron = "0 */10 * * * ?")
 //    @Scheduled(fixedDelay = 60000)
     public void aliyunUrlReplace() {
         System.out.println("执行阿里云地址替换-----------------------------开始");

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

@@ -38,7 +38,7 @@ import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.TextdictBy345VO;
 import org.springblade.manager.vo.TextdictInfoVO;
-import org.springframework.context.annotation.Lazy;
+import org.springblade.system.cache.ParamCache;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -49,6 +49,7 @@ import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.*;
 
 /**
  * 参数信息表 服务实现类