Commit 5a8be4b2 by 朱天成

日志管理

parent 7ca3676e
......@@ -23,6 +23,7 @@
<value>classpath:com/jw/app/business/calendar/calendarDAO.xml</value>
<value>classpath:com/jw/app/business/vote/voteDAO.xml</value>
<value>classpath:com/jw/app/business/meeting/meetingDAO.xml</value>
<value>classpath:com/jw/app/business/log/logDAO.xml</value>
</list>
</property>
</bean>
......@@ -80,6 +81,10 @@
<property name="mapperInterface" value="com.jw.app.business.meeting.meetingDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="logDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.log.logDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<!-- BusinessInterFace -->
<bean id="PortletBusiness"
class="com.jw.app.business.portlet.PortletBusinessImpl">
......@@ -136,6 +141,11 @@
<property name="meetingDAO" ref="meetingDAO"/>
</bean>
<bean id="LogBusiness"
class="com.jw.app.business.log.LogBusinessImpl">
<property name="logDAO" ref="logDAO"/>
</bean>
<!-- DAO -->
<bean id="portletDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.portlet.PortletDAO"/>
......
//此乃本模块与后台交互的方法接口部分
var logModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
logModule.prototype = BusinessObject;
//插入日志数据
logModule.prototype.insertLog = function(){};
//修改日志数据
logModule.prototype.updateLog = function(){};
//删除日志数据
logModule.prototype.deleteLog = function(){};
//插入回复数据
logModule.prototype.insertReply = function(){};
//删除回复数据
logModule.prototype.deleteReply = function(){};
//日志数据_分页
logModule.prototype.list = function(){};
//日志所有数据
logModule.prototype.listAll = function(){};
//获取回复内容
logModule.prototype.listItem = function(){};
//创建一个数据操作对象,然后再后续使用
logModule.logActAction = new logModule("json").delegate("logAct");
//创建一个数据获取对象,然后再后续使用
logModule.logDataAction = new logModule("json").delegate("logData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//定义grid列表
var ls_title="会议签到管理&nbsp;&nbsp;<font color='#993300'></font>";
var is_column = [ [
{field : 'LOG_TITLE',title : '日志标题',width : 100,align : 'center'},
{field : 'LOG_CONTENT',title : '日志内容',width : 300,align : 'center'},
{field : 'NEW_CREATE',title : '创建人',width : 80,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 150,align : 'center'},
{field : 'NEW_UPDATE',title : '修改人',width : 80,align : 'center'},
{field : 'UPDATE_TIME',title : '修改时间',width : 150,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/logData_list",queryData,is_column,60,80);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function formatMenu(value, data,index) {
var returnData="";
return returnData
+ "<span class=\"icon-ext-moremenu\" style=\"padding-left:20px;*width:20px;\"></span>"
+ "<span data-p1="+index+" class=\"easyui-tooltip\" style=\"color:blue;cursor:pointer;\">更多</span>";
}
//上浮横向菜单集里的具体菜单项(需更改)
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-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"replyRow('"
+ index + "')\">回复</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 3;
return is_menu_count;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("logView_logTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
}
//保存
function insertData(is_entity){
var v_result = logModule.logActAction.insertLog(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//加载修改子页面
function editRow(index) {
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'update';
openEditRow("logView_logTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
}
//保存
function updateData(is_entity){
var v_result = logModule.logActAction.updateLog(is_entity);
$('#list').datagrid('reload');
return v_result;
}
function openreplyRow(editUrl,is_row,is_title,is_max,is_width,is_height,is_left,is_top){
$('#detail').dialog( {
title : is_title,
iconCls : $.getJwWindowPic(),
width : ls_width * is_width,
height :ls_height * is_height,
closed : false,
cache : false,
maximizable:is_max,
left:is_left,
top:is_top,
href : editUrl,
queryParams:get_FIELD(is_row),
modal : true,
buttons : [ {
text : '关闭',
iconCls : 'icon-back',
handler : function() {
closeBox('detail');
}
} ],
onLoad:function editUrlOnload(){
if(is_row.OPETYPE=='reply'){
replyUrlOnloadCallback(is_row);
}else{
updateUrlOnloadCallback(is_row);
}
}
});
}
/**
* 序号:
* 功能:回复
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载回复子页面
function replyRow(index) {
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'reply';
openreplyRow("logView_replyTabDetail",is_row[0],"回复",true,0.65,0.95,0,0);
}
//加载回复子页面成功后的回调
function replyUrlOnloadCallback(is_row){
var listItem=logModule.logDataAction.listItem({
FIELD_LOG_ID:is_row.UUID
}).listItems;
for(var i=0;i<listItem.length;i++){
add_log_item(listItem[i].REPLY_NAME,listItem[i].REPLY_CONTENT,listItem[i].UUID,listItem[i].CODE);
}
}
//回复保存
function replySaveRow(){
var items={FIELD_LOG_ID:$("input[name=FIELD_UUID]").val(),
FIELD_REPLY_CONTENT:$("input[name=FIELD_USER_REPLY_CONTENT]").val()}
var v_result = logModule.logActAction.insertReply(items);
if(v_result.NAME=='999'){
add_log_item(v_result.REPLY_NAME,v_result.REPLY_CONTENT,v_result.UUID,v_result.CODE);
$("#USER_REPLY_CONTENT").textbox('setValue','')
}
}
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = logModule.logActAction.deleteLog(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = logModule.logActAction.deleteLog(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#logTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function searchRow(){
var v_query = $("#logTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
function add_log_item(index,content,uuid,code){
if(typeof index == 'undefined'){
index='';
}
if(typeof content == 'undefined'){
content='';
}
if(typeof uuid == 'undefined'){
uuid='';
}
if(typeof code == 'undefined'){
code='';
}
var log_item_list=$(".log_item_list");
var item=$("<div class='log_item_one' style='overflow: auto;margin-bottom:10px'></div>");
log_item_list.append(item);
var log_item_index=$('<div></div>');
log_item_index.addClass('log_item_index');
var log_item_info=$('<div></div>');
log_item_info.addClass('log_item_info');
var log_item_delete=$('<div></div>');
log_item_delete.addClass('log_item_delete');
var log_item_uuid=$('<div></div>');
log_item_uuid.addClass('log_item_uuid');
var log_item_code=$('<div></div>');
log_item_code.addClass('log_item_code');
item.append(log_item_index);
item.append(log_item_info);
item.append(log_item_delete);
item.append(log_item_uuid);
item.append(log_item_code);
log_item_index.append('<input class="easyui-validatebox easyui-textbox" readonly="readonly" name="log_item_index" value="'+index+'" />');
log_item_info.append('<input class="easyui-validatebox easyui-textbox" readonly="readonly" name="log_item_info" style="width: 400px" value="'+content+'"/>');
log_item_delete.append('<a name="log_item_delete" class="log_item_delete" onclick="javascript:deleteItemRow(this)">删除</a>');
log_item_uuid.append('<input type="hidden" name="log_item_uuid" value="'+uuid+'" />');
log_item_code.append('<input type="hidden" name="log_item_code" value="'+code+'" />');
$.parser.parse('.log_item_one');
}
/**
* 序号:
* 功能:回复删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteItemRow(handler){
code=$(handler).parent().next().find('input').val();
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
$(handler).parent().parent().remove();
var v_result = logModule.logActAction.deleteReply(v_query);
$.messager.alert('提示',v_result.VALUE);
}
});
}
/****/
/**
* 序号:
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//定义grid列表
var ls_title="会议签到管理&nbsp;&nbsp;<font color='#993300'></font>";
var is_column = [ [
{field : 'LOG_TITLE',title : '日志标题',width : 100,align : 'center'},
{field : 'LOG_CONTENT',title : '日志内容',width : 300,align : 'center'},
{field : 'OPT',title : '操作',width : 300,align : 'center',
formatter:function(index){
var replyBtn='<a style="cursor:pointer" onclick="javascript:replyRow('+index+')">回复</a>'
return '<div class="optBtn">'+replyBtn+'</div>'
}
}
] ];
//列表加载完成回调
function reportrollback(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
reportgrid("list",ls_title,gaowj.WEB_APP_NAME + "/logData_list",queryData,is_column,60,80);
/**
* 序号:
* 功能:回复
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载回复子页面
function replyRow(index) {
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'update';
openEditRow("logView_replyTabDetail",is_row[0],"回复",true,0.65,0.95,0,0);
}
//加载回复子页面成功后的回调
function updateUrlOnloadCallback(is_row){
var listItem=logModule.logDataAction.listItem({
FIELD_LOG_ID:is_row.UUID
}).listItems;
for(var i=0;i<listItem.length;i++){
add_log_item(listItem[i].REPLY_NAME,listItem[i].REPLY_CONTENT,listItem[i].UUID,listItem[i].CODE);
}
$('.log_item_delete').each(function (){
if(typeof $(this).next().next().find('input').val() == 'undefined'){
}else{
if($(this).next().next().find('input').val() == gaowj.SEESION_CODE ){
}else {
$(this).hide();
}
}
});
}
//保存
function updateData(is_entity){
var v_result = logModule.logActAction.updateLog(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//回复保存
function replySaveRow(){
var items={FIELD_LOG_ID:$("input[name=FIELD_UUID]").val(),
FIELD_REPLY_CONTENT:$("input[name=FIELD_USER_REPLY_CONTENT]").val()}
var v_result = logModule.logActAction.insertReply(items);
if(v_result.NAME=='999'){
add_log_item(items.REPLY_NAME,items.REPLY_CONTENT,items.UUID,items.CODE);
}
}
/**
* 序号:
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#logTab_searchForm")[0].reset();
}
/****/
/**
* 序号:
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function searchRow(){
var v_query = $("#logTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
function add_log_item(index,content,uuid,code){
if(typeof index == 'undefined'){
index='';
}
if(typeof content == 'undefined'){
content='';
}
if(typeof uuid == 'undefined'){
uuid='';
}
if(typeof code == 'undefined'){
code='';
}
var log_item_list=$(".log_item_list");
var item=$("<div class='log_item_one' style='overflow: auto;margin-bottom:10px'></div>");
log_item_list.append(item);
var log_item_index=$('<div></div>');
log_item_index.addClass('log_item_index');
var log_item_info=$('<div></div>');
log_item_info.addClass('log_item_info');
var log_item_delete=$('<div></div>');
log_item_delete.addClass('log_item_delete');
var log_item_uuid=$('<div></div>');
log_item_uuid.addClass('log_item_uuid');
var log_item_code=$('<div></div>');
log_item_code.addClass('log_item_code');
item.append(log_item_index);
item.append(log_item_info);
item.append(log_item_delete);
item.append(log_item_uuid);
item.append(log_item_code);
log_item_index.append('<input class="easyui-validatebox easyui-textbox" readonly="readonly" name="log_item_index" value="'+index+'" />');
log_item_info.append('<input class="easyui-validatebox easyui-textbox" readonly="readonly" name="log_item_info" style="width: 400px" value="'+content+'"/>');
log_item_delete.append('<a name="log_item_delete" class="log_item_delete" onclick="javascript:deleteItemRow(this)">删除</a>');
log_item_uuid.append('<input type="hidden" name="log_item_uuid" value="'+uuid+'" />');
log_item_code.append('<input type="hidden" name="log_item_code" value="'+code+'" />');
$.parser.parse('.log_item_one');
}
/**
* 序号:
* 功能:回复删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteItemRow(handler){
code=$(handler).parent().next().find('input').val();
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = logModule.logActAction.deleteReply(v_query);
$.messager.alert('提示',v_result.VALUE);
}
});
}
/****/
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="logTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="logTab_searchForm" style="float:left">
日志标题: <input class="easyui-textbox" id="FIELD_LOG_TITLE" name="FIELD_LOG_TITLE" style="width:200px"/>&nbsp;&nbsp;
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</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-add',plain:true" onclick="javascript:addRow()">添加</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/log/js/logModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/log/js/logTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}"/>
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>日志标题:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="LOG_TITLE" name="FIELD_LOG_TITLE" style="width:600px" required=true value="${is_row.LOG_TITLE}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable" valign="top" style="height:210px">
<span>日志内容:</span>
</td>
<td id="LOG_CONENT_RE">
<input class="easyui-textbox" id="LOG_CONTENT" name="FIELD_LOG_CONTENT" style="width:600px;height:200px;border-width:5px" required=true multiline=true value="${is_row.LOG_CONTENT}"/>
</td>
</tr>
</table>
</form>
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="replyTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="replyTab_searchForm" style="float:left">
日志名称: <input class="easyui-textbox" id="FIELD_LOG_TITLE" name="FIELD_LOG_TITLE" style="width:200px"/>&nbsp;&nbsp;
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/log/js/logModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/log/js/replyTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<style type="text/css">
.datagrid-header {
position: absolute;
visibility: hidden;
}
#inputForm {
position: relative;
}
.log_reply_list{
position:absolute;
bottom:7%;}
.log_item_list div div{
float:left;
}
.log_item_info{
margin-left: 26px;
}
.log_item_index input{
width:120px;
}
.tableStyle span,.log_item_one span{
border:none;
}
</style>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}"/>
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}"/>
<input type="hidden" name="FIELD_CREATE_NAME" id="CREATE_NAME" value="${is_row.CREATE_NAME}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>日志标题:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="LOG_TITLE" name="FIELD_LOG_TITLE" readonly style="width:600px" value="${is_row.LOG_TITLE}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable" valign="top" style="height:210px">
<span>日志内容:</span>
</td>
<td id="LOG_CONTENT_RE">
<input class="easyui-textbox" id="LOG_CONTENT" readonly name="FIELD_LOG_CONTENT" style="width:600px;height:200px" multiline=true value="${is_row.LOG_CONTENT}"/>
</td>
</tr>
</table>
</form>
<form id="logItemInputForm">
<div class="log_item_list">
</div>
</form>
<div class="log_reply_list" >
<input class="easyui-textbox" id="USER_REPLY_CONTENT" name="FIELD_USER_REPLY_CONTENT" required style="width:600px;" value="${is_row.USER_REPLY_CONTENT}"/>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:replySaveRow()" >回复</a>
</div>
\ No newline at end of file
......@@ -258,23 +258,6 @@ function searchRow(){
}
/****/
/**
* 查询自己参与
* **/
function userselfRow(){
// $("#list").each(function(index) {
// var content=$(this).val();
// if ($(this).VOTE_COUNT >0) {
// $('#list').datagrid('load',content);
// }
// });
// if(row.VOTE_COUNT>0){
//
// }
// $('#list').datagrid('load',v_query);
}
function add_vote_item(index,content,uuid){
if(typeof index == 'undefined'){
......
package com.jw.app.business;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface LogBusiness {
/**
* 插入
* @param entity
* @throws BusinessException
*/
void insert_log(Map<String,Object> entity) throws BusinessException ;
/**
* 更新
* @param entity
* @throws BusinessException
*/
void update_log(Map<String,Object> entity) throws BusinessException ;
/**
* 删除记录
* @param entity
* @throws BusinessException
*/
void delete_log(List<String> list)throws BusinessException;
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_log(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_log(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_log(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_reply(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_reply(Map<String, Object> query) throws BusinessException ;
/**
* 插入
* @param entity
* @throws BusinessException
*/
void insert_reply(Map<String,Object> entity) throws BusinessException ;
/**
* 删除记录
* @param entity
* @throws BusinessException
*/
void delete_reply(List<String> list)throws BusinessException;
}
package com.jw.app.business.log;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds;
import com.jw.app.business.LogBusiness;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
import com.gaowj.standard.utils.CacheKit;
public class LogBusinessImpl implements LogBusiness {
private logDAO logDAO;
public logDAO getlogDAO() {
return logDAO;
}
public void setlogDAO(logDAO logDAO) {
this.logDAO = logDAO;
}
@Override
public void insert_log(Map<String, Object> entity) throws BusinessException {
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("CREATE_NAME", SessionUtil.getEmname());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
infoList.add(entity.get(str));
infoListKey.add(str);
}
entity.put("infoListKey", infoListKey);
entity.put("infoList", infoList);
// 插入
logDAO.insert_log(entity);
}
}
@Override
public void update_log(Map<String, Object> entity) throws BusinessException {
// 动态传值修改
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
if (StringUtils.equalsIgnoreCase("UUID", str))
continue;
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
entity.put("info", updateList);
//
logDAO.update_log(entity);
}
}
@Override
public void delete_log(List<String> list) throws BusinessException {
logDAO.delete_log(list);
logDAO.delete_log_reply(list);
}
@Override
public Page<Map<String, Object>> list_log(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException {
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = logDAO.list_log(new RowBounds(pageStart, pageSize),
query);
// 获取列表个数
int count = listCount_log(query);
// 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount(count);
page.setItems(items);
return page;
}
@Override
public List<Map<String, Object>> list_log(Map<String, Object> query) throws BusinessException
{
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "meeting" + query);
if (list_data == null || list_data.size() == 0) {
list_data = logDAO.list_log(query);
CacheKit.put("ehcache10", "log" + query, list_data);
}
return list_data;
}
@Override
public int listCount_log(Map<String, Object> query) throws BusinessException {
return logDAO.listCount_log(query);
}
@Override
public List<Map<String, Object>> list_reply(Map<String, Object> query) throws BusinessException {
return logDAO.list_reply(query);
}
@Override
public int listCount_reply(Map<String, Object> query) throws BusinessException {
return logDAO.listCount_reply(query);
}
@Override
public void insert_reply(Map<String, Object> entity) throws BusinessException {
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("CODE",SessionUtil.getCode());
entity.put("REPLY_NAME", SessionUtil.getEmname());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", SessionUtil.getCurrenttime());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", SessionUtil.getCurrenttime());
List<String> itemListKey = new ArrayList<String>();
List<Object> itemList = new ArrayList<Object>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
itemList.add(entity.get(str));
itemListKey.add(str);
}
entity.put("itemListKey", itemListKey);
entity.put("itemList", itemList);
// 插入
logDAO.insert_reply(entity);
}
}
@Override
public void delete_reply(List<String> list) throws BusinessException {
logDAO.delete_reply(list);
}
}
\ No newline at end of file
package com.jw.app.business.log;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface logDAO {
void insert_log(Map<String, Object> entity) throws BusinessException;
void update_log(Map<String, Object> entity) throws BusinessException;
void delete_log(List<String> list) throws BusinessException;
void delete_log_reply(List<String> list) throws BusinessException;
List<Map<String, Object>> list_log(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_log(Map<String, Object> query) throws BusinessException;
int listCount_log(Map<String, Object> query) throws BusinessException;
void insert_reply(Map<String, Object> entity) throws BusinessException;
void delete_reply(List<String> list) throws BusinessException;
List<Map<String, Object>> list_reply(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_reply(Map<String, Object> query) throws BusinessException;
int listCount_reply(Map<String, Object> query) throws BusinessException;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jw.app.business.log.logDAO">
<sql id="WHERE">
<where>
<trim prefixOverrides="and">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="LOG_TITLE != null and LOG_TITLE != ''">
and f.LOG_TITLE like concat('%',#{LOG_TITLE},'%')
</if>
<if test="LOG_CONTENT != null and LOG_CONTENT != ''">
and f.LOG_CONTENT like concat('%',#{LOG_CONTENT},'%')
</if>
<if test="CREATE_NAME != null and CREATE_NAME != ''">
and f.CREATE_NAME = #{CREATE_NAME}
</if>
<if test="CREATE_ID != null and CREATE_ID != ''">
and f.CREATE_ID like concat('%',#{CREATE_ID},'%')
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
<if test="UPDATE_ID != null and UPDATE_ID != ''">
and f.UPDATE_ID like concat('%',#{UPDATE_ID},'%')
</if>
<if test="UPDATE_TIME != null and UPDATE_TIME != ''">
and f.UPDATE_TIME = #{UPDATE_TIME}
</if>
</trim>
</where>
</sql>
<insert id="insert_log" parameterType="map">
insert into LOG_MANAGE(
<trim prefix="" suffixOverrides=",">
<foreach collection="infoListKey" item="key">
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="infoList" item="value">
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_log" parameterType="map">
<![CDATA[
update LOG_MANAGE set
]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="delete_log" parameterType="list">
<![CDATA[
delete from LOG_MANAGE where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<insert id="insert_reply" parameterType="map">
insert into LOG_REPLY(
<trim prefix="" suffixOverrides=",">
<foreach collection="itemListKey" item="key">
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="itemList" item="value">
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<delete id="delete_log_reply" parameterType="list">
<![CDATA[
delete from LOG_REPLY where LOG_ID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<delete id="delete_reply" parameterType="list">
<![CDATA[
delete from LOG_REPLY where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_log" parameterType="map" resultType="upperCaseKeyMap">
select nmanage.*,nupdate.real_name new_update from (select manage.*,info.real_name new_create
from log_manage manage
LEFT JOIN `uicm_user_info` info on
info.user_id=manage.create_id ) nmanage
LEFT JOIN (select manage.uuid,info.real_name
from log_manage manage
LEFT JOIN `uicm_user_info` info on
info.user_id=manage.update_id ) nupdate
on nmanage.uuid=nupdate.uuid
<include refid="WHERE"></include>
order by CREATE_TIME DESC
</select>
<select id="listCount_log" parameterType="map" resultType="int">
SELECT count(*) FROM LOG_MANAGE f
<include refid="WHERE"></include>
</select>
<select id="list_reply" parameterType="map" resultType="upperCaseKeyMap">
select *
from LOG_REPLY
where LOG_ID=#{LOG_ID}
order by CREATE_TIME
</select>
<select id="listCount_reply" parameterType="map" resultType="int">
SELECT count(*) FROM LOG_REPLY
where LOG_ID=#{LOG_ID}
</select>
</mapper>
\ No newline at end of file
......@@ -33,7 +33,7 @@ public class MeetingBusinessImpl implements MeetingBusiness {
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
//动态传值插入
......@@ -55,12 +55,14 @@ public class MeetingBusinessImpl implements MeetingBusiness {
@Override
public void insert_check_in(Map<String, Object> entity) throws BusinessException {
List<Map<String, Object>> items = meetingDAO.list_check_in(entity);
if(items.size() == 0) {
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("PARTICIPANTS_NAME", SessionUtil.getEmname());
entity.put("CHECK_IN_TIME", new Date());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
//动态传值插入
List<String> infoListKey = new ArrayList<String>();
......@@ -78,11 +80,12 @@ public class MeetingBusinessImpl implements MeetingBusiness {
meetingDAO.insert_check_in(entity);
}
}
}
@Override
public void update_meeting(Map<String, Object> entity) throws BusinessException {
//动态传值修改
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if(entity.keySet()!=null){
......@@ -134,7 +137,6 @@ public class MeetingBusinessImpl implements MeetingBusiness {
public Page<Map<String, Object>> list_check_in(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException {
// 计算起始记录
query.put("USER_ID", SessionUtil.getEmname());
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
......
......@@ -43,7 +43,7 @@ public class VoteBusinessImpl implements VoteBusiness {
entity.put("START_TIME", new Date());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("UPDATE_TIME", new Date());
entity.put("STATUS_FLAG", 1);
......@@ -70,7 +70,7 @@ public class VoteBusinessImpl implements VoteBusiness {
item.put("UUID", java.util.UUID.randomUUID().toString());
item.put("CREATE_ID", SessionUtil.getCode());
item.put("CREATE_TIME", SessionUtil.getCurrenttime());
item.put("UPDATE_ID", SessionUtil.getEmname());
item.put("UPDATE_ID",SessionUtil.getCode());
item.put("MANAGE_ID", entity.get("UUID"));
item.put("UPDATE_TIME", SessionUtil.getCurrenttime());
item.put("SORT_NUM", i);
......@@ -106,7 +106,7 @@ public class VoteBusinessImpl implements VoteBusiness {
itemmap.put("VOTE_TIME", SessionUtil.getCurrenttime());
itemmap.put("CREATE_ID", SessionUtil.getCode());
itemmap.put("CREATE_TIME", SessionUtil.getCurrenttime());
itemmap.put("UPDATE_ID", SessionUtil.getEmname());
itemmap.put("UPDATE_ID", SessionUtil.getCode());
itemmap.put("UPDATE_TIME", SessionUtil.getCurrenttime());
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
......@@ -186,7 +186,7 @@ public class VoteBusinessImpl implements VoteBusiness {
item.put("MANAGE_ID", entity.get("UUID"));
item.put("CREATE_ID", SessionUtil.getCode());
item.put("CREATE_TIME", SessionUtil.getCurrenttime());
item.put("UPDATE_ID", SessionUtil.getEmname());
item.put("UPDATE_ID", SessionUtil.getCode());
item.put("UPDATE_TIME", SessionUtil.getCurrenttime());
List<String> itemListKey = new ArrayList<String>();
List<Object> itemList = new ArrayList<Object>();
......@@ -262,7 +262,6 @@ public class VoteBusinessImpl implements VoteBusiness {
throws BusinessException {
// 计算起始记录
query.put("STATUS_FLAG", 1);
query.put("USER_ID", SessionUtil.getEmname());
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
......@@ -354,7 +353,7 @@ public class VoteBusinessImpl implements VoteBusiness {
// 动态传值修改
entity.put("REALLY_END_TIME", new Date());
entity.put("UPDATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_ID", SessionUtil.getCode());
entity.put("STATUS_FLAG", 2);
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if (entity.keySet() != null) {
......
package com.jw.app.log.action;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import com.jw.app.business.LogBusiness;
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.gaowj.standard.utils.CacheKit;
public class actAction extends BasicAction {
private static final long serialVersionUID = -4469183762817854794L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertLog() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
// 新增
business.insert_log(entity);
// 操作日志
// sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertLog", "" + entity, "增加测试数据", (String) entity.get("UUID"),
(String) entity.get("CREATE_NAME"), "logdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertReply() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
// 新增
business.insert_reply(entity);
// 操作日志
// sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertReply", "" + entity, "增加测试数据", (String) entity.get("UUID"),
(String) entity.get("CREATE_NAME"), "logdemo1");
Map<String, Object> result=Status.getStatusSuccessMessage("保存成功");
result.put("UUID", entity.get("UUID"));
result.put("REPLY_NAME", entity.get("REPLY_NAME"));
result.put("CODE", entity.get("CODE"));
result.put("REPLY_CONTENT", entity.get("REPLY_CONTENT"));
jsonObject.putAll(result);
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 更新
*
* @param entity
* @throws BusinessException
*/
public String updateLog() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
// 去除不要更新的字段
entity.remove("OPETYPE");
// 修改
entity = QueryParamUtil.StringToDate(entity);
business.update_log(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateLog", "" + entity, "修改测试数据", (String) entity.get("UUID"),
(String) entity.get("CREATE_NAME"), "logdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
/**
* 在软删除基础上删除记录
*
* @param entity
* @throws BusinessException
*/
public String deleteLog() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.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_log(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteLog", "" + ListKey, "删除测试数据", deletekey, "多个流水号", "logdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
/**
* 在软删除基础上删除记录
*
* @param entity
* @throws BusinessException
*/
public String deleteReply() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.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_reply(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteLog", "" + ListKey, "删除测试数据", deletekey, "多个流水号", "logdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.jw.app.log.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONObject;
import com.jw.app.business.LogBusiness;
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.PropUtil;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.SessionUtil;
import com.gaowj.business.util.TestMd5;
import com.gaowj.standard.utils.CacheKit;
public class dataAction extends BasicAction{
private static final long serialVersionUID = 4416458722090020762L;
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() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public String list() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_log(pageNo,pageSize, 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) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
public String listAll() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
try {
//表示获取前台表单提交的所有"FIELD_"开始的键值数据,例如FIELD_NAME,FIELD_CODE....
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
//把前端传进来的字符型时间数据例 如DATE_2018-09-09转换成DATE型的时间数据。
//主要和前端is_entity.FIELD_CREATE_TIME = strToDateObj(is_entity.FIELD_CREATE_TIME)配对使用。
//前端提交前strToDateObj方法会把时间处理成DATE_2018-09-09再提交
query = QueryParamUtil.StringToDate(query);
//session工具
String code = SessionUtil.getCode();//当前用户ID
String emid = SessionUtil.getEmid();//当前用户帐号
String emname = SessionUtil.getEmname();//当前用户名称
String emdepart = SessionUtil.getEmdepart();//当前用户部门id
String emdepartname = SessionUtil.getEmdepartname();//当前用户部门名称
String emsex = SessionUtil.getEmsex();//当前用户性别
String loginip = SessionUtil.getLoginip();//当前用户登录IP
String clientip = SessionUtil.getClientIp();//获取客户端IP
String quanxian = SessionUtil.getQuanxian();//获取当前用户使用模块清单
String sessionid = SessionUtil.getSessionid();//获取当前用户sessionID
String currenttimme = SessionUtil.getCurrenttime();//当前用户本次登录时间
String beforetime = SessionUtil.getBeforetime();//当前用户上次登录时间
//配置文件工具
//表示获取src目录下quartz_service.properties文件中主键是login_main_url的值
String tt = PropUtil.getValue("login_main_url", "quartz_service", "");
List<Map<String, Object>> listData = business.list_log(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) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
public String listItem() throws BusinessException {
LogBusiness business = BusinessManager.getBusiness(LogBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
List<Map<String, Object>> listItems=business.list_reply(query);
jsonObject = new JSONObject();
jsonObject.put("listItems", listItems);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
}
package com.jw.app.log.action;
import java.util.Map;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.RequestUtils;
public class viewAction extends BasicAction {
private static final long serialVersionUID = -3683396984525750653L;
public String logTab() throws BusinessException {
return "logTab";
}
public String logTabDetail() throws BusinessException {
Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "logTabDetail";
}
public String replyTabDetail() throws BusinessException {
Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "replyTabDetail";
}
public String replyTab() throws BusinessException {
return "replyTab";
}
}
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