Commit 84fcd60c authored by yanzg's avatar yanzg

消除成功接收处理

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