Commit 79fbacc1 by 管理员

Merge branch 'develop' into 'master'

mergeBranch

See merge request !1
parents eb891273 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&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="url" value="jdbc:mysql://192.168.1.249:3306/pc_system?useUnicode=true&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;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&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="username" value="jw_standard" />
<property name="password" value="jw_standard" />
<property name="url" value="jdbc:mysql://192.168.1.249:3306/jf_standard?useUnicode=true&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="username" value="jf_standard" />
<property name="password" value="jf_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&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="url" value="jdbc:mysql://192.168.1.249:3306/pc_business?useUnicode=true&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="username" value="pc_business" />
<property name="password" value="pc_business" />
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
......
......@@ -313,3 +313,6 @@
.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/images/main/nbjwtop.jpg

11.3 KB | W: | H:

WebContent/images/main/nbjwtop.jpg

57.2 KB | W: | H:

WebContent/images/main/nbjwtop.jpg
WebContent/images/main/nbjwtop.jpg
WebContent/images/main/nbjwtop.jpg
WebContent/images/main/nbjwtop.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -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>
......
......@@ -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>
......
......@@ -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,10 +69,23 @@ var ls_ywlx = 'YBYW';
var ls_title="抓取数据列表";
var is_column = [ [
{field : 'URL',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(){
......@@ -98,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;
......@@ -106,7 +120,7 @@ function getOptionMenu(data,index){
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 4;
var is_menu_count = 5;
return is_menu_count;
}
......@@ -187,6 +201,10 @@ function updateData(is_entity){
}
/****/
function refreshRow(){
$('#list').datagrid('load',{});
}
/**
* 序号:7
* 功能:单个删除
......@@ -268,18 +286,31 @@ 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){
console.log(data);
$.messager.alert('提示',data);
$.messager.alert('提示',"爬取中.....");
$('#list').datagrid('reload');
}
});
}
});
}
......@@ -289,7 +320,31 @@ 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);
}
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
......@@ -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);
}
......
......@@ -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>
......
......@@ -11,7 +11,7 @@
<html>
<head>
<title>V5 | XXX系统</title>
<title>V5 | PC</title>
<%-- 富客户端环境引用文件 --%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<link rel="shortcut icon" href="images/main/logo.ico" />
......
......@@ -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>
......
......@@ -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 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");
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";
}
}
......@@ -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")){
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()));
......@@ -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;
}
}
......@@ -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";
}
}
......@@ -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 jsonObject=new com.alibaba.fastjson.JSONObject(param);
String json=jsonObject.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());
......
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