📄 nodert.java
字号:
package cn.myapps.core.workflow.storage.runtime.ejb;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import cn.myapps.base.dao.ValueObject;
import cn.myapps.core.user.action.WebUser;
import cn.myapps.core.workflow.element.Node;
import cn.myapps.util.sequence.Sequence;
import cn.myapps.util.sequence.SequenceException;
/**
* @hibernate.class table="T_NODERT"
*/
public class NodeRT extends ValueObject {
private String id;
private String nodeid;
private String name;
private String flowid;
private String docid;
private Collection actorrts = new HashSet();
public NodeRT(String docid, String flowid, Node node)
throws SequenceException {
setId(Sequence.getSequence());
setName(node.name);
setNodeid(node.id);
setDocid(docid);
setFlowid(flowid);
}
public NodeRT() {
}
/**
* @hibernate.id column="ID" generator-class="assigned"
*/
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
/**
* @hibernate.property column="NAME"
* @return
*/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* @hibernate.property column="NODEID"
* @return
*/
public String getNodeid() {
return nodeid;
}
public void setNodeid(String nodeid) {
this.nodeid = nodeid;
}
/**
* @hibernate.property column="FLOWID"
* @return
*/
public String getFlowid() {
return flowid;
}
public void setFlowid(String flowid) {
this.flowid = flowid;
}
/**
* @hibernate.set name="actorrts" table="T_ACTORRT" inverse="false"
* cascade="all"
*
* @hibernate.collection-key column="NODERT_ID"
*
* @hibernate.collection-one-to-many class="cn.myapps.core.workflow.storage.runtime.ejb.ActorRT"
* @return
*/
public Collection getActorrts() {
return actorrts;
}
public void setActorrts(Collection actorrts) {
this.actorrts = actorrts;
}
/**
* @hibernate.property column="DOCID"
*/
public String getDocid() {
return docid;
}
public void setDocid(String docid) {
this.docid = docid;
}
public boolean isContainInActors(WebUser user) {
boolean flag = false;
if (actorrts != null) {
outloop: for (Iterator iter = actorrts.iterator(); iter.hasNext();) {
ActorRT actrt = (ActorRT) iter.next();
switch (actrt.getType()) {
case Type.TYPE_DEPARTMENT:
if (user.getDepartments() != null) {
if (user.getDepartmentById(actrt.getActorid()) != null) {
flag = true;
break outloop;
}
}
break;
case Type.TYPE_ROLE:
if (user.getRoles() != null) {
if (user.getRoleById(actrt.getActorid()) != null) {
flag = true;
break outloop;
}
}
break;
case Type.TYPE_USER:
if (user.getId() != null
&& user.getId().equals(actrt.getActorid())) {
flag = true;
break outloop;
}
break;
}
}
}
return flag;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -