66 lines
1.9 KiB
Java
66 lines
1.9 KiB
Java
package com.tenwa.flow.action.comm;
|
|
|
|
import com.amarsoft.app.lc.util.DateAssistant;
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.context.ASUser;
|
|
|
|
public abstract class BaseTable {
|
|
public String CurUserID;
|
|
private ASUser asUser;
|
|
public void initUser()throws Exception{
|
|
if(null!=this.CurUserID&&this.CurUserID.length()>0){
|
|
this.asUser=new ASUser(CurUserID);
|
|
}else{
|
|
this.CurUserID="admin";
|
|
this.asUser=new ASUser(CurUserID);
|
|
}
|
|
}
|
|
public BizObject initTabeUserInfo(BizObject bo) throws Exception{
|
|
|
|
if(null!=CurUserID){
|
|
String creator_="";
|
|
if(bo.indexOfAttribute("InputUserID")>0){
|
|
creator_=bo.getAttribute("InputUserID").toString();
|
|
if(null!=creator_&&creator_.length()<=0){
|
|
bo.setAttributeValue("InputUserID", this.CurUserID);
|
|
if(bo.indexOfAttribute("InputTime")>0){
|
|
bo.setAttributeValue("InputTime", DateAssistant.getTodayNow());
|
|
}
|
|
if(bo.indexOfAttribute("InputOrgID")>0){
|
|
bo.setAttributeValue("InputOrgID", this.getAsUser().getOrgID());
|
|
}
|
|
|
|
}else{
|
|
if(bo.indexOfAttribute("UpdateUserID")>0){
|
|
bo.setAttributeValue("UpdateUserID",this.CurUserID);
|
|
if(bo.indexOfAttribute("UpdateTime")>0){
|
|
bo.setAttributeValue("UpdateTime", DateAssistant.getTodayNow());
|
|
}
|
|
if(bo.indexOfAttribute("UpdateOrgID")>0){
|
|
bo.setAttributeValue("UpdateOrgID", this.getAsUser().getOrgID());
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
return bo;
|
|
}
|
|
public ASUser getAsUser()throws Exception {
|
|
if(null==asUser){
|
|
this.initUser();
|
|
}
|
|
return asUser;
|
|
}
|
|
public void setAsUser(ASUser asUser) {
|
|
this.asUser = asUser;
|
|
}
|
|
public String getCurUserID() {
|
|
return CurUserID;
|
|
}
|
|
public void setCurUserID(String curUserID) {
|
|
CurUserID = curUserID;
|
|
}
|
|
}
|