package com.chinacreator.videoalliance.order.util; /** * Create by IntelliJ IDEA. * Author: EricJin * Date: 08/15/2018 10:46 */ public class SequenceUtils { private final static int MAX_SEQUENCE = 10000; private static int currentSequence = 1; public synchronized static String getSequence() { currentSequence ++; if(currentSequence >= MAX_SEQUENCE) { currentSequence = 1; } return String.format("%04d", currentSequence); } }