Commit 4b1d7bca authored by yanzg's avatar yanzg

升级新版本

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