- 更多API请至Hutool官网:https://hutool.cn
- 流水号规则:年月日时分秒+5位随机数组成
pom.xml依赖配置
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.4.7</version>
</dependency>
代码
- 此DateUtil类和RandUtil是由Hutool提供的
String format = DateUtil.format(new Date(),"yyyyMMddHHmmss");
String numbers = RandomUtil.randomNumbers(5);
String liushui = format+numbers;