Commit 8a7191ee by 陈玉兰

更新

parent eb891273
......@@ -34,17 +34,21 @@ var tables=[
}];
$(function(){
var tableName = $.getUrlParam("tablename");
init(tableName);
var savePath = $.getUrlParam("savepath");
init(savePath);
console.log(savePath);
})
function init(tableName){
for(var i=0;i<tables.length;i++){
function init(savePath){
var i=0;
datagridLog("listFileData",ls_title,gaowj.WEB_APP_NAME + "/fileGrapData_listFileData?SAVE_PATH="+savePath,queryData,tables[i].columns,60,80);
/*for(var i=0;i<tables.length;i++){
if(tableName==tables[i].tableName){
datagridLog("listFileData",ls_title,gaowj.WEB_APP_NAME + "/fileGrapData_listFileData?tableName="+tableName,queryData,tables[i].columns,60,80);
datagridLog("listFileData",ls_title,gaowj.WEB_APP_NAME + "/fileGrapData_listFileData?SAVE_PATH="+savePath,queryData,tables[i].columns,60,80);
break;
}
}
}*/
}
function picture(value){
......
......@@ -69,6 +69,7 @@ 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'},
......@@ -268,18 +269,24 @@ function modifyNode(treeNode){
function grapRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$.ajax({
type:'post',
url:"fileGrapAct_grap",
data:{
url:is_row[0].URL,
save_path:is_row[0].SAVE_PATH,
},
success:function(data){
console.log(data);
$.messager.alert('提示',data);
$.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,
},
success:function(data){
$.messager.alert('提示',"爬取中.....");
}
});
}
});
}
......@@ -289,7 +296,7 @@ function lookRow(index){
is_row[0].OPETYPE = 'update';
//document.getElementById("textGrapiframe").contentWindow.init(is_row[0].TABLE_NAME);
//fileGrapiframe.window.init(is_row[0].TABLE_NAME);
window.location = 'fileGrapView_fileGrapDataTab?tablename='+is_row[0].TABLE_NAME;
window.location = 'fileGrapView_fileGrapDataTab?savepath='+is_row[0].SAVE_PATH;
//openViewIframRow('listData',"fileGrapView_fileGrapDataTab?tableName="+is_row[0].TABLE_NAME,is_row[0],"爬取数据",true,0.65,0.95,170,0);
}
......@@ -6,8 +6,8 @@ userDefaultPass = 0000
uploadPath=c:/temp/
uploadMaxSize=10485760
#------------license----------------------------
licensenumber=A010000002
licensedsoftware=A040000002
licensenumber=A010000003
licensedsoftware=A040000007
licensemaccharset=gbk
licensemacshowcmd=false
licensemacadress=00-21-CC-C9-D2-29
......
......@@ -138,6 +138,9 @@ public class AllDataBusinessImpl implements AllDataBusiness {
// TODO Auto-generated method stub
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
if(query.get("SAVE_PATH")!=null&&""!=(query.get("SAVE_PATH"))){
query.put("SAVE_PATH", "%"+query.get("SAVE_PATH")+"%");
}
List<Map<String, Object>> items = allDataDAO.list_file_attribute(
new RowBounds(pageStart, pageSize), query);
// 获取列表个数
......
......@@ -58,6 +58,9 @@
select f.*
from FILE_ATTRIBUTE f where 1=1
]]>
<if test="SAVE_PATH != null and SAVE_PATH != ''">
and f.SAVE_PATH LIKE #{SAVE_PATH}
</if>
</select>
<select id="listCount_file_attribute" parameterType="map" resultType="int">
......
......@@ -61,6 +61,9 @@
<if test="DATA_SORT_ID != null and DATA_SORT_ID != ''">
and f.DATA_SORT_ID = #{DATA_SORT_ID}
</if>
<if test="SAVE_PATH != null and SAVE_PATH != ''">
and f.SAVE_PATH LIKE #{SAVE_PATH}
</if>
order by f.CREATE_TIME DESC
</select>
......
......@@ -114,7 +114,7 @@ public class actAction extends BasicAction{
param.put("save_path", save_path);
com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(param);
String json=jsonObject.toJSONString();
ResponseBack responseBack=RestUtil.post("http://192.168.1.191:8188/downloadfile",json, "utf-8");
ResponseBack responseBack=RestUtil.post("http://192.168.1.51:8188/downloadfile",json, "utf-8");
jsonObject.putAll(Status.getStatusSuccessMessage("开始抓取"));
jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody());
......
......@@ -85,13 +85,13 @@ public class dataAction extends BasicAction{
public String listFileData() throws BusinessException{
AllDataBusiness business=BusinessManager.getBusiness(AllDataBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String table=RequestUtils.getString(request, "tableName");
String savePath=RequestUtils.getString(request, "SAVE_PATH");
try {
Page<Map<String, Object>> pageRows=null;
query = QueryParamUtil.StringToDate(query);
if(table.equals("file_attribute")){
pageRows = business.list_file_attribute(page, pageSize, query);
}
query.put("SAVE_PATH", savePath);
pageRows = business.list_file_attribute(page, pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
......
......@@ -20,7 +20,7 @@ public class viewAction extends BasicAction{
public String fileGrapDataTab() throws BusinessException{
String tableName=RequestUtils.getString(request, "tableName");
request.setAttribute("tableName", tableName);
//request.setAttribute("tableName", tableName);
return "fileGrapDataTab";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment