소스 검색

未上传试卷结构提示

wangliang 2 년 전
부모
커밋
935a031e2d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamPaperServiceImpl.java

+ 3 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamPaperServiceImpl.java

@@ -117,6 +117,9 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
         ret.setPaperPath(ep.getPaperPath());
         if (Objects.isNull(ep.getPaperMd5())) {
             try {
+                if (Objects.isNull(ep.getPaperPath())) {
+                    throw new BusinessException("未上传试卷结构");
+                }
                 ep.setPaperMd5(BinaryUtil.encodeMD5(ossUtil.download(false, ep.getPaperPath())));
                 if (Objects.isNull(ep.getStructMd5())) {
                     ep.setStructMd5(BinaryUtil.encodeMD5(ossUtil.download(false, ep.getStructPath())));