| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | //大屏页面统计 |
| | |
| | | @Autowired |
| | | private TicketBlackService ticketBlackService; |
| | | |
| | | @Scheduled(cron = "0 0 * * * ?") |
| | | @Scheduled(cron = "0 0/40 * * * ?") |
| | | public void execute() throws IOException { |
| | | System.out.println("开始定时任务-------》"); |
| | | List<TicketBlack> list = ticketBlackService.updateType(); |
| | | for(TicketBlack t:list){ |
| | | t.setBlackType(1); |
| | | ticketBlackService.save(t); |
| | | if(list.size() > 0){ |
| | | for(TicketBlack t:list){ |
| | | t.setBlackType(1); |
| | | ticketBlackService.save(t); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<Statistic> all = statisticService.findAll(); |
| | | Statistic statistic = all.get(0); |
| | | if(statistic==null){ |
| | | return; |
| | | } |
| | | |
| | | statistic.setCreateTime(new Date()); |
| | | statistic.setData1(outParkService.count1()); |
| | | statistic.setData2(outParkService.count2()); |
| | | statistic.setData3(outParkService.sumByPrice()); |
| | |
| | | statistic.setData19(ticketBlackService.count1()); |
| | | statistic.setData20(ticketBlackService.count2()); |
| | | statisticService.save(statistic); |
| | | System.out.println("结束定时任务-------》"); |
| | | } |
| | | } |