Commit 8621c493b265125bb6a5199daa53389777d00870
1 parent
f96b474a
Signed-off-by: YRF <YRF@DESKTOP-UNV37O6>
Showing
1 changed file
with
4 additions
and
6 deletions
src/main/java/com/bsth/data/LineVersionsData.java
| ... | ... | @@ -21,7 +21,7 @@ import com.bsth.service.StationRouteService; |
| 21 | 21 | */ |
| 22 | 22 | @Component |
| 23 | 23 | @Order(20) |
| 24 | -public class LineVersionsData implements CommandLineRunner { | |
| 24 | +public class LineVersionsData extends Thread { | |
| 25 | 25 | |
| 26 | 26 | static Logger logger = LoggerFactory.getLogger(LineVersionsData.class); |
| 27 | 27 | |
| ... | ... | @@ -33,9 +33,7 @@ public class LineVersionsData implements CommandLineRunner { |
| 33 | 33 | StationRouteService stationRouteService; |
| 34 | 34 | |
| 35 | 35 | @Override |
| 36 | - public void run(String... arg0) throws Exception { | |
| 37 | - | |
| 38 | - | |
| 36 | + public void run() { | |
| 39 | 37 | try { |
| 40 | 38 | List<LineVersions> list = lineVersionsService.lineUpdate(); |
| 41 | 39 | for (LineVersions lineVersions : list) { |
| ... | ... | @@ -44,11 +42,11 @@ public class LineVersionsData implements CommandLineRunner { |
| 44 | 42 | Map<String, Object> map = new HashMap<>(); |
| 45 | 43 | map.put("lineId", lineId); |
| 46 | 44 | stationRouteService.usingSingle(map); |
| 45 | + logger.info("线路版本更新成功!"); | |
| 47 | 46 | } |
| 48 | - logger.info("待更新线路更新成功!"); | |
| 49 | 47 | } catch (Exception e) { |
| 50 | 48 | e.printStackTrace(); |
| 51 | - logger.error("待更新线路更新出现异常!", e); | |
| 49 | + logger.error("线路版本更新出现异常!", e); | |
| 52 | 50 | } |
| 53 | 51 | } |
| 54 | 52 | } | ... | ... |