|
@@ -15,6 +15,7 @@ import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.enums.GradeAnalyzePaperStatusEnum;
|
|
|
+import com.qmth.teachcloud.common.enums.TaskResultEnum;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.slf4j.Logger;
|
|
@@ -97,12 +98,11 @@ public class NotifyApiController {
|
|
|
|
|
|
if (Objects.isNull(gradeBatch.getNotifyTime()) ||
|
|
|
(Objects.nonNull(gradeBatch.getNotifyTime())
|
|
|
- && gradeBatch.getNotifyTime().longValue() >= calculateNotifyResult.getTime().longValue())) {
|
|
|
- if (Objects.nonNull(calculateNotifyResult.getStatus())) {
|
|
|
- gradeBatch.setStatus(GradeAnalyzePaperStatusEnum.valueOf(calculateNotifyResult.getStatus()));
|
|
|
- }
|
|
|
+ && gradeBatch.getNotifyTime().longValue() <= calculateNotifyResult.getTime().longValue())) {
|
|
|
+ gradeBatch.setStatus(Objects.nonNull(calculateNotifyResult.getStatus()) ? GradeAnalyzePaperStatusEnum.valueOf(calculateNotifyResult.getStatus()) : null);
|
|
|
gradeBatch.setProgress(calculateNotifyResult.getProgress());
|
|
|
gradeBatch.setNotifyTime(System.currentTimeMillis());
|
|
|
+ gradeBatch.setResult(Objects.nonNull(calculateNotifyResult.getResult()) ? TaskResultEnum.valueOf(calculateNotifyResult.getResult()) : null);
|
|
|
gradeBatchService.updateById(gradeBatch);
|
|
|
|
|
|
QueryWrapper<GradeBatchPaper> gradeBatchPaperQueryWrapper = new QueryWrapper<>();
|
|
@@ -115,9 +115,11 @@ public class NotifyApiController {
|
|
|
GradeBatchPaper gradeBatchPaper = gradeBatchPaperService.getOne(gradeBatchPaperQueryWrapper);
|
|
|
Optional.ofNullable(gradeBatchPaper).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("批次科目[" + k + "]数据为空"));
|
|
|
|
|
|
- gradeBatchPaper.setStatus(v);
|
|
|
- gradeBatchPaper.setUpdateTime(System.currentTimeMillis());
|
|
|
- gradeBatchPaperList.add(gradeBatchPaper);
|
|
|
+ if (Objects.isNull(gradeBatchPaper.getStatus()) || (Objects.nonNull(gradeBatchPaper.getStatus()) && gradeBatchPaper.getStatus() != v)) {
|
|
|
+ gradeBatchPaper.setStatus(v);
|
|
|
+ gradeBatchPaper.setUpdateTime(System.currentTimeMillis());
|
|
|
+ gradeBatchPaperList.add(gradeBatchPaper);
|
|
|
+ }
|
|
|
});
|
|
|
gradeBatchPaperService.updateBatchById(gradeBatchPaperList);
|
|
|
}
|