您的位置:首页 > 其它

欢迎使用CSDN-markdown编辑器

2016-07-26 15:42 399 查看
public static String getOrderNo(final String prefix) {
DateFormat df = new SimpleDateFormat("yyMMddHHmm");
String MI = "";
String last = "";
Date date = null;
synchronized (df) {
date = new Date();
Calendar CD = Calendar.getInstance();
MI = CD.get(Calendar.MILLISECOND) + "";
if (MI.length() < 3) {
Random random = new Random();
MI = (random.nextInt(999 - 100 + 1) + 100) + "";
}
Random random = new Random();
last = (random.nextInt(999 - 100 + 1) + 100) + "";
}
return prefix + df.format(date) + MI + last;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: