|
@@ -9,7 +9,6 @@ import com.qmth.distributed.print.business.bean.result.TSyncExamStudentScoreResu
|
|
|
import com.qmth.distributed.print.business.entity.TSyncExamStudentScore;
|
|
|
import com.qmth.distributed.print.business.enums.ImageTrajectoryEnum;
|
|
|
import com.qmth.distributed.print.business.mapper.TSyncExamStudentScoreMapper;
|
|
|
-import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
|
import com.qmth.distributed.print.business.service.TSyncExamStudentScoreService;
|
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
@@ -115,10 +114,11 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
*
|
|
|
* @param tSyncExamStudentScore
|
|
|
* @param imageTrajectoryEnum
|
|
|
+ * @param b
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public TSyncExamStudentScore createImageTrajectory(TSyncExamStudentScore tSyncExamStudentScore, ImageTrajectoryEnum imageTrajectoryEnum) {
|
|
|
+ public TSyncExamStudentScore createImageTrajectory(TSyncExamStudentScore tSyncExamStudentScore, ImageTrajectoryEnum imageTrajectoryEnum, boolean needSync) {
|
|
|
List<File> fileSourceList = new ArrayList<>(), fileTargetList = new ArrayList<>();
|
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
|
try {
|
|
@@ -130,7 +130,7 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
|
|
|
String hostUrl = SystemConstant.getLocalFileHost(dictionaryConfig.sysDomain().getFileHost());
|
|
|
|
|
|
- if (Objects.isNull(tSyncExamStudentScore.getLocalSheetUrls()) || Objects.isNull(tSyncExamStudentScore.getTrajectoryUrls())) {
|
|
|
+ if (needSync || Objects.isNull(tSyncExamStudentScore.getLocalSheetUrls()) || Objects.isNull(tSyncExamStudentScore.getTrajectoryUrls())) {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(tSyncExamStudentScore.getSheetUrls());
|
|
|
if (!jsonArray.isEmpty()) {
|
|
|
JSONObject syncDataJson = JSON.parseObject(tSyncExamStudentScore.getSyncData());
|
|
@@ -178,12 +178,6 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
} else {
|
|
|
if (imageTrajectoryEnum == ImageTrajectoryEnum.PREVIEW) {
|
|
|
String filePath = fileSource.getPath();
|
|
|
- String trailUrl;
|
|
|
- if (filePath.startsWith("/")) {
|
|
|
- trailUrl = hostUrl + filePath;
|
|
|
- } else {
|
|
|
- trailUrl = hostUrl + File.separator + filePath;
|
|
|
- }
|
|
|
}
|
|
|
sheetObject.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
|
sheetObject.put(SystemConstant.PATH, (stringJoiner.toString() + dirJpgName.toString()).replaceAll("\\\\", "/"));
|
|
@@ -191,10 +185,10 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
jsonImageSourcePathArray.add(sheetObject);
|
|
|
|
|
|
// 轨迹
|
|
|
- JSONArray markTagJsonArray = (JSONArray) markTagsJson.get(i + 1);
|
|
|
- if (Objects.isNull(markTagJsonArray) || markTagJsonArray.size() == 0) {
|
|
|
+ if(markTagsJson.isEmpty()){
|
|
|
continue;
|
|
|
}
|
|
|
+ JSONArray markTagJsonArray = (JSONArray) markTagsJson.get(i + 1);
|
|
|
|
|
|
StringJoiner dirTargetJpgName = new StringJoiner("");
|
|
|
dirTargetJpgName.add(UploadFileEnum.FILE.getTitle()).add(File.separator)
|