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

注解@J4EFormat、@J4EDateFormat无效 #122

Open
Lsx1131188021 opened this issue Jan 9, 2019 · 1 comment
Open

注解@J4EFormat、@J4EDateFormat无效 #122

Lsx1131188021 opened this issue Jan 9, 2019 · 1 comment
Assignees

Comments

@Lsx1131188021
Copy link

Lsx1131188021 commented Jan 9, 2019

试了N多个版本的nutz-integration-json4excel,nutz版本1.r.62,使用对应版本发现各种问题,又尝试下载最新快照版本仍有问题。
示例:
User.java

@Table("ua_user")
@J4EName("用户信息")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @Name
    @Column("USER_ID")
    @Prev(els = @EL("uuid(32)"))
    @J4EIgnore
    private String userId;

    @Column("USER_NAME")
    @J4EName("用户名")
    private String userName;

    @Column("LOGON_NAME")
    @J4EName("登录名")
    @J4EFormat(UpperCase = true)
    private String logonName;

    @Column("PASSWORD")
    @J4EIgnore
    private String password;

    @Column("ORGAN_ID")
    @J4EIgnore
    private String organId;

    @Column("STATUS")
    @J4EIgnore
    private String status;

    @Column("CURRENT_LOGON_DATE")
    @J4EName("最近登录时间")
    @J4EDefine(type = J4EColumnType.DATE)
    @J4EDateFormat(from = "yyyy-MM-dd HH:mm:ss", to = "yyyy-MM-dd")
    private Date currentLogonDate;

    @Column("LOCK_FLAG")
    @J4EName("锁定标识")
    @J4EDefine(type = J4EColumnType.NUMERIC, precision = 4)
    private String lockFlag;

    @Column("LOCK_DATE")
    @J4EIgnore
    private Date lockDate;`
导出excel操作:
`List<User> users = dao.query(User.class, null);
        File file = tempFilePool.createFile("人员数据.xls");
        boolean success = J4E.toExcel(file, users, null);
        if (success) {
            return file;
        }

最终生成的excel内容没办法上传图片,我直接描述问题:
1、J4EDateFormat注解字段日期格式化失效;
2、type = J4EColumnType.NUMERIC, precision = 4导出数据无变化;
3、J4EFormat(UpperCase = true)无效;
4、在对应1.r.62版本J4EIgnore注解也无效。
这个插件用的人比较少,这次尝试一下,问题比较多,建议再做些优化。本人不是大牛,只是简单把我使用出现的问题描述出来。

@wendal
Copy link
Member

wendal commented Jan 9, 2019

帮你 @pangwu86

@pangwu86 pangwu86 self-assigned this Jan 9, 2019
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

3 participants