taskid加同步锁,防止创建相同id

This commit is contained in:
psh
2023-10-19 08:49:17 +08:00
parent 96e401b696
commit 4b98cd1998

View File

@@ -1,7 +1,7 @@
package org.nl.wms.util;
public class IdUtil {
public static Long getLongId() {
public synchronized static Long getLongId() {
return cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId();
}