CheckSystemCondition.jsp
14 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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="java.util.List" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.text.DecimalFormat" %>
<%@ page import="java.text.Format" %>
<%@ page import="wscheck.CheckSystemConditionUtil" %>
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%
// 增加参数判断缓存
response.setHeader("cache-control", "no-cache");
response.setHeader("pragma", "no-cache");
response.setHeader("expires", "Mon 1 Jan 1990 00:00:00 GMT");
%>
<%
User user = (User)request.getSession(true).getAttribute("weaver_user@bean") ;
if(user == null) {
response.sendRedirect("/login/Login.jsp");
return;
}
if(!user.getLoginid().equalsIgnoreCase("sysadmin")){
response.getWriter().print("请用sysadmin账号登录");
return;
}
/**
* 检测补丁包跳包情况
*
**/
List<String> packageList=new ArrayList<String>();
String latestPackageNo="";
String systemInfo="";//补丁包编号信息
String allmissPackageNo="";//全部缺失的补丁号信息
String missPackageNo="";//缺失的补丁号信息
boolean showinfodetail=false;
RecordSet rs=new RecordSet();
rs.execute("select label from ecologyuplist order by label desc");
while(rs.next()){
packageList.add(rs.getString(1));
}
if(packageList.size()>=1){
latestPackageNo = packageList.get(0);
}
if(!latestPackageNo.equals("")){
// latestPackageNo=(String)packageList.get(0);
systemInfo+=" 当前系统最新补丁包编号:<span style=\"color:red\">"+latestPackageNo+"</span>";
Format f1 = new DecimalFormat("000");
int lastpacknumer=Integer.valueOf(latestPackageNo);
for(int i=1;i<6;i++){
if((lastpacknumer-i)<=0){
break;
}
if(!packageList.contains(f1.format(lastpacknumer-i))){
missPackageNo+=f1.format(lastpacknumer-i)+"、";
}
}
if(!missPackageNo.equals("")){
missPackageNo = missPackageNo.substring(0, missPackageNo.length()-1);
allmissPackageNo=allmissPackageNo+missPackageNo;
if(missPackageNo.length()>31){
//allmissPackageNo=allmissPackageNo+missPackageNo;
missPackageNo=missPackageNo.substring(0,30);
missPackageNo=missPackageNo.substring(0,missPackageNo.lastIndexOf("、"))+"....";
}
systemInfo+=";补丁包出现跳包,跳包情况(<a href='javascript:showpackinfo()'>"+missPackageNo+"</a>)";
}else{
systemInfo+=" 补丁包打包情况:正常";
}
}else{
systemInfo+=" 未获取到当前系统最新补丁包编号";
}
%>
<html>
<head>
<title>升级环境检查</title>
</head>
<style type="text/css">
*{
margin:0 auto;
padding:0;
}
body{
background-color: #F0F5FF;
width: 100%;
height: 100%;
text-align: center;
}
.container{
text-align:left;
margin:0 auto;
width: 40%;
height: auto;
background-color: white;
}
.borderlink{
border-bottom: 1px solid #787878;
border-top: 1px solid #787878;
}
.showborder{
border: 1px solid #787878;
}
</style>
<%
CheckSystemConditionUtil util=new CheckSystemConditionUtil();
%>
<script src="js/jquery-1.8.3.min_wev8.js"></script>
<body class="allbackground">
<div class="container">
<table style="width:100%;height: auto;border:2px;border:1px solid gray;margin-top:20px;rules:rows;" cellspacing="0" cellpadding="0">
<tr style="height: 50px;">
<td style="text-align: center;color:white;font-weight: bolder;background-color: #335285;">升级预检</td>
</tr>
<%--<tr style="height: 10px;" >--%>
<%--<td class="borderlink"></td>--%>
<%--</tr>--%>
<%--<tr style="height: 30px;" >--%>
<%--<td style="background-color: #3f73c4;font-weight: bold;font-size: 14px; color:white">--%>
<%-- 检查项--%>
<%--</td>--%>
<%--</tr>--%>
<%--<tr style="height: 10px;" >--%>
<%--<td class="borderlink"></td>--%>
<%--</tr>--%>
<tr style="height: 30px;" >
<td style="background-color: #87cefa;font-weight: bold;font-size: 14px">
系统检查
</td>
</tr>
<tr style="height: 100px;;font-size: 14px" >
<td class="borderlink" style="">
<ul style="list-style: none">
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
boolean canWirteAndRead=util.checkSystemReadAndWrite();
if(canWirteAndRead){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">检查Ecology文件夹读写权限成功</span></div>
<%
}else{
%>
<div ><img src="image/error.gif" style="height:30px;line-height:25px; float: left;margin-left: 20px;padding: 2px;"><span style="margin-left: 10px;height:30px;line-height:30px;font-size:14px; float: left">检查Ecology,Resin,JDK文件夹读写权限失败</span></div>
<%
}
%>
</li>
<%
if(util.isWindowsOS()){
%>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">当前系统为Window系统,IP校验通过</span></div>
</li>
<%
}else{
%>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px;color:red">本机为linux系统,计算机名:<%=util.getLocalHostName()%> IP:<%=util.getLinuxLocalIp()%> 请确认计算机IP映射是否正确</span></div>
</li>
<%
}
%>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
if(util.checkSlqupgrdeFileExist()){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">当前系统没有遗留的脚本文件</span></div>
<%
}else{
%>
<div ><img src="image/error.gif" style="height:30px;line-height:25px; float: left;margin-left: 20px;padding: 2px;"><span style="margin-left: 10px;height:30px;line-height:30px;font-size:14px; float: left">sqlupgrade文件夹下存在脚本文件,请检查脚本是否可以忽略</span></div>
<%
}
%>
</li>
</ul>
</td>
</tr>
<tr style="height: 30px;;font-size: 14px" >
<td style="background-color: #87cefa;font-weight: bold;font-size: 14px">
检查Ecology环境配置
</td>
</tr>
<tr style="height: 100px;;font-size: 14px" >
<td class="borderlink" style="">
<ul style="list-style: none">
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
int parsewebXML=util.parseWebXMl();
if(parsewebXML==0){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px"> 系统未配置Cas集成</span></div>
<%
}else if(parsewebXML==1){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px"> 检查Cas等集成登录功能,白名单中添加相关的配置成功</span></div>
<%
}else{
%>
<div ><img src="image/error.gif" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">检查Cas等集成登录功能,白名单中添加相关的配置失败,请检查Cas集成登录是否配置正确</span></div>
<%
}
%>
</li>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
if(util.checkWebappContextListener()){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">WebappContextListener监听器配置检查正确</span></div>
<%
}else{
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px;color:red">系统存在WebappContextListener监听器,如果要升级E9需要删除监听器配置</span></div>
<%
}
%>
</li>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px"><%=util.getClusterNodeInfo()%></span></div>
</li>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
if(util.getUpgradeStatus()){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">Upgrade.properties文件配置正确</span></div>
<%
}else{
%>
<div ><img src="image/error.gif" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">Upgrade.properties文件配置错误,请修改</span></div>
<%
}
%>
</li>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%
if(util.checkResinWebXml()){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">resin-web.xml文件配置正确</span></div>
<%
}else{
%>
<div ><img src="image/error.gif" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">FileCheckFilter拦截器未配置,请修改resin-web.xml配置文件</span></div>
<%
}
%>
</li>
</ul>
</td>
</tr>
<tr style="height: 30px;;font-size: 14px" >
<td style="background-color: #87cefa;font-weight: bold;font-size: 14px">
数据库检查
</td>
</tr>
<tr style="height: 100px;" >
<td class="borderlink" style="">
<ul style="list-style: none">
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">请检查数据库IP地址<%=util.getDataBaseIp()%> 是否正确</span></div>
</li>
<li style="position: relative;width: 100%;float: left;padding: 3px;">
<%if(util.checkDBCharset()){
%>
<div ><img src="image/ok.png" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">数据库字符集校验成功</span></div>
<%}else{%>
<div ><img src="image/error.gif" style="height:25px;line-height:30px; float: left;margin-left: 20px;padding: 2px;"><span style="height:30px;line-height:30px;font-size:14px; float: left;margin-left: 10px">数据库字符集校验失败(E7及以下版本数据库字符集为GBK)</span></div>
<%}%>
</li>
</ul>
</td>
</tr>
<tr style="height: 30px;;font-size: 14px" >
<td style="background-color: #87cefa;font-weight: bold;font-size: 14px">
升级记录 <span style="color:red"><%=systemInfo%></span>
</td>
</tr>
<tr style="height: auto;font-size: 14px" >
<td class="borderlink" width="100%;" height="auto">
<div width="100%">
<table style="border: 1px solid #787878;max-height: 200px; width:100%; text-align: center;"cellspacing="1" cellpadding="1">
<tr style="height: 30px; width: 100%;">
<td class="showborder">补丁包编号</td></td>
<td class="showborder">补丁包名称</td>
</tr>
<%
int i=0;
rs.execute("select * from ecologyuplist order by label desc");
while(rs.next()){
if(i>=5){
break;
}
String packagelabel=Util.null2String(rs.getString("label"));
String packagename=Util.null2String(rs.getString("versionNo"));
i++;
%>
<tr style="height: 30px; width: 100%;">
<td class="showborder"><%=packagelabel%></td></td>
<td class="showborder"><%=packagename%></td>
</tr>
<%}%>
</table>
</div>
</td>
</tr>
<tr style="height: auto;font-size: 14px" >
<td class="borderlink" style="float: bottom;" width="100%;" height="auto">
<div width="100%" style="color: red;margin-bottom:10px">
<span style="font-size: 20px;font-weight: bold">注意</span></br>
1.在系统升级操作之前,请对系统进行升级预检操作,以检测升级环境是否正常。</br>
2.如果检测结果出现失败的信息,请及时提问题流程解决相关的问题,否则可能会导致系统升级失败。
</div>
版本:1.0
</td>
</tr>
</tbody>
</table>
</div>
</body>
<script language="javascript" type="text/javascript">
function showpackinfo(){//点击查看跳包详情
alert("<%=allmissPackageNo%>");
}
// function getsysinfo(){
// $.ajax({
// type:'post',
// dataType:'json',
// url:'CheckSystemConditionOperation.jsp',
// success:function(){
// alert("success");
// }
// })
// }
jQuery(document).ready(function(){
// getsysinfo();
});
</script>
</html>