|
@@ -16,6 +16,7 @@ import com.qmth.teachcloud.common.bean.dto.stmms.GroupDetailDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.PicConfig;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.PicConfig;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionBaseDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionBaseDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionDTO;
|
|
|
|
+import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
@@ -86,6 +87,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ DictionaryConfig dictionaryConfig;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 定时任务批量同步
|
|
* 定时任务批量同步
|
|
*/
|
|
*/
|
|
@@ -207,8 +211,8 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
String objectiveStructure = examPaperStructure.getObjectiveStructure();
|
|
String objectiveStructure = examPaperStructure.getObjectiveStructure();
|
|
if (StringUtils.isNotBlank(objectiveStructure)) {
|
|
if (StringUtils.isNotBlank(objectiveStructure)) {
|
|
List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
|
|
List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
|
|
- long count = objectiveJsons.stream().filter(m->m.containsKey("answer")).count();
|
|
|
|
- if(objectiveJsons.size() == 0 || count == 0) {
|
|
|
|
|
|
+ long count = objectiveJsons.stream().filter(m -> m.containsKey("answer")).count();
|
|
|
|
+ if (objectiveJsons.size() == 0 || count == 0) {
|
|
List<QuestionDTO> syncObjectiveStructureDatas = new ArrayList<>();
|
|
List<QuestionDTO> syncObjectiveStructureDatas = new ArrayList<>();
|
|
cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
|
|
cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
|
|
}
|
|
}
|
|
@@ -514,8 +518,10 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw ExceptionResultEnum.ERROR.exception(e.getMessage());
|
|
throw ExceptionResultEnum.ERROR.exception(e.getMessage());
|
|
} finally {
|
|
} finally {
|
|
- if (file != null && file.exists()) {
|
|
|
|
- file.delete();
|
|
|
|
|
|
+ if (Objects.nonNull(dictionaryConfig.sysDomain()) && dictionaryConfig.sysDomain().isOss()) {
|
|
|
|
+ if (file != null && file.exists()) {
|
|
|
|
+ file.delete();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|