getRemindInfo.jsp
19.6 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="weaver.general.Util"%>
<%@ page import="java.util.*"%>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@ page import="weaver.hrm.User"%>
<%@ page import="weaver.conn.RecordSet"%>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<%@ page import="weaver.login.LicenseCheckLogin" %>
<%@page import="weaver.hrm.settings.ChgPasswdReminder"%>
<%@page import="weaver.hrm.settings.RemindSettings"%>
<%@page import="weaver.file.Prop"%>
<%
String isTimeOutLogin = Prop.getPropValue("Others","isTimeOutLogin");
User user = HrmUserVarify.getUser (request , response) ;
String result = "[{\"name\":\"" + SystemEnv.getHtmlLabelName(22521, user.getLanguage()) + "\",\"key\":\"nodata\",\"isfirst\":\"1\"}]";
if("2".equals(isTimeOutLogin)){
out.print(result);
return;
}
String userOffline = Util.null2String((String)session.getAttribute("userOffline"));
if(userOffline.equals("1")){
//强制下线
String loginfile = Util.getCookie(request , "loginfileweaver") ;
Map userSessions = (Map) application.getAttribute("userSessions");
if (userSessions != null) {
Map logmessages = (Map) application.getAttribute("logmessages");
if (logmessages != null)logmessages.remove("" + user.getUID());
session.removeValue("moniter");
session.removeValue("WeaverMailSet");
userSessions.remove(user.getUID());
session.invalidate();
}%>
<script language="javascript">
window.top.Dialog.alert("<%=SystemEnv.getErrorMsgName(175,user.getLanguage())%>",function(){
window.top.location="<%="/Refresh.jsp?loginfile="+loginfile+"&message=175"%>";
});
</script>
<%
return;
}
//更新人员在线统计时间戳
LicenseCheckLogin onlineu = new LicenseCheckLogin();
onlineu.setOutLineDate(user.getUID());
result = getRemindMenu(user);
out.clearBuffer();
out.print(result);
%>
<%!private String getRemindMenu(User user) {
if (user == null) {
return null;
}
String s = "";
int bgcnt = 4;
int bgindex = 4;
String[] sbgPostions = new String[] { "0 -28", "0 -84", "0 0", "0 -56" };
RecordSet rs = new RecordSet();
// RequestUtil ru = new RequestUtil();
String sql = "";
int userid = user.getUID();
int usertype = Util.getIntValue(user.getLogintype(), 1) - 1;
String userID = String.valueOf(user.getUID());
//int userid=user.getUID();
String belongtoshow = "";
rs.executeSql("select * from HrmUserSetting where resourceId = " + userID);
if (rs.next()) {
belongtoshow = rs.getString("belongtoshow");
}
String userIDAll = String.valueOf(user.getUID());
String Belongtoids = user.getBelongtoids();
int Belongtoid = 0;
String[] arr2 = null;
ArrayList<String> userlist = new ArrayList();
userlist.add(userid + "");
if (!"".equals(Belongtoids)) {
userIDAll = userID + "," + Belongtoids;
arr2 = Belongtoids.split(",");
for (int i = 0; i < arr2.length; i++) {
Belongtoid = Util.getIntValue(arr2[i]);
userlist.add(Belongtoid + "");
}
}
if ("1".equals(belongtoshow)) {
if (rs.getDBType().equals("oracle")) {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid in ("
+ userIDAll
+ ") and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid in ("
+ userIDAll
+ ") AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1))or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid in("
+ userIDAll + "))) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
} else if(rs.getDBType().equals("mysql")){
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid in ("
+ userIDAll
+ ") and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid in ("
+ userIDAll
+ ") AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1))or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid in("
+ userIDAll + "))) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}else {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid in ("
+ userIDAll
+ ") and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid in ("
+ userIDAll
+ ") AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid in("
+ userIDAll + "))) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}
} else {
if (rs.getDBType().equals("oracle")) {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid="
+ userid
+ " and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid="
+ userid
+ " AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid ="
+ userid + ")) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}else if(rs.getDBType().equals("mysql")){
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid="
+ userid
+ " and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid="
+ userid
+ " AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid ="
+ userid + ")) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}
else {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid="
+ userid
+ " and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid="
+ userid
+ " AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid ="
+ userid + ")) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}
}
/* if (ru.getOfsSetting().getIsuse() == 1) {
if ("1".equals(belongtoshow)) {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid in ("
+ userIDAll
+ ") and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and (a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) or a.requestid in (select requestid from ofs_todo_data where userid in ("
+ userIDAll
+ ") and viewtype='0' and islasttimes=1 ) ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid in ("
+ userIDAll
+ ") and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid in ("
+ userIDAll
+ ") AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid in("
+ userIDAll + "))) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
} else {
sql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid="
+ userid
+ " and a.usertype='"
+ usertype
+ "' and ( (a.type=0 and (a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and isremark in ('0','1','8','9','7') ) or a.requestid in (select requestid from ofs_todo_data where userid in ("
+ userIDAll
+ ") and viewtype='0' and islasttimes=1) ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid="
+ userid
+ " and usertype='"
+ usertype
+ "' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3' or isprocessed is null)) or isremark='5') and userid="
+ userid
+ " AND usertype='"
+ usertype
+ "' and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1)) or (a.type=15 and a.requestid in(select id from mailresource where folderid=0 and status='0' and canview=1 and resourceid ="
+ userid + ")) or type in (2,3,4,6,7,8,11,12,13,21,25)) group by a.type";
}
} */
rs.executeSql(sql);
ChgPasswdReminder reminder = new ChgPasswdReminder();
RemindSettings settings = reminder.getRemindSettings();
while (rs.next()) {
if ("2".equals(rs.getString("type"))) {//生日
String birth_valid = settings.getBirthvalid();
String birth_remindmode = settings.getBirthremindmode();
if (birth_valid != null && birth_valid.equals("1")) {
if (birth_remindmode != null && birth_remindmode.equals("1")) {
} else {
continue;
}
} else {
continue;
}
}
bgindex++;
int count = 0;
String itemName = SystemEnv.getHtmlLabelName(rs.getInt("typedescription"), user.getLanguage());
if (rs.getString("statistic").equals("y")) {
count = rs.getInt("count");
}
s += ",{\"name\":\"" +itemName+ "\",\"url\":\""+rs.getString("link") + "\",\"count\":\""+count + "\",\"key\":\""+rs.getString("type") +"\"}";
}
if (s.equals("")) {
s = "{\"name\":\"" + SystemEnv.getHtmlLabelName(22521, user.getLanguage()) + "\",\"key\":\"nodata\"}";
}else{
s= s.substring(1);
}
/* s = "{\"name\":\"新到达流程\",\"url\":\"/system/sysRemindWfLink.jsp?flag=newWf\",\"count\":\"10\",\"key\":\"0\"}";
s += ",{\"name\":\"工作流完成\",\"url\":\"/system/sysRemindWfLink.jsp?flag=endWf\",\"count\":\"9\",\"key\":\"1\"}";
s += ",{\"name\":\"新到达邮件\",\"url\":\"/system/sysRemindWfLink.jsp?flag=newEmail\",\"count\":\"8\",\"key\":\"15\"}";
*/
return "["+s+"]";
}%>