import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;


public class test {
    private static final TimedCache<String, TestQo> cache = CacheUtil.newTimedCache(3000L);

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

        try{
            System.out.println("start");
            throw new Exception("111");
        }catch (Exception e) {
            System.out.println("ex");
            throw e;
        }finally {
            System.out.println("end1");
        }

//        Date date = new Date();
//        Date tomrrow = DateUtils.addDays(date, 1);
//        Date yestory = DateUtils.addDays(date, -1);
//        long l = DateUtil.betweenDay(tomrrow, date, true);
//
//        long l2 = DateUtil.betweenDay(date, tomrrow, true);
//        TestQo qo=new TestQo();
//        qo.setName("test");
//        System.out.println(l + "=" + l2);
//
//        cache.put("test",qo);
//        Thread.sleep(1000L);
//        TestQo test = cache.get("test");
//        System.out.println(JSONObject.toJSONString(test));
//
//        Thread.sleep(2000L);
//        System.out.println(JSONObject.toJSONString(test));
//        Thread.sleep(2000L);
//        System.out.println(JSONObject.toJSONString(test));
//        test = cache.get("test");
//        System.out.println(JSONObject.toJSONString(test));
//
//        int i=20;
//        while (i-->0) {
//            Thread.sleep(2000L);
//        }
////        String key = "3.2.1";
//        String[] split = key.split(".");
//
//        System.out.println(split[1]);
//        Long dimissionTime = 1550838571L;
//        LocalDateTime dateTime = LocalDateTime.ofEpochSecond(dimissionTime, 0, ZoneOffset.ofHours(8));
//        Instant instant = dateTime.toInstant(ZoneOffset.ofHours(8));
//        Date from = Date.from(instant);
//        System.out.println(from);
//
//        Integer num = 2;
//        int i = 2 & 4;
//        System.out.println(i);
//
//		//插入不存在的我们pre表的企业微信数据
//		int pageSize = 500;
//    	int count = 345;
//    	int pre = count/pageSize+1;
//    	int yushu = count%pageSize;
//    	if(yushu==0){
//    		pre = pre- 1;
//    	}
//    	int  i= 0;
//    	while(i<pre){
//            System.out.println("这是第{}次，进入"+i);
//    		i++;
//	    	int fromIndex = (i-1)*pageSize;
//	    	int toIndex = (count-fromIndex) > pageSize ? (fromIndex+pageSize):count;
//
//	    	System.out.println("fromIndex=============>"+fromIndex);
//	    	System.out.println("toIndex=============>"+toIndex);
//
//    	}
    }

}
