02940e38663e2e2ba5343b83b4174ccd1ef81ca1.svn-base 493 B

1234567891011121314151617181920
  1. package com.chinacreator.videoalliance.order.util;
  2. /**
  3. * Create by IntelliJ IDEA.
  4. * Author: EricJin
  5. * Date: 08/15/2018 10:46
  6. */
  7. public class SequenceUtils {
  8. private final static int MAX_SEQUENCE = 10000;
  9. private static int currentSequence = 1;
  10. public synchronized static String getSequence() {
  11. currentSequence ++;
  12. if(currentSequence >= MAX_SEQUENCE) {
  13. currentSequence = 1;
  14. }
  15. return String.format("%04d", currentSequence);
  16. }
  17. }