Commit 84fcd60c authored by yanzg's avatar yanzg

消除成功接收处理

parent f3f155a4
......@@ -722,7 +722,7 @@ public class StringHelper {
* @return
*/
public static String getNewID() {
String tag = String.format("z%012d", new Date().getTime() / 1000);
String tag = String.format("z%012d", System.currentTimeMillis() / 1000);
String id = getUUID();
return tag + id.substring(tag.length());
}
......
......@@ -142,7 +142,7 @@ public class RunnableListAutoItem implements Comparable<RunnableListAutoItem> {
this.HandleException(ex);
} finally {
this.Count++;
this.Time += new Date().getTime() - start.getTime();
this.Time += System.currentTimeMillis() - start.getTime();
}
}
......
......@@ -30,11 +30,13 @@ public class ThreadHelper {
timeout = new RunPlan();
interval = new RunPlan();
Runnable addExecute = new Runnable() {
@Override
public void run() {
OnExecuteAdd();
}
};
Runnable itemExecuted = new Runnable() {
@Override
public void run() {
OnItemExecuted();
}
......@@ -60,6 +62,7 @@ public class ThreadHelper {
return;
}
runThread(new Runnable() {
@Override
public void run() {
threadIsRun = true;
while (threadIsRun) {
......@@ -89,9 +92,10 @@ public class ThreadHelper {
*/
private static void StartMonitor() {
runThread(new Runnable() {
@Override
public void run() {
do {
if (threadIsRun && ((new Date().getTime() - threadDate.getTime()) / 1000) > 5) {
if (threadIsRun && ((System.currentTimeMillis() - threadDate.getTime()) / 1000) > 5) {
try {
if (threadIsRun) {
threadIsRun = false;
......@@ -213,6 +217,7 @@ public class ThreadHelper {
*/
public static void runThread(final RunInterval run) {
runThread(new Runnable() {
@Override
public void run() {
while (!run.isBreak()) {
try {
......
......@@ -69,7 +69,7 @@ public class ThreadWait {
* @description
*/
public void nexted() {
this.time = new Date().getTime();
this.time = System.currentTimeMillis();
}
/**
......@@ -97,7 +97,7 @@ public class ThreadWait {
}
this.stopPrint();
if (!this.execute.isFinally()) {
this.time = new Date().getTime();
this.time = System.currentTimeMillis();
this.timer = new Timer();
this.timer.schedule(new TimerTask() {
@Override
......
......@@ -37,7 +37,7 @@ public class RequestCacheResult {
* @return
*/
public long getMillsecond() {
return new Date().getTime() - date.getTime();
return System.currentTimeMillis() - date.getTime();
}
/**
......
......@@ -44,7 +44,7 @@ public class DbExecuteImpl implements DbExecute {
*/
public int update(Class targetClass, String sqlName, String sql, Object... paras) {
int row = 0;
long start = new Date().getTime();
long start = System.currentTimeMillis();
try {
sql = this.handleParas(sql, paras);
row = jdbc.update(sql, paras);
......@@ -68,7 +68,7 @@ public class DbExecuteImpl implements DbExecute {
*/
public <T extends Object> void query(Class targetClass, Class<T> cls, DbRow<T> rowHandle, String sqlName, String sql, Object... paras) {
Ref<Integer> row = new Ref<Integer>(0);
long start = new Date().getTime();
long start = System.currentTimeMillis();
try {
sql = this.handleParas(sql, paras);
jdbc.query(sql, paras, new RowCallbackHandler() {
......@@ -99,7 +99,7 @@ public class DbExecuteImpl implements DbExecute {
*/
public <T extends Object> List<T> query(Class targetClass, Class<T> cls, String sqlName, String sql, Object... paras) {
int row = 0;
long start = new Date().getTime();
long start = System.currentTimeMillis();
try {
sql = this.handleParas(sql, paras);
List<T> ret = jdbc.query(sql, paras, AllBeanRowMapper.getInstance(cls, configDb));
......@@ -137,7 +137,7 @@ public class DbExecuteImpl implements DbExecute {
*/
public Object queryCell(Class targetClass, String sqlName, String sql, Object... paras) {
int row = 0;
long start = new Date().getTime();
long start = System.currentTimeMillis();
try {
sql = this.handleParas(sql, paras);
SqlRowSet rowSet = jdbc.queryForRowSet(sql, paras);
......
......@@ -144,7 +144,7 @@ public class MessageServiceImpl implements MessageService {
// 设置处理次数
messageVo.setHandleCount(messageVo.getHandleCount() + 1);
Date next = new Date(new Date().getTime() + 5 * 60 * 1000);
Date next = new Date(System.currentTimeMillis() + 5 * 60 * 1000);
// 设置下次处理时间
messageVo.setHandleTime(DateHelper.getDateTimeString(next));
......
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