Commit 8a7191ee by 陈玉兰

更新

parent eb891273
...@@ -34,17 +34,21 @@ var tables=[ ...@@ -34,17 +34,21 @@ var tables=[
}]; }];
$(function(){ $(function(){
var tableName = $.getUrlParam("tablename"); var savePath = $.getUrlParam("savepath");
init(tableName); init(savePath);
console.log(savePath);
}) })
function init(tableName){ function init(savePath){
for(var i=0;i<tables.length;i++){ 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){ 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; break;
} }
} }*/
} }
function picture(value){ function picture(value){
......
...@@ -69,6 +69,7 @@ var ls_ywlx = 'YBYW'; ...@@ -69,6 +69,7 @@ var ls_ywlx = 'YBYW';
var ls_title="抓取数据列表"; var ls_title="抓取数据列表";
var is_column = [ [ var is_column = [ [
{field : 'URL',title : '名称',width : 300,align : 'left'}, {field : 'URL',title : '名称',width : 300,align : 'left'},
{field : 'SAVE_PATH',title : '保存路径',width : 300,align : 'left'},
{field : 'DATABASE_NAME',title : '指定数据库',width : 150,align : 'left'}, {field : 'DATABASE_NAME',title : '指定数据库',width : 150,align : 'left'},
{field : 'TABLE_NAME',title : '指定表名',width : 150,align : 'left'}, {field : 'TABLE_NAME',title : '指定表名',width : 150,align : 'left'},
{field : 'CREATE_TIME',title : '创建时间',width : 150,align : 'left'}, {field : 'CREATE_TIME',title : '创建时间',width : 150,align : 'left'},
...@@ -268,18 +269,24 @@ function modifyNode(treeNode){ ...@@ -268,18 +269,24 @@ function modifyNode(treeNode){
function grapRow(index){ function grapRow(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
$.ajax({ $.messager.confirm('提示', '确定开始爬取?', function(r) {
type:'post', if (r) {
url:"fileGrapAct_grap", $.ajax({
data:{ type:'post',
url:is_row[0].URL, url:"fileGrapAct_grap",
save_path:is_row[0].SAVE_PATH, data:{
}, url:is_row[0].URL,
success:function(data){ save_path:is_row[0].SAVE_PATH,
console.log(data); },
$.messager.alert('提示',data); success:function(data){
$.messager.alert('提示',"爬取中.....");
}
});
} }
}); });
} }
...@@ -289,7 +296,7 @@ function lookRow(index){ ...@@ -289,7 +296,7 @@ function lookRow(index){
is_row[0].OPETYPE = 'update'; is_row[0].OPETYPE = 'update';
//document.getElementById("textGrapiframe").contentWindow.init(is_row[0].TABLE_NAME); //document.getElementById("textGrapiframe").contentWindow.init(is_row[0].TABLE_NAME);
//fileGrapiframe.window.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); //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 ...@@ -6,8 +6,8 @@ userDefaultPass = 0000
uploadPath=c:/temp/ uploadPath=c:/temp/
uploadMaxSize=10485760 uploadMaxSize=10485760
#------------license---------------------------- #------------license----------------------------
licensenumber=A010000002 licensenumber=A010000003
licensedsoftware=A040000002 licensedsoftware=A040000007
licensemaccharset=gbk licensemaccharset=gbk
licensemacshowcmd=false licensemacshowcmd=false
licensemacadress=00-21-CC-C9-D2-29 licensemacadress=00-21-CC-C9-D2-29
......
...@@ -138,6 +138,9 @@ public class AllDataBusinessImpl implements AllDataBusiness { ...@@ -138,6 +138,9 @@ public class AllDataBusinessImpl implements AllDataBusiness {
// TODO Auto-generated method stub // TODO Auto-generated method stub
int pageStart = (pageNo - 1) * pageSize; 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( List<Map<String, Object>> items = allDataDAO.list_file_attribute(
new RowBounds(pageStart, pageSize), query); new RowBounds(pageStart, pageSize), query);
// 获取列表个数 // 获取列表个数
......
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
select f.* select f.*
from FILE_ATTRIBUTE f where 1=1 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>
<select id="listCount_file_attribute" parameterType="map" resultType="int"> <select id="listCount_file_attribute" parameterType="map" resultType="int">
......
...@@ -61,6 +61,9 @@ ...@@ -61,6 +61,9 @@
<if test="DATA_SORT_ID != null and DATA_SORT_ID != ''"> <if test="DATA_SORT_ID != null and DATA_SORT_ID != ''">
and f.DATA_SORT_ID = #{DATA_SORT_ID} and f.DATA_SORT_ID = #{DATA_SORT_ID}
</if> </if>
<if test="SAVE_PATH != null and SAVE_PATH != ''">
and f.SAVE_PATH LIKE #{SAVE_PATH}
</if>
order by f.CREATE_TIME DESC order by f.CREATE_TIME DESC
</select> </select>
......
...@@ -114,7 +114,7 @@ public class actAction extends BasicAction{ ...@@ -114,7 +114,7 @@ public class actAction extends BasicAction{
param.put("save_path", save_path); param.put("save_path", save_path);
com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(param); com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(param);
String json=jsonObject.toJSONString(); 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.putAll(Status.getStatusSuccessMessage("开始抓取"));
jsonObject.put("statusCode", responseBack.getStatusCode()); jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody()); jsonObject.put("responseBody", responseBack.getResponseBody());
......
...@@ -85,13 +85,13 @@ public class dataAction extends BasicAction{ ...@@ -85,13 +85,13 @@ public class dataAction extends BasicAction{
public String listFileData() throws BusinessException{ public String listFileData() throws BusinessException{
AllDataBusiness business=BusinessManager.getBusiness(AllDataBusiness.class); AllDataBusiness business=BusinessManager.getBusiness(AllDataBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String table=RequestUtils.getString(request, "tableName"); String savePath=RequestUtils.getString(request, "SAVE_PATH");
try { try {
Page<Map<String, Object>> pageRows=null; Page<Map<String, Object>> pageRows=null;
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
if(table.equals("file_attribute")){ query.put("SAVE_PATH", savePath);
pageRows = business.list_file_attribute(page, pageSize, query); pageRows = business.list_file_attribute(page, pageSize, query);
}
setPageCount((pageRows.getCount() - 1) / pageSize + 1); setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
......
...@@ -20,7 +20,7 @@ public class viewAction extends BasicAction{ ...@@ -20,7 +20,7 @@ public class viewAction extends BasicAction{
public String fileGrapDataTab() throws BusinessException{ public String fileGrapDataTab() throws BusinessException{
String tableName=RequestUtils.getString(request, "tableName"); String tableName=RequestUtils.getString(request, "tableName");
request.setAttribute("tableName", tableName); //request.setAttribute("tableName", tableName);
return "fileGrapDataTab"; 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