Commit 4b1d7bca authored by yanzg's avatar yanzg

升级新版本

parent 1583439b
......@@ -6,6 +6,7 @@ import com.yanzuoguang.dao.impl.SqlData;
import com.yanzuoguang.mq.dao.MessageDao;
import com.yanzuoguang.mq.vo.MessageVo;
import com.yanzuoguang.util.helper.YzgTimeout;
import com.yanzuoguang.util.thread.ThreadHelper;
import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
......@@ -65,14 +66,16 @@ public class MessageDaoImpl extends BaseDaoImpl implements MessageDao, Initializ
*/
@Override
public void afterPropertiesSet() throws Exception {
YzgTimeout.timeOut(MessageDaoImpl.class, "消息队列处理工具类初始化", () -> {
List<MapRow> tables = this.getDb().query(MessageDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(MessageDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
} else {
this.getDb().update(MessageDaoImpl.class, "ALTER_TABLE_SQL", ALTER_TABLE_SQL);
}
});
ThreadHelper.runThread(() ->
YzgTimeout.timeOut(MessageDaoImpl.class, "消息队列处理工具类初始化", () -> {
List<MapRow> tables = this.getDb().query(MessageDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(MessageDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
} else {
this.getDb().update(MessageDaoImpl.class, "ALTER_TABLE_SQL", ALTER_TABLE_SQL);
}
})
);
}
/**
......
......@@ -3,6 +3,8 @@ package com.yanzuoguang.mq.dao.impl;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.mq.dao.MessageLogDao;
import com.yanzuoguang.mq.vo.MessageLogVo;
import com.yanzuoguang.util.helper.YzgTimeout;
import com.yanzuoguang.util.thread.ThreadHelper;
import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
......@@ -53,10 +55,14 @@ public class MessageLogDaoImpl extends BaseDaoImpl implements MessageLogDao, Ini
*/
@Override
public void afterPropertiesSet() throws Exception {
List<MapRow> tables = this.getDb().query(MessageLogDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(MessageLogDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
ThreadHelper.runThread(() -> {
YzgTimeout.timeOut(MessageLogDaoImpl.class, "消息队列处理工具类初始化", () -> {
List<MapRow> tables = this.getDb().query(MessageLogDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(MessageLogDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
});
});
}
/**
......
......@@ -4,6 +4,8 @@ import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.db.DbExecute;
import com.yanzuoguang.mq.dao.QueueServerDao;
import com.yanzuoguang.mq.vo.QueueServerVo;
import com.yanzuoguang.util.helper.YzgTimeout;
import com.yanzuoguang.util.thread.ThreadHelper;
import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
......@@ -45,10 +47,14 @@ public class QueueServerDaoImpl extends BaseDaoImpl implements QueueServerDao, I
*/
@Override
public void afterPropertiesSet() throws Exception {
DbExecute db = this.getDb();
List<MapRow> tables = db.query(QueueServerDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
db.update(QueueServerDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
ThreadHelper.runThread(() -> {
YzgTimeout.timeOut(QueueServerDaoImpl.class, "消息队列处理工具类初始化", () -> {
DbExecute db = this.getDb();
List<MapRow> tables = db.query(QueueServerDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
db.update(QueueServerDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
});
});
}
}
......@@ -3,6 +3,8 @@ package com.yanzuoguang.mq.dao.impl;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.mq.dao.QueueServerTokenDao;
import com.yanzuoguang.mq.vo.QueueServerTokenVo;
import com.yanzuoguang.util.helper.YzgTimeout;
import com.yanzuoguang.util.thread.ThreadHelper;
import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
......@@ -48,9 +50,13 @@ public class QueueServerTokenDaoImpl extends BaseDaoImpl implements QueueServerT
*/
@Override
public void afterPropertiesSet() throws Exception {
List<MapRow> tables = this.getDb().query(QueueServerTokenDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(QueueServerTokenDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
ThreadHelper.runThread(() -> {
YzgTimeout.timeOut(QueueServerTokenDaoImpl.class, "消息队列处理工具类初始化", () -> {
List<MapRow> tables = this.getDb().query(QueueServerTokenDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(QueueServerTokenDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
});
});
}
}
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