系统添加不加在数据库操作
This commit is contained in:
parent
be5923d8ea
commit
2ad4ff5be5
|
@ -122,3 +122,5 @@ jeecg :
|
|||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: ??
|
||||
data:
|
||||
use: true
|
|
@ -12,7 +12,7 @@ public class DataSourceUtilProperties {
|
|||
public static final String MYSQLDRIVER_6 = "com.mysql.jdbc.Driver"; // mysql数据库的驱动类
|
||||
public static final String MYSQLDRIVER = "com.mysql.jdbc.Driver"; // mysql数据库的驱动类
|
||||
public static final String ORACLEDRIVER = "oracle.jdbc.OracleDriver"; // oracles数据库的驱动类
|
||||
public static final String SQL2005DRIVER = "net.sourceforge.jtds.jdbc.Driver"; // sqlserver数据库的驱动类
|
||||
public static final String SQL2005DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; // sqlserver数据库的驱动类
|
||||
public static final String SQL2000DRIVER = "net.sourceforge.jtds.jdbc.Driver"; // sqlserver数据库的驱动类
|
||||
public static final String dm = "dm.jdbc.driver.DmDriver"; // 达梦数据库的驱动类
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingE
|
|||
import com.hzya.frame.web.quartz.QuartzJobFactoryUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
@ -34,13 +35,17 @@ public class MyApplicationListener implements ApplicationListener<ApplicationRea
|
|||
private IIntegrationTaskLivingDao iIntegrationTaskLivingDao;
|
||||
@Resource
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
|
||||
@Value("${data.use}")
|
||||
private boolean dataUse;
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
initTask();
|
||||
}
|
||||
|
||||
private void initTask() {
|
||||
if(!dataUse){
|
||||
return;
|
||||
}
|
||||
//查询所有任务,添加到任务执行计划中
|
||||
IntegrationTaskEntity queryEntity = new IntegrationTaskEntity();
|
||||
//任务状态1、启用
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.hzya.frame.web.action.ApplicationContextUtil;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -36,25 +37,27 @@ public class InitCommandLineRunner implements ApplicationListener<ApplicationRea
|
|||
Logger logger = LoggerFactory.getLogger(InitCommandLineRunner.class);
|
||||
@Resource
|
||||
private ApplicationCache applicationCache;
|
||||
|
||||
@Value("${data.use}")
|
||||
private boolean dataUse;
|
||||
@Resource
|
||||
private InterfaceCache interfaceCache;
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent event) {
|
||||
logger.info("初始化ApplicationCache Map start <<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
applicationCache.reloadData("1");
|
||||
applicationCache.reloadData("2");
|
||||
applicationCache.reloadData("3");
|
||||
applicationCache.reloadData("4");
|
||||
|
||||
interfaceCache.reloadData("1");
|
||||
interfaceCache.reloadData("2");
|
||||
interfaceCache.reloadData("3");
|
||||
interfaceCache.reloadData("4");
|
||||
interfaceCache.reloadData("5");
|
||||
interfaceCache.reloadData("6");
|
||||
logger.info("初始化ApplicationCache Map END <<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
if(dataUse){
|
||||
logger.info("初始化ApplicationCache Map start <<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
applicationCache.reloadData("1");
|
||||
applicationCache.reloadData("2");
|
||||
applicationCache.reloadData("3");
|
||||
applicationCache.reloadData("4");
|
||||
|
||||
interfaceCache.reloadData("1");
|
||||
interfaceCache.reloadData("2");
|
||||
interfaceCache.reloadData("3");
|
||||
interfaceCache.reloadData("4");
|
||||
interfaceCache.reloadData("5");
|
||||
interfaceCache.reloadData("6");
|
||||
logger.info("初始化ApplicationCache Map END <<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
}
|
||||
String path = InitCommandLineRunner.class.getClassLoader().getResource("").getPath();
|
||||
;
|
||||
logger.info("cfgHomeClassURL:" + path);
|
||||
|
|
Loading…
Reference in New Issue