ソースを参照

Merge branch 'lk20230428'

luok 2 年 前
コミット
63e6121e60

+ 4 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ProjectInfo.java

@@ -150,5 +150,8 @@ public class ProjectInfo extends BaseEntity {
     @ApiModelProperty(value = "电签类型 '1'安签 '2'东方中讯")
     private Integer remarkType;
 
-
+    /**
+     * 是否正在自动组卷中  0否  1是
+     */
+    private Integer isArchivesAuto;
 }

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

@@ -30,4 +30,10 @@ public interface ProjectClient {
     @GetMapping(API_PREFIX + "/getById")
     ProjectInfo getById(@RequestParam String key);
 
+    /**
+     * 根据项目ID更新自动归档状态
+     */
+    @GetMapping(API_PREFIX + "/updateIsArchivesAutoById")
+    void updateIsArchivesAutoById(@RequestParam Long id,@RequestParam Integer isArchivesAuto);
+
 }

+ 18 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchivesAutoController.java

@@ -32,7 +32,9 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springblade.manager.entity.ProjectInfo;
 import org.springblade.manager.feign.ArchiveTreeContractClient;
+import org.springblade.manager.feign.ProjectClient;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -63,7 +65,7 @@ public class ArchivesAutoController extends BladeController {
 
 	private final IArchiveAutoPdfService archiveAutoPdfService;
 	private final ArchiveTreeContractClient archiveTreeContractClient;
-
+	private ProjectClient projectClient;
 	/**
 	 * 详情
 	 */
@@ -320,9 +322,23 @@ public class ArchivesAutoController extends BladeController {
 	 */
 	@PostMapping("/archiveAutoMethod")
 	public R archiveAutoMethod(Long projectId) {
+		//先验证当前项目是否在自动组卷中,组卷中直接返回
+		ProjectInfo projectInfo = projectClient.getById(String.valueOf(projectId));
+		Integer isArchivesAuto = projectInfo.getIsArchivesAuto();
+		if(isArchivesAuto!=null && isArchivesAuto==1){
+			return R.fail("当前项目已经在自动组卷中");
+		}
+		//设置自动组卷中
+		projectClient.updateIsArchivesAutoById(projectId,1);
+
+		//将项目未锁定案卷拆卷
 		archivesAutoService.splitArchvies(projectId);
+		//项目自动组卷入口
 		archivesAutoService.archiveAutoMethod(projectId);
-		return R.data("");
+
+		//设置自动组卷结束
+		projectClient.updateIsArchivesAutoById(projectId,0);
+		return R.data("自动组卷结束");
 	}
 
 	/**

+ 7 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ProjectClientImpl.java

@@ -26,4 +26,11 @@ public class ProjectClientImpl implements ProjectClient {
     public ProjectInfo getById(String key) {
         return projectInfoService.getById(key);
     }
+
+    @Override
+    public void updateIsArchivesAutoById(Long id,Integer isArchivesAuto) {
+        ProjectInfo projectInfo = projectInfoService.getById(id);
+        projectInfo.setIsArchivesAuto(isArchivesAuto);
+        projectInfoService.updateById(projectInfo);
+    }
 }