package com.tuoheng.admin.utils;

import com.tuoheng.common.utils.DateUtils;

import java.util.Random;

/**
 * @User qiujinyang
 * @Description
 * @Date Created by 2022/7/27 13:44
 */
public class CodeUtil {

    /**
     * 生成报告编号，R+年月日+随机四位数
     * @return
     */
    public static String createCodeNo(){
        String Date = DateUtils.dateTimeNow(DateUtils.YYYYMMDD);
        int randomNum = new Random().nextInt(9999) % (9999 - 1000 + 1) + 1000;
        String reportNo = Date + randomNum;

        return reportNo;
    }
}
