package com.prolog.cs.biz.inbound.service.impl;

import com.prolog.common.util.DateUtils;

import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Random;
import java.util.regex.Pattern;

/**
 * 码上放心平台
 *
 * @author tianhl
 * @Date 2017/5/21 16:10
 */
//@Transactional //打开的话测试之后数据可自动回滚
public class RegMain {

    public static void main(String[] args) {
        System.out.println(Pattern.compile("^\\d{20}$").matcher("dsadfa").matches());
        System.out.println(Pattern.compile("^8[0-9]{19}$").matcher("81516350599094736814").matches());
        System.out.println(Pattern.compile("^8[0-9]{19}$").matcher("8151635059909473681a").matches());
        System.out.println(Pattern.compile("^8[0-9]{19}$").matcher("81516350599094736815").matches());
        System.out.println(Pattern.compile("^8[0-9]{19}$").matcher("11516350599094736814").matches());
        System.out.println(new Random().nextInt(15) + 15);
        System.out.println(new Random().nextInt(15) + 15);
        System.out.println(new Random().nextInt(15) + 15);
        System.out.println(new Random().nextInt(15) + 15);

        int minute = new Random().nextInt(15) + 15;
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MINUTE, minute);
        System.out.println(DateUtils.format(calendar.getTime()));
        System.out.println(new BigDecimal("0.999").intValue());
        System.out.println("131243134\n".split("\n").length);
    }
}
