Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

版本:3.0.1 @ColumnWidth失效 #2151

Closed
ld-github opened this issue Oct 27, 2021 · 2 comments
Closed

版本:3.0.1 @ColumnWidth失效 #2151

ld-github opened this issue Oct 27, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ld-github
Copy link

同样的代码,在3.0.0-beta3是正常导出的,在3.0.1版本中自定义宽度失效,其它注解正常
触发Bug的代码

    /**
     * 订单号
     */
    @ColumnWidth(25)
    @ExcelProperty(value = "订单号", order = 1)
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
    private String orderNo;

    /**
     * 订单标题
     */
    @ColumnWidth(75)
    @ExcelProperty(value = "订单标题", order = 2)
    private WriteCellData<String> title;

    /**
     * 总金额
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "总金额", order = 4)
    private String totalAmount;

    /**
     * 支付金额
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "支付金额", order = 5)
    private String payAmount;

    /**
     * 支付类型
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "支付类型", order = 6)
    private String payType;

    /**
     * 订单类型
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "订单类型", order = 7)
    private String type;

    /**
     * 订单状态
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "订单状态", order = 8)
    private String state;

    /**
     * 支付状态
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "支付状态", order = 9)
    private String payState;

    /**
     * 下单时间
     */
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    @ColumnWidth(20)
    @ExcelProperty(value = "下单时间", order = 10)
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
    private Date orderDatetime;

    /**
     * 收货人姓名
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "收货人姓名", order = 11)
    private String rcvName;

    /**
     * 收货人电话号码
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "收货人电话号码", order = 12)
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
    private String rcvFullPhoneNo;

    /**
     * 收货人电话号码
     */
    @ColumnWidth(60)
    @ExcelProperty(value = "收货人地址", order = 13)
    private String rcvFullAddr;

    /**
     * 发货类型(无, 物流, 线上, 自提)
     */
    @ColumnWidth(40)
    @ExcelProperty(value = "发货类型(无, 物流, 线上, 自提)", order = 14)
    private String deliveryType;

    /**
     * 物流编号
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "物流单号", order = 15)
    private String logisticsNo;

    /**
     * 物流公司编码
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "物流公司编码", order = 16)
    private String logisticsCompanyCode;

    /**
     * 物流公司名称
     */
    @ColumnWidth(30)
    @ExcelProperty(value = "物流公司名称", order = 17)
    private String logisticsCompanyName;

写流代码:
try (OutputStream os = response.getOutputStream()) {
EasyExcel.write(os, OrderExcelRow.class)
.sheet(0)
.doWrite(() -> {

@ld-github ld-github added the bug Something isn't working label Oct 27, 2021
@zhangyang-gg
Copy link

就是,我还以为我哪里写的有问题呢

@zhuangjiaju
Copy link
Collaborator

3.0.2 中已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants