Commit 16fc2d00 authored by yanzg's avatar yanzg

常规BUG的修改

parent 2a6fb6bd
......@@ -742,7 +742,7 @@ public class StringHelper {
* @return
*/
public static String getNewID() {
String tag = String.format("z%012d", System.currentTimeMillis() / 1000);
String tag = getNewIdTag(System.currentTimeMillis());
String id = getUUID();
return tag + id.substring(tag.length());
}
......@@ -820,11 +820,21 @@ public class StringHelper {
if (date == null) {
throw new CodeException("生成时间搓 MD5 ID 时,时间不能为空");
}
String tag = String.format("z%012d", date.getTime() / 1000);
String tag = getNewIdTag(date.getTime());
String id = md51(getId(froms));
return tag + id.substring(tag.length());
}
/**
* 获取新Id标价
*
* @param time
* @return
*/
private static String getNewIdTag(long time) {
return String.format("z%015d", time);
}
/**
* 获取组合编号的MD5值
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment