xiatian 3 сар өмнө
parent
commit
b823ca0ce9

+ 9 - 0
src/main/java/cn/com/qmth/am/service/impl/StudentScoreServiceImpl.java

@@ -193,11 +193,15 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
                     if (image.exists()) {
                         continue;
                     }
+                    if (!image.getParentFile().exists()) {
+                        image.getParentFile().mkdirs();
+                    }
                     byte[] bs = Arrays.copyOf(ims.getImage(), ims.getImage().length);
                     out = new FileOutputStream(image);
                     out.write(bs, 0, bs.length);
                     out.flush();
                 } catch (Exception e) {
+                    throw new RuntimeException(e);
                 } finally {
                     concurrentService.getReadWriteLock(path).writeLock().unlock();
                     if (out != null) {
@@ -219,6 +223,10 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
         File image = new File(sysProperty.getDataDir() + "/" + path);
         if (image.exists()) {
             image.delete();
+        } else {
+            if (!image.getParentFile().exists()) {
+                image.getParentFile().mkdirs();
+            }
         }
         FileOutputStream out = null;
         try {
@@ -227,6 +235,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
             out.write(bs, 0, bs.length);
             out.flush();
         } catch (Exception e) {
+            throw new RuntimeException(e);
         } finally {
             if (out != null) {
                 try {

+ 1 - 1
src/main/java/cn/com/qmth/am/task/AiMarkingJob.java

@@ -55,7 +55,7 @@ public class AiMarkingJob {
                 });
     }
 
-    @Scheduled(fixedDelay = 5 * 1000, initialDelay = 5 * 1000)
+    @Scheduled(fixedDelay = 1 * 1000, initialDelay = 5 * 1000)
     public void doJob() {
         if (!sysProperty.getMarkingTaskEnable()) {
             return;