4f8948a1cf21132d8ac6027f2785ba05758cfab4.svn-base
3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.oa.entity;
import java.util.List;
import org.hibernate.validator.constraints.Length;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.Collections3;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.sys.entity.User;
/**
* 通知通告Entity
* @author ThinkGem
* @version 2014-05-16
*/
public class OaNotify extends DataEntity<OaNotify> {
private static final long serialVersionUID = 1L;
private String type; // 类型
private String title; // 标题
private String content; // 类型
private String files; // 附件
private String status; // 状态
private String readNum; // 已读
private String unReadNum; // 未读
private boolean isSelf; // 是否只查询自己的通知
private String readFlag; // 本人阅读状态
private List<OaNotifyRecord> oaNotifyRecordList = Lists.newArrayList();
public OaNotify() {
super();
}
public OaNotify(String id){
super(id);
}
@Length(min=0, max=200, message="标题长度必须介于 0 和 200 之间")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Length(min=0, max=1, message="类型长度必须介于 0 和 1 之间")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Length(min=0, max=2000, message="附件长度必须介于 0 和 2000 之间")
public String getFiles() {
return files;
}
public void setFiles(String files) {
this.files = files;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getReadNum() {
return readNum;
}
public void setReadNum(String readNum) {
this.readNum = readNum;
}
public String getUnReadNum() {
return unReadNum;
}
public void setUnReadNum(String unReadNum) {
this.unReadNum = unReadNum;
}
public List<OaNotifyRecord> getOaNotifyRecordList() {
return oaNotifyRecordList;
}
public void setOaNotifyRecordList(List<OaNotifyRecord> oaNotifyRecordList) {
this.oaNotifyRecordList = oaNotifyRecordList;
}
/**
* 获取通知发送记录用户ID
* @return
*/
public String getOaNotifyRecordIds() {
return Collections3.extractToString(oaNotifyRecordList, "user.id", ",") ;
}
/**
* 设置通知发送记录用户ID
* @return
*/
public void setOaNotifyRecordIds(String oaNotifyRecord) {
this.oaNotifyRecordList = Lists.newArrayList();
for (String id : StringUtils.split(oaNotifyRecord, ",")){
OaNotifyRecord entity = new OaNotifyRecord();
entity.setId(IdGen.uuid());
entity.setOaNotify(this);
entity.setUser(new User(id));
entity.setReadFlag("0");
this.oaNotifyRecordList.add(entity);
}
}
/**
* 获取通知发送记录用户Name
* @return
*/
public String getOaNotifyRecordNames() {
return Collections3.extractToString(oaNotifyRecordList, "user.name", ",") ;
}
/**
* 设置通知发送记录用户Name
* @return
*/
public void setOaNotifyRecordNames(String oaNotifyRecord) {
// 什么也不做
}
public boolean isSelf() {
return isSelf;
}
public void setSelf(boolean isSelf) {
this.isSelf = isSelf;
}
public String getReadFlag() {
return readFlag;
}
public void setReadFlag(String readFlag) {
this.readFlag = readFlag;
}
}