Ver Fonte

Merge remote-tracking branch 'origin/master'

liuyc há 1 ano atrás
pai
commit
d59c98a283
34 ficheiros alterados com 495 adições e 187 exclusões
  1. 4 4
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchiveExpertConclusion.java
  2. 14 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchiveExpertScore.java
  3. 3 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ExpertInspection.java
  4. 2 1
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveAutoClient.java
  5. 1 1
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClient.java
  6. 18 0
      blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/UpdateExpertVO.java
  7. 83 20
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertConclusionController.java
  8. 19 26
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java
  9. 6 3
      blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveAutoClientImpl.java
  10. 2 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClientImpl.java
  11. 2 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchiveExpertScoreMapper.java
  12. 6 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchiveExpertScoreMapper.xml
  13. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.java
  14. 2 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml
  15. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ExpertInspectionMapper.java
  16. 2 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ExpertInspectionMapper.xml
  17. 10 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertConclusionService.java
  18. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertScoreService.java
  19. 7 7
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchivesAutoService.java
  20. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/IExpertInspectionService.java
  21. 2 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/ITraceLogService.java
  22. 77 10
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java
  23. 10 5
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertScoreServiceImpl.java
  24. 141 70
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java
  25. 2 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ExpertInspectionServiceImpl.java
  26. 29 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/TraceLogServiceImpl.java
  27. 1 8
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  28. 6 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  29. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeContractController.java
  30. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.java
  31. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml
  32. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeContractService.java
  33. 26 10
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java
  34. 4 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

+ 4 - 4
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchiveExpertConclusion.java

@@ -65,10 +65,10 @@ public class ArchiveExpertConclusion extends BaseEntity {
     @ApiModelProperty("存在问题及建议")
     private String questionSuggest;
 
-    @ApiModelProperty("审批状态,0未上报,1待审批,2已审批,3已废除")
-    private Integer approveStatus;
-
-    @ApiModelProperty("审批状态,0未上报,1待审批,2已审批,3已废除")
+    @ApiModelProperty("生成报告PDF时间")
     private LocalDate approveDate;
 
+    @ApiModelProperty("任务")
+    private Long taskId;
+
 }

+ 14 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ArchiveExpertScore.java

@@ -42,6 +42,9 @@ public class ArchiveExpertScore extends BaseEntity {
     @ApiModelProperty("项目id")
     private Long projectId;
 
+    @ApiModelProperty("结论id")
+    private Long conclusionId;
+
     @ApiModelProperty("单位类型:1业主2监理3施工")
     private Integer unitType;
 
@@ -72,4 +75,15 @@ public class ArchiveExpertScore extends BaseEntity {
         this.normative = normative;
         this.normativeDeduction = normativeDeduction;
     }
+
+    public ArchiveExpertScore(Long projectId, Long conclusionId, Integer unitType, String scoreItem, Integer integrality, Integer integralityDeduction, Integer normative, Integer normativeDeduction) {
+        this.projectId = projectId;
+        this.conclusionId = conclusionId;
+        this.unitType = unitType;
+        this.scoreItem = scoreItem;
+        this.integrality = integrality;
+        this.integralityDeduction = integralityDeduction;
+        this.normative = normative;
+        this.normativeDeduction = normativeDeduction;
+    }
 }

+ 3 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/entity/ExpertInspection.java

@@ -19,6 +19,9 @@ public class ExpertInspection extends BaseEntity {
     @ApiModelProperty("项目id")
     private Long projectId;
 
+    @ApiModelProperty("结论id")
+    private Long conclusionId;
+
     @ApiModelProperty("单位类型:1施工2监理3业主")
     private Integer UnitType;
 

+ 2 - 1
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveAutoClient.java

@@ -3,6 +3,7 @@ package org.springblade.archive.feign;
 import org.springblade.archive.entity.ArchiveProjectConfig;
 import org.springblade.archive.entity.ArchivesAuto;
 import org.springblade.archive.vo.ArchivesAutoVO;
+import org.springblade.archive.vo.UpdateExpertVO;
 import org.springblade.common.constant.ArchiveConstant;
 import org.springblade.common.constant.EVisaConstant;
 import org.springblade.core.tool.api.R;
@@ -42,5 +43,5 @@ public interface ArchiveAutoClient {
      * 批量修改档案专家,参数为节点集合
      */
     @PostMapping(API_PREFIX + "/batchUpdateExpertId")
-    R<Boolean> batchUpdateExpertId(@RequestParam String userId,@RequestParam List<Long> ids);
+    R<Boolean> batchUpdateExpertId(@RequestBody UpdateExpertVO vo);
 }

+ 1 - 1
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClient.java

@@ -14,5 +14,5 @@ public interface ArchiveExpertConclusionClient {
     String API_PREFIX = "/api/archive/archiveExpertConclusion";
 
     @GetMapping(API_PREFIX + "/saveBaseTableInfo")
-    R saveBaseTableInfo(@RequestParam Long projectId, @RequestParam String appUrl);
+    R saveBaseTableInfo(@RequestParam Long projectId, @RequestParam String appUrl,@RequestParam Long taskId);
 }

+ 18 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/UpdateExpertVO.java

@@ -0,0 +1,18 @@
+package org.springblade.archive.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Param   用于批量修改传参
+ * @Author wangwl
+ * @Date 2024/1/10 18:18
+ **/
+@Data
+public class UpdateExpertVO implements Serializable {
+    private static final long serialVersionUID = 996L;
+
+    private String ids;
+    private String userid;
+}

+ 83 - 20
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveExpertConclusionController.java

@@ -11,10 +11,7 @@ import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.archive.service.IArchiveExpertConclusionService;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.tool.api.R;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -67,25 +64,13 @@ public class ArchiveExpertConclusionController extends BladeController {
     public R getAppPreview(@RequestParam Long projectId) {
         return R.data(conclusionService.getAppPreview(projectId));
     }
-    /**
-     * 在线验收-查看验收报告
-     */
-    @GetMapping("/getTable")
-    @ApiOperationSupport(order = 5)
-    @ApiOperation(value = "在线验收-查看验收报告", notes = "传入当前项目id,返回当期验收报告URL地址")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
-    })
-    public R getTable(@RequestParam Long projectId) {
-        return R.data(conclusionService.getTable(projectId));
-    }
 
     /**
      * 编写结论-是否生成打分表
      */
     @GetMapping("/creatScore")
-    @ApiOperationSupport(order = 1)
-    @ApiOperation(value = "验收申请-是否生成打分表", notes = "传入当前项目id,返回1选择0不选择")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "编写结论-是否生成打分表", notes = "传入当前项目id,返回1选择0不选择")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
     })
@@ -97,8 +82,8 @@ public class ArchiveExpertConclusionController extends BladeController {
      * 编写结论-修改是否生成打分表
      */
     @GetMapping("/updateScore")
-    @ApiOperationSupport(order = 1)
-    @ApiOperation(value = "验收申请-修改是否生成打分表", notes = "传入当前项目id,传入1选择0不选择")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "编写结论-修改是否生成打分表", notes = "传入当前项目id,传入1选择0不选择")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
             @ApiImplicitParam(name = "isSelect", value = "1选择0不选择", required = true)
@@ -107,4 +92,82 @@ public class ArchiveExpertConclusionController extends BladeController {
         conclusionService.updateScore(projectId,isSelect);
         return R.data("修改成功");
     }
+
+    /**
+     * 在线验收-获取当前期在线验收id
+     */
+    @GetMapping("/getCurrentId")
+    @ApiOperationSupport(order = 9)
+    @ApiOperation(value = "在线验收-获取当前期在线验收id", notes = "传入当前项目id,返回当前期在线验收id")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+    })
+    public R getCurrentId(@RequestParam Long projectId) {
+        return R.data(conclusionService.getCurrentId(projectId));
+    }
+
+    /**
+     * 在线验收-下一步编写报告,校验
+     */
+    @GetMapping("/checkTable")
+    @ApiOperationSupport(order = 9)
+    @ApiOperation(value = "在线验收-下一步编写报告,校验", notes = "传入当前项目id,返回ture允许跳转")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+    })
+    public R checkTable(@RequestParam Long projectId) {
+        return R.data(conclusionService.checkTable(projectId));
+    }
+
+    /**
+     * 在线验收-获取结论
+     */
+    @GetMapping("/getTable")
+    @ApiOperationSupport(order = 10)
+    @ApiOperation(value = "在线验收-获取结论", notes = "传入当前项目id,返回结论信息")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+    })
+    public R<ArchiveExpertConclusion> getTable(@RequestParam Long projectId) {
+        return R.data(conclusionService.getTable(projectId));
+    }
+
+
+    /**
+     * 编写结论-暂存草稿
+     */
+    @PostMapping("/saveTable")
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "在线验收-暂存草稿", notes = "传入结论信息")
+    public R saveTable(@RequestBody ArchiveExpertConclusion conclusion) {
+        conclusionService.updateById(conclusion);
+        return R.data("草稿保存成功");
+    }
+
+    /**
+     * 编写结论-校验提交权限
+     */
+    @GetMapping("/checkSubmit")
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "在线验收-确认提交权限", notes = "传入项目id,返回true代表为专家组长,显示提交按钮")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+    })
+    public R checkSubmit(@RequestParam Long projectId) {
+        return R.data(conclusionService.checkSubmit(projectId));
+    }
+
+    /**
+     * 编写结论-确认提交
+     */
+    @PostMapping("/submitTable")
+    @ApiOperationSupport(order = 12)
+    @ApiOperation(value = "在线验收-确认提交", notes = "传入结论信息")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
+    })
+    public R submitTable(@RequestBody ArchiveExpertConclusion conclusion) {
+        conclusionService.submitTable(conclusion);
+        return R.data("提交成功");
+    }
 }

+ 19 - 26
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java

@@ -544,11 +544,14 @@ public class ArchivesAutoController extends BladeController {
 			if(isArchivesAuto!=-1 && isArchivesAuto!=null && isArchivesAuto!=0){
 				return R.fail("当前合同段已经在自动组卷中,请耐心等待");
 			}
-			log.info("开始刷新档号....");
+
+			Long traceId = SnowFlakeUtil.getId();
+			iTraceLogService.save(traceId,"开始刷新档号");
+			log.info("开始刷新档号...." + traceId);
 			//设置自动组卷中
 			contractClient.updateIsArchivesAutoById(contractId,1);
 
-			archivesAutoService.refreshFileNumberThread(projectId,contractId,nodeId);
+			archivesAutoService.refreshFileNumberThread(projectId,contractId,nodeId,traceId);
 			return R.success("开始刷新档号中,请耐心等待");
 		}catch (Exception e){
 			e.printStackTrace();
@@ -559,19 +562,6 @@ public class ArchivesAutoController extends BladeController {
 		}
 	}
 
-	/**
-	 * 刷新指定项目的档案
-	 * @param projectId 项目id
-	 * @return R
-	 */
-	@PostMapping("/refreshFileNumber1")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "刷新项目档案", notes = "传入projectId,contractId")
-	public R<String> refreshProjectArchive1(@RequestParam Long projectId, @RequestParam Long contractId,@RequestParam Long nodeId) {
-		archivesAutoService.refreshFileNumberNoSlipt(projectId,contractId,null,false);
-		return R.data("刷新成功");
-	}
-
 
 	/**
 	 * 批量编辑
@@ -818,10 +808,11 @@ public class ArchivesAutoController extends BladeController {
 	@ApiOperation(value = "在线验收-修改抽检状态", notes = "在当前页面停留30秒再调接口:传入档案id,返回查阅完成,可以显示到页面")
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
-			@ApiImplicitParam(name = "archiveId", value = "档案id", required = true)
+			@ApiImplicitParam(name = "archiveId", value = "档案id", required = true),
+			@ApiImplicitParam(name = "conclusionId", value = "当前期id", required = true)
 	})
-	public R updateInspectStatus(@RequestParam Long archiveId,@RequestParam Long projectId) {
-		archivesAutoService.updateInspectStatus(archiveId,projectId);
+	public R updateInspectStatus(@RequestParam Long archiveId,@RequestParam Long projectId,@RequestParam Long conclusionId) {
+		archivesAutoService.updateInspectStatus(archiveId,projectId,conclusionId);
 		return R.data("当前案卷查阅完成");
 	}
 
@@ -833,10 +824,11 @@ public class ArchivesAutoController extends BladeController {
 	@ApiOperation(value = "在线验收-获取档案文件抽检意见", notes = "传入项目id,文件id")
 	@ApiImplicitParams(value = {
 			@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
-			@ApiImplicitParam(name = "fileId", value = "文件id", required = true)
+			@ApiImplicitParam(name = "fileId", value = "文件id", required = true),
+			@ApiImplicitParam(name = "conclusionId", value = "当前期id", required = true)
 	})
-	public R<ExpertInspectionVO> getArchiveFileOpinion(@RequestParam Long fileId,@RequestParam Long projectId) {
-		ExpertInspectionVO vo = archivesAutoService.getArchiveFileOpinion(fileId, projectId);
+	public R<ExpertInspectionVO> getArchiveFileOpinion(@RequestParam Long fileId,@RequestParam Long projectId,@RequestParam Long conclusionId) {
+		ExpertInspectionVO vo = archivesAutoService.getArchiveFileOpinion(fileId, projectId,conclusionId);
 		return R.data(vo);
 	}
 
@@ -850,7 +842,8 @@ public class ArchivesAutoController extends BladeController {
 			@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
 			@ApiImplicitParam(name = "archiveId", value = "档案id", required = true),
 			@ApiImplicitParam(name = "fileId", value = "文件id", required = false),
-			@ApiImplicitParam(name = "opinion", value = "抽检意见", required = false)
+			@ApiImplicitParam(name = "opinion", value = "抽检意见", required = false),
+			@ApiImplicitParam(name = "conclusionId", value = "结论id", required = false)
 	})
 	public R saveInspect(@RequestBody ExpertInspection inspection) {
 		archivesAutoService.saveInspect(inspection);
@@ -868,8 +861,8 @@ public class ArchivesAutoController extends BladeController {
 			@ApiImplicitParam(name = "size", value = "每页的数量", required = true),
 			@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
 	})
-	public R<IPage<ExpertInspectionVO>> getUserInspectInfo(Query query,@RequestParam Long projectId) {
-		IPage<ExpertInspectionVO> page = archivesAutoService.getUserInspectInfo(query, projectId);
+	public R<IPage<ExpertInspectionVO>> getUserInspectInfo(Query query,@RequestParam Long projectId,@RequestParam Long conclusionId) {
+		IPage<ExpertInspectionVO> page = archivesAutoService.getUserInspectInfo(query, projectId,conclusionId);
 		return R.data(page);
 	}
 
@@ -884,8 +877,8 @@ public class ArchivesAutoController extends BladeController {
 			@ApiImplicitParam(name = "size", value = "每页的数量", required = true),
 			@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
 	})
-	public R<IPage<ExpertInspectionVO>> getUserInspectInfo2(Query query,@RequestParam Long projectId) {
-		IPage<ExpertInspectionVO> page = archivesAutoService.getUserInspectInfo2(query, projectId);
+	public R<IPage<ExpertInspectionVO>> getUserInspectInfo2(Query query,@RequestParam Long projectId,@RequestParam Long conclusionId) {
+		IPage<ExpertInspectionVO> page = archivesAutoService.getUserInspectInfo2(query, projectId,conclusionId);
 		return R.data(page);
 	}
 

+ 6 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveAutoClientImpl.java

@@ -8,6 +8,7 @@ import org.springblade.archive.mapper.ArchivesAutoMapper;
 import org.springblade.archive.service.IArchiveProjectConfigService;
 import org.springblade.archive.service.IArchivesAutoService;
 import org.springblade.archive.vo.ArchivesAutoVO;
+import org.springblade.archive.vo.UpdateExpertVO;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -50,21 +51,23 @@ public class ArchiveAutoClientImpl implements ArchiveAutoClient {
     }
 
     @Override
-    public R<Boolean> batchUpdateExpertId(String userId, List<Long> ids) {
+    public R<Boolean> batchUpdateExpertId(UpdateExpertVO vo) {
+        List<Long> ids = Func.toLongList(vo.getIds());
         List<ArchivesAuto> list = autoMapper.getNodeAllArchive(ids);
         //循环判断是否已经存在专家,存在则追加
         list.stream().forEach(l->{
             if (StringUtils.isBlank(l.getExpertId())){
                 //为空
-                l.setExpertId(userId);
+                l.setExpertId(vo.getUserid());
             }else {
                 //不为空
                 String expertId = l.getExpertId();
-                l.setExpertId(expertId+","+userId);
+                l.setExpertId(expertId+","+vo.getUserid());
             }
         });
         //保存所有节点
         archivesAutoService.updateBatchById(list);
         return R.data(true);
     }
+
 }

+ 2 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveExpertConclusionClientImpl.java

@@ -16,7 +16,7 @@ public class ArchiveExpertConclusionClientImpl implements ArchiveExpertConclusio
 
 
     @Override
-    public R saveBaseTableInfo(Long projectId, String appUrl) {
-        return conclusionService.saveBaseTableInfo(projectId,appUrl);
+    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId) {
+        return conclusionService.saveBaseTableInfo(projectId,appUrl,taskId);
     }
 }

+ 2 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchiveExpertScoreMapper.java

@@ -3,6 +3,7 @@ package org.springblade.archive.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.archive.entity.ArchiveExpertScore;
 import org.springblade.archive.entity.ExpertInspection;
 
@@ -18,4 +19,5 @@ import java.util.List;
 public interface ArchiveExpertScoreMapper extends BaseMapper<ArchiveExpertScore> {
 
 
+    ArchiveExpertConclusion getConclusion(@Param("projectId") Long projectId);
 }

+ 6 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchiveExpertScoreMapper.xml

@@ -3,4 +3,10 @@
 <mapper namespace="org.springblade.archive.mapper.ArchiveExpertScoreMapper">
 
 
+    <select id="getConclusion" resultType="org.springblade.archive.entity.ArchiveExpertConclusion">
+        select * from u_archive_expert_conclusion
+        where project_id = #{projectId} and is_deleted = 0
+        order by create_time desc
+        limit 1
+    </select>
 </mapper>

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

@@ -185,7 +185,7 @@ public interface ArchivesAutoMapper extends BaseMapper<ArchivesAuto> {
 
 	Integer getUserReviewedTotal(@Param("projectId") Long projectId,@Param("userId") Long userId);
 
-	IPage<ExpertInspectionVO> getUserInspectInfo(IPage<ExpertInspectionVO> page,@Param("projectId") Long projectId,@Param("userId") Long userId);
+	IPage<ExpertInspectionVO> getUserInspectInfo(IPage<ExpertInspectionVO> page,@Param("projectId") Long projectId,@Param("userId") Long userId,@Param("conclusionId") Long conclusionId);
 
     List<ArchivesAutoVO3> getAllInspectArchive(@Param("projectId")Long projectId);
 

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

@@ -1065,11 +1065,11 @@
              ) a
     </select>
     <select id="getUserInspectInfo" resultType="org.springblade.archive.vo.ExpertInspectionVO">
-        select aei.id,aei.archive_name ,aei.opinion , aei.archive_id,expert_name,file_id,aei.is_pass,
+        select aei.id,aei.archive_name ,aei.opinion , aei.archive_id,expert_name,file_id,aei.is_pass,aei.conclusion_id,
                (case when unit_type = 1 then '施工' when unit_type = 2 then '监理' else '业主' end) as unitName,
                (select uaf.pdf_file_url from u_archive_file uaf where uaf.id = aei.file_id) as filePdf
         from u_archive_expert_inspection aei
-        WHERE project_id = #{projectId} and is_deleted = 0 and is_pass = 0
+        WHERE project_id = #{projectId} and is_deleted = 0 and is_pass = 0 and conclusion_id = #{conclusionId}
         <if test="userId != null">
             and expert_id = #{userId}
         </if>

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ExpertInspectionMapper.java

@@ -17,5 +17,5 @@ import java.util.List;
  */
 public interface ExpertInspectionMapper extends BaseMapper<ExpertInspection> {
 
-    List<ExpertInspection> getListByFileId(@Param("fileId") Long fileId,@Param("projectId") Long projectId);
+    List<ExpertInspection> getListByFileId(@Param("fileId") Long fileId,@Param("projectId") Long projectId,@Param("conclusionId") Long conclusionId);
 }

+ 2 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ExpertInspectionMapper.xml

@@ -4,6 +4,7 @@
 
     <select id="getListByFileId" resultType="org.springblade.archive.entity.ExpertInspection">
         select * from u_archive_expert_inspection
-        where project_id = #{projectId} and file_id = #{fileId} and is_deleted = 0 and is_pass = 0
+        where project_id = #{projectId} and file_id = #{fileId} and conclusion_id = #{conclusionId}
+        and is_deleted = 0 and is_pass = 0
     </select>
 </mapper>

+ 10 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertConclusionService.java

@@ -12,7 +12,7 @@ public interface IArchiveExpertConclusionService extends BaseService<ArchiveExpe
 
 
     //验收申请审批通过,创建当前报表基本信息
-    R saveBaseTableInfo(Long projectId,String appUrl);
+    R saveBaseTableInfo(Long projectId,String appUrl,Long taskId);
 
     Boolean getAppStatus(Long projectId);
 
@@ -20,9 +20,17 @@ public interface IArchiveExpertConclusionService extends BaseService<ArchiveExpe
 
     String getAppPreview(Long projectId);
 
-    String getTable(Long projectId);
+    ArchiveExpertConclusion getTable(Long projectId);
 
     Integer creatScore(Long projectId);
 
     void updateScore(Long projectId, Integer isSelect);
+
+    Boolean checkTable(Long projectId);
+
+    void submitTable(ArchiveExpertConclusion conclusion);
+
+    Boolean checkSubmit(Long projectId);
+
+    Long getCurrentId(Long projectId);
 }

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveExpertScoreService.java

@@ -10,7 +10,7 @@ import java.util.List;
 public interface IArchiveExpertScoreService extends BaseService<ArchiveExpertScore> {
 
     // 审批成功,保存基础评分信息
-    void saveBaseScoreInfo(Long projectId);
+    void saveBaseScoreInfo(Long projectId,Long conclusionId);
 
     List<ArchiveExpertScore> getItemByUnit(Long projectId, Integer unitType);
 }

+ 7 - 7
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchivesAutoService.java

@@ -70,7 +70,7 @@ public interface IArchivesAutoService extends BaseService<ArchivesAuto> {
 
 	void batchDestroyArchive(String ids);
 
-	void archiveAutoMethod(Long project,Long contractId,Long nodeId);
+	void archiveAutoMethod(Long project,Long contractId,Long nodeId,Long traceId);
 
 	void splitArchvies(Long project,Long contractId,Long nodeId);
 
@@ -84,7 +84,7 @@ public interface IArchivesAutoService extends BaseService<ArchivesAuto> {
 
 
 	//刷新某个项目的档号
-	void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce);
+	void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce, Long traceId);
 
 	void test();
 
@@ -92,7 +92,7 @@ public interface IArchivesAutoService extends BaseService<ArchivesAuto> {
 
 	void archiveAutoMethodThread(Long projectId, Long contractId, Long nodeId, Long traceId);
 
-	void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId);
+	void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId, Long traceId);
 
 	List<User> getArchiveDestroyUser(Long projectId);
 
@@ -130,17 +130,17 @@ public interface IArchivesAutoService extends BaseService<ArchivesAuto> {
 
 	Map<String,String> userInspectStats(Long projectId);
 
-	void updateInspectStatus(Long archiveId,Long projectId);
+	void updateInspectStatus(Long archiveId,Long projectId,Long conclusionId);
 
 	void saveInspect(ExpertInspection inspection);
 
-	IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId);
+	IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId, Long conclusionId);
 
-	IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId);
+	IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId,Long conclusionId);
 
     ProjectInspectStatVO projectInspectStat(Long projectId);
 
-	ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId);
+	ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId,Long conclusionId);
 
 
     ArchiveConclusion getArchiveConclusion(Long projectId);

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IExpertInspectionService.java

@@ -11,5 +11,5 @@ import java.util.List;
 public interface IExpertInspectionService extends BaseService<ExpertInspection> {
 
 
-    List<ExpertInspection> getListByFileId(Long fileId, Long projectId);
+    List<ExpertInspection> getListByFileId(Long fileId, Long projectId,Long conclusionId);
 }

+ 2 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/ITraceLogService.java

@@ -7,4 +7,6 @@ public interface ITraceLogService extends BaseService<TraceLog> {
     // Define methods specific to the TraceLog entity here
 
     void save(Long traceId, String format, Object... args);
+
+    void saveLog(Long traceId, String format, Object... args);
 }

+ 77 - 10
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertConclusionServiceImpl.java

@@ -11,8 +11,10 @@ import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
 import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
 import org.springblade.archive.service.IArchiveExpertConclusionService;
 import org.springblade.archive.service.IArchiveExpertScoreService;
+import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.ProjectInfo;
 import org.springblade.manager.feign.ProjectClient;
@@ -31,22 +33,32 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
 
     @Override
     @Transactional
-    public R saveBaseTableInfo(Long projectId, String appUrl) {
+    public R saveBaseTableInfo(Long projectId, String appUrl,Long taskId) {
+        //判断当前项目下是否存在抽检中的数据
+        long count = this.count(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
+                .eq(ArchiveExpertConclusion::getProjectId, projectId)
+                .eq(ArchiveExpertConclusion::getStatus, 1));
+        if (count > 0){
+            return R.fail("操作失败,上次验收还未完成");
+        }
         //保存表单基础信息
         ArchiveExpertConclusion conclusion = new ArchiveExpertConclusion();
+        Long id = SnowFlakeUtil.getId();
+        conclusion.setId(id);
         conclusion.setProjectId(projectId);
         conclusion.setAppUrl(appUrl);
         conclusion.setIsBuildScore(0);
         conclusion.setStatus(1);
-        conclusion.setApproveStatus(0);
+        conclusion.setTaskId(taskId);
         ProjectInfo info = projectClient.getById(projectId + "");
         if (info == null){
             return R.fail("获取项目信息失败");
         }
         conclusion.setTableTitle(info.getProjectName()+"项目档案验收报告");
+        conclusion.setGeneralSituation(info.getProjectGist());
         this.save(conclusion);
         //保存评分基础信息
-        scoreService.saveBaseScoreInfo(projectId);
+        scoreService.saveBaseScoreInfo(projectId,id);
         return R.data("保存成功");
     }
 
@@ -105,10 +117,10 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
     }
 
     /**
-     * 在线验收-查看验收报告
+     * 在线验收-获取结论
      */
     @Override
-    public String getTable(Long projectId) {
+    public ArchiveExpertConclusion getTable(Long projectId) {
         //获取最新的最新的一期验收
         ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
                 .eq(ArchiveExpertConclusion::getProjectId, projectId)
@@ -118,10 +130,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
         if (one == null){
             throw new ServiceException("暂无验收档案信息,请检查是否申请过验收");
         }
-        if (StringUtils.isBlank(one.getTableUrl())){
-            throw new ServiceException("当前在线验收还未生成报告");
-        }
-        return one.getTableUrl();
+        return one;
     }
 
     /**
@@ -153,10 +162,68 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
                 .last("limit 1"));
         //如果为空代表没有申请过,返回true
         if (one == null){
-            throw new ServiceException("当前没有申请验收信息,无法修改");
+            throw new ServiceException("当前项目没有申请验收信息,无法修改");
         }
         one.setIsBuildScore(isSelect);
         this.updateById(one);
     }
+
+    /**
+     * 在线验收-下一步编写报告,校验
+     */
+    @Override
+    public Boolean checkTable(Long projectId) {
+        //获取最新的最新的一期验收
+        ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
+                .eq(ArchiveExpertConclusion::getProjectId, projectId)
+                .orderByDesc(ArchiveExpertConclusion::getCreateTime)
+                .last("limit 1"));
+        //如果为空代表没有申请过,返回true
+        if (one == null){
+            throw new ServiceException("当前项目没有申请验收信息,无法编写报告");
+        }
+        return true;
+    }
+
+    /**
+     * 编写结论-确认提交
+     */
+    @Override
+    @Transactional
+    public void submitTable(ArchiveExpertConclusion conclusion) {
+        //保存数据
+        //查询出数据
+        //判断是否追加
+        //调用生成
+
+    }
+
+    @Override
+    public Boolean checkSubmit(Long projectId) {
+        //判断当前用户职位是否为专家组长,专家组长允许提交
+        String userRole = AuthUtil.getUserRole();
+        if ("专家组长".equals(userRole)){
+            return true;
+        }else {
+            return false;
+        }
+    }
+
+    /**
+     * 在线验收-获取当前期在线验收id
+     */
+    @Override
+    public Long getCurrentId(Long projectId) {
+        //获取最新的最新的一期验收
+        ArchiveExpertConclusion one = this.getOne(new LambdaUpdateWrapper<ArchiveExpertConclusion>()
+                .eq(ArchiveExpertConclusion::getProjectId, projectId)
+                .orderByDesc(ArchiveExpertConclusion::getCreateTime)
+                .last("limit 1"));
+        //如果为空代表没有申请过,返回true
+        if (one == null){
+            throw new ServiceException("当前项目没有申请验收信息,请联系管理员");
+        }
+        return one.getId();
+    }
 }
 

+ 10 - 5
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveExpertScoreServiceImpl.java

@@ -2,6 +2,7 @@ package org.springblade.archive.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.archive.entity.ArchiveExpertScore;
 import org.springblade.archive.entity.ExpertInspection;
 import org.springblade.archive.mapper.ArchiveExpertScoreMapper;
@@ -19,14 +20,14 @@ public class ArchiveExpertScoreServiceImpl extends BaseServiceImpl<ArchiveExpert
 
 
     @Override
-    public void saveBaseScoreInfo(Long projectId) {
+    public void saveBaseScoreInfo(Long projectId,Long conclusionId) {
         List<ArchiveExpertScore> list = new ArrayList<>();
         //业主
-        list.add(new ArchiveExpertScore(projectId,1,"业主评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,1,"业主评分项1",10,0,10,0));
         //监理
-        list.add(new ArchiveExpertScore(projectId,2,"监理评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,2,"监理评分项1",10,0,10,0));
         //施工
-        list.add(new ArchiveExpertScore(projectId,3,"施工评分项1",10,0,10,0));
+        list.add(new ArchiveExpertScore(projectId,conclusionId,3,"施工评分项1",10,0,10,0));
         this.saveBatch(list);
     }
 
@@ -35,9 +36,13 @@ public class ArchiveExpertScoreServiceImpl extends BaseServiceImpl<ArchiveExpert
      */
     @Override
     public List<ArchiveExpertScore> getItemByUnit(Long projectId, Integer unitType) {
+        //获取当前结论
+        ArchiveExpertConclusion conclusion = baseMapper.getConclusion(projectId);
+        
         List<ArchiveExpertScore> list = this.list(new LambdaQueryWrapper<ArchiveExpertScore>()
                 .eq(ArchiveExpertScore::getProjectId, projectId)
-                .eq(ArchiveExpertScore::getUnitType, unitType));
+                .eq(ArchiveExpertScore::getUnitType, unitType)
+                .eq(ArchiveExpertScore::getConclusionId,conclusion.getId()));
         return list;
     }
 }

+ 141 - 70
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -143,6 +143,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	private final NewIOSSClient newIOSSClient;
 
 	private final IArchiveExpertConclusionService expertConclusionService;
+	private final ITraceLogService iTraceLogService;
+
 	//表格高度
 	private static int high = 20;
 	//表格宽度
@@ -700,7 +702,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	}
 
 	@Override
-    public void archiveAutoMethod(Long projectId, Long contractId, Long nodeId) {
+    public void archiveAutoMethod(Long projectId, Long contractId, Long nodeId, Long traceId) {
         //步骤一:把档号集合初始化
         indexMap = new HashMap<>();
         //步list = {ArrayList@18238}  size = 19骤二:查询归档树节点。存在未归档文件的节点。
@@ -746,19 +748,19 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		Map<String,List<ArchiveFile>> boxMap = new LinkedHashMap<>();
 		Map<Long,String> boxFileMap = new LinkedHashMap<>();
 
-		archiveAutoMethod3(list3,boxMap,boxFileMap);//单独组卷
+		archiveAutoMethod3(list3,boxMap,boxFileMap,traceId);//单独组卷
 		//设置完成度30%
 		projectClient.updateIsArchivesAutoById(projectId,30);
-		archiveAutoMethod2(list2,projectId,boxMap,boxFileMap);//分类组卷
+		archiveAutoMethod2(list2,projectId,boxMap,boxFileMap,traceId);//分类组卷
 		//设置完成度50%
 		projectClient.updateIsArchivesAutoById(projectId,50);
-		archiveAutoMethod1(list1,boxMap,boxFileMap);//默认组卷
+		archiveAutoMethod1(list1,boxMap,boxFileMap,traceId);//默认组卷
 
 		//分盒组卷的且节点没配置组卷类型的
 		archiveAutoMethod0(list0,boxMap,boxFileMap);//默认组卷
 		//设置完成度70%
 		projectClient.updateIsArchivesAutoById(projectId,70);
-		archiveAutoMethodBox(boxMap);//分盒组卷
+		archiveAutoMethodBox(boxMap,traceId);//分盒组卷
 	}
 
 	private void addBoxMap(ArchiveFile file,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
@@ -1476,17 +1478,25 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * @param list
 	 * @param boxMap
 	 */
-	private void archiveAutoMethod3(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
+	private void archiveAutoMethod3(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap, Long traceId){
 		//步骤1:遍历节点集合
 		for(ArchiveTreeContract node:list){
 			//步骤2:查询节点下的未组卷文件
 			List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString());
+
 			//步骤3:遍历未归档文件
 			//待组卷文件集合
 			List<ArchiveFile> waitArchiveFiles = new ArrayList<>();
 			//待组卷文件总页数
 			int archivesSize=0;
 			if(archiveFiles!=null){
+
+				if (archiveFiles.size() > 0) {
+					String completeMsg = "[自动组卷] 单独组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
+					iTraceLogService.saveLog(traceId, completeMsg);
+					//log.info("[自动组卷]{}","单独组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size());
+				}
+
 				for(ArchiveFile file:archiveFiles){
 					//步骤4:断文件是否存在分盒设置
 					if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1){
@@ -1514,7 +1524,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * 分类并卷组卷  设置分类的节点下只有一个案卷,节点下的所有文件都组成这个案卷。如果设置分类节点(select=1的)多个,案卷归属排序第一个节点。
 	 */
 	private void archiveAutoMethod2(List<ArchiveTreeContract> list,Long projectId,
-									Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap){
+									Map<String,List<ArchiveFile>> boxMap,Map<Long,String> boxFileMap, Long traceId){
 
 		//分类并卷集合<groupId,List<文件>>
 		Map<Long,List<ArchiveFile>> archiveMap = new HashMap<>();
@@ -1530,6 +1540,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			//步骤3:遍历未归档文件
 			if(archiveFiles!=null){
 				for(ArchiveFile file:archiveFiles){
+
+					if (archiveFiles.size() > 0) {
+						String completeMsg = "[自动组卷] 分类组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
+						iTraceLogService.saveLog(traceId, completeMsg);
+					}
 					//步骤4:判断文件是否存在分盒设置
 					if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1){
 						//添加到分盒文件集合
@@ -1566,7 +1581,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * 默认组卷流程 文件可以跨节点组卷,受最高并卷节点限制范围,跨节点文件组卷时,案卷规格按照第一个文件所在的节点规格 组卷。
 	 */
 	private void archiveAutoMethod1(List<ArchiveTreeContract> list,Map<String,List<ArchiveFile>> boxMap,
-									Map<Long,String> boxFileMap){
+									Map<Long,String> boxFileMap, Long traceId){
 		//最高并卷节点
 		Long archiveAutoNodeId=null;
 
@@ -1616,6 +1631,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			//步骤3.3:遍历未组卷文件
 			int archiveFilesSize=0;
 			for(ArchiveFile file:archiveFiles){
+
+				if (archiveFiles.size() > 0) {
+					String completeMsg = "[自动组卷] 最高组卷:"+"-traceId:"+traceId + "节点:" + node.getNodeName() + " 文件数量:" + archiveFiles.size();
+					iTraceLogService.saveLog(traceId, completeMsg);
+				}
 				archiveFilesSize++;
 				//步骤3.4:判断文件是否存在分盒设置
 				if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1) {
@@ -1729,10 +1749,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * 分盒组卷流程
 	 * @param boxMap
 	 */
-	private void archiveAutoMethodBox(Map<String,List<ArchiveFile>> boxMap){
+	private void archiveAutoMethodBox(Map<String,List<ArchiveFile>> boxMap, Long traceId){
 		Set<Map.Entry<String, List<ArchiveFile>>> entries = boxMap.entrySet();
 		for (Map.Entry<String, List<ArchiveFile>> entry:entries){
 			//一个分盒一个案卷 归属第一个文件所在节点
+			String completeMsg = "[自动组卷] 分盒组卷:"+"-traceId:"+traceId + "box:" + entry.getKey() + " 文件数量:" + entry.getValue().size();
+			iTraceLogService.saveLog(traceId, completeMsg);
 			createArchiveBox(entry.getKey(),entry.getValue());
 		}
 	}
@@ -1742,7 +1764,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * @param ids
 	 * @return
 	 */
-	public List<ArchivesAuto> findArchivesAutosByIds(List<Long> ids) {
+	public List<ArchivesAuto> findArchivesAutosByIds(List<Long> ids,Long traceId) {
 		QueryWrapper<ArchivesAuto> queryWrapper = new QueryWrapper<>();
 		queryWrapper.in("node_id", ids)
 				.eq("is_deleted",0)
@@ -1768,11 +1790,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * @param contractId
 	 * @param nodeId
 	 */
-	public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce) {
+	public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce, Long traceId) {
 		List<ArchiveTreeContract> list = archiveTreeContractClient.getListByProjectId(projectId);
 		if (nodeId!= null) {
 			ArchiveTreeContract node = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
-			if (node!= null && node.getContractId() != null) {
+			if (node!= null && node.getContractId() != null && node.getContractId() != -1) {
 				contractId = node.getContractId();
 			}
 		}
@@ -1780,7 +1802,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		Integer indexType = 0;
 		ArchiveProjectConfig config = archiveProjectConfigService.getByProjectIdOrNew(projectId);
 
-		this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce,config.getIndexType(),config.getDirType(),config.getIndexNum());
+		this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce,config.getIndexType(),config.getDirType(),config.getIndexNum(),traceId);
 	}
 
 	/**
@@ -1790,7 +1812,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * @param nodeId
 	 */
 	public void refreshFileNumberNoSlipt(List<ArchiveTreeContract> archiveTreeContracts,Long contractId,Long nodeId,
-										 boolean bforce,Integer indexType, Integer dirType,Integer indexNum) {
+										 boolean bforce,Integer indexType, Integer dirType,Integer indexNum,Long traceId) {
 
 		List<ArchiveTreeContractVO2> subTreeList = new ArrayList<>();
 		List<List<ArchiveTreeContract>>  subGroupedList = new ArrayList<>();
@@ -1819,7 +1841,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			if(ids.size()==0){
 				continue;
 			}
-			List<ArchivesAuto> archivesAutos = findArchivesAutosByIds(ids);
+
+			for(ArchiveTreeContract node:subList){
+				String fileMessage = "[自动组卷] 刷新档号:节点名0 "+ subList.get(0).getNodeName()+ "-节点列表:"+node.getNodeName()+ "-traceId:"+traceId;
+				log.info(fileMessage);
+			}
+
+			List<ArchivesAuto> archivesAutos = findArchivesAutosByIds(ids,traceId);
 			if (archivesAutos == null || archivesAutos.size() == 0) {
 				continue;
 			}
@@ -1829,6 +1857,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 				node_fileNumberPrefixMap.put(node.getId().toString(),node.getFileNumberPrefix());
 			}
 
+			if (archivesAutos.size() > 0) {
+				String startLogMessage = "[自动组卷] 刷新档号:节点名0 "+ subList.get(0).getNodeName()+"-案卷0 :"+archivesAutos.get(0).getName()
+						+"-案卷数量:"+archivesAutos.size()+"-traceId:"+traceId;
+				iTraceLogService.saveLog(traceId, startLogMessage);
+			}
+
+
 			for (ArchivesAuto archivesAuto: archivesAutos) {
 				String nodeId1 = archivesAuto.getNodeId().toString();
 				String fileNumberPrefix ="";
@@ -1868,6 +1903,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 					}
 				}
 
+				String fileMessage = "[自动组卷] 刷新档号:"+archivesAuto.getName()+"-fileNumber:"+fileNumber+"-index:"+index+"-traceId:"+traceId;
+				log.info(fileMessage);
 				index++;
 			}
 		}
@@ -2328,74 +2365,99 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		return autoMapper.getCarrierTypeByDict();
 	}
 
+
+
 	@Override
 	public void archiveAutoMethodThread(Long projectId, Long contractId, Long nodeId, Long traceId) {
-		executorService.execute(()->{
-			try{
-				//将项目未锁定案卷拆卷
-				log.info("[自动组卷]{}","开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
+		executorService.execute(() -> {
+			try {
+				// 将项目未锁定案卷拆卷
+				String startSplitMsg = "[自动组卷] 开始对未锁定案卷拆卷。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.info(startSplitMsg);
+				iTraceLogService.saveLog(traceId, startSplitMsg);
 
-				//todo 有项目上传几百G文件,点组卷会产生大量费用,等改完文件下载走内网再打开此开关。
-//				if (true) {
-//					return;
-//				}
+				// TODO: 有项目上传几百G文件,点组卷会产生大量费用,等改完文件下载走内网再打开此开关。
+				// if (true) {
+				//     return;
+				// }
 
-				splitArchvies(projectId,contractId,nodeId);
-				//设置完成度10%
-				contractClient.updateIsArchivesAutoById(contractId,10);
+				splitArchvies(projectId, contractId, nodeId);
+				// 设置完成度10%
+				contractClient.updateIsArchivesAutoById(contractId, 10);
 
-				//项目自动组卷入口
-				log.info("[自动组卷]{}","开始自动组卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
-				archiveAutoMethod(projectId,contractId,nodeId);
-				//设置完成度80%
-				contractClient.updateIsArchivesAutoById(contractId,80);
+				// 项目自动组卷入口
+				String startAutoArchiveMsg = "[自动组卷] 开始自动组卷。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.info(startAutoArchiveMsg);
+				iTraceLogService.saveLog(traceId, startAutoArchiveMsg);
 
-				//刷新项目档号
-				log.info("[自动组卷]{}","开始刷新组卷档号。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
-				refreshFileNumberNoSlipt(projectId,contractId,nodeId,true);
+				archiveAutoMethod(projectId, contractId, nodeId, traceId);
+				// 设置完成度80%
+				contractClient.updateIsArchivesAutoById(contractId, 80);
 
+				// 刷新项目档号
+				String startRefreshMsg = "[自动组卷] 开始刷新组卷档号。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.info(startRefreshMsg);
+				iTraceLogService.saveLog(traceId, startRefreshMsg);
 
-				//设置自动组卷结束
-				contractClient.updateIsArchivesAutoById(contractId,0);
-				log.info("[自动组卷]{}","自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
-			}catch (Exception e){
+				refreshFileNumberNoSlipt(projectId, contractId, nodeId, true,traceId);
+
+				// 设置自动组卷结束
+				contractClient.updateIsArchivesAutoById(contractId, 0);
+				String completeMsg = "[自动组卷] 自动组卷完成。projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.info(completeMsg);
+				iTraceLogService.saveLog(traceId, completeMsg);
+
+			} catch (Exception e) {
 				e.printStackTrace();
-				log.error("[自动组卷] 报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
-				//设置自动组卷结束
+				String errorMsg = "[自动组卷] 报错。" + e.getMessage() + "--projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.error(errorMsg);
+				iTraceLogService.saveLog(traceId, errorMsg);
+
+				// 设置自动组卷结束
 				contractClient.updateIsArchivesAutoById(contractId, 0);
-			}finally {
+
+			} finally {
 				contractClient.updateIsArchivesAutoById(contractId, 0);
-				log.error("[自动组卷] 流程结束--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId);
+				String endMsg = "[自动组卷] 流程结束--projectId:" + projectId + "-contractId:" + contractId + "-nodeId:" + nodeId + "-traceId:" + traceId;
+				//log.error(endMsg);
+				iTraceLogService.saveLog(traceId, endMsg);
 			}
 		});
 	}
 
 
 	@Override
-	public void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId) {
+	public void refreshFileNumberThread(Long projectId, Long contractId, Long nodeId, Long traceId) {
 		executorService.execute(()->{
-			try{
-				//将项目未锁定案卷拆卷
-				log.info("[自动组卷]{}","开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
+			try {
+				// 将项目未锁定案卷拆卷
+				String startLogMessage = "[刷新档号] 开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
+				iTraceLogService.saveLog(traceId, startLogMessage);
 
-				//设置完成度10%
+				// 设置完成度10%
 				contractClient.updateIsArchivesAutoById(contractId,10);
 
-				//项目自动组卷入口
-				this.refreshFileNumberNoSlipt(projectId,contractId,null,false);
+				// 项目自动组卷入口
+				this.refreshFileNumberNoSlipt(projectId, contractId, null, false,traceId);
 
-				//设置自动组卷结束
+				// 设置自动组卷结束
 				contractClient.updateIsArchivesAutoById(contractId,0);
-				log.info("[自动组卷]{}","自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
-			}catch (Exception e){
+
+				String endLogMessage = "[刷新档号] 自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
+				iTraceLogService.saveLog(traceId, endLogMessage);
+
+			} catch (Exception e) {
 				e.printStackTrace();
-				log.error("自动组卷报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
-				//设置自动组卷结束
+				String errorLogMessage = "刷新档号报错。" + e.getMessage() + "--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId+"-traceId:"+traceId;
+				iTraceLogService.saveLog(traceId, errorLogMessage);
+
+				// 设置自动组卷结束
 				contractClient.updateIsArchivesAutoById(contractId, 0);
 			}
 		});
 	}
 
+
 	@Override
 	public List<User> getArchiveDestroyUser(Long projectId) {
 		return autoMapper.getArchiveDestroyUser(projectId);
@@ -2873,7 +2935,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			total += (int)Math.ceil(new Double(vo2.getName().length()+4) / 50);
 			//如果出现不相同,则合并之前的
 			document.add(dataTable);
-			if (total >= 35 && i !=  (vo2s.size()-1)) {
+			if (total >= 40 && i !=  (vo2s.size()-1)) {
 				total = 0;
 				document.newPage();
 				tableHeader(projectName,document,size10font,size17font,floats);
@@ -3033,11 +3095,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 */
 	@Override
 	@Transactional
-	public void updateInspectStatus(Long archiveId,Long projectId) {
+	public void updateInspectStatus(Long archiveId,Long projectId,Long conclusionId) {
 		//查看当前档案是否存在有意见的数据,存在则什么都不修改,不存在则修改已抽检,合格
 		long count2 = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
 				.eq(ExpertInspection::getIsPass, 0)
-				.eq(ExpertInspection::getArchiveId, archiveId));
+				.eq(ExpertInspection::getArchiveId, archiveId)
+				.eq(ExpertInspection::getConclusionId,conclusionId));
 		//修改档案抽检状态
 		if (count2 == 0) {
 			this.update(new LambdaUpdateWrapper<ArchivesAuto>()
@@ -3049,7 +3112,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		Long userId = AuthUtil.getUserId();
 		long count = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
 						.eq(ExpertInspection::getExpertId, userId)
-						.eq(ExpertInspection::getArchiveId, archiveId));
+						.eq(ExpertInspection::getArchiveId, archiveId)
+						.eq(ExpertInspection::getConclusionId,conclusionId));
 		if (count == 0){
 			String userName = AuthUtil.getNickName();
 			//获取档案信息,如果状态未未查阅则修改
@@ -3070,6 +3134,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			inspection.setUnitType(unitType);
 			inspection.setArchiveId(archiveId);
 			inspection.setArchiveName(archive.getName());
+			inspection.setConclusionId(conclusionId);
 			inspectionService.save(inspection);
 		}
 
@@ -3117,18 +3182,21 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			ExpertInspection one = inspectionService.getOne(new LambdaQueryWrapper<ExpertInspection>()
 					.eq(ExpertInspection::getExpertId, userId)
 					.eq(ExpertInspection::getArchiveId, archive.getId())
-					.eq(ExpertInspection::getIsPass, 1));
+					.eq(ExpertInspection::getIsPass, 1)
+					.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 			if (one == null) {
 				//先删除当前专家对当前案卷当前文件的意见
 				inspectionService.remove(new LambdaQueryWrapper<ExpertInspection>()
 						.eq(ExpertInspection::getExpertId, userId)
 						.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
-						.eq(ExpertInspection::getFileId, inspection.getFileId()));
+						.eq(ExpertInspection::getFileId, inspection.getFileId())
+						.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 				//判断当前档案是否存在其他意见,有则直接跳过
 				long count3 = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
 						.eq(ExpertInspection::getExpertId, userId)
 						.eq(ExpertInspection::getArchiveId, archive.getId())
-						.eq(ExpertInspection::getIsPass, 0));
+						.eq(ExpertInspection::getIsPass, 0)
+						.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 				if (count3 == 0) {
 					//没有就直接保存合格
 					inspection.setFileId(null);
@@ -3141,12 +3209,14 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			inspectionService.remove(new LambdaQueryWrapper<ExpertInspection>()
 					.eq(ExpertInspection::getExpertId, userId)
 					.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
-					.eq(ExpertInspection::getIsPass, 1));
+					.eq(ExpertInspection::getIsPass, 1)
+					.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 			//再去查看意见表是否存在对当前档案当前文件的意见
 			ExpertInspection one = inspectionService.getOne(new LambdaQueryWrapper<ExpertInspection>()
 					.eq(ExpertInspection::getExpertId, userId)
 					.eq(ExpertInspection::getArchiveId, inspection.getArchiveId())
-					.eq(ExpertInspection::getFileId, inspection.getFileId()));
+					.eq(ExpertInspection::getFileId, inspection.getFileId())
+					.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 			//如果不存在数据,然后保存
 			if (one == null) {
 				inspectionService.save(inspection);
@@ -3160,7 +3230,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		//查询当前档案的所有不合格专家意见
 		long count = inspectionService.count(new LambdaQueryWrapper<ExpertInspection>()
 				.eq(ExpertInspection::getArchiveId, archive.getId())
-				.eq(ExpertInspection::getIsPass, 0));
+				.eq(ExpertInspection::getIsPass, 0)
+				.eq(ExpertInspection::getConclusionId, inspection.getConclusionId()));
 		if (count > 0){
 			//如果有则修改档案不合格
 			archive.setUpdateStatus(1);
@@ -3175,17 +3246,17 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * 在线验收-抽检记录
 	 */
 	@Override
-	public IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId) {
+	public IPage<ExpertInspectionVO> getUserInspectInfo(Query query, Long projectId, Long conclusionId) {
 		Long userId = AuthUtil.getUserId();
 		IPage<ExpertInspectionVO> page = new Page<>(query.getCurrent(),query.getSize());
-		return baseMapper.getUserInspectInfo(page,projectId,userId);
+		return baseMapper.getUserInspectInfo(page,projectId,userId,conclusionId);
 	}
 
 	/**
 	 * 在线验收-抽检记录-汇总
 	 */
 	@Override
-	public IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId) {
+	public IPage<ExpertInspectionVO> getUserInspectInfo2(Query query, Long projectId,Long conclusionId) {
 		Long userId = AuthUtil.getUserId();
 		//判断当前用户职位是否为专家组长,专家组长查看所有
 		String userRole = AuthUtil.getUserRole();
@@ -3193,7 +3264,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			userId = null;
 		}
 		IPage<ExpertInspectionVO> page = new Page<>(query.getCurrent(),query.getSize());
-		return baseMapper.getUserInspectInfo(page,projectId,userId);
+		return baseMapper.getUserInspectInfo(page,projectId,userId,conclusionId);
 	}
 
 	/**
@@ -3298,12 +3369,12 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 	 * 在线验收-获取档案文件抽检意见
 	 */
 	@Override
-	public ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId) {
+	public ExpertInspectionVO getArchiveFileOpinion(Long fileId, Long projectId,Long conclusionId) {
 		Long userId = AuthUtil.getUserId();
 		String userName = AuthUtil.getNickName();
 		ExpertInspectionVO vo = new ExpertInspectionVO();
 		//获取意见表里当前文件相关意见
-		List<ExpertInspection> list = inspectionService.getListByFileId(fileId,projectId);
+		List<ExpertInspection> list = inspectionService.getListByFileId(fileId,projectId,conclusionId);
 		if (list != null && list.size() > 0){
 			StringBuilder str = new StringBuilder();
 			for (ExpertInspection inspection : list) {

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

@@ -15,8 +15,8 @@ public class ExpertInspectionServiceImpl extends BaseServiceImpl<ExpertInspectio
 
 
     @Override
-    public List<ExpertInspection> getListByFileId(Long fileId, Long projectId) {
-        return baseMapper.getListByFileId(fileId,projectId);
+    public List<ExpertInspection> getListByFileId(Long fileId, Long projectId,Long conclusionId) {
+        return baseMapper.getListByFileId(fileId,projectId,conclusionId);
     }
 }
 

+ 29 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/TraceLogServiceImpl.java

@@ -1,11 +1,13 @@
 package org.springblade.archive.service.impl;
 
+import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.archive.entity.TraceLog;
 import org.springblade.archive.mapper.TraceLogMapper;
 import org.springblade.archive.service.ITraceLogService;
 import org.springframework.stereotype.Service;
 
+@Slf4j
 @Service
 public class TraceLogServiceImpl extends BaseServiceImpl<TraceLogMapper, TraceLog> implements ITraceLogService {
     // Implementations of methods defined in ITraceLogService
@@ -40,4 +42,31 @@ public class TraceLogServiceImpl extends BaseServiceImpl<TraceLogMapper, TraceLo
         }
     }
 
+    @Override
+    public void saveLog(Long traceId, String format, Object... args) {
+        try {
+            // 使用String.format来格式化字符串
+            String content = String.format(format, args);
+
+            // 截取content,确保长度不超过400字符
+            if (content.length() > 400) {
+                content = content.substring(0, 400);
+            }
+
+            log.info(content);
+
+            // 创建TraceLog对象
+            TraceLog traceLog = new TraceLog();
+            traceLog.setTraceId(traceId);
+            traceLog.setContent(content);
+            save(traceLog);
+
+        } catch (Exception e) {
+            // 异常处理逻辑,比如打印日志
+            System.err.println("Error saving trace log: " + e.getMessage());
+        }
+    }
+
+
+
 }

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

@@ -1881,7 +1881,7 @@ public class InformationWriteQueryController extends BladeController {
                     if (parent == null) {
                         parent = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(wtc.getParentId(), Long.parseLong(wtc.getContractId()));
                     }
-                    /*节点公式*/
+                    /*凡是关联了节点参数公式的元素都不复制数据*/
                     List<Map<String, Object>> paramKey = this.jdbcTemplate.queryForList("select DISTINCT b.e_key ek from m_table_info a  join m_wbs_form_element b on a.id=b.f_id  join m_element_formula_mapping c on b.id = c.element_id where a.tab_en_name='" + tableName + "' and b.is_deleted=0 and c.scope=35 ");
                     if (paramKey.size() > 0) {
                         map.putAll(paramKey.stream().map(m -> m.get("ek").toString()).collect(Collectors.toMap(s -> s, s -> StringPool.NULL)));
@@ -1937,13 +1937,6 @@ public class InformationWriteQueryController extends BladeController {
                         List<String[]> la = Arrays.stream(value.toString().split("☆")).map(s -> s.split("_\\^_")).collect(Collectors.toList());
                         /*全部为一个数的时候不用修改*/
                         if (la.stream().map(a -> a[0]).collect(Collectors.toSet()).size() > 1 || la.size() == 1) {
-/*                            return la.stream().map(a -> {
-                                String v = a[0];
-                                RangeJson best = rjs.stream().min(Comparator.comparingDouble(j -> Double.parseDouble(v) - Double.parseDouble(j.getDesign()))).orElse(rjs.get(0));
-                                int scale = Math.max(new StringBuilder(v).reverse().indexOf("."), 0);
-                                String sv = BaseUtils.rangeList(1, best.getDesign(), best.getDev(), 1, scale, 1).get(0).toString();
-                                return sv + "_^_" + a[1];
-                            }).collect(Collectors.joining());*/
                             List<String> result = new ArrayList<>();
                             for (String[] a : la) {
                                 String v = a[0];

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

@@ -706,9 +706,12 @@ public class TaskController extends BladeController {
                                     }
                                 }
                                 //创建报表基本信息,报表中会自动创建评分基础信息
-                                R r = conclusionClient.saveBaseTableInfo(Long.parseLong(task.getProjectId()), task.getAttachmentPdfUrl());
-                                if (r == null || !"保存成功".equals(r.getData())){
-                                    throw new ServiceException("保存报表基本信息失败");
+                                R r = conclusionClient.saveBaseTableInfo(Long.parseLong(task.getProjectId()), task.getAttachmentPdfUrl(),task.getId());
+                                if (r == null ){
+                                    throw new ServiceException("调用档案服务失败");
+                                }
+                                if (!"保存成功".equals(r.getData())){
+                                    throw new ServiceException(r.getMsg());
                                 }
                             }
                             return R.data(true);

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

@@ -502,8 +502,8 @@ public class ArchiveTreeContractController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "projectId", value = "项目id")
     })
-    public R<Boolean> startInspect(@RequestParam Long projectId) {
-        return R.data(archiveTreeContractService.startInspect(projectId));
+    public R<Boolean> startInspect(@RequestParam Long projectId,@RequestParam Integer type) {
+        return R.data(archiveTreeContractService.startInspect(projectId,type));
     }
 
 

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

@@ -19,6 +19,7 @@ package org.springblade.manager.mapper;
 
 import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.manager.entity.ArchiveTreeContract;
@@ -128,4 +129,6 @@ public interface ArchiveTreeContractMapper extends BaseMapper<ArchiveTreeContrac
     List<ArchiveTreeContract> getSelectNodes(@Param("ids") List<Long> longs);
 
     List<MyInspectTreeVO> MyLazyTree(@Param("parentId") Long parentId,@Param("projectId") Long projectId,@Param("userId") Long userId);
+
+    ArchiveExpertConclusion getNewTable(@Param("projectId") Long projectId);
 }

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

@@ -607,6 +607,12 @@
         and FIND_IN_SET(#{userId},d.expert_id)
         ORDER BY d.sort
     </select>
+    <select id="getNewTable" resultType="org.springblade.archive.entity.ArchiveExpertConclusion">
+        select * from u_archive_expert_conclusion
+        WHERE is_deleted = 0 and project_id = #{projectId}
+        order by create_time DESC
+        limit 1
+    </select>
 
 
     <update id="updateAllSonNodeIdsForArchiveAutoRule">

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

@@ -131,5 +131,5 @@ public interface IArchiveTreeContractService extends BaseService<ArchiveTreeCont
 
     List<MyInspectTreeVO> lazyTree(Long parentId, Long projectId);
 
-    Boolean startInspect(Long projectId);
+    Boolean startInspect(Long projectId,Integer type);
 }

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

@@ -22,7 +22,9 @@ import com.mixsmart.utils.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
 import lombok.AllArgsConstructor;
+import org.springblade.archive.entity.ArchiveExpertConclusion;
 import org.springblade.archive.feign.ArchiveAutoClient;
+import org.springblade.archive.vo.UpdateExpertVO;
 import org.springblade.business.feign.ArchiveFileClient;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.BladeUser;
@@ -1464,7 +1466,10 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 		//保存所有节点
 		this.updateBatchById(list);
 		//修改节点下所有档案,并保存
-		R<Boolean> booleanR = archiveAutoClient.batchUpdateExpertId(userId, longs);
+		UpdateExpertVO vo = new UpdateExpertVO();
+		vo.setUserid(userId);
+		vo.setIds(ids);
+		R<Boolean> booleanR = archiveAutoClient.batchUpdateExpertId(vo);
 		if (booleanR.getData() == null || booleanR.getData() != true){
 			throw new ServiceException("为档案绑定专家失败");
 		}
@@ -1503,7 +1508,7 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 	 * 在线验收-开始抽检
 	 */
 	@Override
-	public Boolean startInspect(Long projectId) {
+	public Boolean startInspect(Long projectId,Integer type) {
 		//获取当前项目首节点
 		ArchiveTreeContract one = this.getOne(new LambdaQueryWrapper<ArchiveTreeContract>()
 				.eq(ArchiveTreeContract::getProjectId, projectId)
@@ -1511,19 +1516,30 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 		if (one == null){
 			throw new ServiceException("未找到当前项目首节点");
 		}
+
+		//获取项目最新的一条结论,如果不存在则提示
+		ArchiveExpertConclusion conclusion = baseMapper.getNewTable(projectId);
+		if (conclusion == null){
+			throw new ServiceException("当前项目还未申请在线验收");
+		}
+
 		BladeUser user = AuthUtil.getUser();
 		String roleId = user.getRoleId();
 		//判断当前用户是否为专家
-		if (roleId.contains("1656191696348082177") || roleId.contains("1656191770880864257")){
-			//判断是否存在当前专家id
-			if (StringUtil.isNotBlank(one.getExpertId()) && one.getExpertId().contains(user.getUserId()+"")){
-				return false;
-			}else {
-				return true;
-			}
-		}else {
+		if (!"1656191696348082177,1656191770880864257".contains(roleId)){
 			throw new ServiceException("当前用户不是专家,不能抽检");
 		}
+		//判断当前结论的状态是否已经完成
+		if (type ==  1){
+			if (conclusion.getStatus() == 2){
+				throw new ServiceException("当前抽检已经生成结论,请直接点击编辑结论");
+			}
+		}
+		//判断是否存在当前专家id
+		if (StringUtil.isNotBlank(one.getExpertId()) && one.getExpertId().contains(user.getUserId()+"")){
+			return false;
+		}
+		return true;
 
 	}
 

+ 4 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -793,13 +793,14 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             if (CollectionUtil.isNotEmpty(simple)) {
                 for(FormData fd:simple){
                     if(!tec.force&&fd.executable()&&fd.getFormula().getFormula().contains(WP)){
-                        /*节点公式已经生成过就自动填充,无需再计算*/
+                        /*非强制刷新模式下,节点参数公式已经生成过就自动填充且不会覆盖已经存在的内容,无需再计算*/
                        Optional<Object> op= fd.getValues().stream().map(ElementData::getValue).filter(Func::isNotEmpty).findAny();
                        if(op.isPresent()) {
                            for(ElementData ed:fd.getValues()){
-                               ed.setValue(op.get());
+                               if(ed.isEmpty()) {
+                                   ed.setValue(op.get());
+                               }
                            }
-                           fd.getFormula().setOutm(1);
                            fd.setFinished(true);
                            fd.setUpdate(1);
                        }