|
@@ -35,27 +35,32 @@ public class ExamJobTimerTaskRunner implements CommonTimerTaskRunner {
|
|
|
@Override
|
|
@Override
|
|
|
public void action(String jobId) {
|
|
public void action(String jobId) {
|
|
|
log.info("ExamJobTimerTaskRunner jobId:{} RUN...",jobId);
|
|
log.info("ExamJobTimerTaskRunner jobId:{} RUN...",jobId);
|
|
|
- if(jobId != null && !jobId.isEmpty()){
|
|
|
|
|
- JSONObject jb = devJobApi.queryEntity(jobId);
|
|
|
|
|
- if(jb != null && jb.getIntValue("code") == 200){
|
|
|
|
|
- String category = jb.getString("category");
|
|
|
|
|
- JSONObject extJson = jb.getJSONObject("extJson");
|
|
|
|
|
- log.info("ExamJobTimerTaskRunner jobId:{} category:{} extJson:{}",jobId,category,extJson);
|
|
|
|
|
- TExam taskExam = texamMapper.selectById(extJson.getString("id"));
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ if(jobId != null && !jobId.isEmpty()){
|
|
|
|
|
+ JSONObject jb = devJobApi.queryEntity(jobId);
|
|
|
|
|
+ if(jb != null && jb.getIntValue("code") == 200){
|
|
|
|
|
+ String category = jb.getString("category");
|
|
|
|
|
+ JSONObject extJson = jb.getJSONObject("extJson");
|
|
|
|
|
+ log.info("ExamJobTimerTaskRunner jobId:{} category:{} extJson:{}",jobId,category,extJson);
|
|
|
|
|
+ TExam taskExam = texamMapper.selectById(extJson.getString("id"));
|
|
|
|
|
|
|
|
- if(category.contains("start")){
|
|
|
|
|
- taskExam.setExamStatus(1);
|
|
|
|
|
- texamMapper.updateById(taskExam);
|
|
|
|
|
- }
|
|
|
|
|
- if(category.contains("end")){
|
|
|
|
|
- taskExam.setExamStatus(2);
|
|
|
|
|
- texamMapper.updateById(taskExam);
|
|
|
|
|
|
|
+ if(category.contains("start")){
|
|
|
|
|
+ taskExam.setExamStatus(1);
|
|
|
|
|
+ texamMapper.updateById(taskExam);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(category.contains("end")){
|
|
|
|
|
+ taskExam.setExamStatus(2);
|
|
|
|
|
+ texamMapper.updateById(taskExam);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ log.error("ExamJobTimerTaskRunner jobId:{} Query Error", jobId);
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
- log.error("ExamJobTimerTaskRunner jobId:{} Query Error", jobId);
|
|
|
|
|
|
|
+ log.error("ExamJobTimerTaskRunner jobId IS Empty");
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- log.error("ExamJobTimerTaskRunner jobId IS Empty");
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("ExamJobTimerTaskRunner Error:{}", e);
|
|
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|