java之定時任務

來源:互聯網
上載者:User

標籤:actor   ati   date   ann   zcl   with   closed   pen   for   

  1 package com.financial.server.util;  2 import java.text.SimpleDateFormat;  3 import java.util.Date;  4 import java.util.HashMap;  5 import java.util.Map;  6 import org.springframework.beans.factory.annotation.Autowired;  7 import org.springframework.scheduling.annotation.Scheduled;  8 import org.springframework.stereotype.Component;  9  10 import com.financial.server.service.impl.GSXQ_K_LineOfDayService; 11 import com.financial.server.service.impl.GSYJReportService; 12 import com.financial.server.service.impl.HGYJReportService; 13 import com.financial.server.service.impl.HYYYReportService; 14 import com.financial.server.service.impl.JuChaoServiceImpl; 15 import com.financial.server.service.impl.LongHuBangDetailsService; 16 import com.financial.server.service.impl.QSCHReportService; 17 import com.financial.server.service.impl.SHZQService; 18 import com.financial.server.service.impl.SZZQService; 19 import com.financial.server.service.impl.TZCLReportService; 20 import com.financial.server.service.impl.TaoGuBaService; 21 import com.financial.server.service.impl.XGYBReportService; 22 import com.financial.server.thread.GSYJThread; 23 import com.financial.server.thread.HGYJThread; 24 import com.financial.server.thread.HYYYThread; 25 import com.financial.server.thread.JuChaoDownloadThread; 26 import com.financial.server.thread.KOfDayThread; 27 import com.financial.server.thread.LongHuBangDetailsThread; 28 import com.financial.server.thread.QSCHThread; 29 import com.financial.server.thread.SHZQThread; 30 import com.financial.server.thread.SZZQThread; 31 import com.financial.server.thread.TGBThread; 32 import com.financial.server.thread.TZCLThread; 33 import com.financial.server.thread.XGYBThread; 34  35  36 @Component   37 public class TimerTask {  38     @Autowired 39     private GSXQ_K_LineOfDayService kOfDayService; 40      41      42     @Autowired 43     private JuChaoServiceImpl juChaoServiceImpl; 44      45     @Autowired 46     private TaoGuBaService taoGuBaService; 47      48     @Autowired 49     private GSYJReportService gsyjReportService; 50     @Autowired 51     private XGYBReportService xgybReportService; 52     @Autowired 53     private HYYYReportService hyyyReportService; 54     /*@Autowired 55     private GNYBReportService gnybReportService;*/ 56     @Autowired 57     private TZCLReportService tzclReportService; 58     @Autowired 59     private QSCHReportService qschReportService; 60     @Autowired 61     private HGYJReportService hgyjReportService; 62      63     @Autowired 64     private LongHuBangDetailsService longHuBangDetailsService; 65      66     @Autowired 67     private JuChaoServiceImpl juchChaoServiceImpl; 68     @Autowired 69     private GSXQ_K_LineOfDayService gsxq_K_LineOfDayService; 70      71     String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());// 72     //String date = "2018-07-12"; 73     String typeFile = "F:/巨潮網/巨潮網公告類別.txt"; 74     @Scheduled(cron = "0 59 13 ? * *")//每天15:04執行一次   75     public void doSomethingWithCron() {   76         try { 77               78               79              80             //插入跟帖 81             /*Map<String, String> map = TaoGuBa.webParseHtmls("https://www.taoguba.com.cn/index?blockID=1"); 82             String JessionID = map.get("JSESSIONID").toString(); 83             String cookie = TaoGuBa.SubmitPost(JessionID);  84             new Thread(new TGBThread(taoGuBaService, date, date,true)).start();//淘股吧 85 */             86             new Thread(new GSYJThread(gsyjReportService, date, date,true)).start();//公司研究 87              88             new Thread(new XGYBThread(xgybReportService, date, date,true)).start();//新股研報 89              90             new Thread(new HYYYThread(hyyyReportService, date, date,true)).start();//行業研究 91              92             new Thread(new TZCLThread(tzclReportService, date, date,true)).start();//投資策略 93              94             new Thread(new QSCHThread(qschReportService, date, date,true)).start();//券商晨會 95              96             new Thread(new HGYJThread(hgyjReportService, date, date,true)).start();//宏觀研究 97              98            new Thread(new LongHuBangDetailsThread(longHuBangDetailsService, date, date,true)).start();//龍虎榜詳情 99             100             101             new Thread(new JuChaoThread(juchChaoServiceImpl,typeFile,date, date,true)).start();//巨潮網公告102             103             104             new Thread(new KOfDayThread(gsxq_K_LineOfDayService,date,true)).start();//日k線資料105             106              107             108         } catch (Exception e) {109             e.printStackTrace();110         } 111     }  112   113 }  
View Code

 

java之定時任務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.