工作流实体类————————————————————-
/** * 审核工作流定义 * @author chenlin */
@Entity
@Table(name = "flow_auditworkflow")
public class AuditWorkflow implements Serializable {
@OneToMany(mappedBy = "auditWorkflow", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<WorkflowSwimlane> workflowSwimlanes;
@OneToMany(mappedBy = "auditWorkflow", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<AuditWorkflowItem> auditWorkflowItems;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
private String workflowName;//工作流名称
private String roleName;//角色
private String memo;//备注
@Override
public int hashCode() {
int hash = 0;
hash += (int) id;
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof AuditWorkflow)) {
return false;
}
AuditWorkflow other = (AuditWorkflow) object;
if (this.id != other.id) {
return false;
}
return true;
}
@Override
public String toString() {
return this.workflowName;
}
set get ........
/** *工作流环节 * @author chenlin */
@Entity
@Table(name = "flow_workflowSwimlane")
public class WorkflowSwimlane implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
@ManyToOne
private AuditWorkflow auditWorkflow;
private String whichLinks;//环节名
@Override
public int hashCode() {
int hash = 0;
hash += (int) getId();
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof WorkflowSwimlane)) {
return false;
}
WorkflowSwimlane other = (WorkflowSwimlane) object;
if (this.getId() != other.getId()) {
return false;
}
return true;
}
set get....
/** * * 审核工作流明细 * @author chenlin */
@Entity
@Table(name = "flow_auditworkflowitem")
public class AuditWorkflowItem implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
@ManyToOne
private AuditWorkflow auditWorkflow;//审核工作流
@OneToOne
private WorkflowRole workflowRole;//工作流角色
@OneToOne
private Employee employee;//员工审批人
private String workflowNodeName;//工作流节点名
private int empOrRole;//0为角色,1为员工标志,2为自己,3为密码确认,4出库仓管员,5为入库仓管员
@Transient
private String empOrRoleStr;
private int status;//状态 1为第一审批人,2为第二审批人以次类推。
private String startAndEndState;//开始结束状态;特殊状态如下:检查状态:在某个节点检查库存数、入库状态:产生入库单
private String docQueryStatus;//单据查询状态;例如:待提交、待审批等等
@OneToOne
private WorkflowSwimlane workflowSwimlane;//所处环节;
@Temporal(javax.persistence.TemporalType.DATE)
private Date startDate;//开始时间
@Temporal(javax.persistence.TemporalType.DATE)
private Date endDate;//结束时间
private boolean noticeState;//消息通知下一节点
private boolean noticeSubmitPerson;//是否消息通知提交人
private boolean printState;//是否打印
private boolean enableFlag;//审批人启用状态,如果没有启用不能使用。
private boolean editFlag;//是否编辑
private boolean editFlag2;//是否编辑某个字段或区域 update flow_auditworkflowitem set editFlag2=0,editFlag3=0,editFlag4=0,editFlag5=0,editFlag6=0,editFlag7=0,editFlag8=0;
private boolean editFlag3;//是否编辑某个字段或区域
private boolean editFlag4;//是否编辑某个字段或区域
private boolean editFlag5;//是否编辑某个字段或区域
private boolean editFlag6;//是否编辑某个字段或区域
private boolean editFlag7;//是否编辑某个字段或区域
private boolean editFlag8;//是否编辑某个字段或区域
public void setEmpOrRole(int empOrRole) {
this.empOrRole = empOrRole;
}
public String getEmpOrRoleStr() {
if (this.empOrRole == 0) {
empOrRoleStr = "角色";
} else if (this.empOrRole == 1) {
empOrRoleStr = "员工";
} else if (this.empOrRole == 2) {
empOrRoleStr = "自己";
} else if (this.empOrRole == 3) {
empOrRoleStr = "密码确认";
}else if (this.empOrRole == 4) {
empOrRoleStr = "出库仓管员";
}else if (this.empOrRole == 5) {
empOrRoleStr = "入库仓管员";
}
return empOrRoleStr;
}
set get...
/** * 工作流角色 * @author chenlin */
@Entity
@Table(name = "flow_workflowrole")
public class WorkflowRole implements Serializable {
@OneToMany(mappedBy = "workflowRole",cascade = CascadeType.ALL, fetch = FetchType.LAZY )
private List<WorkflowRoleItem> workflowRoleItems;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
private String docCode;//编号
private String workflowRoleName;//工作流角色名称
private boolean status;//状态
@Temporal(javax.persistence.TemporalType.DATE)
private Date createDate;
private String creator;//创建人
set get...
/** * 工作流角色明细 * @author chenlin */
@Entity
@Table(name = "flow_workflowroleitem")
public class WorkflowRoleItem implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
@ManyToOne
private WorkflowRole workflowRole;
@OneToOne
private Employee employee;//员工
@Transient
private String userId;
@Transient
private String userName;
@Transient
private String departmentName;
private boolean enableFlag = true;//审批人启用状态
set get...
/** * 工作流任务 * @author chenlin */
@Entity
@Table(name = "flow_wrkflowtask")
public class WorkflowTask implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
@OneToOne
private VouchType vouchType;
@Transient
private String vouchName;//单据名称
@Transient
private String classCode;//单据类名(含包名)
@Transient
private String formClassName; //显示窗口的类名
private String createPerson;//制单人
@Temporal(javax.persistence.TemporalType.DATE)
private Date createDate;//制单日期
@OneToOne
private WorkflowSwimlane workflowSwimlane;//所处环节;
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date auditTime;//审批时间
@Transient
private String auditTimeStr;
private String pendingPerson;//待审批人 主要是查询我待审批任务时用到。
private String approvalPerson;//批量-已审批人//请用英文豆号隔开例如:张三,李四。主要是查询我已审批任务时用到。
private String content;//意见
private boolean endState;
private long formDocId;//来源单据id
private String formDocCode;//来源单据编号
private boolean deleteFlag;//删除标志
private String remark;
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date reqAuditTime;//要求审核完成时间
@Transient
private String reqAuditTimeStr;
/** * @param reqAuditTime the reqAuditTime to set */
public void setReqAuditTime(Date reqAuditTime) {
this.reqAuditTime = reqAuditTime;
}
/** * @return the reqAuditTimeStr */
public String getReqAuditTimeStr() {
if (reqAuditTime != null) {
reqAuditTimeStr = Pub.formatDate(reqAuditTime, "yyyy-MM-dd HH:mm");
}
return reqAuditTimeStr;
}
}
set get...
单据类型实体类—————————————————-
/** *单据类型 * @author chenlin */
@Entity
@Table(name = "vouchtype")
public class VouchType implements Serializable {
@OneToOne
private AuditWorkflow auditWorkflow;//工作流
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private Object selfObject = this;
private String vouchCode;//单据编码
private String vouchName;//单据名称
private String classCode;//单据类名(含包名)
private String formClassName; //显示窗口的类名
private String pre;//单据前缀
private boolean blCancel;//是否可作废该单据类型:true:可作废、false:不可作废
set get....
员工部门相关表—————————————————————————-
/** * 员工信息 * @author chenlin */
@Entity
@PrimaryKeyJoinColumn(name = "Employee_PK")
@Table(name = "hr_employee")
public class Employee extends User {
@Transient
private boolean selection;//是否选中
@ManyToOne
private Department department;
private String tel;//联系电话
private String mobile;//移动电话
private String address;//现住址
private String birthPlace;//出身地址
private String employState;//在职状态
private String post;//职位
private String employeeType;//员工
private String macAddress;//网卡地址
private String bandingMobileDeviceID;//绑定的移动设备ID
private String email;
@Temporal(TemporalType.DATE)
private Date employDate;//入职日期
@Transient
private String employDateStr;
private String idCard;
//
@Temporal(TemporalType.DATE)
private Date birthDate;
@Transient
private boolean create;
@Transient
private String departmentName;
//
@Transient
private String departmentFullName;
private String savePath;
private String photo;
//
@Transient
private byte[] photoBytes;
//
@Transient
private String photoUrl;
//2011-08-03新增 基本资料
private String nation;//民族
private String education;//学历
private String school;//学校 school、professional 2个属性在界面上调反了,但是因为数据已填写了保持不变。
@Temporal(TemporalType.DATE)
private Date graduateDate;//毕业时间
private String professional;//专业
private String temporaryField;//临时字段2013-03-02
private String politicsStatus;//政治面貌
private String maritalStatus;//婚姻状况
private String idNumber;//身份证号码
private String emergencyContactName;//紧急联系人
private String emergencyContactTel;//紧急联系人电话
private String emergencyContactAddress;//紧急联系人地址
//2011-08-03新增 部门资料
private String systemName;//所属系统
private String titleName;//职称
private String titleLevel;//职位等级
private String salaryLevel;//薪资等级
private String workLocation;//工作地点
private String recruitmentChannel;//招聘渠道
@Temporal(javax.persistence.TemporalType.DATE)
private Date contractStartDate;//合同开始日期
@Temporal(javax.persistence.TemporalType.DATE)
private Date contractEndDate;//合同截止日期
@Temporal(javax.persistence.TemporalType.DATE)
private Date twiceContractStartDate;//二次合同开始日期
@Temporal(javax.persistence.TemporalType.DATE)
private Date twiceContractEndDate;//二次合同截止日期
@Temporal(javax.persistence.TemporalType.DATE)
private Date thriceContractStartDate;//三次合同开始日期
@Temporal(javax.persistence.TemporalType.DATE)
private Date thriceContractEndDate;//三次合同截止日期//禁用2014-03-12
private String thriceContractEndDateStr;//三次合同截止日期 长期
private String toFormallyStatus;//转正情况
@Temporal(javax.persistence.TemporalType.DATE)
private Date becomeFormalstaffDate;//转正日期
@Transient
private String seniority;//工龄
private String bHealthCertificate;//是否有健康证明
private String bankCardAccount;//银行卡账号
private String remark;
@Temporal(javax.persistence.TemporalType.DATE)
private Date leaveDate;//离职日期
@Transient
private String leaveDateStr;
private String leaveReason;//离职原因
//部门异动
@Transient
private List<DepartmentTransferRecord> dtRecordList;
@Transient
private List<AwardPunitiveRecord> apRecordList;//奖惩记录
@Transient
private List<TrainRecord> trainRecordList;//培训记录
@Transient
private List<DevelopmentSystemLimits> developmentSystemLimits;//研发系统权限处理
@Transient
private List<Donations> donationList;//爱心捐助
@Transient
private List<PerformanceAppraisal> performanceAppraisals;//绩效考核
@Transient
private List<FilesCatalogue> filesCatalogues;//档案目录
private String enableBandingPC;//操作时绑定电脑 “是” “否” "null" ""
private String enableBandingMobileDevice;//操作时绑定移动设备 “是” “否” "null" ""
public Employee() {
}
public Employee(long id, String userId, String userName, Department department, String tel) {
this.setId(id);
this.setUserId(userId);
this.setUserName(userName);
this.setDepartment(department);
this.setTel(tel);
}
@PostLoad
public void afterload() {
setDepartment(this.getDepartment());
}
//
public String getEmployState() {
return this.employState != null ? this.employState.trim() : "";
}
public void setEmployState(String employState) {
this.employState = employState;
}
/** * @return the departmentName */
public String getDepartmentName() {
if (this.department != null) {
departmentName = this.department.getDepartmentName();
}
return departmentName;
}
public String getPhotoUrl() {
if (photo != null) {
photoUrl = savePath + "/" + photo;
}
return photoUrl;
}
set get...
}
/** * 部门信息 * @author chenlin */
@Entity
@Table(name = "hr_department")
public class Department implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Transient
private boolean selection;//是否被选中
private String departmentName;
private String depCode;//部门编码
@Transient
private Object selfObject = this;
@ManyToOne
private Department parent;
private String strPath;
private int ilevel;
private boolean deleteFlag = false;
@Transient
private boolean create;
}
/** * 用户信息 * @author chenlin */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "um_user")
public class User implements Serializable {
@Transient
private final PropertyChangeSupport propertyChangeSupport;
public void addPropertyChangeListener(PropertyChangeListener listener) {
this.getPropertyChangeSupport().addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
this.getPropertyChangeSupport().removePropertyChangeListener(listener);
}
@Transient
private Object selfObject;
@Transient
private boolean selection;//是否被选中
@Transient
private int serialNumber;//列表显示序号
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String userId;
private String oaUserId;//oa账户 用来发送信息到对应oa账号
private String userName;
private String sex;
private String password;
private boolean allowLogin;
private boolean deleteFlag;
@OneToMany(mappedBy = "user", cascade = {javax.persistence.CascadeType.REMOVE}, fetch = FetchType.LAZY)
private List<UserRole> userRoles;
@OneToMany(mappedBy = "user", cascade = {javax.persistence.CascadeType.REMOVE}, fetch = FetchType.LAZY)
private List<UserPower> userPowers;
@Transient
private List<String> powers;
@Transient
private List<String> roles;
@Transient
private List<Power> newPowers;
@Transient
private List<Role> newGrantedRoles;
@Transient
private List<Role> oldGrantedRoles;
@Transient
private List<Role> revokedRoles;
@Transient
private String roleString;
@Transient
private String powerString;
@Transient
private String powerIds;
public User() {
this.selfObject = this;
this.propertyChangeSupport = new PropertyChangeSupport(this);
this.allowLogin = false;
this.powers = new ArrayList();
this.roles = new ArrayList();
this.newPowers = null;
}
public User(String userId,String userName) {
this.userId = userId;
this.userName = userName;
this.propertyChangeSupport = new PropertyChangeSupport(this);
}
set get ....
用户角色权限相关-
———————————————–
/** *用户角色 * @author chenlin */
@Entity
@Table(name="um_userrole")
public class UserRole implements Serializable {
@Transient
private Object selfObject;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@ManyToOne
private User user;
@ManyToOne
private Role role;
@Transient
private boolean selected;
@Transient
private boolean create;
}
/** *用户权限 * @author chenlin */
@Entity
@Table(name="um_userpower")
public class UserPower implements Serializable {
private static final long serialVersionUID = 1L;
@Transient
private Object selfObject = this;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@ManyToOne
private User user;
@OneToOne
private Power power;
@OneToOne
private Role role;
@Transient
private String roleName;
private String moduleName;
private String powerName;
@Transient
private boolean selected;
@Transient
private boolean create;
}
/** *系统权限 * @author chenlin */
@Entity
@Table(name="um_power")
public class Power implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String displayName;
private String powerName;
@ManyToOne
private Module module;
@Transient
private String fullName;
private int pri;
}
/** *系统角色 * @author chenlin */
@Entity
@Table(name="um_role")
public class Role implements Serializable {
private static final long serialVersionUID = 1L;
@Transient
private Object selfObject = this;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@Column(unique=true)
private String roleName;
@Column(length = 1500)
private String memo;
@OneToMany(mappedBy="role", cascade={javax.persistence.CascadeType.REMOVE}, fetch=FetchType.LAZY)
private List<RolePower> rolePowers;
@Transient
private List<Power> oldGrantedPowers;
@Transient
private List<Power> newGrantedPowers;
@Transient
private List<Power> pendingAddPowers;
@Transient
private List<Power> pendingDelPowers;
@Transient
private boolean create;
@Transient
private boolean selected;
}
**系统模块类**
——————————————
主要存储用户对应权限的模块名称
/** *系统模块 * @author chenlin */
@Entity
@Table(name="um_module")
public class Module implements Serializable {
@OneToMany(mappedBy="module", cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.LAZY)
private List<Power> powers;
private String displayName;//显示名称
private String name;//英文 及路径用名
@Transient
private String oldName;
@Column(length = 1500)
private String memo;
@ManyToOne
private Module parent;
private String m_path;
private String fullName;
private int m_level;
private int pri;
@Transient
private boolean create;
@Transient
private boolean selected;
@Transient
private Object selfObject = this;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
}