MigrationSystemCheck.jsp
17.5 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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.File" %>
<%@ page import="weaver.general.GCONST" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.PropUtil" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.ToolUtil" %>
<%@ page import="java.util.LinkedHashMap" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.general.StringUtil" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.DBUpgradeProcess" %>
<%@ page import="weaver.hrm.UserManager" %>
<%@ page import="weaver.hrm.User" %>
<%@ include file="/system/upgradetoe9/DBUpgradeInit.jsp"%>
<html>
<%
RecordSet rs= new RecordSet();
//获得要初始化properties文件名
rs.executeQuery("select path from DBUpgradeInitConfig group by path,type order by type");
StringBuffer propertiesfile=new StringBuffer();
while(rs.next()) {
String path = Util.null2String(rs.getString("path"));
if (!"".equalsIgnoreCase(path)) {
if (propertiesfile.length() > 0) {
propertiesfile.append("," + path.replace("\\","\\\\"));//.replace("\\","/")
} else {
propertiesfile.append(path.replace("\\","\\\\"));
}
}
}
// User user1=new UserManager().getUserByUserIdAndLoginType(1,"1");
// user.setLanguage(7);
// session.setAttribute("weaver_user@bean",user1);
//获得要检测文件的id
StringBuffer checkids=new StringBuffer();
rs.executeQuery("select id from configFileManager where isdelete=0 and filetype in(1,2)");
while(rs.next()) {
if (checkids.length() > 0) {
checkids.append("," + rs.getString("id"));
} else {
checkids.append(rs.getString("id"));
}
}
%>
<script type="text/javascript" src="/system/upgradetoe9/js/jquery-1.8.3.min_wev8.js"></script>
<link rel="stylesheet" href="/system/upgradetoe9/css/seachBody_wev8.css" type="text/css" />
<script type="text/javascript" src="/system/upgradetoe9/js/upgradeDialog.js"></script>
<link type="text/css" rel="stylesheet" href="/system/upgradetoe9/css/dialog.css" />
<script type="text/javascript" src="/system/upgradetoe9/js/dialog.js"></script>
<script type="text/javascript">
$("document").ready(function () {
});
</script>
<head>
<title> E-cology迁移程序</title>
<style>
TABLE {
FONT-SIZE: 9pt;
FONT-FAMILY: Verdana;
}
BODY {
FONT-SIZE: 9pt;
MARGIN: 0px;
FONT-FAMILY: Verdana;
LIST-STYLE-TYPE: circle;
}
input,select,textarea{
/*border:#e7e7e7 1px solid;*/
vertical-align:middle;
}
input,select{
line-height:24px;
height:24px;
}
table input{
border: 1px solid #ccc!important;
border-radius: 3px;/* !*css3属性IE不支持*!*/
padding: 6px 0px 5px 10px;
}
.progressbar{
width: 98%;
/* margin-left: 10%;*/
border-radius: 7px;
border: 1px solid #008000;
float: left;
-webkit-box-shadow: 3px 3px 3px #ADADAD;
-moz-box-shadow: 3px 3px 3px #ADADAD;
box-shadow: 3px 3px 3px #ADADAD;
}
.btn-primary{
height: 30px;
text-decoration:none;
background:#169bd5;
color:#f2f2f2;
padding: 0 20px 0 20px;
font-size:14px;
font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;
/*font-weight:bold;*/
border-radius:10px;
-webkit-transition:all linear 0.10s;
-moz-transition:all linear 0.10s;
transition:all linear 0.10s;
}
.btn-primary:hover{
background:#286090;
}
.btn-success{
height: 25%;
text-decoration:none;
background:#5CB85C;
color:#f2f2f2;
padding: 0 20px 0 20px;
font-size:14px;
font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;
/*font-weight:bold;*/
border-radius:5px;
}
.btn-success:hover{
background:#b8b1b6;
}
.btn-success-disabled:hover{
background:#5CB85C;
}
.btn-success-disabled{
height: 25%;
text-decoration:none;
background: #b8b1b6;
color:#f2f2f2;
padding: 0 20px 0 20px;
font-size:14px;
font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;
/*font-weight:bold;*/
border-radius:5px;
}
.e8_btn_disabled{
border:0px;cursor:pointer;
padding-left:0;
padding-left:10px;
padding-right:10px;
height:30px;
line-height:30px;
background-color:#959595;
color:white;
width:auto;
}
.e8_btn_submit{
border:0px;cursor:pointer;
padding-left:0;
padding-left:10px;
padding-right:10px;
height:30px;
line-height:30px;
background-color:#558ED5;
color:white;
width:auto;
}
.e8_btn_submit_hover{
background-color:#0170C1 !important;
color:white;
}
a{
text-decoration: none;
text-underline: none;
}
.btn-check{
height: 30px;
text-decoration:none;
background:#ff9900;
color:#f2f2f2;
padding: 0 20px 0 20px;
font-size:14px;
font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;
/*font-weight:bold;*/
border-radius:10px;
-webkit-transition:all linear 0.10s;
-moz-transition:all linear 0.10s;
transition:all linear 0.10s;
}
.btn-check:hover{
background-color:#ff6600;
}
.top1{
position: relative;
float: left;
height: 80px;
width: 80px;
}
.top2{
float: left;
height:80px;
font-size: 20px;
/*font-weight: bold;*/
color: red;
}
.ulliststep4{
list-style: decimal;
background-color: #fff3dc;
}
.listyle1{
line-height: 30px;
color: #6c6c6c;
font-size: 15px;
}
.headerstep4{
height: 30px;
background-color: #f1f1f1;
}
.headerstep4 td p{
/*font-weight: bolder;*/
color: black;
font-size: 15px;
}
.ulliststep4{
list-style: decimal;
line-height: 30px;
color: black;
/*font-weight: bolder;*/
font-size: 15px;
}
.md1{
float: none;
}
.md2{
height: 400px;
/*margin-top: 50px;*/
}
.showtable{
height: 400px;
overflow: scroll;
}
.litext{
font-size: 15px;
text-align: left;
/*font-weight: bold;*/
line-height: 40px;
}
</style>
</head>
<%
String titlename = "";
PropUtil prop = PropUtil.getInstance(PropUtil.WEAVER_SOURCE);
double process=10.0;
String currentProcess="清空E9中源库与目标库相同的表数据";
%>
<jsp:include page="/system/upgradetoe9/CommonTabHead.jsp?step=6">
<jsp:param name="mouldID" value="upgrade"/>
<jsp:param name="step" value="<%=currentStep%>"/>
<jsp:param name="navName" value="数据库迁移工具"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<%--<button style="margin-right:10px;" id="check1" type="hidden" name="check1" onclick="checkfile()" class="e8_btn_submit">一键检测</button>--%>
<button style="margin-right:10px;" id="next" type="button" name="next" onclick="nextstep1()" class="e8_btn_submit">下一步</button>
</td>
</tr>
</table>
<body style="height:100%;width:100%;">
<div style="width:20%;height:100%;float:left;background:#fcfcfc;">
<jsp:include page="MigrationStep.jsp"></jsp:include>
</div>
<div style="width:80%;height:100%;float:right">
<div id="tab2" style="width:98%;padding-left: 1%;padding-top:1%;">
<div style="width: 100%;height: auto;">
<%--<div style="" class="top1">--%>
<%--<img src="./images/default_wev8.png" alt="" height="40px">--%>
<%--</div>--%>
<div class="top2" style="height:40px;line-height:40px;float:left;padding-top: 1%;width:100%;padding-left: 1%">
<%--<img src="./images/default_wev8.png" style="height:40px;line-height:40px;float:left">--%>
<span style="height:40px;line-height:40px;float:left;">自动初始化和检测当前系统环境</span>
</div>
<br/>
</div>
<div class="md1" style="width: 98%;padding-left: 1%;padding-top:1%">
<%--<p class="litext">1.初始化配置文件</p>--%>
<table style="width: 90%;height:200px; overflow: scroll;" cellspacing="0" cellpadding="0" class="showtable" >
<tr class="headerstep4">
<td>
<div><img src="images/sysadmin_doc_wev8.png" style="height:40px;line-height:40px;float:left"><span style="font-size:15px;height:40px;line-height:40px;float:left">初始化文件列表</span></div>
</td>
</tr>
<tr>
<td>
<ul class="ulliststep4" id="initfilelist" style="height:200px; overflow-y: scroll;overflow-x: hidden;margin-top: 0px;">
</ul>
</td>
</tr>
</table>
</div>
<div class="md2" style="width: 98%;padding-left: 1%;padding-top:1%">
<%--<p class="litext">2.系统检测<span style="font-size:10px;color:red">(在迁移完成后,到E9后端应用中心下的升级中心中查看详细)</span></p>--%>
<table style="width: 90%;height:auto;" cellspacing="0" cellpadding="0" class="showtable" >
<tr class="headerstep4">
<td>
<div><img src="images/sysadmin_doc_wev8.png" style="height:40px;line-height:40px;float:left"><span style="font-size:15px;height:40px;line-height:40px;float:left">系统检测结果</span><span style="font-size:15px;color:red;height:40px;line-height:40px;float:left">(在迁移完成后,到E9后端应用中心下的升级中心中查看详情)</span></div>
</td>
</tr>
<tr>
<td>
<ul class="ulliststep4" id="checkresult" style="height: auto;padding-bottom: 20px;margin-top: 0px;">
<li id="list1">正检测代码规范</li>
<li id="list2">正检测文件配置</li>
</ul>
</td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
var allpath="<%=propertiesfile.toString()%>";
var allpaths=allpath.split(",");
var pop=0;
var ids="<%=checkids.toString()%>";
$("document").ready(function () {
checkfile();
});
function nextstep1(){
$.DialogByZ.Confirm({Title: "提示", Content: "开始执行下一步?",BtnL:"确定",FunL:removesession,BtnR:"取消"})
}
function removesession(){//移除登录信息
$.ajax({
sync:false,
dataType:'json',
type:'post',
url:'MigrationSystemCheckOperation.jsp',
data:{
'operation': 'removesession',
},
success:function(data){
if(data.status==1) {
next();
}
},
error:function () {
next();
}
});
}
function checkfile(){//一键检测
$("#next").attr('disabled',false);
$("#next").removeClass("e8_btn_disabled");
$("#next").addClass("e8_btn_submit");
// $("#check1").attr('disabled',true);
// $("#check1").removeClass("e8_btn_submit");
// $("#check1").addClass("e8_btn_disabled");
initFile();
checkhtml();
checkconfigitem();
}
function checkhtml(){//检测流程模板
$("#list1").html("请点击查看详情跳转到文件检测 <a href=\"javascript:void(0);\" onclick=\"lookfilestandard()\">查看详情</a>");
// $.ajax({
// sync:false,
// dataType:'json',
// type:'post',
// url:'MigrationSystemCheckOperation.jsp',
// data:{
// 'operation': 'checkfile',
// 'tabtype': 'checkhtml',
// 'ishtml': 0,
// 'navName': '检测流程模板',
// },
// success:function(data){
// if(data.status==1) {
// $("#list1").html("当前已检测出" + data.counts + "个文件不符合代码规范 <a href=\"javascript:void(0);\" onclick=\"lookfilestandard()\">查看详情</a>");
// }else{
// $("#list1").html("检测失败 <a href=\"javascript:void(0);\" onclick=\"lookfilestandard()\">检测并查看</a>");
// }
// },
// error:function () {
// $("#list1").html("检测出现错误,请重新检测 <a href=\"javascript:void(0);\" onclick=\"checkhtml()\">重新检测</a>");
// }
// });
}
function checkconfigitem(){//检查配置项
$.ajax({
sync:false,
dataType:'json',
type:'post',
url:'MigrationSystemCheckOperation.jsp',
data:{
'operation': 'checkconfig',
'ids': ids,
},
success:function(data){
if(data.status==1){
$("#list2").html("系统检测出"+data.counts+"个配置项未配置"+data.result+" <a href=\"javascript:void(0);\" onclick=\"lookconfigdetail()\">查看详情</a>");
}else{
$("#list2").html("检测失败 <a href=\"javascript:void(0);\" onclick=\"checkconfigitem()\">重新检测</a>");
}
},
error:function () {
$("#list2").html("配置项检测失败 <a href=\"javascript:void(0);\" onclick=\"checkconfigitem()\">查看详情</a>");
}
});
}
function lookfilestandard(){//查看文件规范详细
//var url="/system/upgradetoe9/matchruleHtmlResult.jsp?tabtype=checkhtml&ishtml=0&navName='检测流程模板'&type=1"
var url="/templetecheck/checkruleiframe.jsp?tabtype=checkhtml&ishtml=0&navName='检测流程模板'";
openDialog("文件规范详细",url)
//window.open(url);
//doOpen(url,"编辑配置文件信息",dWidth,dHeight);
}
function lookconfigdetail(){//查看配置项详细
// var url = "/system/upgradetoe9/CheckConfigResultIframe.jsp?checkids="+ids;
var url="/templetecheck/ConfigManagerIframe.jsp";
//window.open(url)
openDialog("配置详细信息",url)
//doOpen(url,"编辑配置文件信息",dWidth,dHeight);
}
function initFile(){//初始化文件
if(pop<allpaths.length) {
$("#initfilelist").html($("#initfilelist").html() + "开始初始化文件" + allpaths[pop] + "<br>");
$.ajax({
sync: false,
dataType: 'json',
type: 'post',
url: 'MigrationSystemCheckOperation.jsp',
data: {
'operation': 'initfile',
'path': allpaths[pop],
},
success: function (data) {
var status = data.status;
if (status == '1') {
$("#initfilelist").html($("#initfilelist").html() + "<span style=\"color: blue\">" + allpaths[pop] + "文件初始化成功</span><br/>");
pop = pop + 1;
initFile()
} else {
$("#initfilelist").html($("#initfilelist").html() + "<span style=\"color: red\">" + allpaths[pop] + "文件初始化失败<br/>");
pop = pop + 1;
initFile()
}
},
error: function () {
$("#initfilelist").html($("#initfilelist").html() + "<span style=\"color: red\">" + allpaths[pop] + "文件初始化错误<br/>");
pop = pop + 1;
initFile()
}
});
}
}
var dWidth = 600;
var dHeight = 500;
function openDialog(title,url) {
var dlg=new Dialog();//定义Dialog对象
//var dlg=Dialog;
dlg.currentWindow = Window;
dlg.Model=true;
dlg.Width=1000;//定义长度
dlg.Height=600;
dlg.URL=url;
dlg.Title=title;
dlg.show();
}
</script>