70 lines
1.6 KiB
Java
70 lines
1.6 KiB
Java
package cn.bean;
|
||
|
||
import java.io.Serializable;
|
||
|
||
import com.amarsoft.are.ARE;
|
||
import com.amarsoft.are.jbo.BizObject;
|
||
import com.amarsoft.are.jbo.BizObjectManager;
|
||
import com.amarsoft.are.jbo.JBOException;
|
||
import com.amarsoft.are.jbo.JBOFactory;
|
||
|
||
/**
|
||
* 重新构建用户对象,区别于ASUser,该类仅仅是一个简单的POJO
|
||
* @author yangsong
|
||
* @date 2014-1-21
|
||
*/
|
||
public class User implements Serializable,Cloneable{
|
||
|
||
private static final long serialVersionUID = 6977258491539684334L;
|
||
|
||
private String userId;
|
||
private String userName;
|
||
private String status;
|
||
|
||
private Org org;
|
||
|
||
public User(){
|
||
}
|
||
|
||
public User(String userID){
|
||
try {
|
||
BizObjectManager bm = JBOFactory.getFactory().getManager("jbo.sys.USER_INFO");
|
||
BizObject user = bm.createQuery("UserID=:UserID").setParameter("UserID", userID).getSingleResult(false);
|
||
if(user==null)return;
|
||
this.userId = userID;
|
||
this.userName = user.getAttribute("UserName").getString();
|
||
this.status = user.getAttribute("Status").getString();
|
||
this.org = new Org(user.getAttribute("BelongOrg").getString());
|
||
} catch (JBOException e) {
|
||
ARE.getLog().error("构造User对象出错!");
|
||
e.printStackTrace();
|
||
}
|
||
}
|
||
|
||
public String getUserId() {
|
||
return userId;
|
||
}
|
||
public void setUserId(String userId) {
|
||
this.userId = userId;
|
||
}
|
||
public String getUserName() {
|
||
return userName;
|
||
}
|
||
public void setUserName(String userName) {
|
||
this.userName = userName;
|
||
}
|
||
public String getStatus() {
|
||
return status;
|
||
}
|
||
public void setStatus(String status) {
|
||
this.status = status;
|
||
}
|
||
|
||
public Org getOrg() {
|
||
return org;
|
||
}
|
||
public void setOrg(Org org) {
|
||
this.org = org;
|
||
}
|
||
}
|