|
@@ -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;
|
|
|
}
|