package com.malk.aiwei.schedule;

import com.malk.aiwei.service.GZT_PN;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@Configuration
@EnableScheduling
public class Timer {

    @Autowired
    private GZT_PN gzt_pn;


    private Map portal_cache = new HashMap();

    @Scheduled(cron = "0 */5 * * * ?")//工作台数据5分钟更新一次
    public void hzmhByType() {
        try {
            gzt_pn.getDataList();
//            HttpUtil.get("http://aservice.risechina.com:9020/ruisi/hzmh/byType");
//            portal_cache = new HashMap();
//            rsService.getPortalList("财务专区");
//            rsService.getPortalList("公司头条");
//            rsService.getPortalList("企业文化");
//            rsService.getPortalList("员工自助");
//            rsService.getPortalList("规章制度");

        } catch (Exception e) {
            // 记录错误信息
            e.printStackTrace();
        }
    }

}

