Explorar o código

截图修改超时时间

wyyay hai 6 meses
pai
achega
06f8101899

+ 5 - 5
business-service/src/main/java/com/ozs/service/service/impl/CameraCaptureService.java

@@ -27,7 +27,7 @@ public class CameraCaptureService {
     MinioUtils minioUtils;
 
 
-    private final static Integer CONST_TIME_OUT = 30 * 1000;
+    private final static Integer CONST_TIME_OUT = 60 * 1000;
 
     public boolean getCapture(URL url, String fileName) throws IOException {
         return getCapture(url, "", fileName);
@@ -76,17 +76,17 @@ public class CameraCaptureService {
                     byteArrayOutputStream.write(bytes,0,index);
                 }
                 byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
-                String uploadUrl = "/data/test_picture/"+ IdUtils.fastSimpleUUID()+".jpeg";
+                //String uploadUrl = "/data/test_picture/"+ IdUtils.fastSimpleUUID()+".jpeg";
 //                String uploadUrl = "d://tmp/c/"+ (cameraCode + "-" + (System.currentTimeMillis() / 1000)) +".jpeg";
 //                if (log.isDebugEnabled()) {
 //                    log.debug("生成至服务器本地开始,路径为: " + uploadUrl);
 //                }
-                fileOutputStream = new FileOutputStream(uploadUrl);
-                IOUtils.copy(byteArrayInputStream, fileOutputStream);
+                //fileOutputStream = new FileOutputStream(uploadUrl);
+                //IOUtils.copy(byteArrayInputStream, fileOutputStream);
 //                if (log.isDebugEnabled()) {
 //                    log.debug("生成至服务器本地结束,路径为: " + uploadUrl);
 //                }
-                byteArrayInputStream.reset();
+               //byteArrayInputStream.reset();
 //                if (log.isDebugEnabled()) {
 //                    log.debug("getCapture======" + fileName);
 //                }

+ 3 - 3
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/ShotPictureTaskExecutors.java

@@ -163,9 +163,9 @@ public class ShotPictureTaskExecutors {
             }
         }
         // 判断开关是否执行
-//        if (status != 1) {
-//            return;
-//        }
+        if (status != 1) {
+            return;
+        }
         // 获取字典值: 截图存放路径
         List<SysDictData> addressDataList = DictUtils.getDictCache("shot_address");
         if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){