package cn.iocoder.yudao.framework.common.util.string;

import cn.hutool.core.util.RandomUtil;

import java.time.LocalDateTime;

public class SerialCodeUtils {

    public static String generateOrderNumber(int num) {
        StringBuilder sb = new StringBuilder();
        //获取区域编码
        //todo 获取区域编码
        String randomNumber = RandomUtil.randomNumbers(6);
        //获取年份
        int year = LocalDateTime.now().getYear();
        sb.append(randomNumber).append(year).append(String.format("%06d", num));
        return sb.toString();
    }
}
