liujiaji 6397d906b5 src_app 移除
src_app_fresh 添加
2018-06-11 13:40:56 +08:00

70 lines
1.6 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}