sys_guid生成的主键重复 java如何生成12位序列号?

java如何生成12位序列号?Private static int maxvaluefive=9999999Private static int minvaluefive=0Private stati

java如何生成12位序列号?

Private static int maxvaluefive=9999999

Private static int minvaluefive=0

Private static atomicinteger atomic=new atomicinteger(minvaluefive)]/*]生成序列号*/

static string getseqfive(int coverpad){

for(){

int current=原子。获取()

int newValue=current>=maxvaluefive?minvaluefive:当前1

如果(原子比较数据集(current,newValue)){

返回StringUtils.leftPad文件( String.valueOf值(当前),coverpad,“0”)

}

Java写GUI用swing还是JavaFX呢?

JavaFX是五年前使用的,其他的都太旧了