Commit 5db38a640b340fbcca56c349298c8a934856f383
1 parent
b00c27fb
运管数据上传时间修改为:07:00
Showing
1 changed file
with
7 additions
and
1 deletions
src/main/java/com/bsth/XDApplication.java
| @@ -58,11 +58,17 @@ public class XDApplication implements CommandLineRunner { | @@ -58,11 +58,17 @@ public class XDApplication implements CommandLineRunner { | ||
| 58 | SeiPstThread seiPstThread; | 58 | SeiPstThread seiPstThread; |
| 59 | 59 | ||
| 60 | private static long timeDiff; | 60 | private static long timeDiff; |
| 61 | + private static long timeDiffTraffic; | ||
| 61 | 62 | ||
| 62 | static { | 63 | static { |
| 64 | + // 早上2:20 | ||
| 63 | timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); | 65 | timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); |
| 64 | if (timeDiff < 0) | 66 | if (timeDiff < 0) |
| 65 | timeDiff += (1000 * 60 * 60 * 24); | 67 | timeDiff += (1000 * 60 * 60 * 24); |
| 68 | + // 早上07:00 | ||
| 69 | + timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis(); | ||
| 70 | + if (timeDiffTraffic < 0) | ||
| 71 | + timeDiffTraffic += (1000 * 60 * 60 * 24); | ||
| 66 | } | 72 | } |
| 67 | 73 | ||
| 68 | @Override | 74 | @Override |
| @@ -129,7 +135,7 @@ public class XDApplication implements CommandLineRunner { | @@ -129,7 +135,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 129 | 135 | ||
| 130 | //运管处静态数据提交 | 136 | //运管处静态数据提交 |
| 131 | log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); | 137 | log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); |
| 132 | - sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiff / 1000 + 60 * 60 * 5, 60 * 60 * 24, TimeUnit.SECONDS); | 138 | + sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 133 | //计算油、公里加注 | 139 | //计算油、公里加注 |
| 134 | sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | 140 | sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 135 | 141 |