SocialHrmCountData.jsp
2.81 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
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="weaver.hrm.*" %>
<%@page import="weaver.workflow.search.WorkflowRequestUtil"%>
<%@ page import="weaver.workflow.workflow.TestWorkflowCheck" %>
<%@ page import="weaver.blog.BlogDao" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="net.sf.json.*"%>
<jsp:useBean id="SocialIMService" class="weaver.social.service.SocialIMService" scope="page" />
<%
response.setHeader("cache-control", "no-cache");
response.setHeader("pragma", "no-cache");
response.setHeader("expires", "Mon 1 Jan 1990 00:00:00 GMT");
User user = HrmUserVarify.getUser (request , response) ;
if(user == null){
return;
}
//问题1
TestWorkflowCheck twc=new TestWorkflowCheck();
if(twc.checkURI(session,request.getRequestURI(),request.getQueryString())){
return;
}
int navtype = Util.getIntValue(request.getParameter("navtype"), -1);
String sysicoids = request.getParameter("sysicoids");
String resourceid = request.getParameter("resourceid");
String userid = "" + user.getUID();
int count = -1;
if(sysicoids != null && !sysicoids.equals("")){
String[] ids = sysicoids.split(",");
JSONObject ret = new JSONObject();
for(int i = 0; i < ids.length; ++i){
if(ids[i].equals("2")){ //待办事宜
try{
int wf_count = new WorkflowRequestUtil().getRequestCount(user,resourceid);
ret.put("2", wf_count+"");
}catch(Exception e){
ret.put("2", count+"");
}
}
if(ids[i].equals("4")){ //日志
try{
String weiboCount = new BlogDao().getRemindUnReadCount(userid, "update");
ret.put("4", weiboCount);
}catch(Exception e){
ret.put("4", count+"");
}
}
if(ids[i].equals("5")){ //邮件
HashMap<String, String> params = new HashMap<String, String>();
params.put("resourceid", resourceid);
params.put("status", "0");
params.put("folderid", "0");
try{
List<String> mailInfo = SocialIMService.getMailInfo(params);
ret.put("5", mailInfo.get(0));
}catch(Exception e){
ret.put("5", count+"");
}
}
}
out.print(ret);
return;
}
if(navtype == 1){
//流程
try{
int wf_count = new WorkflowRequestUtil().getRequestCount(user,resourceid);
count = wf_count;
}catch(Exception e){
count = -1;
}
}else if(navtype == 3){
//微博
try{
String weiboCount = new BlogDao().getRemindUnReadCount(userid, "update");
count = Integer.parseInt(weiboCount);
}catch(Exception e){
count = -1;
}
}else if(navtype == 4){
//邮件
HashMap<String, String> params = new HashMap<String, String>();
params.put("resourceid", resourceid);
params.put("status", "0");
params.put("folderid", "0");
try{
List<String> mailInfo = SocialIMService.getMailInfo(params);
count = Integer.parseInt(mailInfo.get(0));
}catch(Exception e){
count = -1;
}
}
out.print(count);
%>