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

AutoPoi 在将excel转换为LIst<T>时,对象的属性为LocalDate、LocalDateTIme类型对象,因为其不是Java基础类。会导致转换失败,使用自定义数据处理器也不行。esaypoi可以正常转换。 #6209

Open
TheUserDoesNotExist opened this issue May 7, 2024 · 1 comment

Comments

@TheUserDoesNotExist
Copy link

TheUserDoesNotExist commented May 7, 2024

版本号:JeecgBoot 3.6.3
分支: master
前端版本: vue3
问题描述:

AutoPoi 在将excel转换为LIst时,对象的属性为LocalDate、LocalDateTIme类型对象,因为其不是Java基础类。会导致转换失败,使用自定义数据处理器也不行。esaypoi可以正常转换。

截图&代码:

//ExcelImportUtil.importExcel()方法转换
图片

//excel.show()==true 这里excel为null,报错
图片

//实体类
‘’‘java

public class CcCollect{

/** id */
private Long id;

/** 日期 */
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", format = "yyyy-MM-dd")
private LocalDate date;

/** 创建时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime ;

/** 修改时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;

/** 创建人 */
private String createBy;

‘’‘’

友情提示(为了提高issue处理效率):

  • 未按格式要求发帖、描述过于简抽象的,会被直接删掉;
  • 请自己初判问题描述是否清楚,是否方便我们调查处理;
  • 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;
  • springboot3_sas分支采用 Spring Authorization Server 替换 Shiro,目前是beta版不稳定,生产项目不要使用;
@zhangdaiscott
Copy link
Member

cr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants