package com.ruoyi.hywz.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Random;

/**
 * @author: jxh
 * @description:
 * @create: 2024/4/9
 */
public class AppNoGenUtil {

    public static String getAppNo() {
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");

        String dateTime = now.format(formatter);

        // 生成随机3位数字
        Random random = new Random();
        int randomNum = random.nextInt(900) + 100;

        return dateTime + randomNum;
    }

}
