2229499815 / async-excel Goto Github PK
View Code? Open in Web Editor NEW一个基于easyexcel大数据量数据导入导出异步处理组件
License: Apache License 2.0
一个基于easyexcel大数据量数据导入导出异步处理组件
License: Apache License 2.0
场景是这样的:我的项目配置了一个 mybatplus填充器。
/**
* 填充 创建人、更新人信息
*/
@Bean
public MetaObjectHandler metaObjectHandler() {
return new CreatorAndUpdatorInfoHandler();
}
但是我发现没有生效,debug之后发现,是async的GlobalConfig 把项目中的GlobalConfig替换了,这样我的MetaObjectHandler 就失效了。
/**
* @Description TODO
* @Author 姚仲杰#80998699
* @Date 2022/7/5 16:37
*/
@Configuration
@MapperScan(value = "com.asyncexcel.springboot.context.mapper",sqlSessionFactoryRef = "excelSqlSessionFactory")
@EnableConfigurationProperties({ExcelDataSourceProperties.class,MybatisPlusProperties.class})
public class ExcelMybatisPlusConfiguration {
@Bean("excelDataSource")
public DataSource dataSource(ExcelDataSourceProperties properties){
HikariDataSource hikariDataSource = new HikariDataSource();
hikariDataSource.setJdbcUrl(properties.getUrl());
hikariDataSource.setUsername(properties.getUsername());
hikariDataSource.setPassword(properties.getPassword());
hikariDataSource.setDriverClassName(properties.getDriverClassName());
return hikariDataSource;
}
@Bean("excelSqlSessionFactory")
public SqlSessionFactory sqlSessionFactory(@Qualifier("excelDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
mybatisSqlSessionFactoryBean.setVfs(SpringBootVFS.class);
mybatisSqlSessionFactoryBean.setDataSource(dataSource);
GlobalConfig globalConfig = new GlobalConfig();
DbConfig dbConfig = new DbConfig();
dbConfig.setIdType(IdType.AUTO);
globalConfig.setDbConfig(dbConfig);
mybatisSqlSessionFactoryBean.setGlobalConfig(globalConfig);
return mybatisSqlSessionFactoryBean.getObject();
}
}
setGlobalConfig 导致我的失效了?没有仔细debug去看源码了,结果是前端提交一片报错 ,因为我的表的createDt等字段都是自动填充的。
excelService.listPage,返回的total=0,麻烦帮忙看看是什么问题
现在只有application.prop的写法
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.