liubo 3 rokov pred
rodič
commit
a7493b3749

+ 8 - 9
zd-modules/zd-exam/src/main/java/com/zd/exam/service/impl/ElResourcesServiceImpl.java

@@ -21,16 +21,15 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 import ws.schild.jave.EncoderException;
 import ws.schild.jave.MultimediaObject;
 import ws.schild.jave.info.MultimediaInfo;
 
-import java.net.*;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 /**
@@ -158,11 +157,11 @@ public class ElResourcesServiceImpl implements IElResourcesService {
             SaveUtil.setCommonAttr(elResources);
             int num = elResourcesMapper.insertElResources(elResources);
 
-            try {
+            /*try {
                 previewKkFile(elResources.getPath());
             } catch (URISyntaxException e) {
                 e.printStackTrace();
-            }
+            }*/
             if(num == 0){
                 throw new ServiceException("添加失败!");
             }
@@ -172,14 +171,14 @@ public class ElResourcesServiceImpl implements IElResourcesService {
         return elResources;
     }
 
-    @Async
+    /*@Async
     public void previewKkFile(String filePath) throws URISyntaxException {
         logger.info("****调用kkFileService开始****");
         String kkFilePath=remoteKkFileService.getKkFilePath(new URI("http://127.0.0.1:8012"), URLEncoder.encode(Base64.getEncoder().encodeToString(filePath.getBytes())));
         if(StringUtils.isNotBlank(kkFilePath) && StringUtils.isNotNull(kkFilePath)){
             logger.info("!!!!调用kkFileService成功!!!!");
         }
-    }
+    }*/
 
 
     private void saveResources(ElResources elResources, MultipartFile file){
@@ -261,9 +260,9 @@ public class ElResourcesServiceImpl implements IElResourcesService {
         try {
             elResourcesMapper.updateElResources(elResources);
             if(type == 1){
-                previewKkFile(elResources.getPath());
+//                previewKkFile(elResources.getPath());
             }
-        } catch (URISyntaxException e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return 1;