IdGenerator { public synchronized String batchId(int tenantId, int module) { String prefix = DateTime.now().toString(DatePattern.PURE_DATETIME_MS_PATTERN); return prefix + tenantId + module + RandomUtil.randomNumbers(3); }  synchronized String batchId(int tenantId, int module); @Deprecated synchronized String getBatchId(int tenantId, int module); String simpleUUID(); String randomUUID(); synchronized long snowflakeId(); synchronized long snowflakeId(long workerId, long dataCenterId); String objectId();  }
@Test public void testBatchId() { for (int i = 0; i < 100; i++) { String batchId = idGenerator.batchId(1001, 100); System.out.println("批次号: " + batchId); } }