1.BeanUtil.copyProperties(securityEmployee, loginInfo);
loginInfo 的属性如下
@TableId
private String userId;
private String cname;
private String plant;
private String mail;
private String deptId;
private LocalDateTime updateTime;
private LocalDateTime lockTime;
private Integer retryCount;
securityEmployee的属性如下
@TableId
@Alias("userId")
protected String emplid;
protected String cname;
protected String mail;
protected String plant;
@Alias("deptId")
protected String deptid;
securityEmployee的emplid 与 loginInfo的userId 不对应,使用BeanUtil.copyProperties(securityEmployee, loginInfo);将securityEmployee的值复制给loginInfo时
会导致userId 的值为空。所以这里@Alias("userId") 在属性上使用别名。