Giter Site home page Giter Site logo

doexcel's Introduction

DoExcel

介绍

专注于 Excel 处理操作

注解

  • @DoSheet 针对单元表
title 单元表的标题
localeResource 国际化资源文件地址
  • @Column 针对实体类属性 也对应 Excel 列数据
name 字段名称
columnEnums 配置字段值需要转换输出注解
  • @ColumnEnum 当作 @Column 注解的属性
code 需要转换的字符串
value 转换之后的字符串

操作方法

已实现功能

  • 注解配置,导出 Excel 文件

  • 支持国际化(单元表标题,列标题以及某个字段)

    只需要在实体类上加上 @DoSheet 注解,同时配置属性 localeResource 然后国际化资源文件对应 @ColumnEnum 的 value 属性即可

  • 支持字段值转换输出(比如某个字段 status 取值 {0: 无效, 1: 有效} 最终导出数据用户希望看到的是字符串而非数字)

    正常导出数据是这样:

    ID status
    1 1

    用户其实想看到这样:

    ID status
    1 有效

    需要在实体类的字段里面这样:

@DoSheet(title = "终端信息表")
public class ExcelAgent {
    @Column(name = "id")
    private Long id;
    @Column(name = "status", columnEnums = {
            @ColumnEnum(code = "0", value = "无效"),
            @ColumnEnum(code = "1", value = "有效")
            })
    private Integer status;

    // 省略 get set
}

  • 支持自动计算列宽度,根据值长度自适应

  • 支持时间格式化输出

待实现功能

  • 关于国际化,目前基于注解和枚举初步实现简体中文、繁体中文、英文共 3 种,暂不支持其他语言国际化,后续这一块会放宽限制
  • 支持异步操作, 异步操作可随时取得进度描述
  • 可以预先制定使用内存大小, 防止 OOM
  • 提供 csv 导入 导出

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.