Commit 65b6e575 by EVEN02\76050

fix:添加全文搜索功能

parent 6a837345
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<script type="text/javascript" src="${ctx}/bussInfo/common/js/buss_info.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/bussInfo/pages/awardSearching/js/awardSearchingModule.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="${ctx}/bussInfo/common/css/buss_info.css" charset="utf-8"></link>
<style lang="scss" scoped>
.dialogDiv {
height: 400px;
overflow: auto;
}
</style>
<div id="el_awardSearching_tab" class="l_main">
<div class="l_search">
<span class="s_span">关键字:</span>
<el-input placeholder="请输入关键字" suffix-icon="el-icon-search" v-model="keywords" size="mini" style="width:160px;"></el-input>
<el-button type="primary" size="mini" icon="el-icon-search" style="width:80px;" @click="doSearch">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh-right" style="width:80px;" @click="reset_list">重置</el-button>
<el-button type="primary" size="mini" icon="el-icon-plus" style="width:80px;" @click="doAdd">新增</el-button>
<el-button type="primary" size="mini" icon="el-icon-delete" style="width:80px;" @click="doBatchDelete">删除</el-button>
<el-button type="primary" size="mini" icon="el-icon-share" style="width:120px;" @click="analyse">分析关键词</el-button>
</div>
<!-- 表格展示 -->
<div class="l_table">
<el-table :data="tableData" style="width: 100%;background:#f8f8f8;" :height="table_height" :max-height="table_max_height"
:border="table_border" :stripe="table_stripe" @selection-change="doSelect" @row-dblclick="doDBClick" >
<el-table-column type="selection" min-width="10%"> </el-table-column>
<el-table-column label="序号" type="index" :index='indexMethod' min-width="10%" align="center"> </el-table-column>
<el-table-column label="关键字" min-width="20%" align="center" prop="NAME"> </el-table-column>
<el-table-column label="标记值" min-width="20%" align="center" prop="SIGN"> </el-table-column>
<el-table-column label="备注" min-width="20%" align="center" prop="REMARK"> </el-table-column>
<el-table-column label="排序号" min-width="20%" align="center" prop="ORDERBY"> </el-table-column>
<el-table-column label="创建时间" min-width="20%" align="center" prop="CREATE_TIME"> </el-table-column>
<el-table-column label="操作" min-width="10%" fixed="right">
<template slot-scope="scope">
<a @click="doEdit(scope.$index, scope.row)" class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
</template>
</el-table-column>
</el-table>
</div>
<!-- 表格分页 -->
<div class="l_page">
<el-pagination @size-change="doSizeChange" @current-change="doCurrentChange" :current-page="is_page" :page-sizes="is_listPageSize"
:page-size="is_rows" layout="sizes, prev, pager, next, jumper,total" :total="is_total">
</el-pagination>
</div>
<!-- 编辑弹框 -->
<el-dialog style='display:none;' :visible.sync="dialogFormVisible" width="50%" top="2%" @opened="dialogOpen" @close="dialogClose" :ref="is_ref_dialogName">
<el-form :model="form" :rules="fieldRules" :ref="is_ref_formName" :label-width="is_form_label_width" label-suffix=":">
<el-row>
<el-col :span="24">
<el-form-item label="关键字" prop="FIELD_NAME">
<el-input v-model="form.FIELD_NAME" auto-complete="off" :style="{width:'90%'}" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="FIELD_REMARK">
<el-input v-model="form.FIELD_REMARK" auto-complete="off" :style="{width:'90%'}" type="textarea" :rows="2" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="排序号" prop="FIELD_ORDERBY">
<el-input v-model="form.FIELD_ORDERBY" auto-complete="off" :style="{width:'90%'}" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 弹窗按钮 -->
<div slot="footer">
<el-button type="primary" @click="doSubmit()">保存</el-button>
<el-button @click="dialogFormVisible = false">关闭</el-button>
</div>
<div slot="title">
<el-divider content-position="left">
<i class="el-icon-edit"></i> {{is_dialog_title}} </el-divider>
</div>
</el-dialog>
</div>
<script type="text/javascript">
var s_flag = 0;
var url = '<%=request.getContextPath()%>';
var vm_awardSearching = new Vue({
el: '#el_awardSearching_tab',
data: function(){
//方法定义
let v_page = 1;
let v_rows = 20;
let v_queryData = {};
v_queryData.page = v_page;
v_queryData.rows = v_rows;
//数据返回
return {
is_page:v_page,//当前页
is_rows:v_rows,//每页显示
is_listPageSize:[20,50,100,200,500],//每页数量选择
is_total:200,//共计多少条数据
is_queryData:v_queryData,//分页查询条件
table_height:'300px',//设定表格高度
table_max_height:'300px',//设定表格最大高度
table_border:true,//表格是否有竖线
table_stripe:true,//表格是否为斑马纹
keywords:'',
tableData: [],
tableSelect:[],//列表选中数据
dialogFormVisible: false,
is_dialog_title:'编辑',
is_ref_dialogName:'whaqqyDialog',
is_ref_formName:'whaqqyForm',
form: {
FIELD_UUID: '',
FIELD_NAME: '',
FIELD_REMARK: '',
FIELD_ORDERBY: ''
},
loading: true,
form1: {},
is_form_label_width:'120',//表单每个字段的label名称宽度
fieldRules:{}
}
},
created:function(){//列表初始化执行
this.doSearch();
},
methods: {
analyse () {
var v_result = ajaxGetTBdata(url+'/test2', {});
this.$message({showClose: true,message: v_result.msg,type: 'success'});
},
indexMethod (index) {
let curpage = this.is_page; //当前页码
let limitpage = this.is_rows; //每页条数
return (index+1) + (curpage-1) * limitpage;
},
dialogOpen(){
},
dialogClose(){
this.doResetForm();
},
doResetForm() {
this.$refs[this.is_ref_formName].resetFields();
this.form = clearFormData(this.form);
},
doSelect(val){//选中行赋值
this.tableSelect = val;
},
doDBClick(row, column, event){//双击编辑
this.doEdit(0,row);
},
doAdd(){
this.is_dialog_title='新增';
this.dialogFormVisible = true;
this.fileList = [];
},
doEdit(index, row) {//按扭编辑
this.is_dialog_title='编辑';
this.dialogFormVisible = true;
this.form.FIELD_UUID = row.UUID;
this.form.FIELD_NAME = row.NAME;
this.form.FIELD_REMARK = row.REMARK;
this.form.FIELD_ORDERBY= row.ORDERBY;
},
doShowReturnMessage(v_result){//提交后的返回提示
if(v_result.NAME.indexOf('999')==-1){
this.$message({showClose: true,message: v_result.VALUE,type: 'error'});
}else{
this.$message({showClose: true,message: v_result.VALUE,type: 'success'});
this.doSearch();
}
},
// 保存
doSubmit:function(){
this.$refs[this.is_ref_formName].validate((valid) => {
if (valid) {
var v_result = '';
this.form.flag = s_flag;
if(this.is_dialog_title=='编辑'){
v_result = awardSearchingModule.infoActAction.updateDataM(this.form);
}else{
v_result = awardSearchingModule.infoActAction.insertDataM(this.form);
}
if(v_result.NAME.indexOf('999')>-1){
this.dialogFormVisible = false;
}
this.doShowReturnMessage(v_result);
} else {
this.$message({showClose: true,message: '表单信息未填写完整!',type: 'error'});
return false;
}
});
},
doBatchDelete(){//按扭批量软删
deleteData(vm_awardSearching,awardSearchingModule);
},
doSizeChange(val) {//每页显示数量选择变化
this.is_queryData.rows = val;
this.is_rows = val;
this.doSearch();
},
doCurrentChange(val) {//当前页变化
this.is_queryData.page = val;
this.is_page = val;
this.doSearch();
},
doSearch(){//数据查询
this.is_queryData.FIELD_NAME = this.keywords;
this.is_queryData.flag = s_flag;
let entityData = awardSearchingModule.infoDataAction.list(this.is_queryData);
this.tableData =entityData.rows;
this.is_total = entityData.total;
},
reset_list(){//重置
this.keywords='';
this.doSearch();
}
}
});
var ls_width = $(window).width();
var ls_height = $(window).height();
<!-- 表格最大高度设定 -->
$(document).ready(function() {
var is_b = $('.l_main').height();
var is_s = $('.l_search').height();
var is_t = $('.l_table').height();
var is_p = $('.l_page').height();
is_t = is_b - is_s - is_p - 20;
vm_awardSearching.table_max_height = is_t;
vm_awardSearching.table_height = is_t;
});
<!-- JSON串所有值置空 -->
function clearFormData(formData){
var c_d = {};
for (var key in formData) {
c_d[key] = undefined;
}
return c_d;
};
</script>
//此乃本模块与后台交互的方法接口部分
var awardSearchingModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
awardSearchingModule.prototype = BusinessObject;
//插入数据
awardSearchingModule.prototype.insertDataM = function(){};
//修改数据
awardSearchingModule.prototype.updateDataM = function(){};
//删除数据
awardSearchingModule.prototype.deleteDataM = function(){};
//恢复数据
awardSearchingModule.prototype.resumeDataM = function(){};
//清除数据
awardSearchingModule.prototype.deleteTrueDataM = function(){};
//附件数据_分页
awardSearchingModule.prototype.list = function(){};
//附件所有数据
awardSearchingModule.prototype.listAll = function(){};
//附件所有数据
awardSearchingModule.prototype.chart = function(){};
//创建一个数据操作对象,然后再后续使用
awardSearchingModule.infoActAction = new awardSearchingModule("json").delegate("info_awardSearchingAct");
//创建一个数据获取对象,然后再后续使用
awardSearchingModule.infoDataAction = new awardSearchingModule("json").delegate("info_awardSearchingData");
package com.jf.action.awardSearching;
import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.Status;
import com.jf.businessInfo.DataMBusiness;
import net.sf.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 调度任务类型管理
* @author chenh
*
*/
public class actAction extends BasicAction
{
/**
*
*/
private static final long serialVersionUID = 9174985425702762706L;
private JSONObject jsonObject = new JSONObject();
private static String tableName = "t_award_searching";
public JSONObject getJsonObject()
{
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject)
{
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @throws BusinessException
*/
public String insertDataM() throws BusinessException
{
DataMBusiness business = BusinessManager.getBusiness(DataMBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try
{
entity = QueryParamUtil.StringToDate(entity);
//查询是否已存在
Map<String, Object> query = new HashMap<>();
query.put("NAME",entity.get("NAME"));
List<Map<String, Object>> listData = business.list_dataM(tableName,query);
if(listData.size()>0){
jsonObject.putAll(Status.getStatusErrorMessage("关键词已存在!"));
return "json";
}
//添加标记
List<Map<String, Object>> list = business.excuteSql("select * from t_award_searching order by CREATE_TIME desc limit 1 ");
if(list.size()==0){
entity.put("SIGN",0);
}else{
entity.put("SIGN",Integer.parseInt(list.get(0).get("SIGN").toString())+1);
}
business.insert_dataM(tableName, entity);
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertDataM", "" + entity, "增加任务调度器类型数据", (String) entity.get("UUID"), (String) entity
.get("NAME"), "jobType");
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
}
catch (Exception e)
{
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 更新
*
* @throws BusinessException
*/
public String updateDataM() throws BusinessException
{
DataMBusiness business = BusinessManager
.getBusiness(DataMBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
try
{
entity = QueryParamUtil.StringToDate(entity);
//查询是否已存在
Map<String, Object> query = new HashMap<>();
query.put("NAME",entity.get("NAME"));
List<Map<String, Object>> listData = business.list_dataM(tableName,query);
if(listData.size()>0){
jsonObject.putAll(Status.getStatusErrorMessage("关键词已存在!"));
return "json";
}
business.update_dataM(tableName, entity);
SystemOpeBusiness sysbusiness = BusinessManager .getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateDataM", "" + entity,
"修改任务调度器类型数据", (String) entity.get("UUID"), (String) entity
.get("NAME"), "jobType");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
}
catch (Exception e)
{
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
/**
* 在软删除基础上删除记录
*
* @throws BusinessException
*/
public String deleteDataM() throws BusinessException
{
DataMBusiness business = BusinessManager
.getBusiness(DataMBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey);
try
{
business.delete_dataM(tableName, ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager
.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteDataM", "" + ListKey,
"删除任务调度器类型数据", deletekey, "多个流水号", "jobType");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
}
catch (Exception e)
{
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.jf.action.awardSearching;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.jf.businessInfo.DataMBusiness;
import net.sf.json.JSONObject;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 调度任务类型管理
* @author chenh
*
*/
public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 3230796492319157931L;
private static String tableName="t_award_searching";
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
rows = getPageSize();
return rows;
}
public void setRows(int rows) {
setPageSize(rows);
this.rows = getPageSize();
}
public int getPage() {
page = getPageNo();
return page;
}
public void setPage(int page) {
setPageNo(page);
this.page = getPageNo();
}
/**
* 分页获取记录
* @throws BusinessException
*/
public String list() throws BusinessException {
DataMBusiness business = BusinessManager.getBusiness(DataMBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
query.put("sortCriteria","ORDERBY ASC,CREATE_TIME DESC");
Page<Map<String, Object>> pageRows = business.list_dataM_Name(pageNo,pageSize,tableName, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageRows.getCount());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
return "json";
}
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
public String listAll() throws BusinessException {
DataMBusiness business = BusinessManager.getBusiness(DataMBusiness.class);
try {
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
query = QueryParamUtil.StringToDate(query);
query.put("sortCriteria","ORDERBY ASC,CREATE_TIME DESC");
List<Map<String, Object>> listData = business.list_dataM(tableName,query);
int listDataCount = listData.size();
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(listData));
data.put("pageNo", 1);
data.put("pageSize", listDataCount);
data.put("pageCount", listDataCount);
data.put("rows", data.get("rowSet"));
data.put("total", listDataCount);
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
return "json";
}
}
package com.jf.action.awardSearching;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
/**
* @author chenh
*
*/
public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = -7150087929209524946L;
/**
* 列表页
* @return
* @throws BusinessException
*/
public String Tab() throws BusinessException{
return "success";
}
public String TabTest() throws BusinessException{
return "success";
}
}
package com.jf.timer;
import java.util.TimerTask;
import com.gaowj.business.util.PropUtil;
import com.jf.common.GetWord;
import com.jw.app.business.utils.DateTools;
/**
*获取wordn内容
*
* @author VULCAN
*
*/
public class getWordSignTask extends TimerTask {
@Override
public void run() {
//每天 00:10:00 执行
if(PropUtil.getValue("WORD_SING_TIME", "quartz_service", "0").equals(DateTools.getServerDateTime(10).split(" ")[1])){
GetWord.getWordContentSign();
}
}
}
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