Commit 738fdd7c authored by 郑建's avatar 郑建

暂停定时任务报送

parent f54043b0
package cn.quantgroup.report.config.datasource.history;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
@Import(XyqbHistoryDataSourcePreperties.class)
@Configuration
@Slf4j
@MapperScan(basePackages = XyqbHistoryDataSourceConfig.PACKAGE, sqlSessionFactoryRef = "xyqbHistorySqlSessionFactory")
public class XyqbHistoryDataSourceConfig {
static final String PACKAGE = "cn.quantgroup.report.mapper.history";
@Value("${baihang.mapper-locations2}")
private String mapperLocations;
//private String mapperLocations = "classpath:cn/quantgroup/report/mapper/history/*.xml";
@Value("${baihang.type-aliases-package2}")
private String typeAliasesPackage;
//private String typeAliasesPackage = "cn.quantgroup.report.mapper.history";
@Value("${config-location}")
private String configLocation;
@Autowired
private XyqbHistoryDataSourcePreperties xyqbHistoryDataSourcePreperties;
@Bean(name = "xyqbHistoryDataSource")
public DataSource xyqbHistoryDataSource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(xyqbHistoryDataSourcePreperties.getJdbcUrl());
log.info("xyqb历史数据库地址:{}", xyqbHistoryDataSourcePreperties.getJdbcUrl());
config.setPassword(xyqbHistoryDataSourcePreperties.getPassword());
config.setUsername(xyqbHistoryDataSourcePreperties.getUsername());
config.setMaximumPoolSize(xyqbHistoryDataSourcePreperties.getMaxPoolSize());
config.setMinimumIdle(xyqbHistoryDataSourcePreperties.getMinPoolSize());
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
return new HikariDataSource(config);
}
@Bean(name = "xyqbHistoryTransactionManager")
public DataSourceTransactionManager xyqbHistoryTransactionManager(@Qualifier("xyqbHistoryDataSource") DataSource xyqbHistoryDataSource) {
return new DataSourceTransactionManager(xyqbHistoryDataSource);
}
/* @Bean(name = "xyqbHistorySqlSessionFactory")
public SqlSessionFactory xyqbHistorySqlSessionFactory(@Qualifier("xyqbHistoryDataSource") DataSource xyqbHistoryDataSource) throws Exception {
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(xyqbHistoryDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(mapperLocations));
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
sessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver()
.getResource(configLocation));
return sessionFactory.getObject();
}*/
/*
@Bean(name = "xyqbHistorySqlSessionTemplate")
public SqlSessionTemplate xyqbHistorySqlSessionTemplate(@Qualifier("xyqbHistorySqlSessionFactory") SqlSessionFactory xyqbHistorySqlSessionFactory) throws Exception {
return new SqlSessionTemplate(xyqbHistorySqlSessionFactory);
}*/
@Bean(name = "xyqbHistoryJdbcTemplate")
public JdbcTemplate primaryJdbcTemplate(@Qualifier("xyqbHistoryDataSource") DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
}
//package cn.quantgroup.report.config.datasource.history;
//
//
//import com.zaxxer.hikari.HikariConfig;
//import com.zaxxer.hikari.HikariDataSource;
//import lombok.extern.slf4j.Slf4j;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Import;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource;
//
//@Import(XyqbHistoryDataSourcePreperties.class)
//@Configuration
//@Slf4j
//@MapperScan(basePackages = XyqbHistoryDataSourceConfig.PACKAGE, sqlSessionFactoryRef = "xyqbHistorySqlSessionFactory")
//public class XyqbHistoryDataSourceConfig {
//
//
// static final String PACKAGE = "cn.quantgroup.report.mapper.history";
//
// @Value("${baihang.mapper-locations2}")
// private String mapperLocations;
// //private String mapperLocations = "classpath:cn/quantgroup/report/mapper/history/*.xml";
//
// @Value("${baihang.type-aliases-package2}")
// private String typeAliasesPackage;
// //private String typeAliasesPackage = "cn.quantgroup.report.mapper.history";
//
// @Value("${config-location}")
// private String configLocation;
//
// @Autowired
// private XyqbHistoryDataSourcePreperties xyqbHistoryDataSourcePreperties;
//
// @Bean(name = "xyqbHistoryDataSource")
// public DataSource xyqbHistoryDataSource() {
// HikariConfig config = new HikariConfig();
// config.setJdbcUrl(xyqbHistoryDataSourcePreperties.getJdbcUrl());
// log.info("xyqb历史数据库地址:{}", xyqbHistoryDataSourcePreperties.getJdbcUrl());
// config.setPassword(xyqbHistoryDataSourcePreperties.getPassword());
// config.setUsername(xyqbHistoryDataSourcePreperties.getUsername());
// config.setMaximumPoolSize(xyqbHistoryDataSourcePreperties.getMaxPoolSize());
// config.setMinimumIdle(xyqbHistoryDataSourcePreperties.getMinPoolSize());
// config.addDataSourceProperty("cachePrepStmts", "true");
// config.addDataSourceProperty("prepStmtCacheSize", "250");
// config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
// return new HikariDataSource(config);
// }
//
// @Bean(name = "xyqbHistoryTransactionManager")
// public DataSourceTransactionManager xyqbHistoryTransactionManager(@Qualifier("xyqbHistoryDataSource") DataSource xyqbHistoryDataSource) {
// return new DataSourceTransactionManager(xyqbHistoryDataSource);
// }
//
// /* @Bean(name = "xyqbHistorySqlSessionFactory")
// public SqlSessionFactory xyqbHistorySqlSessionFactory(@Qualifier("xyqbHistoryDataSource") DataSource xyqbHistoryDataSource) throws Exception {
// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
// sessionFactory.setDataSource(xyqbHistoryDataSource);
// sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
// .getResources(mapperLocations));
// sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
// sessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver()
// .getResource(configLocation));
// return sessionFactory.getObject();
// }*/
///*
// @Bean(name = "xyqbHistorySqlSessionTemplate")
// public SqlSessionTemplate xyqbHistorySqlSessionTemplate(@Qualifier("xyqbHistorySqlSessionFactory") SqlSessionFactory xyqbHistorySqlSessionFactory) throws Exception {
// return new SqlSessionTemplate(xyqbHistorySqlSessionFactory);
// }*/
//
// @Bean(name = "xyqbHistoryJdbcTemplate")
// public JdbcTemplate primaryJdbcTemplate(@Qualifier("xyqbHistoryDataSource") DataSource dataSource) {
// return new JdbcTemplate(dataSource);
// }
//
//}
package cn.quantgroup.report.controller.external;
import cn.quantgroup.report.job.SynLoanInfoHistoryTask;
import cn.quantgroup.report.response.GlobalResponse;
import cn.quantgroup.report.service.baihang.BaiHangZhuDaiService;
import cn.quantgroup.report.service.manualTool.ManualToolService;
......@@ -41,22 +41,19 @@ public class ExZhuDaiBaiHangReSendController {
@Autowired
BaiHangZhuDaiService baiHangZhuDaiService;
@Autowired
private SynLoanInfoHistoryTask synLoanInfoHistoryTask;
@Autowired
private ManualToolService manualToolService;
@RequestMapping("/manual/synTable/historyAndplan")
public String historyAndplan(String p3,String secretKey){
if(manualToolService.checkSecretKey(p3,secretKey)){
//增量同步history和plan表数据
synLoanInfoHistoryTask.syn_historyAndplan_by_id();
return "historyAndplan任务调度完成";
}else{
return "historyAndplan任务调度失败,参数错误";
}
}
// @RequestMapping("/manual/synTable/historyAndplan")
// public String historyAndplan(String p3,String secretKey){
// if(manualToolService.checkSecretKey(p3,secretKey)){
// //增量同步history和plan表数据
// synLoanInfoHistoryTask.syn_historyAndplan_by_id();
// return "historyAndplan任务调度完成";
// }else{
// return "historyAndplan任务调度失败,参数错误";
// }
// }
//存量整理公共方法
......@@ -284,27 +281,27 @@ public class ExZhuDaiBaiHangReSendController {
}
}
@RequestMapping("/manual/syn_history_by_CreatedAt")
public String syn_history_by_CreatedAt(String p3,String secretKey){
if(manualToolService.checkSecretKey(p3,secretKey)){
//增量同步rc_real_time_data_pool_v2.xyqb_i_loan_application_manifest_history
synLoanInfoHistoryTask.syn_history_by_CreatedAt();
return "syn_history_by_CreatedAt任务调度完成";
}else{
return "syn_history_by_CreatedAt任务调度失败,参数错误";
}
}
@RequestMapping("/manual/syn_plan_by_CreatedAt")
public String syn_plan_by_CreatedAt(String p3,String secretKey){
if(manualToolService.checkSecretKey(p3,secretKey)){
//增量同步rc_real_time_data_pool_v2.xyqb_i_repayment_plan
synLoanInfoHistoryTask.syn_plan_by_CreatedAt();
return "syn_plan_by_CreatedAt任务调度完成";
}else{
return "syn_plan_by_CreatedAt任务调度失败,参数错误";
}
}
// @RequestMapping("/manual/syn_history_by_CreatedAt")
// public String syn_history_by_CreatedAt(String p3,String secretKey){
// if(manualToolService.checkSecretKey(p3,secretKey)){
// //增量同步rc_real_time_data_pool_v2.xyqb_i_loan_application_manifest_history
// synLoanInfoHistoryTask.syn_history_by_CreatedAt();
// return "syn_history_by_CreatedAt任务调度完成";
// }else{
// return "syn_history_by_CreatedAt任务调度失败,参数错误";
// }
// }
//
// @RequestMapping("/manual/syn_plan_by_CreatedAt")
// public String syn_plan_by_CreatedAt(String p3,String secretKey){
// if(manualToolService.checkSecretKey(p3,secretKey)){
// //增量同步rc_real_time_data_pool_v2.xyqb_i_repayment_plan
// synLoanInfoHistoryTask.syn_plan_by_CreatedAt();
// return "syn_plan_by_CreatedAt任务调度完成";
// }else{
// return "syn_plan_by_CreatedAt任务调度失败,参数错误";
// }
// }
@RequestMapping("/manual/d3CheckToJson")
public String d3CheckToJson(String p3,String secretKey, String filePath){
......
......@@ -39,8 +39,8 @@ public class QuantGroupZhuDaiReportToBaiHang {
@Autowired
private BaiHangZhuDaiService baiHangZhuDaiService;
@Autowired
private SynLoanInfoHistoryTask synLoanInfoHistoryTask;
// @Autowired
// private SynLoanInfoHistoryTask synLoanInfoHistoryTask;
@Autowired
private DingTalk dingTalk;
......
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