pull/5/head
infin_caishuxiao 8 years ago
parent ee64870a53
commit be5d8b0156

@ -1,4 +1,4 @@
package com.xxl.job.executor;
package com.infincash.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@ -1,4 +1,4 @@
package com.xxl.job.executor.core.config;
package com.infincash.config;
import javax.sql.DataSource;
@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@Configuration
@MapperScan(basePackages = {"com.infincash.statistics.risk.mapper.prd"}, sqlSessionFactoryRef = "sqlSessionFactoryPrd")
@MapperScan(basePackages = {"com.infincash.cron.collection.mapper"}, sqlSessionFactoryRef = "sqlSessionFactoryPrd")
public class PrdDbConfig {
static final String MAPPER_LOCATION = "classpath:mapping/prd/*.xml";

@ -1,4 +1,4 @@
package com.xxl.job.executor.core.config;
package com.infincash.config;
import com.xxl.job.core.executor.XxlJobExecutor;
import org.slf4j.Logger;

@ -4,12 +4,12 @@ import static com.infincash.util.Jdk8DateUtils.dateSubstract;
import static com.infincash.util.Jdk8DateUtils.getDateAfter;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -19,6 +19,7 @@ import com.infincash.cron.collection.table.TBizCollection;
import com.infincash.cron.collection.table.TBizCollectionOverdueBucket;
import com.xxl.job.core.log.XxlJobLogger;
@Service
public class CronCollectionServiceImpl implements CronCollectionService
{
@Autowired

@ -1,39 +0,0 @@
package com.xxl.job.executor.core.config;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@Configuration
@MapperScan(basePackages = {"com.infincash.statistics.risk.mapper.stats"}, sqlSessionFactoryRef = "sqlSessionFactoryStats")
public class StatsDbConfig {
static final String MAPPER_LOCATION = "classpath:mapping/stats/*.xml";
@Autowired
@Qualifier("stats")
private DataSource stats;
@Bean
public SqlSessionFactory sqlSessionFactoryStats() throws Exception {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
factoryBean.setDataSource(stats);
factoryBean.setMapperLocations(
new PathMatchingResourcePatternResolver().getResources(MAPPER_LOCATION)
);
return factoryBean.getObject();
}
@Bean
public SqlSessionTemplate sqlSessionTemplateStats() throws Exception {
SqlSessionTemplate template = new SqlSessionTemplate(sqlSessionFactoryStats()); // 使用上面配置的Factory
return template;
}
}

@ -1,9 +1,9 @@
spring.datasource.prd.url=jdbc:mysql://47.74.188.197:3306/microfinance?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
spring.datasource.prd.url=jdbc:mysql://172.16.16.99:3306/microfinance?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
spring.datasource.prd.username=jobopr
spring.datasource.prd.password=jobopr666
spring.datasource.prd.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.stats.url=jdbc:mysql://47.74.188.197:3306/microfinance1?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
spring.datasource.stats.url=jdbc:mysql://172.16.16.99:3306/microfinance1?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
spring.datasource.stats.username=jobopr
spring.datasource.stats.password=jobopr666
spring.datasource.stats.driver-class-name=com.mysql.jdbc.Driver
@ -19,7 +19,7 @@ logging.config=classpath:logback.xml
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:8090
xxl.job.admin.addresses=http://172.16.16.101:8090
#xxl.job.admin.addresses=http://dispatch-center.infincash.com
### xxl-job executor address

@ -5,7 +5,7 @@ import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.xxl.job.executor.Application;
import com.infincash.config.Application;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class ,webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT)

Loading…
Cancel
Save