Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jfV5pc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
管理员
jfV5pc
Commits
a24dc5fb
Commit
a24dc5fb
authored
Jul 06, 2018
by
陈玉兰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
beb91385
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
120 additions
and
59 deletions
+120
-59
applicationContext-business.xml
...ent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
+5
-5
icon.css
...tent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
+4
-0
fileGrapTab.jsp
WebContent/reptile/fileGrap/fileGrapTab.jsp
+1
-0
fileGrapTabDetail.jsp
WebContent/reptile/fileGrap/fileGrapTabDetail.jsp
+2
-2
fileGrapTab.js
WebContent/reptile/fileGrap/js/fileGrapTab.js
+60
-11
textGrapTab.js
WebContent/reptile/textGrap/js/textGrapTab.js
+0
-27
textGrapTabDetail.jsp
WebContent/reptile/textGrap/textGrapTabDetail.jsp
+3
-3
actAction.java
src_reptile/com/gaowj/fileGrap/actAction.java
+32
-8
dataAction.java
src_reptile/com/gaowj/fileGrap/dataAction.java
+9
-0
actAction.java
src_reptile/com/gaowj/textGrap/actAction.java
+4
-3
No files found.
WebContent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
View file @
a24dc5fb
...
...
@@ -22,7 +22,7 @@
<!-- 增加数据源dataSource-system -->
<bean
id=
"dataSource-system"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
116
:3306/pc_system?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
249
:3306/pc_system?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"pc_system"
/>
<property
name=
"password"
value=
"pc_system"
/>
<property
name=
"driverClassName"
value=
"com.mysql.jdbc.Driver"
/>
...
...
@@ -57,9 +57,9 @@
<!-- 增加数据源dataSource-standard -->
<bean
id=
"dataSource-standard"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
116:3306/jw
_standard?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"j
w
_standard"
/>
<property
name=
"password"
value=
"j
w
_standard"
/>
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
249:3306/jf
_standard?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"j
f
_standard"
/>
<property
name=
"password"
value=
"j
f
_standard"
/>
<property
name=
"driverClassName"
value=
"com.mysql.jdbc.Driver"
/>
<!-- 配置初始化大小、最小、最大 -->
...
...
@@ -92,7 +92,7 @@
<!-- 增加数据源dataSource-business -->
<bean
id=
"dataSource-business"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
destroy-method=
"close"
>
<!-- 基本属性 url、user、password -->
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
116
:3306/pc_business?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"url"
value=
"jdbc:mysql://192.168.1.
249
:3306/pc_business?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
/>
<property
name=
"username"
value=
"pc_business"
/>
<property
name=
"password"
value=
"pc_business"
/>
<property
name=
"driverClassName"
value=
"com.mysql.jdbc.Driver"
/>
...
...
WebContent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
View file @
a24dc5fb
...
...
@@ -312,4 +312,7 @@
}
.icon-ext-10_36{
background:url('
../../../../
images
/
icons
/(
10
,
36
).
png
') no-repeat left center;
}
.icon-ext-13_12{
background:url('
../../../../
images
/
icons
/(
13
,
12
).
png
'
)
no-repeat
left
center
;
}
\ No newline at end of file
WebContent/reptile/fileGrap/fileGrapTab.jsp
View file @
a24dc5fb
...
...
@@ -14,6 +14,7 @@
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
</div>
</div>
...
...
WebContent/reptile/fileGrap/fileGrapTabDetail.jsp
View file @
a24dc5fb
...
...
@@ -8,7 +8,7 @@
<span>URL:</span>
</td>
<td style="width: 100%">
<input class="easyui-textbox" id="URL" name="FIELD_URL" style="width:300px" value="${is_row.URL}"/>
<input class="easyui-textbox" id="URL" name="FIELD_URL" style="width:300px" value="${is_row.URL}"
required="required"
/>
</td>
</tr>
<tr>
...
...
@@ -16,7 +16,7 @@
<span>存放地址:</span>
</td>
<td style="width: 100%">
<input class="easyui-textbox" id="save_Path" name="FIELD_SAVE_PATH" style="width:300px" value="${is_row.SAVE_PATH}"/>
<input class="easyui-textbox" id="save_Path" name="FIELD_SAVE_PATH" style="width:300px" value="${is_row.SAVE_PATH}"
required="required"
/>
</td>
</tr>
<tr>
...
...
WebContent/reptile/fileGrap/js/fileGrapTab.js
View file @
a24dc5fb
...
...
@@ -69,11 +69,23 @@ var ls_ywlx = 'YBYW';
var
ls_title
=
"抓取数据列表"
;
var
is_column
=
[
[
{
field
:
'URL'
,
title
:
'名称'
,
width
:
300
,
align
:
'left'
},
{
field
:
'SAVE_PATH'
,
title
:
'保存路径'
,
width
:
300
,
align
:
'left'
},
{
field
:
'DATABASE_NAME'
,
title
:
'指定数据库'
,
width
:
150
,
align
:
'left'
},
{
field
:
'TABLE_NAME'
,
title
:
'指定表名'
,
width
:
150
,
align
:
'left'
},
{
field
:
'CREATE_TIME'
,
title
:
'创建时间'
,
width
:
150
,
align
:
'left'
},
{
field
:
'CREATE_ID'
,
title
:
'创建人'
,
width
:
150
,
align
:
'left'
}
{
field
:
'SAVE_PATH'
,
title
:
'保存路径'
,
width
:
200
,
align
:
'left'
},
{
field
:
'DATABASE_NAME'
,
title
:
'指定数据库'
,
width
:
100
,
align
:
'left'
},
{
field
:
'TABLE_NAME'
,
title
:
'指定表名'
,
width
:
100
,
align
:
'left'
},
{
field
:
'STATUS'
,
title
:
'爬取状态'
,
width
:
100
,
align
:
'left'
,
formatter
:
function
(
value
,
row
,
index
){
if
(
value
==
'SUCCESS'
){
return
"爬取成功"
;
}
if
(
value
==
'PENDING'
){
return
"爬取中"
;
}
if
(
value
==
'FAILURE'
){
return
"爬取失败"
;
}
}},
{
field
:
'RESULT_COUNT'
,
title
:
'当前数目'
,
width
:
50
,
align
:
'left'
},
{
field
:
'CREATE_TIME'
,
title
:
'创建时间'
,
width
:
100
,
align
:
'left'
},
{
field
:
'CREATE_ID'
,
title
:
'创建人'
,
width
:
100
,
align
:
'left'
}
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
...
...
@@ -99,7 +111,8 @@ function formatMenu(value, data,index) {
function
getOptionMenu
(
data
,
index
){
var
returnData
=
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>编辑</a> | <span class=
\"
icon-ext-11_10
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
grapRow('"
+
index
+
"')
\"
>爬取</a> | <span class=
\"
icon-search
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
lookRow('"
+
index
+
"')
\"
>爬取</a> | <span class=
\"
icon-ext-13_12
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
statusRow('"
+
index
+
"')
\"
>状态</a> | <span class=
\"
icon-search
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
lookRow('"
+
index
+
"')
\"
>查看</a> | <span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a>"
;
return
returnData
;
...
...
@@ -107,7 +120,7 @@ function getOptionMenu(data,index){
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
var
is_menu_count
=
4
;
var
is_menu_count
=
5
;
return
is_menu_count
;
}
...
...
@@ -188,6 +201,10 @@ function updateData(is_entity){
}
/****/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
}
/**
* 序号:7
* 功能:单个删除
...
...
@@ -269,17 +286,24 @@ function modifyNode(treeNode){
function
grapRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
var
map
=
{};
map
.
FIELD_UUID
=
is_row
[
0
].
UUID
map
.
FIELD_CREATE_ID
=
is_row
[
0
].
CREATE_ID
map
.
FIELD_CREATE_TIME
=
is_row
[
0
].
CREATE_TIME
map
.
FIELD_DATABASE_NAME
=
is_row
[
0
].
DATABASE_NAME
map
.
FIELD_DATA_SORT_ID
=
is_row
[
0
].
DATA_SORT_ID
map
.
FIELD_SAVE_PATH
=
is_row
[
0
].
SAVE_PATH
map
.
FIELD_TABLE_NAME
=
is_row
[
0
].
TABLE_NAME
map
.
FIELD_URL
=
is_row
[
0
].
URL
$
.
messager
.
confirm
(
'提示'
,
'确定开始爬取?'
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
'post'
,
url
:
"fileGrapAct_grap"
,
data
:{
url
:
is_row
[
0
].
URL
,
save_path
:
is_row
[
0
].
SAVE_PATH
,
},
data
:
map
,
success
:
function
(
data
){
$
.
messager
.
alert
(
'提示'
,
"爬取中....."
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
...
...
@@ -300,3 +324,27 @@ function lookRow(index){
//openViewIframRow('listData',"fileGrapView_fileGrapDataTab?tableName="+is_row[0].TABLE_NAME,is_row[0],"爬取数据",true,0.65,0.95,170,0);
}
function
statusRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
var
map
=
{};
map
.
FIELD_UUID
=
is_row
[
0
].
UUID
map
.
FIELD_CREATE_ID
=
is_row
[
0
].
CREATE_ID
map
.
FIELD_CREATE_TIME
=
is_row
[
0
].
CREATE_TIME
map
.
FIELD_DATABASE_NAME
=
is_row
[
0
].
DATABASE_NAME
map
.
FIELD_DATA_SORT_ID
=
is_row
[
0
].
DATA_SORT_ID
map
.
FIELD_SAVE_PATH
=
is_row
[
0
].
SAVE_PATH
map
.
FIELD_TABLE_NAME
=
is_row
[
0
].
TABLE_NAME
map
.
FIELD_URL
=
is_row
[
0
].
URL
map
.
FIELD_TASK_ID
=
is_row
[
0
].
TASK_ID
$
.
ajax
({
type
:
'post'
,
url
:
"fileGrapAct_status"
,
data
:
map
,
success
:
function
(
data
){
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
\ No newline at end of file
WebContent/reptile/textGrap/js/textGrapTab.js
View file @
a24dc5fb
...
...
@@ -53,33 +53,7 @@ function resetQueryData(){
var
ls_module_id
=
'999'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//var v_standardquery = {};
//var v_standard_tree = standardModel.dataAction.listAllTables(v_reportquery);
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"抓取数据列表"
;
var
is_column
=
[
[
...
...
@@ -297,7 +271,6 @@ function refreshRow(){
function
searchRow
(){
var
v_query
=
$
(
"#textbGrapTab_searchForm"
).
getFormVal
();
console
.
log
(
v_query
);
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
}
...
...
WebContent/reptile/textGrap/textGrapTabDetail.jsp
View file @
a24dc5fb
...
...
@@ -8,7 +8,7 @@
<span>URL:</span>
</td>
<td style="width: 100%">
<input class="easyui-textbox" id="URL" name="FIELD_URL" style="width:300px" value="${is_row.URL}"/>
<input class="easyui-textbox" id="URL" name="FIELD_URL" style="width:300px" value="${is_row.URL}"
required="required"
/>
</td>
</tr>
<tr>
...
...
@@ -45,7 +45,7 @@
<span>数据库名称:</span>
</td>
<td style="width: 100%">
<input class="easyui-textbox" id="DATABASE_NAME" name="FIELD_DATABASE_NAME" style="width:300px" value="${is_row.DATABASE_NAME}"/>
<input class="easyui-textbox" id="DATABASE_NAME" name="FIELD_DATABASE_NAME" style="width:300px" value="${is_row.DATABASE_NAME}"
required="required"
/>
</td>
</tr>
<tr>
...
...
@@ -53,7 +53,7 @@
<span>表名:</span>
</td>
<td style="width: 100%">
<input class="easyui-textbox" id="TABLE_NAME" name="FIELD_TABLE_NAME" style="width:300px" value="${is_row.TABLE_NAME}"/>
<input class="easyui-textbox" id="TABLE_NAME" name="FIELD_TABLE_NAME" style="width:300px" value="${is_row.TABLE_NAME}"
required="required"
/>
</td>
</tr>
</table>
...
...
src_reptile/com/gaowj/fileGrap/actAction.java
View file @
a24dc5fb
...
...
@@ -6,6 +6,7 @@ import java.util.Map;
import
net.sf.json.JSONObject
;
import
com.gaowj.business.AllDataBusiness
;
import
com.gaowj.business.SystemOpeBusiness
;
import
com.gaowj.business.FileGrapBusiness
;
import
com.gaowj.business.action.BasicAction
;
...
...
@@ -65,7 +66,6 @@ public class actAction extends BasicAction{
FileGrapBusiness
business
=
BusinessManager
.
getBusiness
(
FileGrapBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
//去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
//修改
...
...
@@ -106,18 +106,42 @@ public class actAction extends BasicAction{
}
public
String
grap
()
throws
BusinessException
{
String
url
=
RequestUtils
.
getString
(
request
,
"url"
);
String
save_path
=
RequestUtils
.
getString
(
request
,
"save_path"
);
FileGrapBusiness
business
=
BusinessManager
.
getBusiness
(
FileGrapBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"url"
,
url
);
param
.
put
(
"save_path"
,
save_path
);
com
.
alibaba
.
fastjson
.
JSONObject
js
on
Object
=
new
com
.
alibaba
.
fastjson
.
JSONObject
(
param
);
String
json
=
js
on
Object
.
toJSONString
();
param
.
put
(
"url"
,
entity
.
get
(
"URL"
)
);
param
.
put
(
"save_path"
,
entity
.
get
(
"SAVE_PATH"
)
);
com
.
alibaba
.
fastjson
.
JSONObject
jsObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
(
param
);
String
json
=
jsObject
.
toJSONString
();
ResponseBack
responseBack
=
RestUtil
.
post
(
"http://192.168.1.51:8188/downloadfile"
,
json
,
"utf-8"
);
String
taskid
=
responseBack
.
getResponseBody
();
entity
.
put
(
"TASK_ID"
,
taskid
);
business
.
update_fileGrap
(
entity
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"开始抓取"
));
jsonObject
.
put
(
"statusCode"
,
responseBack
.
getStatusCode
());
jsonObject
.
put
(
"responseBody"
,
responseBack
.
getResponseBody
());
return
"json"
;
}
public
String
status
()
throws
BusinessException
{
FileGrapBusiness
business
=
BusinessManager
.
getBusiness
(
FileGrapBusiness
.
class
);
AllDataBusiness
allBusiness
=
BusinessManager
.
getBusiness
(
AllDataBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"task_id"
,
entity
.
get
(
"TASK_ID"
));
com
.
alibaba
.
fastjson
.
JSONObject
jsObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
(
param
);
String
json
=
jsObject
.
toJSONString
();
ResponseBack
responseBack
=
RestUtil
.
post
(
"http://192.168.1.51:8188/getstatus"
,
json
,
"utf-8"
);
entity
.
put
(
"STATUS"
,
responseBack
.
getResponseBody
());
if
(
responseBack
.
getResponseBody
().
equals
(
"PENDING"
)||
responseBack
.
getResponseBody
().
equals
(
"SUCCESS"
)){
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"SAVE_PATH"
,
entity
.
get
(
"SAVE_PATH"
));
int
count
=
allBusiness
.
listCount_file_attribute
(
map
);
entity
.
put
(
"RESULT_COUNT"
,
count
);
}
else
{
entity
.
put
(
"RESULT_COUNT"
,
0
);
}
business
.
update_fileGrap
(
entity
);
jsonObject
.
put
(
"responseBody"
,
responseBack
.
getResponseBody
());
return
"json"
;
}
}
src_reptile/com/gaowj/fileGrap/dataAction.java
View file @
a24dc5fb
...
...
@@ -111,4 +111,13 @@ public class dataAction extends BasicAction{
}
return
"json"
;
}
public
int
listFileCount
()
throws
BusinessException
{
AllDataBusiness
business
=
BusinessManager
.
getBusiness
(
AllDataBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
savePath
=
RequestUtils
.
getString
(
request
,
"SAVE_PATH"
);
query
.
put
(
"SAVE_PATH"
,
savePath
);
int
count
=
business
.
listCount_file_attribute
(
query
);
return
count
;
}
}
src_reptile/com/gaowj/textGrap/actAction.java
View file @
a24dc5fb
...
...
@@ -111,16 +111,17 @@ public class actAction extends BasicAction{
}
public
String
grap
()
throws
BusinessException
{
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
url
=
RequestUtils
.
getString
(
request
,
"url"
);
String
dbName
=
RequestUtils
.
getString
(
request
,
"dbName"
);
String
tableName
=
RequestUtils
.
getString
(
request
,
"tableName"
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"dbname"
,
dbName
);
param
.
put
(
"tablename"
,
tableName
);
com
.
alibaba
.
fastjson
.
JSONObject
js
on
Object
=
new
com
.
alibaba
.
fastjson
.
JSONObject
(
param
);
String
json
=
js
on
Object
.
toJSONString
();
com
.
alibaba
.
fastjson
.
JSONObject
jsObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
(
param
);
String
json
=
jsObject
.
toJSONString
();
ResponseBack
responseBack
=
RestUtil
.
post
(
url
,
json
,
"utf-8"
);
String
taskid
=
responseBack
.
getResponseBody
();
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"开始抓取"
));
jsonObject
.
put
(
"statusCode"
,
responseBack
.
getStatusCode
());
jsonObject
.
put
(
"responseBody"
,
responseBack
.
getResponseBody
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment