|
@@ -2,6 +2,7 @@ package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.aliyun.oss.common.utils.BinaryUtil;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
|
|
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -104,7 +106,19 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
|
|
|
ret.setTotalObjectiveScore(ep.getTotalObjectiveScore());
|
|
|
ret.setTotalSubjectiveScore(ep.getTotalSubjectiveScore());
|
|
|
ret.setPaperPath(ep.getPaperPath());
|
|
|
+ if (Objects.isNull(ep.getPaperMd5())) {
|
|
|
+ try {
|
|
|
+ ep.setPaperMd5(BinaryUtil.encodeMD5(ossUtil.download(false, ep.getPaperPath())));
|
|
|
+ if (Objects.isNull(ep.getStructMd5())) {
|
|
|
+ ep.setStructMd5(BinaryUtil.encodeMD5(ossUtil.download(false, ep.getStructPath())));
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ret.setPaperMd5(ep.getPaperMd5());
|
|
|
ret.setStructPath(ep.getStructPath());
|
|
|
+ ret.setStructMd5(ep.getStructMd5());
|
|
|
ret.setAnswerPath(ep.getAnswerPath());
|
|
|
ret.setDecryptSecret(ep.getDecryptSecret());
|
|
|
ret.setDecryptVector(ep.getDecryptVector());
|