package com.gyee.generation;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;

import com.gyee.generation.service.initalcache.CacheService;
import com.gyee.generation.service.initialpoint.InitialPointService;

import com.gyee.generation.util.SpringUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @description:
 * @author: shilin
 * @date: 2024/5/30 8:50
 * @param:
 * @return:
 **/
@SpringBootApplication
@MapperScan("com.gyee.generation.mapper")
public class GenerationTest {


    public static void main(String[] args) throws Exception {

        SpringApplication.run(GenerationTest.class, args);

        /*************************健康管理测点导出**************************/
        Calendar c = Calendar.getInstance();


        Date begin = new Date();
        Date end = null;
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(df.format(c.getTime()).toString());

        InitialPointService initialPointService = SpringUtils.getBean("initialPointService");

//     initialPointService.initalFc();
//        initialPointService.initalFj();

        CacheService cacheService = SpringUtils.getBean("cacheService");

        cacheService.initRedisCache();

        end = new Date();
        System.out.println(df.format(end).toString());
        System.out.println("完成一次!。。。。。。");
        System.out.println("执行用时" + DateUtil.between(begin, end, DateUnit.SECOND) + "秒");


        /*************************健康管理测点导出**************************/
//
//
// /*************************redis缓存**************************/
//        Calendar c = Calendar.getInstance();
//
//
//        Date begin = new Date();
//        Date end = null;
//        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        System.out.println(df.format(c.getTime()).toString());
//
//
//        CacheService cacheService= SpringUtils.getBean("cacheService");
//        cacheService.initRedisCache();
//
//        end = new Date();
//        System.out.println(df.format(end).toString());
//        System.out.println("完成一次!。。。。。。");
//        System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
//
//
//        /*************************redis缓存**************************/


        System.out.println("启动完成");
    }
}
