xiatian 1 rok pred
rodič
commit
4a1f00db87

+ 4 - 0
file/说明.txt

@@ -8,8 +8,12 @@ question-import.xlsx为小题导入文件,student-import.xlsx为考生导入
 文件名皆不可修改。
 
 配置文件可修改内容:
+	com.qmth.llm.server:评分接口调用地址 示例 https://solar.qmth.com.cn
+	com.qmth.ocr.server:ocr接口调用地址 示例 https://solar.qmth.com.cn
 	com.qmth.solar.access-key:授权秘钥
 	com.qmth.solar.access-secret:授权秘钥
+	am.ocr-task.enable:是否开启ocr任务true/false
+	am.marking-task.enable:是否开启评分任务true/false
 	am.data-type:数据来源类型,可填MARKING_CLOUD | TEACH_CLOUD,分别对应云阅卷、知学知考。
 	am.image-server:图片文件访问域名 示例:https://file.markingcloud.com
 	am.data-dir:excel导入文件读取目录。示例./data

+ 22 - 0
src/main/java/cn/com/qmth/am/config/SysProperty.java

@@ -14,6 +14,12 @@ public class SysProperty {
     @Value("${am.data-dir}")
     private String dataDir;
 
+    @Value("${am.ocr-task.enable}")
+    private Boolean ocrTaskEnable;
+    
+    @Value("${am.marking-task.enable}")
+    private Boolean markingTaskEnable;
+    
     @Value("${am.image-server}")
     private String imageServer;
 
@@ -51,5 +57,21 @@ public class SysProperty {
 	public void setDataDir(String dataDir) {
 		this.dataDir = dataDir;
 	}
+
+	public Boolean getOcrTaskEnable() {
+		return ocrTaskEnable;
+	}
+
+	public void setOcrTaskEnable(Boolean ocrTaskEnable) {
+		this.ocrTaskEnable = ocrTaskEnable;
+	}
+
+	public Boolean getMarkingTaskEnable() {
+		return markingTaskEnable;
+	}
+
+	public void setMarkingTaskEnable(Boolean markingTaskEnable) {
+		this.markingTaskEnable = markingTaskEnable;
+	}
 	
 }

+ 7 - 1
src/main/java/cn/com/qmth/am/task/AiMarkingJob.java

@@ -9,20 +9,26 @@ import org.springframework.stereotype.Service;
 
 import com.qmth.boot.core.concurrent.service.ConcurrentService;
 
+import cn.com.qmth.am.config.SysProperty;
 import cn.com.qmth.am.entity.StudentScoreEntity;
 import cn.com.qmth.am.enums.LockType;
 import cn.com.qmth.am.service.StudentScoreService;
 
 @Service
 public class AiMarkingJob {
-	public static Boolean enable=true;
+	public static Boolean enable=null;
 	@Autowired
 	private StudentScoreService studentScoreService;
 	@Autowired
 	private ConcurrentService concurrentService;
+	@Autowired
+	private SysProperty sysProperty;
 
 	@Scheduled(fixedDelay = 5 * 1000, initialDelay = 20 * 1000)
 	public void doJob() {
+		if(enable==null) {
+			enable=sysProperty.getMarkingTaskEnable();
+		}
 		if(!enable) {
 			return;
 		}

+ 7 - 2
src/main/java/cn/com/qmth/am/task/BuildImageJob.java

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import com.qmth.boot.core.concurrent.service.ConcurrentService;
 
+import cn.com.qmth.am.config.SysProperty;
 import cn.com.qmth.am.consumer.BuildImageConsumer;
 import cn.com.qmth.am.entity.QuestionEntity;
 import cn.com.qmth.am.entity.StudentEntity;
@@ -25,14 +26,15 @@ import cn.com.qmth.am.utils.SpringContextHolder;
 
 @Service
 public class BuildImageJob {
-	public static Boolean enable=true;
+	public static Boolean enable=null;
 	@Autowired
 	private StudentService studentService;
 	@Autowired
 	private QuestionService questionService;
 	@Autowired
 	private ConcurrentService concurrentService;
-
+	@Autowired
+	private SysProperty sysProperty;
 	private static ExecutorService executor;
 
 	static {
@@ -55,6 +57,9 @@ public class BuildImageJob {
 
 	@Scheduled(fixedDelay = 5 * 1000, initialDelay = 20 * 1000)
 	public void doJob() {
+		if(enable==null) {
+			enable=sysProperty.getOcrTaskEnable();
+		}
 		if(!enable) {
 			return;
 		}

+ 2 - 0
src/main/resources/application.properties

@@ -37,6 +37,8 @@ com.qmth.ocr.server=https://solar.qmth.com.cn
 com.qmth.solar.access-key=7bbdc11570bc474dbf50e0d4a5dff328
 com.qmth.solar.access-secret=IOodRvbp2LspJTHOScgB7Yx8MRloMpyl
 
+am.ocr-task.enable=false
+am.marking-task.enable=false
 am.data-type=MARKING_CLOUD
 am.image-server=https://file.markingcloud.com
 am.data-dir=./data