ViewRequestOS.jsp
4.8 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util,weaver.conn.RecordSet" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.interfaces.outter.CheckIpNetWorkForUpcoming" %>
<%
/**
* 这个页面只打开其他系统的页面。其他页面误入直接跳转到ViewRequest.jsp
*/
User user = HrmUserVarify.getUser (request , response) ;
int requestid = Util.getIntValue(request.getParameter("requestid"));
int workflowid = Util.getIntValue(request.getParameter("workflowid"));
int sysid = Util.getIntValue(request.getParameter("sysid"));
int reflush = Util.getIntValue(request.getParameter("reflush"),0);
if(reflush==1){
%>
<script type='text/javascript'>
//var pwindow=window.parent.document.getElementById("bodyiframe").contentWindow;
try{
window.parent.opener.btnWfCenterReload.onclick();
}catch(e){}
try{
window.parent.opener._table.reLoad();
}catch(e){
}
setTimeout(function(){
try{
window.parent.opener.btnWfCenterReload.onclick();
}catch(e){}
try{
window.parent.opener._table.reLoad();
}catch(e){
}
window.close();
}
,1500);
</script>
<%
}else{
if(requestid>0){//OA的流程
response.sendRedirect("/workflow/request/ViewRequest.jsp?requestid="+requestid);
}else{//打开统一待办的流程
String tourl = "";
RecordSet rsrtx = new RecordSet();
String sqlStr = "select * from SystemSet";
rsrtx.executeSql(sqlStr);
rsrtx.next();
String oaaddress = rsrtx.getString("oaaddress");
RecordSet rs = new RecordSet();
//查询打开的前缀和url
String pcprefixurl = "";
String pcouterfixurl = "";
String pcurl = "" ;
String syscode = "";
rs.executeSql("select s.Pcprefixurl, s.pcouterfixurl, d.pcurl,s.syscode,s.pcentranceurl from ofs_sysinfo s ,ofs_todo_data d where d.sysid=s.sysid and d.requestid="+requestid+" and s.sysid="+sysid+" and userid="+user.getUID()+" and islasttimes=1 and d.workflowid="+workflowid);
if(rs.next()){
pcprefixurl = Util.null2String(rs.getString(1));
pcouterfixurl = Util.null2String(rs.getString(2));
pcurl = Util.null2String(rs.getString(3));
syscode = Util.null2String(rs.getString(4));
}
String autologinFlag = "0";//
RecordSet recordSet = new RecordSet();
String sqlForStatus = "SELECT * FROM autologin_status WHERE syscode='"+syscode+"'";
recordSet.execute(sqlForStatus);
if (recordSet.next()) {
autologinFlag = Util.null2String(recordSet.getString("status"),"0");
}
//0代表不开启,则所有通过内网访问
//1代表开启,并且有设置网段
//2代表开启,但是没有设置网段
if (autologinFlag.equals("0")){
//TODO 判断是否存在中专页面
String pcentranceurl = Util.null2String(rs.getString("pcentranceurl"));
if(!"".equals(pcentranceurl)){
//跳转中转页面
response.sendRedirect(pcurl);
}
//response.sendRedirect(pcprefixurl+pcurl);
tourl = pcprefixurl+pcurl;
} else if (autologinFlag.equals("2")) {
//TODO 判断是否存在中专页面
String pcentranceurl = Util.null2String(rs.getString("pcentranceurl"));
if(!"".equals(pcentranceurl)){
//跳转中转页面
response.sendRedirect(pcurl);
}
//response.sendRedirect(pcouterfixurl+pcurl);
tourl = pcouterfixurl+pcurl;
}else if (autologinFlag.equals("1")){
String clientIp = Util.getIpAddr(request);
CheckIpNetWorkForUpcoming checkIpNetWorkForUpcoming = new CheckIpNetWorkForUpcoming();
boolean notInOuter = checkIpNetWorkForUpcoming.checkIpSeg(clientIp);
if (notInOuter) {
//TODO 判断是否存在中专页面
String pcentranceurl = Util.null2String(rs.getString("pcentranceurl"));
if(!"".equals(pcentranceurl)){
//跳转中转页面
response.sendRedirect(pcurl);
}
//不在网段策略中
//response.sendRedirect(pcouterfixurl+pcurl);
tourl = pcouterfixurl+pcurl;
} else {
//TODO 判断是否存在中专页面
String pcentranceurl = Util.null2String(rs.getString("pcentranceurl"));
if(!"".equals(pcentranceurl)){
//跳转中转页面
response.sendRedirect(pcurl);
}
//在网段策略中
//response.sendRedirect(pcprefixurl+pcurl);
tourl = pcprefixurl+pcurl;
}
}
if(pcurl.startsWith("http") || pcurl.startsWith("https")){
tourl = pcurl;
}
%>
<script type="text/javascript">
location.href='<%=tourl%>';
</script>
<%
try{
rs.executeSql("update ofs_todo_data set viewtype=1 where requestid="+requestid+" and userid="+user.getUID()+" and islasttimes=1");
String delsql = "delete from SysPoppupRemindInfoNew where userid = ? and requestid = ?";
rs.executeUpdate(delsql, user.getUID(), requestid);
}catch(Exception e){
}
}
}
%>