public String autoGenerationCode(String code) {
RedisAtomicLong entityIdCounter = new RedisAtomicLong(code, redisTemplate.getConnectionFactory());
Long counter = entityIdCounter.incrementAndGet();
DecimalFormat format = new DecimalFormat("000000");
return code+ format.format(counter);
}
06-27
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-10
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-07
6765
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)