1. public class UUIDUtils {
    2. /**
    3. *
    4. * 获得随机数
    5. */
    6. public static String getUUID(){
    7. String uuid = "wty";
    8. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    9. String date= simpleDateFormat.format(new Date());
    10. date=date.replace("-","");
    11. uuid+=date;
    12. uuid+=(new Random().nextInt(89999999)+10000000);
    13. return uuid;
    14. }
    15. /**
    16. * 获取不带横杆的uuid
    17. * @return
    18. */
    19. public static String getRandomId() {
    20. return UUID.randomUUID().toString().replace("-","");
    21. }
    22. }