Commit 72434a5d02e3c2cd07bdb82ecb0bdb6c8b0c14ff
1 parent
7b64bb9e
修复启动bug
Showing
3 changed files
with
24 additions
and
17 deletions
pom.xml
| @@ -9,11 +9,12 @@ | @@ -9,11 +9,12 @@ | ||
| 9 | </parent> | 9 | </parent> |
| 10 | <groupId>top.panll.assist</groupId> | 10 | <groupId>top.panll.assist</groupId> |
| 11 | <artifactId>wvp-pro-assist</artifactId> | 11 | <artifactId>wvp-pro-assist</artifactId> |
| 12 | - <version>2.0.0</version> | 12 | + <version>1.0.0</version> |
| 13 | <name>wvp-pro-assist</name> | 13 | <name>wvp-pro-assist</name> |
| 14 | <description></description> | 14 | <description></description> |
| 15 | <properties> | 15 | <properties> |
| 16 | <java.version>1.8</java.version> | 16 | <java.version>1.8</java.version> |
| 17 | + <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format> | ||
| 17 | <!-- <pagehelper.version>5.2.0</pagehelper.version>--> | 18 | <!-- <pagehelper.version>5.2.0</pagehelper.version>--> |
| 18 | </properties> | 19 | </properties> |
| 19 | 20 | ||
| @@ -61,12 +62,6 @@ | @@ -61,12 +62,6 @@ | ||
| 61 | <version>1.2.73</version> | 62 | <version>1.2.73</version> |
| 62 | </dependency> | 63 | </dependency> |
| 63 | 64 | ||
| 64 | -<!-- <dependency>--> | ||
| 65 | -<!-- <groupId>com.github.pagehelper</groupId>--> | ||
| 66 | -<!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> | ||
| 67 | -<!-- <version>1.2.10</version>--> | ||
| 68 | -<!-- </dependency>--> | ||
| 69 | - | ||
| 70 | <dependency> | 65 | <dependency> |
| 71 | <groupId>org.springframework.boot</groupId> | 66 | <groupId>org.springframework.boot</groupId> |
| 72 | <artifactId>spring-boot-starter-test</artifactId> | 67 | <artifactId>spring-boot-starter-test</artifactId> |
src/main/java/top/panll/assist/config/StartConfig.java
| @@ -58,18 +58,29 @@ public class StartConfig implements CommandLineRunner { | @@ -58,18 +58,29 @@ public class StartConfig implements CommandLineRunner { | ||
| 58 | FFmpegExecUtils.getInstance().ffprobe = ffprobe; | 58 | FFmpegExecUtils.getInstance().ffprobe = ffprobe; |
| 59 | // 对目录进行预整理 | 59 | // 对目录进行预整理 |
| 60 | File[] appFiles = recordFile.listFiles(); | 60 | File[] appFiles = recordFile.listFiles(); |
| 61 | - for (File appFile : appFiles) { | ||
| 62 | - File[] streamFiles = appFile.listFiles(); | ||
| 63 | - for (File streamFile : streamFiles) { | ||
| 64 | - File[] dateFiles = streamFile.listFiles(); | ||
| 65 | - for (File dateFile : dateFiles) { | ||
| 66 | - File[] files = dateFile.listFiles(); | ||
| 67 | - for (File file : files) { | ||
| 68 | - videoFileService.handFile(file); | 61 | + if (appFiles != null && appFiles.length > 0) { |
| 62 | + for (File appFile : appFiles) { | ||
| 63 | + File[] streamFiles = appFile.listFiles(); | ||
| 64 | + if (streamFiles != null && streamFiles.length > 0) { | ||
| 65 | + for (File streamFile : streamFiles) { | ||
| 66 | + File[] dateFiles = streamFile.listFiles(); | ||
| 67 | + if (dateFiles != null && dateFiles.length > 0) { | ||
| 68 | + for (File dateFile : dateFiles) { | ||
| 69 | + File[] files = dateFile.listFiles(); | ||
| 70 | + if (files != null && files.length > 0) { | ||
| 71 | + for (File file : files) { | ||
| 72 | + videoFileService.handFile(file); | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + | ||
| 69 | } | 78 | } |
| 70 | } | 79 | } |
| 80 | + | ||
| 71 | } | 81 | } |
| 72 | } | 82 | } |
| 83 | + | ||
| 73 | }catch (IOException exception){ | 84 | }catch (IOException exception){ |
| 74 | System.out.println(exception.getMessage()); | 85 | System.out.println(exception.getMessage()); |
| 75 | if (exception.getMessage().indexOf("ffmpeg") > 0 ) { | 86 | if (exception.getMessage().indexOf("ffmpeg") > 0 ) { |
| @@ -81,6 +92,7 @@ public class StartConfig implements CommandLineRunner { | @@ -81,6 +92,7 @@ public class StartConfig implements CommandLineRunner { | ||
| 81 | System.exit(1); | 92 | System.exit(1); |
| 82 | } | 93 | } |
| 83 | }catch (Exception exception){ | 94 | }catch (Exception exception){ |
| 95 | + exception.printStackTrace(); | ||
| 84 | logger.error("环境错误: " + exception.getMessage()); | 96 | logger.error("环境错误: " + exception.getMessage()); |
| 85 | } | 97 | } |
| 86 | } | 98 | } |
src/main/java/top/panll/assist/service/VideoFileService.java
| @@ -202,8 +202,8 @@ public class VideoFileService { | @@ -202,8 +202,8 @@ public class VideoFileService { | ||
| 202 | logger.error("过滤日期文件时异常: {}-{}", name, e.getMessage()); | 202 | logger.error("过滤日期文件时异常: {}-{}", name, e.getMessage()); |
| 203 | return false; | 203 | return false; |
| 204 | } | 204 | } |
| 205 | - return (DateUtils.getStartOfDay(fileDate).compareTo(startDate) <= 0 | ||
| 206 | - && DateUtils.getStartOfDay(fileDate).compareTo(endDate) >= 0) ; | 205 | + return (DateUtils.getStartOfDay(startDate).compareTo(fileDate) <= 0 |
| 206 | + || DateUtils.getEndOfDay(endDate).compareTo(fileDate) >= 0) ; | ||
| 207 | }); | 207 | }); |
| 208 | 208 | ||
| 209 | if (dateFiles != null && dateFiles.length > 0) { | 209 | if (dateFiles != null && dateFiles.length > 0) { |