Commit 538a8438 by 周添尉

Merge remote-tracking branch 'origin/develop' into develop

parents 9d267701 f3dd8b8d
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
<value>classpath:com/jw/app/business/bgmk/bgmkDAO.xml</value> <value>classpath:com/jw/app/business/bgmk/bgmkDAO.xml</value>
<value>classpath:com/jw/app/business/friendlink/friendlinkDAO.xml</value> <value>classpath:com/jw/app/business/friendlink/friendlinkDAO.xml</value>
<value>classpath:com/jw/app/business/notice/noticeDAO.xml</value> <value>classpath:com/jw/app/business/notice/noticeDAO.xml</value>
<value>classpath:com/jw/app/business/todo/TodoDAO.xml</value>
<value>classpath:com/gaowj/business/base/impl/BaseDAO.xml</value>
<value>classpath:com/jw/app/business/meeting/meetingDAO.xml</value>
<value>classpath:com/jw/app/business/log/logDAO.xml</value>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -104,6 +108,18 @@ ...@@ -104,6 +108,18 @@
<property name="mapperInterface" value="com.jw.app.business.notice.noticeDAO"/> <property name="mapperInterface" value="com.jw.app.business.notice.noticeDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/> <property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean> </bean>
<bean id="todoDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.todo.TodoDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="meetingDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<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 --> <!-- BusinessInterFace -->
<bean id="PortletBusiness" <bean id="PortletBusiness"
class="com.jw.app.business.portlet.PortletBusinessImpl"> class="com.jw.app.business.portlet.PortletBusinessImpl">
...@@ -174,6 +190,21 @@ ...@@ -174,6 +190,21 @@
class="com.jw.app.business.notice.NoticeBusinessImpl"> class="com.jw.app.business.notice.NoticeBusinessImpl">
<property name="noticeDAO" ref="noticeDAO"/> <property name="noticeDAO" ref="noticeDAO"/>
</bean> </bean>
<bean id="TodoBusiness"
class="com.jw.app.business.todo.TodoBusinessImpl">
<property name="todoDAO" ref="todoDAO"/>
</bean>
<bean id="MeetingBusiness"
class="com.jw.app.business.meeting.MeetingBusinessImpl">
<property name="meetingDAO" ref="meetingDAO"/>
</bean>
<bean id="LogBusiness"
class="com.jw.app.business.log.LogBusinessImpl">
<property name="logDAO" ref="logDAO"/>
</bean>
<!-- DAO --> <!-- DAO -->
<bean id="portletDAO" class="org.mybatis.spring.mapper.MapperFactoryBean"> <bean id="portletDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.portlet.PortletDAO"/> <property name="mapperInterface" value="com.jw.app.business.portlet.PortletDAO"/>
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<script type="text/javascript" src="<%=localPath %>/js/ajaxfileupload.js"></script> <script type="text/javascript" src="<%=localPath %>/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/lang_json.js"></script> <script type="text/javascript" src="<%=localPath %>/jwapp/common/js/lang_json.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/common_util.js"></script> <script type="text/javascript" src="<%=localPath %>/jwapp/common/js/common_util.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/common_luosz_util.js"></script>
<script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.core-3.5.js"></script> <script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.excheck-3.5.js"></script> <script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.excheck-3.5.js"></script>
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
<link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/jquery-easyui-1.4.1/themes/default/easyui.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/jquery-easyui-1.4.1/themes/default/easyui.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/jquery-easyui-1.4.1/themes/icon.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/jquery-easyui-1.4.1/themes/icon.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/zTree_v3/css/zTreeStyle/zTreeStyle.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="<%=commonPath%>/ria/jquery/zTree_v3/css/zTreeStyle/zTreeStyle.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="<%=localPath%>/jwapp/common/css/choice_user/common.css" charset="utf-8"></link>
<script type="text/javascript"> <script type="text/javascript">
// $.ajaxSetup ({ // $.ajaxSetup ({
......
...@@ -352,3 +352,12 @@ ...@@ -352,3 +352,12 @@
.icon-ext-07_14 { .icon-ext-07_14 {
background:url('../../../../images/icons/(07,14).png') no-repeat left center; background:url('../../../../images/icons/(07,14).png') no-repeat left center;
} }
.icon-ext-05_48 {
background:url('../../../../images/icons/(05,48).png') no-repeat left center;
}
.icon-ext-22_43 {
background:url('../../../../images/icons/(22,43).png') no-repeat left center;
}
.icon-ext-01_08 {
background:url('../../../../images/icons/(01,08).png') no-repeat left center;
}
\ No newline at end of file
.choice_user>div{
display: inline-block;
background:#f4f4f4;
border-radius:5px;
vertical-align: top;
margin-right:5px;
padding:0 5px;
font-size: 12px;
position: relative;
margin-top:5px;
}
.choice_user>div:hover>span:first-child+span{
display: inline-block;
}
.choice_user>div>span:first-child+span{
display:none;
width: 12px;
height: 12px;
position: absolute;
top: -5px;
right: -5px;
cursor: pointer;
}
\ No newline at end of file
var commonutil = {
/**
* 往object的所有key统一添加前缀
*/
keyAddStr : function(object, str) {
if (typeof str == 'undefined' || str == null || str == '') {
str = 'FIELD_';
}
var news = {};
for (key in object) {
news[str + key] = object[key];
}
return news;
}
};
/**
* easyui datagrid方法封装
*/
var easyui = {
datagrid : function(options) {
var opts = $.extend({
pagination : true,
checkOnSelect : false,
selectOnCheck : false,
rownumbers : true,
fitColumns : false,
striped : true,
scrollbarSize : 0,
tableId : options.tableId,
autoRowHeight : false,
isSingleSelect : true,
singleSelect : true,
//如果需要自定义计算最后一列,则需要设置customLastCellWidth属性为true
customLastCellWidth : true
/*,
border:false*/
}, options);
opts.onClickRow = function(rowIndex, rowData) {
if (typeof options.onClickRow == 'function') {
options.onClickRow.call(null, rowIndex, rowData);
}
//如果用户传入了isSingleSelect属性为true,则设置点击事件时候只能单行选中
/*if (opts.isSingleSelect) {
if (typeof datagridSingleSelect == 'function') {
datagridSingleSelect(opts.tableId, rowIndex);
}
}*/
};
opts.onRowContextMenu = function(e, rowIndex, rowData) {
if (typeof options.onRowContextMenu == 'function') {
options.onRowContextMenu.call(null, e, rowIndex, rowData);
}
//如果用户传入了isSingleSelect属性为true,则设置右击事件时候只能单行选中
/*if (opts.isSingleSelect) {
datagridSingleSelect(opts.tableId, rowIndex);
}*/
}
opts.onBeforeLoad = function(param) {
if (typeof options.onBeforeLoad == 'function') {
options.onBeforeLoad.call(null, param);
}
//提交参数前,将每个参数的两边空格都去除
for (var key in param) {
param[key] = (param[key] + "").trim();
}
};
opts.onLoadSuccess = function(data) {
if (typeof options.onLoadSuccess == 'function') {
options.onLoadSuccess.call();
}
//如果回传值有checkedIds属性,则将这些id的记录进行勾选操作
var checkedIds = data.checkedIds;
if (!stringutil.isEmpty(checkedIds) && checkedIds.length > 0) {
var rows = data.rows;
for (var i = 0; i < rows.length; i++) {
for (var j = 0; j < checkedIds.length; j++) {
if (checkedIds[j] == rows[i].id) {
$("#" + opts.tableId).datagrid("checkRow", i);
}
}
}
}
};
return $('#' + opts.tableId).datagrid(opts);
},
dialog : function(options) {
var opts = $.extend({
modal : true,
shadow : false,
onClose : function() {
$(this).dialog('destroy');
}
}, options);
opts.onLoad = function() {
if (typeof options.onLoad == 'function') {
options.onLoad.call();
}
$.messager.defaults.onClose = function() {};
//$.messager.progress('close')
};
opts.onOpen = function() {
if (typeof options.onOpen == 'function') {
options.onOpen.call();
}
//数据加载
/*$.messager.progress({
text : '数据加载中....',
interval : 100
});*/
};
if (opts.dialogSelector) {
//如果是自定义选择器生成dialog,就不需要调用销毁
opts.onClose = function() {};
return opts.dialogSelector.dialog(opts);
} else {
return $('<div/>').dialog(opts);
}
},
combobox : function(options) {
if (!options.selector) {
alert('selector必须设置');
return;
}
var opts = $.extend({
valueField : 'id',
textField : 'text',
defaultEmptyValue : '',
defaultEmptyText : '-- 请选择 --',
//空值行是否需要,默认为true,需要
needEmpty : true
}, options);
//如果key,value传进来的属性名一致,则强制改变textField属性名
var same = false;
if (opts.valueField == opts.textField) {
same = true;
opts.textField = "c_" + opts.textField;
}
var responseInfo;
$.ajax({
url : opts.url,
async : false,
success : function(data) {
responseInfo = data;
}
});
//设置第一个空行
var data = [];
if (opts.needEmpty) {
var d = {};
d[opts.valueField] = opts.defaultEmptyValue;
d[opts.textField] = opts.defaultEmptyText;
data.push(d);
}
var complete_data = stringutil.toJson(responseInfo.data);
for (var i = 0; i < complete_data.length; i++) {
var d = {};
d[opts.valueField] = complete_data[i][opts.valueField];
var textFieldName;
if (same) {
//如果key,value属性名一致,则获取数据的时候,多了一个"c_"字符,要给予去除
textFieldName = opts.textField.split("c_")[1];
} else {
textFieldName = opts.textField;
}
d[opts.textField] = complete_data[i][textFieldName];
data.push(d);
}
if (responseInfo.code == '0000') {
if ($(opts.selector).length == 0) {
alert('selector设置错误');
}
opts.data = data;
delete opts.url;
var handle = $(opts.selector).combobox(opts);
return handle;
}
return null;
},
calendar : function(options) {
if (!options.selector) {
alert('selector必须设置');
return;
}
var opts = $.extend({
current : new Date()
}, options);
$(opts.selector).calendar({
current : new Date()
});
},
datebox : function(options) {
if (!options.selector) {
alert('selector必须设置');
return;
}
var opts = $.extend({
formatter : function(date) {
var y = date.getFullYear();
var m = date.getMonth() + 1;
var d = date.getDate();
return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
}
}, options);
$(opts.selector).datebox(opts);
},
treegrid : function(options) {
var opts = $.extend({
animate : true,
rownumbers : true,
idField : 'id',
treeField : 'name',
tableId : options.tableId,
autoRowHeight:false,
fitColumns:true,
scrollbarSize:0
}, options);
opts.onLoadSuccess = function() {
if (typeof options.onLoadSuccess == 'function') {
options.onLoadSuccess.call();
}
};
opts.onDblClickRow=function(row){
if (typeof options.onDblClickRow == 'function') {
options.onDblClickRow.call();
}
$('#' + opts.tableId).treegrid('toggle',row.id);
};
opts.onLoadError=function(){
if (typeof options.onLoadError == 'function') {
options.onLoadError.call();
}
alert('数据获取失败!');
}
return $('#' + opts.tableId).treegrid(opts);
},
tree : function(options) {
var opts = $.extend({
checkbox : false,
lines : false,
animate : true,
treeId : options.treeId
}, options);
return $('#' + opts.treeId).tree(opts);
}
}
/**
* tree数据中,如果不是叶节点,则将checked属性设置为false
*/
function notleafToUnchecked(data){
for(var i=0;i<data.length;i++){
if(!stringutil.isEmpty(data[i].children)&&data[i].children.length!=0){
//表示非叶子节点
//将checked属性设置为false
data[i].checked=false;
data[i]._checked=false;
//继续判断子节点
notleafToUnchecked(data[i].children);
}
}
}
/**
* 流程编辑页面
* @returns {Boolean}
*/
function openProcEditRow(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-ok',
handler : function() {
saveBox('detail','list');
}
}, {
text : '退回',
iconCls : 'icon-ext-44_08',
handler : function() {
lastBox('detail','list');
}
}, {
text : '下一步',
iconCls : 'icon-ext-44_08',
handler : function() {
nextBox('detail','list');
}
}, {
text : '关闭',
iconCls : 'icon-back',
handler : function() {
closeBox('detail');
}
} ],
onLoad:function editUrlOnload(){
if(is_row.OPETYPE=='insert'){
addUrlOnloadCallback(is_row);
}else{
updateUrlOnloadCallback(is_row);
}
}
});
}
/****/
//弹出层流程编辑上一步(退回)按扭
function lastBox(Box_id,List_id) {
if(Box_id==null||Box_id==''||Box_id==undefined)
Box_id='detail';
if(List_id==null||List_id==''||List_id==undefined)
List_id='list';
var returnIsValid = $('#inputForm').form('validate');
if (returnIsValid) {
//$("#inputForm").submit();
var query = $("#inputForm").getFormVal();
var v_result = backProc(query);
if (v_result != null && v_result != undefined) {
closeBox(Box_id);
$.messager.alert('提示', v_result.VALUE);
}
}
}
//弹出层流程编辑下一步按扭
function nextBox(Box_id,List_id) {
if(Box_id==null||Box_id==''||Box_id==undefined)
Box_id='detail';
if(List_id==null||List_id==''||List_id==undefined)
List_id='list';
var returnIsValid = $('#inputForm').form('validate');
if (returnIsValid) {
//$("#inputForm").submit();
var query = $("#inputForm").getFormVal();
var v_result;
if ($('#OPETYPE').val() == null || $('#OPETYPE').val() == undefined
|| $('#OPETYPE').val() == '' || $('#OPETYPE').val()=='insert'){
v_result = insertDataToNext(query);
}
else{
v_result = updateDataToNext(query);
}
if (v_result != null && v_result != undefined) {
closeBox(Box_id);
$.messager.alert('提示', v_result.VALUE);
}
}
}
/****/
/**
* 模块初始化
*/
function initModule(listFunction,strutsRoutes) {
//此乃本模块与后台交互的方法接口部分
var currency_module = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
currency_module.prototype = BusinessObject;
for(k in listFunction){
eval('currency_module.prototype.'+listFunction[k]+' = function() {};');
}
//创建一个数据操作对象,然后再后续使用
for(k in strutsRoutes){
eval('currency_module.'+k+' = new currency_module("json").delegate("'+strutsRoutes[k]+'");');
}
return currency_module;
}
\ No newline at end of file
...@@ -1823,7 +1823,7 @@ function openViewIframRow(opendiv,editUrl,is_row,is_title,is_max,is_width,is_hei ...@@ -1823,7 +1823,7 @@ function openViewIframRow(opendiv,editUrl,is_row,is_title,is_max,is_width,is_hei
maximizable:is_max, maximizable:is_max,
left:is_left, left:is_left,
top:is_top, top:is_top,
content : '<iframe scrolling="yes" frameborder="0" src="'+ editUrl+ '" style="width:100%;height:98%;"></iframe><span id="return_text"></span>', content : '<iframe scrolling="yes" frameborder="0" src="'+ editUrl+ '" style="width:100%;height:98%;"></iframe><span id="return_text" style="display:none;">'+JSON.stringify(get_FIELD(is_row))+'</span>',
queryParams:get_FIELD(is_row), queryParams:get_FIELD(is_row),
modal : true, modal : true,
buttons : [{ buttons : [{
......
...@@ -68,7 +68,7 @@ var is_column = [ [ ...@@ -68,7 +68,7 @@ var is_column = [ [
return getCodeName(v_typequery_data.rowSet, value); return getCodeName(v_typequery_data.rowSet, value);
} }
}, },
{field : 'CREATOR_ID',title : '创建人员',width : 100,align : 'center'}, {field : 'CREATE_ID',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 100,align : 'center'} {field : 'CREATE_TIME',title : '创建时间',width : 100,align : 'center'}
] ]; ] ];
//列表加载完成回调 //列表加载完成回调
......
//此乃本模块与后台交互的方法接口部分
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':'保存失败'}}}]
/**
* 序号:
* 功能:定义分页(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="日志管理";
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);
/****/
/**
* 序号:
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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;
}
/****/
/**
* 序号:
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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 reply_column = [ [
{field : 'REPLY_NAME',width : 100,align : 'center'},
{field : 'REPLY_CONTENT',width : 300,align : 'center'},
{field :'opt',width : 150,align : 'center',
formatter:function(value,row,index){
var deleteBtn='<a style="cursor:pointer" onclick="javascript:deleteItemRow('+index+')">删除</a>'
return '<div class=\'optBtns\'>'+deleteBtn+'</div>';
}
}
] ];
var logUuid=is_row.UUID;
var reply_query = {
FIELD_LOG_ID:logUuid
}
datagridReply("logItemInputForm",gaowj.WEB_APP_NAME + "/logData_listItem",reply_query,reply_column);
}
//回复保存
function replySaveRow(){
if($("input[name=FIELD_USER_REPLY_CONTENT]").val()==''){
$.messager.alert('提示','请在回复框输入内容')
}else{
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'){
$('#logItemInputForm').datagrid('reload');
}
}
}
/**
* 序号:
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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');
}
});
}
/****/
/**
* 序号:
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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');
}
});
}
/****/
/**
* 序号:
* 功能:回复删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteItemRow(index){
$('#logItemInputForm').datagrid('selectRow',index);
var is_row = $('#logItemInputForm').datagrid('getSelections');
$('#logItemInputForm').datagrid('clearSelections');
var code = is_row[0].UUID;
if(code == ''|| code == null){
return
}else{
$.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);
$('#logItemInputForm').datagrid('reload');
}
});
}
}
/****/
/**
* 序号:
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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);
}
/****/
/**
* 回复
* 2016-12-01
* 高伟杰
**/
function datagridReply(is_view,is_url,is_query,is_column){
$('#'+is_view).datagrid({
iconCls:$.getJwWindowPic(),
url:is_url,
queryParams : is_query,//查询参数
singleSelect : false,//是否多选
fitColumns : false,//是否撑满
autoRowHeight : false,//设定高度
rowStyler :function(index,row){return rowstyler(index,row);},
pagination : true,//分页显示
pageSize : rows,//显示行数
pageList : listPageSize,//条数选择
striped : true, //是否隔行显示
remoteSort : false,//是否从服务器排序
columns : is_column,
onLoadSuccess : function() {
}
});
}
/**
* 序号:
* 功能:定义分页(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="日志管理";
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);
//回复弹出框格式
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 reply_column = [ [
{field : 'REPLY_NAME',width : 100,align : 'center'},
{field : 'REPLY_CONTENT',width : 300,align : 'center'},
{field :'opt',width : 150,align : 'center',
formatter:function(value,row,index){
var deleteBtn='<a style="cursor:pointer" onclick="javascript:deleteItemRow('+index+')">删除</a>'
var Btn=''
return '<div class=\'optBtns\'>'+(row.CODE==gaowj.SEESION_CODE?deleteBtn:Btn)+'</div>';
}
}
] ];
function OnLoadSuccess(){}
var logUuid=is_row.UUID;
var reply_query = {
FIELD_LOG_ID:logUuid
}
datagridReply("logItemInputForm",gaowj.WEB_APP_NAME + "/logData_listItem",reply_query,reply_column);
}
//回复保存
function replySaveRow(){
if($("input[name=FIELD_USER_REPLY_CONTENT]").val()==''){
$.messager.alert('提示','请在回复框输入内容')
}else{
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'){
$('#logItemInputForm').datagrid('reload');
}
}
}
/**
* 序号:
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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);
}
/****/
/**
* 序号:
* 功能:回复删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function deleteItemRow(index){
$('#logItemInputForm').datagrid('selectRow',index);
var is_row = $('#logItemInputForm').datagrid('getSelections');
$('#logItemInputForm').datagrid('clearSelections');
var code = is_row[0].UUID;
var thiscode=is_row[0].CODE;
if(code == ''|| code == null){
return
}else{
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
v_query.FIELD_THISCODE = thiscode;
var v_result = logModule.logActAction.deleteReply(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#logItemInputForm').datagrid('reload');
}
});
}
}
/****/
/**
* 回复
* 2016-12-01
* 高伟杰
**/
function datagridReply(is_view,is_url,is_query,is_column){
$('#'+is_view).datagrid({
iconCls:$.getJwWindowPic(),
url:is_url,
queryParams : is_query,//查询参数
singleSelect : false,//是否多选
fitColumns : false,//是否撑满
autoRowHeight : false,//设定高度
rowStyler :function(index,row){return rowstyler(index,row);},
pagination : true,//分页显示
pageSize : rows,//显示行数
pageList : listPageSize,//条数选择
striped : true, //是否隔行显示
remoteSort : false,//是否从服务器排序
columns : is_column,
onLoadSuccess : function() {
}
});
}
<%@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">
</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
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="check_inTab">
<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="check_inTab_searchForm" style="float:left">
会议名称: <input class="easyui-textbox" id="FIELD_MEETING_NAME" name="FIELD_MEETING_NAME" 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/meeting/js/meetingModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/meeting/js/check_inTab.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_UUID" id="UUID" value="${is_row.UUID}"/>
</form>
<table class="easyui-datagrid" id="check_in_list">
<thead>
<tr>
<th data-options="field:'REAL_NAME',width : 150" >用户名</th>
<th data-options="field:'NAME',width : 150">单位名称</th>
<th data-options="field:'TELEPHONE',width : 150">联系方式</th>
<th data-options="field:'CREATE_TIME',width : 150">签到时间</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
/**
* 序号:
* 功能:定义分页(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="会议签到管理";
var is_column = [ [
{field : 'MEETING_NAME',title : '会议名称',width : 100,align : 'center'},
{field : 'MEETING_CONTENT',title : '会议内容',width : 300,align : 'center'},
{field : 'VENUE',title : '会议地址',width : 300,align : 'center'},
{field :'opt',title : '操作',width : 150,align : 'center',
formatter:function(value,row,index){
var voteBtn='<a style="cursor:pointer" onclick="javascript:check_inRow('+index+')">签到</a>'
var votedBtn='<a style="cursor:pointer">已签到</a>'
return '<div class=\'optBtns\'>'+(row.MEETING_COUNT>0?votedBtn:voteBtn)+'</div>';
}
}
] ];
//列表加载完成回调
function reportrollback(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
reportgrid("list",ls_title,gaowj.WEB_APP_NAME + "/meetingData_list",queryData,is_column,60,80);
/**
* 序号:
* 功能:签到
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function check_inRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
var code = is_row[0].UUID;
var v_query = {};
v_query.FIELD_MEETING_ID = code;
var v_result = meetingModule.meetingActAction.insertCheck_in(v_query);
$('#list').datagrid('reload');
return v_result;
}
/**
* 序号:
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#meetingTab_searchForm")[0].reset();
}
/****/
/**
* 序号:
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function searchRow(){
var v_query = $("#meetingTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
//此乃本模块与后台交互的方法接口部分
var meetingModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
meetingModule.prototype = BusinessObject;
//插入会议数据
meetingModule.prototype.insertMeeting = function(){};
//插入签到数据
meetingModule.prototype.insertCheck_in = function(){};
//修改会议数据
meetingModule.prototype.updateMeeting = function(){};
//删除会议数据
meetingModule.prototype.deleteMeeting = function(){};
//会议数据_分页
meetingModule.prototype.list = function(){};
//签到数据_分页
meetingModule.prototype.listCheck_in = function(){};
//会议所有数据
meetingModule.prototype.listAll = function(){};
//创建一个数据操作对象,然后再后续使用
meetingModule.meetingActAction = new meetingModule("json").delegate("meetingAct");
//创建一个数据获取对象,然后再后续使用
meetingModule.meetingDataAction = new meetingModule("json").delegate("meetingData");
//说明: 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':'保存失败'}}}]
/**
* 序号:
* 功能:定义分页(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="会议签到管理";
var is_column = [ [
{field : 'MEETING_NAME',title : '会议名称',width : 100,align : 'center'},
{field : 'MEETING_CONTENT',title : '会议内容',width : 300,align : 'center'},
{field : 'VENUE',title : '会议地址',width : 300,align : 'center'},
{field : 'START_TIME',title : '开始时间',width : 150,align : 'center'},
{field : 'END_TIME',title : '结束时间',width : 150,align : 'center'},
{field : 'CREATE_ID',title : '创建人',width : 80,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 150,align : 'center'},
{field : 'UPDATE_ID',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 + "/meetingData_list",queryData,is_column,60,80);
/****/
/**
* 序号:
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"check_userRow('"
+ index + "')\">已签人员</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 3;
return is_menu_count;
}
/****/
/**
* 序号:
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("meetingView_meetingTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
initDateBox();
}
//保存
function insertData(is_entity){
is_entity.FIELD_START_TIME = strToDateObj(is_entity.FIELD_START_TIME);
is_entity.FIELD_END_TIME = strToDateObj(is_entity.FIELD_END_TIME);
var v_result = meetingModule.meetingActAction.insertMeeting(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("meetingView_meetingTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
}
//保存
function updateData(is_entity){
is_entity.FIELD_START_TIME = strToDateObj(is_entity.FIELD_START_TIME);
is_entity.FIELD_END_TIME = strToDateObj(is_entity.FIELD_END_TIME);
v_result = meetingModule.meetingActAction.updateMeeting(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//签到
function check_userRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'checkin';
openLookRow("meetingView_check_userList",is_row[0],"签到人员",true,0.65,0.95,0,0);
}
//加载签到子页面成功后的回调
function checkinUrlOnloadCallback(is_row){
var listcheck=meetingModule.meetingDataAction.listCheck_in({
FIELD_MEETING_ID:is_row.UUID
}).listchecks;
for(var i=0;i<listcheck.length;i++){
$('#check_in_list').datagrid('insertRow', {
row: {
REAL_NAME: listcheck[i].REAL_NAME,
CREATE_TIME: listcheck[i].CHECK_IN_TIME,
NAME: listcheck[i].NAME,
TELEPHONE: listcheck[i].TELEPHONE
}
});
}
}
/****/
//签到弹出框格式
function openLookRow(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=='checkin'){
checkinUrlOnloadCallback(is_row);
}else{
updateUrlOnloadCallback(is_row);
}
}
});
}
function addZero(d){
if(d<10){
return "0"+d;
}
return d;
}
//限制时间
function initDateBox(){
$("#START_TIME").datetimebox({
required:true,
formatter:function(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
var h = date.getHours();
var min = date.getMinutes();
var s = date.getSeconds();
var nowDate=new Date();
if(date.getTime() < nowDate.getTime()){
h = nowDate.getHours();
min = nowDate.getMinutes();
s = nowDate.getSeconds();
}
return y+'-'+addZero(m)+'-'+addZero(d)+' '+addZero(h)+':'+addZero(min)+':'+addZero(s);
}
});
$("#END_TIME").datetimebox({
required:true,
formatter:function(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
var h = date.getHours();
var min = date.getMinutes();
var s = date.getSeconds();
var nowDate=new Date();
if(date.getTime() < nowDate.getTime()){
h = nowDate.getHours();
min = nowDate.getMinutes();
s = nowDate.getSeconds();
}
return y+'-'+addZero(m)+'-'+addZero(d)+' '+addZero(h)+':'+addZero(min)+':'+addZero(s);
}
});
$('#START_TIME').datetimebox('calendar').calendar({
validator: function(date){
return new Date().getTime()<=date||date.getDate()==new Date().getDate();
}
});
$('#END_TIME').datetimebox('calendar').calendar({
validator: function(date){
return new Date().getTime()<=date||date.getDate()==new Date().getDate();
}
});
}
/**
* 序号:
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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 = meetingModule.meetingActAction.deleteMeeting(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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 = meetingModule.meetingActAction.deleteMeeting(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#meetingTab_searchForm")[0].reset();
}
/****/
/**
* 序号:
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function searchRow(){
var v_query = $("#meetingTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="meetingTab">
<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="meetingTab_searchForm" style="float:left">
会议名称: <input class="easyui-textbox" id="FIELD_MEETING_NAME" name="FIELD_MEETING_NAME" 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/meeting/js/meetingModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/meeting/js/meetingTab.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="MEETING_NAME" name="FIELD_MEETING_NAME" style="width:600px" required=true value="${is_row.MEETING_NAME}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable" valign="top" style="height:160px">
<span>会议内容:</span>
</td>
<td>
<input class="easyui-textbox" id="MEETING_CONTENT" name="FIELD_MEETING_CONTENT" style="width:600px;height:150px" required=true multiline=true value="${is_row.MEETING_CONTENT}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>会议地址:</span>
</td>
<td>
<input class="easyui-textbox" id="VENUE" name="FIELD_VENUE" style="width:600px" required=true value="${is_row.VENUE}"/>
</td>
</tr>
<tr>
<td style="width: 20%;" class="tableStyleLable">
<span>
会议时间:
</span>
</td>
<td style="width: 80%">
<input id="START_TIME" name="FIELD_START_TIME" value="${is_row.START_TIME}" />
<span>到</span>
<input id="END_TIME" name="FIELD_END_TIME" type="text" value="${is_row.END_TIME}" >
</td>
</tr>
</table>
</form>
\ No newline at end of file
var todoModule=initModule([
'insertInfo',
'updateInfo',
'deleteInfo',
'listInfo',
'updateDoState'],{
act:'todoAct',
data:'todoData'
});
//说明: 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':'保存失败'}}}]
\ No newline at end of file
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:宁波金网
* 备注:无需更改
**/
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
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
var v_sender_or_recipient_data = [{CODE_ID:'0',CODE_NAME:'全部'},{CODE_ID:'1',CODE_NAME:'我发起的'},{CODE_ID:'2',CODE_NAME:'我的代办'}];
var v_do_state_data = [{CODE_ID:'all',CODE_NAME:'全部'},{CODE_ID:'0',CODE_NAME:'未办'},{CODE_ID:'1',CODE_NAME:'已办'}];
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//定义grid列表
var ls_title = "代办管理";
var is_column = [ [
{
field : 'TITLE',
title : '主题',
width : 350,
align : 'center'
},
{
field : 'SEND_REAL_NAME',
title : '发起人',
width : 100,
align : 'center'
},
{
field : 'RECIPIENT_REAL_NAME',
title : '接收人',
width : 100,
align : 'center'
},
{
field : 'LAUNCH_TIME',
title : '发起时间',
width : 120,
align : 'center'
},
{
field : 'READ_TIME',
title : '读取时间',
width : 120,
align : 'center',
formatter : function(value,row,index){
return (value==null||value=='')?"未读":value;
}
},
{
field : 'DO_TIME',
title : '办理时间',
width : 120,
align : 'center',
formatter : function(value,row,index){
return (value==null||value=='')?"未办":value;
}
}
] ];
//列表加载完成回调
function dataOnLoadSuccess() {
}
//设置颜色和每行高度
function rowstyler(index, row) {
}
queryData=$.extend(queryData,$("#todoTab_searchForm").getFormVal());
//展示列表
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/todoData_list", queryData, is_column, 60, 80);
$(function(){
$('#FIELD_ROLE').combobox({
data : v_sender_or_recipient_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
$('#FIELD_DO_STATE').combobox({
data : v_do_state_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
});
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
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-reload\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"todoEndRow('"
+ index + "')\">已办</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount() {
var is_menu_count = 3;
return is_menu_count;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载增加子页面
function addRow() {
var is_row = {
OPETYPE : 'insert'
};
openEditRow("todoView_todoTabDetail", is_row, "新增", true, 0.65, 0.95, 0, 0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row) {
$("#TYPE").val($("#FIELD_TYPE").val());
}
//保存
function insertData(is_entity) {
var RECIPIENTS="";
$("#todo_select_user div").each(function(){
RECIPIENTS+=","+$(this).data('id');
});
if(RECIPIENTS!=''){
is_entity.FIELD_RECIPIENTS=RECIPIENTS.substr("1");
}
var v_result = todoModule.act.insertInfo(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("todoView_todoTabDetail", is_row[0], "编辑", true, 0.65, 0.95, 0, 0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row) {
$("#choice_user_tr").remove();
$("#inputForm").form('load',get_FIELD(is_row));
}
//保存
function updateData(is_entity) {
var v_result = todoModule.act.updateInfo(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
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 = todoModule.act.deleteInfo(v_query);
$.messager.alert('提示', v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
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 = todoModule.act.deleteInfo(v_query);
$.messager.alert('提示', v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function refreshRow() {
$('#list').datagrid('load', {});
$("#todoTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function searchRow() {
var v_query = $("#todoTab_searchForm").getFormVal();
$('#list').datagrid('load', v_query);
}
/****/
/**
* 序号:10
* 功能:人员弹出框选择
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function choiceUser(uuid, singleSelect) { //编辑框上弹出单位选择
var is_title = "人员选择";
var is_row = {
}
var modifyUrl = gaowj.WEB_APP_NAME + "/userchoiceView_userChoice?singleSelect=" + singleSelect;
openViewIframRow("userChoice", modifyUrl, is_row, is_title, true, 0.95, 0.95, 0, 0);
}
//选单位和人员后回调方法
function closeCallback(is_entity) {
var result = $('#return_text').data('json');
if (result == '' || result == null || result == undefined)
return;
$('#todo_select_user').empty();
for (var i = 0; i < result.length; i++) {
//创建一个表格
var $row = createUserInfo(result[i]);
$("#todo_select_user").append($row);
}
}
//创建一个收件人
function createUserInfo(data) {
var $div = $('<div></div>');
$div.data('id', data.USER_ID);
$div.append($('<span>' + data.USER_NAME + '</span>'));
$div.append($('<span class="icon-clear" onclick="removeUserInfo(this)"></span>'));
return $div;
}
function removeUserInfo(span){
$(span).parent().remove();
}
//设为已办
function todoEndRow(index){
$('#list').datagrid('selectRow', index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var v_result = todoModule.act.updateDoState(get_FIELD(is_row[0]));
$.messager.alert('提示', v_result.VALUE);
$('#list').datagrid('reload');
}
\ No newline at end of file
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="todoTab">
<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="todoTab_searchForm" style="float:left">
<input type="hidden" name="FIELD_TYPE" id="FIELD_TYPE" value="${type}" />
主题内容: <input class="easyui-textbox" id="FIELD_TITLE" name="FIELD_TITLE" style="width:200px"/>&nbsp;&nbsp;
角色: <input class="easyui-textbox" id="FIELD_ROLE" name="FIELD_ROLE" value="0" style="width:200px"/>&nbsp;&nbsp;
办理状态: <input class="easyui-textbox" id="FIELD_DO_STATE" name="FIELD_DO_STATE" value="all" 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>
<div id="userChoice" 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/todo/js/todoModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/todo/js/todoTab.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}" />
<input type="hidden" name="FIELD_TYPE" id="TYPE"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr id="choice_user_tr">
<td style="width: 15%;" class="tableStyleLable">
<span>接收人:</span>
</td>
<td style="width: 85%">
<div class="choice_user" id="todo_select_user"></div>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-37_34',plain:true"
onclick="javascript:choiceUser('',false)">选</a>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>主题内容:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="TITLE" name="FIELD_TITLE" style="width: 400px" required="true" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>副标题:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="SUB_TITLE" name="FIELD_SUB_TITLE" style="width: 400px" required="true" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>URL:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="URL" name="FIELD_URL" style="width: 400px" required="true" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>正文:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="CONTENT" name="FIELD_CONTENT" style="width: 400px" required="true" />
</td>
</tr>
</table>
</form>
/** * 序号:1 * 功能:定义分页(EasyUI) * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:无需更改 **/ var ls_width = $(window).width();var ls_height = $(window).height(); $(window).resize(function(){ ls_width = $(window).width(); 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+"'})"); } //定义用户当前全局参数 var ls_node=null;//当前选中的Node queryData.FIELD_UNIT_ID_IS_PARENT='A'; var is_singleSelect = $.getUrlParam('singleSelect'); if(is_singleSelect == null || is_singleSelect=="" || is_singleSelect==undefined){ is_singleSelect = false; }else if(is_singleSelect == "true"){ is_singleSelect = true;; }else if(is_singleSelect == "false"){ is_singleSelect = false;; } /****/ /** * 序号:2 * 功能:构建下拉框内容 * 参数: * 说明:方便新增、修改页面里的下拉选项加载数据 * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //加载是否实体下拉框 /****/ /** * 序号:3 * 功能:构建主页面列表 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //定义grid列表 $('#list').datagrid({ title:"人员信息", iconCls:$.getJwWindowPic(), url:'userchoiceData_listUser', queryParams : queryData,//查询参数 rownumbers : true,//显示索引号 singleSelect : is_singleSelect,//是否多选 fitColumns : false,//是否撑满 autoRowHeight : 30,//设定高度 pagination : true,//分页显示 pageSize : rows,//显示行数 pageList : listPageSize,//条数选择 striped : true, //是否隔行显示 remoteSort : false,//是否从服务器排序 frozenColumns : [[ { field : 'ck', checkbox : true } ]], columns : [ [ { field : 'ID_NUMBER', title : '人员帐号', width : 100, align : 'left' }, { field : 'USER_NAME', title : '姓名', width : 100, align : 'left' }, { field : 'UNIT_NAME', title : '单位', width : 200, align : 'left' },{ field : 'ORDER_ID', title : '排序', width : 80, align : 'center' },{ field : 'SEX_NAME', title : '性别', width : 80, align : 'center' }, { field : 'YESNO_NAME', title : '是否激活', align : 'center', width : 80 }, { field : 'BEGIN_TIME', title : '注册日期', align : 'center', width : 120 }, { field : 'MOBILE', title : '手机号', align : 'center', width : 120 }, { field : 'EMAIL', title : '邮箱', align : 'center', width : 150 } ] ], toolbar : '#tb', onLoadSuccess : function(data) { } }); /****/ /** * 序号:4 * 功能:刷新 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function refreshRow(){ reloadTree(); $("#userChoice_searchForm")[0].reset(); } /****/ /** * 序号:5 * 功能:查询 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function searchRow(){ var v_query = $("#userChoice_searchForm").getFormVal(); $('#list').datagrid('load',v_query); } /****/ /** * 序号:6 * 功能:加载单位树列表 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //setInitTree(节点显示字段,节点显示主题,节点字段UUID,父节点字段) var setting = setInitTree("NAME","NAME","UUID","PARENT_ID"); //加载树时的默认点击 function defautClick(zTree,treeNode){ if(ls_node == null){ ls_node = treeNode; zTree.selectNode(ls_node); }else{ zTree.selectNode(ls_node); modifyNode(ls_node); } } //点击左边节点,datagrid过滤 function modifyNode(treeNode){ ls_node = treeNode; queryData.FIELD_UNIT_ID =treeNode.UUID; $('#list').datagrid('reload',queryData); } //loadTree(后台数据路径,显示的层ID) loadTree("userchoiceData_listUnitAll","userChoice_tree","UUID","A"); function reloadTree(){ loadTree("userchoiceData_listUnitAll","userChoice_tree","UUID","A"); } /****/ /** * 序号:7 * 功能:提交返回 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function tj(){ var uuids = ""; var rows = $('#list').datagrid('getSelections'); for(var i=0; i<rows.length; i++){ uuids = uuids + rows[i].USER_ID+","; } if(rows == null || rows == ""){ $.messager.alert('提示',"请选择一行!"); return; } if(uuids.length>0){ uuids = uuids.substring(0, uuids.length - 1); } parent.$('#return_text').text(uuids); parent.$('#userChoice').window('close'); } /****/ /** * 序号:1 * 功能:定义分页(EasyUI) * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:无需更改 **/ var ls_width = $(window).width();var ls_height = $(window).height(); $(window).resize(function(){ ls_width = $(window).width(); 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+"'})"); } //定义用户当前全局参数 var ls_node=null;//当前选中的Node queryData.FIELD_UNIT_ID_IS_PARENT='A'; var is_singleSelect = $.getUrlParam('singleSelect'); if(is_singleSelect == null || is_singleSelect=="" || is_singleSelect==undefined){ is_singleSelect = false; }else if(is_singleSelect == "true"){ is_singleSelect = true;; }else if(is_singleSelect == "false"){ is_singleSelect = false;; } /****/ /** * 序号:2 * 功能:构建下拉框内容 * 参数: * 说明:方便新增、修改页面里的下拉选项加载数据 * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //加载是否实体下拉框 /****/ /** * 序号:3 * 功能:构建主页面列表 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //定义grid列表 $('#list').datagrid({ title:"人员信息", iconCls:$.getJwWindowPic(), url:'userchoiceData_listUser', queryParams : queryData,//查询参数 rownumbers : true,//显示索引号 singleSelect : is_singleSelect,//是否多选 fitColumns : false,//是否撑满 autoRowHeight : 30,//设定高度 pagination : true,//分页显示 pageSize : rows,//显示行数 pageList : listPageSize,//条数选择 striped : true, //是否隔行显示 remoteSort : false,//是否从服务器排序 frozenColumns : [[ { field : 'ck', checkbox : true } ]], columns : [ [ { field : 'ID_NUMBER', title : '人员帐号', width : 100, align : 'left' }, { field : 'USER_NAME', title : '姓名', width : 100, align : 'left' }, { field : 'UNIT_NAME', title : '单位', width : 200, align : 'left' },{ field : 'ORDER_ID', title : '排序', width : 80, align : 'center' },{ field : 'SEX_NAME', title : '性别', width : 80, align : 'center' }, { field : 'YESNO_NAME', title : '是否激活', align : 'center', width : 80 }, { field : 'BEGIN_TIME', title : '注册日期', align : 'center', width : 120 }, { field : 'MOBILE', title : '手机号', align : 'center', width : 120 }, { field : 'EMAIL', title : '邮箱', align : 'center', width : 150 } ] ], toolbar : '#tb', onLoadSuccess : function(data) { } }); /****/ /** * 序号:4 * 功能:刷新 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function refreshRow(){ reloadTree(); $("#userChoice_searchForm")[0].reset(); } /****/ /** * 序号:5 * 功能:查询 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function searchRow(){ var v_query = $("#userChoice_searchForm").getFormVal(); $('#list').datagrid('load',v_query); } /****/ /** * 序号:6 * 功能:加载单位树列表 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ //setInitTree(节点显示字段,节点显示主题,节点字段UUID,父节点字段) var setting = setInitTree("NAME","NAME","UUID","PARENT_ID"); //加载树时的默认点击 function defautClick(zTree,treeNode){ if(ls_node == null){ ls_node = treeNode; zTree.selectNode(ls_node); }else{ zTree.selectNode(ls_node); modifyNode(ls_node); } } //点击左边节点,datagrid过滤 function modifyNode(treeNode){ ls_node = treeNode; queryData.FIELD_UNIT_ID =treeNode.UUID; $('#list').datagrid('reload',queryData); } //loadTree(后台数据路径,显示的层ID) loadTree("userchoiceData_listUnitAll","userChoice_tree","UUID","A"); function reloadTree(){ loadTree("userchoiceData_listUnitAll","userChoice_tree","UUID","A"); } /****/ /** * 序号:7 * 功能:提交返回 * 参数: * 说明: * 作者:高伟杰 * 时间:2016-01-22 * 单位:宁波金网 * 备注:需更改 **/ function tj(){ var uuids = ""; var rows = $('#list').datagrid('getSelections'); for(var i=0; i<rows.length; i++){ uuids = uuids + rows[i].USER_ID+","; } if(rows == null || rows == ""){ $.messager.alert('提示',"请选择一行!"); return; } if(uuids.length>0){ uuids = uuids.substring(0, uuids.length - 1); } parent.$('#return_text').text(uuids); parent.$('#return_text').data('json',rows); parent.$('#userChoice').window('close'); } /****/
\ No newline at end of file \ No newline at end of file
......
...@@ -40,7 +40,7 @@ var ls_ywlx = 'YBYW'; ...@@ -40,7 +40,7 @@ var ls_ywlx = 'YBYW';
* 备注:需更改 * 备注:需更改
**/ **/
//定义grid列表 //定义grid列表
var ls_title="投票管理功能&nbsp;&nbsp;<font color='#993300'></font>"; var ls_title="投票管理功能";
var is_column = [ [ var is_column = [ [
{field : 'CONTENT',title : '主题内容',width : 150,align : 'center'}, {field : 'CONTENT',title : '主题内容',width : 150,align : 'center'},
{field :'opt',title : '操作',width : 150,align : 'center', {field :'opt',title : '操作',width : 150,align : 'center',
...@@ -94,7 +94,7 @@ function getOptionMenuCount(){ ...@@ -94,7 +94,7 @@ function getOptionMenuCount(){
/** /**
* 序号: * 序号:
* 功能:新增修改弹出 * 功能:查找弹出
* 参数: * 参数:
* 说明: * 说明:
* 作者:朱天成 * 作者:朱天成
......
...@@ -41,7 +41,7 @@ var ls_ywlx = 'YBYW'; ...@@ -41,7 +41,7 @@ var ls_ywlx = 'YBYW';
* 备注:需更改 * 备注:需更改
**/ **/
//定义grid列表 //定义grid列表
var ls_title="投票管理功能&nbsp;&nbsp;<font color='#993300'></font>"; var ls_title="投票管理功能";
var is_column = [ [ var is_column = [ [
{field : 'CONTENT',title : '主题内容',width : 150,align : 'center'}, {field : 'CONTENT',title : '主题内容',width : 150,align : 'center'},
{field : 'VOTE_COUNT',title : '状态',width : 150,align : 'center', {field : 'VOTE_COUNT',title : '状态',width : 150,align : 'center',
...@@ -102,7 +102,7 @@ function getOptionMenuCount(){ ...@@ -102,7 +102,7 @@ function getOptionMenuCount(){
/** /**
* 序号: * 序号:
* 功能:新增修改弹出 * 功能:新增查找弹出
* 参数: * 参数:
* 说明: * 说明:
* 作者:朱天成 * 作者:朱天成
...@@ -121,6 +121,50 @@ function editRow(index) { ...@@ -121,6 +121,50 @@ function editRow(index) {
openEditRow("voteView_userVoteTabDetail",is_row[0],"投票",true,0.65,0.95,0,0); openEditRow("voteView_userVoteTabDetail",is_row[0],"投票",true,0.65,0.95,0,0);
} }
//加载投票子页面成功后的回调
function updateUrlOnloadCallback(is_row){
var listItem=voteModule.voteDataAction.listItem({
FIELD_MANAGE_ID:is_row.UUID
}).listItems;
for(var i=0;i<listItem.length;i++){
add_vote_item(listItem[i].INDEX_NAME,listItem[i].CONTENT,listItem[i].UUID);
}
}
//保存
function updateData(is_entity){
var uuids='';
var i=0;
$(".vote_item_list :checkbox:checked").each(function(index){
uuids+=','+$(this).val();
i++;
});
var min=$("input[name=FIELD_MIN_COUNT]").val();
var max=$("input[name=FIELD_MAX_COUNT]").val();
var flag=$("input[name=FIELD_STATUS_FLAG]").val();
//判断用户选择的选项是否在上下限之间,如果不在,则提示用户,不进行提交操作
if(min==max&&i!=min){
$.messager.alert("必须选择"+max+"个选项");
return;
}else if(i<min||i>max){
$.messager.alert("请选择"+min+"到"+max+"个选项");
return;
}
if(uuids.length>0){
uuids=uuids.substring(1);
}
is_entity.FIELD_UUIDS=uuids;
is_entity.FIELD_FLAG =flag;
v_result = voteModule.voteActAction.insertUserVote(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//查找
function lookfor(index){ function lookfor(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
...@@ -184,49 +228,6 @@ function lookforUrlOnloadCallback(is_row,index){ ...@@ -184,49 +228,6 @@ function lookforUrlOnloadCallback(is_row,index){
} }
} }
//加载投票子页面成功后的回调
function updateUrlOnloadCallback(is_row){
var listItem=voteModule.voteDataAction.listItem({
FIELD_MANAGE_ID:is_row.UUID
}).listItems;
for(var i=0;i<listItem.length;i++){
add_vote_item(listItem[i].INDEX_NAME,listItem[i].CONTENT,listItem[i].UUID);
}
}
//保存
function updateData(is_entity){
var uuids='';
var i=0;
$(".vote_item_list :checkbox:checked").each(function(index){
uuids+=','+$(this).val();
i++;
});
var min=$("input[name=FIELD_MIN_COUNT]").val();
var max=$("input[name=FIELD_MAX_COUNT]").val();
var flag=$("input[name=FIELD_STATUS_FLAG]").val();
//判断用户选择的选项是否在上下限之间,如果不在,则提示用户,不进行提交操作
if(min==max&&i!=min){
$.messager.alert("必须选择"+max+"个选项");
return;
}else if(i<min||i>max){
$.messager.alert("请选择"+min+"到"+max+"个选项");
return;
}
if(uuids.length>0){
uuids=uuids.substring(1);
}
is_entity.FIELD_UUIDS=uuids;
is_entity.FIELD_FLAG =flag;
v_result = voteModule.voteActAction.insertUserVote(is_entity);
$('#list').datagrid('reload');
return v_result;
// }
}
/** /**
* 功能:刷新 * 功能:刷新
...@@ -258,23 +259,6 @@ function searchRow(){ ...@@ -258,23 +259,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){ function add_vote_item(index,content,uuid){
if(typeof index == 'undefined'){ if(typeof index == 'undefined'){
......
/** /**
* 序号:1 * 序号:
* 功能:定义分页(EasyUI) * 功能:定义分页(EasyUI)
* 参数: * 参数:
* 说明: * 说明:
...@@ -30,7 +30,7 @@ var ls_ywlx = 'YBYW'; ...@@ -30,7 +30,7 @@ var ls_ywlx = 'YBYW';
/****/ /****/
/** /**
* 序号:2 * 序号:
* 功能:构建下拉框内容 * 功能:构建下拉框内容
* 参数: * 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据 * 说明:方便新增、修改页面里的下拉选项加载数据
...@@ -44,7 +44,7 @@ var v_statusquery_data = [{CODE_ID:'0',CODE_NAME:'未开始'},{CODE_ID:'1',CODE_ ...@@ -44,7 +44,7 @@ var v_statusquery_data = [{CODE_ID:'0',CODE_NAME:'未开始'},{CODE_ID:'1',CODE_
/****/ /****/
/** /**
* 序号:3 * 序号:
* 功能:构建主页面列表 * 功能:构建主页面列表
* 参数: * 参数:
* 说明: * 说明:
...@@ -54,7 +54,7 @@ var v_statusquery_data = [{CODE_ID:'0',CODE_NAME:'未开始'},{CODE_ID:'1',CODE_ ...@@ -54,7 +54,7 @@ var v_statusquery_data = [{CODE_ID:'0',CODE_NAME:'未开始'},{CODE_ID:'1',CODE_
* 备注:需更改 * 备注:需更改
**/ **/
//定义grid列表 //定义grid列表
var ls_title="投票管理功能&nbsp;&nbsp;<font color='#993300'></font>"; var ls_title="投票管理功能";
var is_column = [ [ var is_column = [ [
{field : 'CONTENT',title : '主题内容',width : 150,align : 'center'}, {field : 'CONTENT',title : '主题内容',width : 150,align : 'center'},
{field : 'SUB_TITLE',title : '副标题',width : 150,align : 'center'}, {field : 'SUB_TITLE',title : '副标题',width : 150,align : 'center'},
...@@ -76,13 +76,6 @@ var is_column = [ [ ...@@ -76,13 +76,6 @@ var is_column = [ [
] ]; ] ];
//列表加载完成回调 //列表加载完成回调
function dataOnLoadSuccess(){ function dataOnLoadSuccess(){
$('#FIELD_STATUS_FLAG').combobox({
data : v_statusquery_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
} }
//设置颜色和每行高度 //设置颜色和每行高度
function rowstyler(index,row){ function rowstyler(index,row){
...@@ -94,7 +87,7 @@ datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/voteData_list",queryData,is_colu ...@@ -94,7 +87,7 @@ datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/voteData_list",queryData,is_colu
/****/ /****/
/** /**
* 序号:4 * 序号:
* 功能:设置主页面操作列菜单 * 功能:设置主页面操作列菜单
* 参数: * 参数:
* 说明: * 说明:
...@@ -129,7 +122,7 @@ function getOptionMenuCount(){ ...@@ -129,7 +122,7 @@ function getOptionMenuCount(){
/****/ /****/
/** /**
* 序号:5 * 序号:
* 功能:新增修改弹出 * 功能:新增修改弹出
* 参数: * 参数:
* 说明: * 说明:
...@@ -198,13 +191,32 @@ function updateUrlOnloadCallback(is_row){ ...@@ -198,13 +191,32 @@ function updateUrlOnloadCallback(is_row){
} }
//保存
function updateData(is_entity){
var returnIsValid = $('#voteItemInputForm').form('validate');
if (returnIsValid) {
var items=[];
$("input[name=vote_item_index]").each(function(index){
items.push({
INDEX_NAME:$(this).val(),
CONTENT:$("input[name=vote_item_info]").eq(index).val(),
UUID:$("input[name=vote_item_delete]").eq(index).val()
});
});
is_entity.FIELD_ITEMS=JSON.stringify(items);
v_result = voteModule.voteActAction.updateVote(is_entity);
$('#list').datagrid('reload');
return v_result;
}
}
function addZero(d){ function addZero(d){
if(d<10){ if(d<10){
return "0"+d; return "0"+d;
} }
return d; return d;
} }
//限制时间
function initDateBox(){ function initDateBox(){
$("#END_TIME").datetimebox({ $("#END_TIME").datetimebox({
required:true, required:true,
...@@ -229,36 +241,13 @@ function initDateBox(){ ...@@ -229,36 +241,13 @@ function initDateBox(){
return new Date().getTime()<=date||date.getDate()==new Date().getDate(); return new Date().getTime()<=date||date.getDate()==new Date().getDate();
} }
}); });
/*$('#ss').numberspinner({
min: 10,
max: 100,
editable: false
});*/
} }
//保存
function updateData(is_entity){
var returnIsValid = $('#voteItemInputForm').form('validate');
if (returnIsValid) {
var items=[];
$("input[name=vote_item_index]").each(function(index){
items.push({
INDEX_NAME:$(this).val(),
CONTENT:$("input[name=vote_item_info]").eq(index).val(),
UUID:$("input[name=vote_item_delete]").eq(index).val()
});
});
is_entity.FIELD_ITEMS=JSON.stringify(items);
v_result = voteModule.voteActAction.updateVote(is_entity);
$('#list').datagrid('reload');
return v_result;
}
}
/****/ /****/
/** /**
* 序号:6 * 序号:
* 功能:单个删除 * 功能:单个删除
* 参数: * 参数:
* 说明: * 说明:
...@@ -287,7 +276,7 @@ function deleteRow(index){ ...@@ -287,7 +276,7 @@ function deleteRow(index){
/****/ /****/
/** /**
* 序号:7 * 序号:
* 功能:批量删除 * 功能:批量删除
* 参数: * 参数:
* 说明: * 说明:
...@@ -322,6 +311,24 @@ function deleteBatchRow(){ ...@@ -322,6 +311,24 @@ function deleteBatchRow(){
/****/ /****/
/** /**
* 序号:
* 功能:选项删除
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function delete_vote_item(){
$(".vote_item_list :checkbox:checked").each(function(){
$(this).parent().parent().remove();
});
}
/**
* *
* 提前结束 * 提前结束
* *
...@@ -344,7 +351,7 @@ function voteEndRow(index){ ...@@ -344,7 +351,7 @@ function voteEndRow(index){
} }
/** /**
* 序号:8 * 序号:
* 功能:刷新 * 功能:刷新
* 参数: * 参数:
* 说明: * 说明:
...@@ -360,7 +367,7 @@ function refreshRow(){ ...@@ -360,7 +367,7 @@ function refreshRow(){
/****/ /****/
/** /**
* 序号:9 * 序号:
* 功能:查询 * 功能:查询
* 参数: * 参数:
* 说明: * 说明:
...@@ -408,10 +415,3 @@ function add_vote_item(index,content,uuid){ ...@@ -408,10 +415,3 @@ function add_vote_item(index,content,uuid){
$.parser.parse('.vote_item_one'); $.parser.parse('.vote_item_one');
} }
function delete_vote_item(){
$(".vote_item_list :checkbox:checked").each(function(){
$(this).parent().parent().remove();
});
}
package com.gaowj.business.base;
import java.util.List;
import java.util.Map;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
/**
* 业务层基准接口(包含通用的增删改查方法)
*
* @author luosz
*
*/
public interface BaseBusiness {
/**
* 插入
*
* @param entity
* 插入的对象
* @throws BusinessException
* @date 2018-09-01 下午3:13:49
* @author luosz@jfbrother.com
*/
void insert(Map<String, Object> entity) throws BusinessException;
/**
* 更新
*
* @param entity
* 更新的对象
* @throws BusinessException
* @date 2018-09-01 下午3:13:54
* @author luosz@jfbrother.com
*/
void update(Map<String, Object> entity) throws BusinessException;
/**
* 删除记录
*
* @param list
* 需要删除的对象的主键uuid组成的list
* @throws BusinessException
* @date 2018-09-01 下午3:13:59
* @author luosz@jfbrother.com
*/
void delete(List<String> list) throws BusinessException;
/**
* 分页获取记录
*
* @param pageNo
* 页码
* @param pageSize
* 每页显示多少条
* @param query
* 查询条件
* @return 分页记录
* @throws BusinessException
* @date 2018-09-01 下午3:14:03
* @author luosz@jfbrother.com
*/
Page<Map<String, Object>> list(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
/**
* 获取所有记录
*
* @param query
* 查询条件
* @return 记录
* @throws BusinessException
* @date 2018-09-01 下午3:14:08
* @author luosz@jfbrother.com
*/
List<Map<String, Object>> list(Map<String, Object> query) throws BusinessException;
/**
* 获取所有记录数
*
* @param query
* 查询条件
* @return 记录数
* @throws BusinessException
* @date 2018-09-01 下午3:14:13
* @author luosz@jfbrother.com
*/
int listCount(Map<String, Object> query) throws BusinessException;
}
package com.gaowj.business.base.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.base.BaseBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.DaoUtil;
import com.gaowj.business.util.Page;
/**
* 业务层基准接口的默认实现
*
* @author luosz
*
*/
public abstract class BaseBusinessImpl implements BaseBusiness {
public BaseDAO dao;
@Override
public void insert(Map<String, Object> entity) throws BusinessException {
DaoUtil.addCreateInfo(entity);
makeInsertEntity(entity);
DaoUtil.addFieldsInfo(entity);
dao.insertInfo(entity);
}
@Override
public void update(Map<String, Object> entity) throws BusinessException {
DaoUtil.addUpdateInfo(entity);
makeUpdateEntity(entity);
DaoUtil.addFieldsInfo(entity, "UUID");
dao.updateInfo(entity);
}
@Override
public void delete(List<String> list) throws BusinessException {
dao.deleteInfo(list);
}
@Override
public Page<Map<String, Object>> list(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
makeQuery(query);
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = dao.listInfo(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = dao.listInfoCount(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(Map<String, Object> query) throws BusinessException {
makeQuery(query);
// 获取列表
List<Map<String, Object>> items = dao.listInfo(query);
return items;
}
@Override
public int listCount(Map<String, Object> query) throws BusinessException {
makeQuery(query);
return dao.listInfoCount(query);
}
/**
* 查询条件的设置,需要用户自己实现
*
* @param query
* @throws BusinessException
* @date 2018-09-01 下午6:22:56
* @author luosz@jfbrother.com
*/
public abstract void makeQuery(Map<String, Object> query) throws BusinessException;
/**
* 处理插入数据
*
* @param entity
* @date 2018-09-01 下午7:30:24
* @author luosz@jfbrother.com
*/
public abstract void makeInsertEntity(Map<String, Object> entity) throws BusinessException;
/**
* 处理更新数据
*
* @param entity
* @date 2018-09-01 下午7:30:36
* @author luosz@jfbrother.com
*/
public abstract void makeUpdateEntity(Map<String, Object> entity) throws BusinessException;
}
package com.gaowj.business.base.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
/**
* DAO接口基类
*
* @author luosz@jfbrother.com
*
*/
public interface BaseDAO {
/**
* 插入
*
* @param entity
* @throws BusinessException
* @date 2018-09-01 下午3:08:31
* @author luosz@jfbrother.com
*/
void insertInfo(Map<String, Object> entity) throws BusinessException;
/**
* 修改
*
* @param entity
* @throws BusinessException
* @date 2018-09-01 下午3:08:37
* @author luosz@jfbrother.com
*/
void updateInfo(Map<String, Object> entity) throws BusinessException;
/**
* 删除
*
* @param entity
* @throws BusinessException
* @date 2018-09-01 下午3:08:41
* @author luosz@jfbrother.com
*/
void deleteInfo(List<String> list) throws BusinessException;
/**
* 列表及详情(带翻页)
*
* @param rowbounds
* @param query
* @return
* @throws BusinessException
* @date 2018-09-01 下午3:08:47
* @author luosz@jfbrother.com
*/
List<Map<String, Object>> listInfo(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
/**
* 列表及详情
*
* @param query
* @return
* @throws BusinessException
* @date 2018-09-01 下午3:08:52
* @author luosz@jfbrother.com
*/
List<Map<String, Object>> listInfo(Map<String, Object> query) throws BusinessException;
/**
* 列表数量
*
* @param query
* @return
* @throws BusinessException
* @date 2018-09-01 下午3:08:56
* @author luosz@jfbrother.com
*/
int listInfoCount(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.gaowj.business.base.impl.BaseDAO">
<sql id="TABLE_NAME">
TABLE_NAME
</sql>
<sql id="WHERE">
<where>
<trim prefixOverrides="and">
<if test="UUID != null and UUID != ''">
and t.UUID = #{UUID}
</if>
</trim>
</where>
</sql>
<insert id="insertInfo" parameterType="map">
insert into
<include refid="TABLE_NAME"></include>
(
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
${info.key},
</foreach>
</trim>
) values(
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
#{info.value},
</foreach>
</trim>
)
</insert>
<update id="updateInfo" parameterType="map">
update
<include refid="TABLE_NAME"></include>
set
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="deleteInfo" parameterType="list">
delete from
<include refid="TABLE_NAME"></include>
where UUID IN
<foreach collection="list" item="UUID" open="(" separator="," close=")">
#{UUID}
</foreach>
</delete>
<select id="listInfo" parameterType="map" resultType="upperCaseKeyMap">
select * from
<include refid="TABLE_NAME"></include>
t
<include refid="WHERE"></include>
</select>
</mapper>
\ No newline at end of file
package com.gaowj.business.util;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.StringUtils;
import com.gaowj.business.exception.BusinessException;
/**
* 数据持久层工具类
*
* @author luosz@jfbrother.com
*
*/
public class DaoUtil {
/**
* 新增或者删除时,构造的字段list(key-value映射)
*/
public static final String INFO = "infos";
/**
* 映射中key的名称
*/
private static final String KEY = "key";
/**
* 映射中value的名称
*/
private static final String VALUE = "value";
/**
* 添加新建信息(UUID,CREATE_ID,CREATE_TIME,UPDATE_ID,UPDATE_TIME)
*
* @param entity
* 填充的对象
* @param ignoreField
* 需要忽略的字段
* @date 2018-09-01 下午5:25:27
* @author luosz@jfbrother.com
*/
public static void addCreateInfo(Map<String, Object> entity, String... ignoreFields) {
// 构造模板
Map<String, Object> entityModel = new HashMap<String, Object>();
entityModel.put("UUID", java.util.UUID.randomUUID().toString());
entityModel.put("CREATE_ID", SessionUtil.getCode());
entityModel.put("CREATE_TIME", new Date());
entityModel.put("UPDATE_ID", SessionUtil.getCode());
entityModel.put("UPDATE_TIME", new Date());
addCommonInfo(entity, entityModel, ignoreFields);
}
/**
* 添加更新信息(UPDATE_ID,UPDATE_TIME)
*
* @param entity
* 填充的对象
* @param ignoreFields
* 需要忽略的字段
* @date 2018-09-01 下午7:32:48
* @author luosz@jfbrother.com
*/
public static void addUpdateInfo(Map<String, Object> entity, String... ignoreFields) {
// 构造模板
Map<String, Object> entityModel = new HashMap<String, Object>();
entityModel.put("UPDATE_ID", SessionUtil.getCode());
entityModel.put("UPDATE_TIME", new Date());
addCommonInfo(entity, entityModel, ignoreFields);
}
/**
* 对entity对象添加entityModel中的元素,但是过滤掉ignoreFields中指定的key(即不覆盖ignoreFields指定的key值)
*
* @param entity
* 填充的对象
* @param entityModel
* 新值
* @param ignoreFields
* 需要忽略的字段
* @date 2018-09-05 下午1:44:45
* @author luosz@jfbrother.com
*/
public static void addCommonInfo(Map<String, Object> entity, Map<String, Object> entityModel, String... ignoreFields) {
// 剔除忽略的属性
if (ignoreFields != null) {
for (String ignoreField : ignoreFields) {
entityModel.remove(ignoreField);
}
}
// 将模板中剩余的属性覆盖到entity
if (entityModel.keySet() != null) {
for (Entry<String, Object> field : entityModel.entrySet()) {
entity.put(field.getKey(), field.getValue());
}
}
}
/**
* 将entity中的字段信息整理成key-value映射的列表,并放入info属性
*
* @param entity
* 需要构造的对象
* @param ignoreFields
* 构造中需要忽略的字段
* @date 2018-09-01 下午6:01:07
* @author luosz@jfbrother.com
*/
public static void addFieldsInfo(Map<String, Object> entity, String... ignoreFields) throws BusinessException {
addFieldsInfo(INFO, KEY, VALUE, entity, ignoreFields);
}
/**
* 将entity中的字段信息整理成key-value映射的列表,并放入info属性(可自由指定增加的列表的key值和key-value对应的key值)
*
* @param infoName
* 列表的key值
* @param keyName
* key元素的key值
* @param valueName
* value元素的key值
* @param entity
* 需要构造的对象
* @param ignoreFields
* 构造中需要忽略的字段
* @throws BusinessException
* @date 2018-09-05 下午1:50:05
* @author luosz@jfbrother.com
*/
public static void addFieldsInfo(String infoName, String keyName, String valueName, Map<String, Object> entity, String... ignoreFields) throws BusinessException {
if (entity.keySet() != null) {
// 字段列表
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
// 将map集合中的key和value 取出来分别放到list集合里
outer: for (String str : entity.keySet()) {
if (ignoreFields != null) {
for (String ignoreField : ignoreFields) {
// 如果该字段被忽略,则继续外层循环
if (StringUtils.equalsIgnoreCase(ignoreField, str))
continue outer;
}
}
// 构造key-value映射对象
Map<String, Object> mapping = new HashMap<String, Object>();
mapping.put(keyName, str);
mapping.put(valueName, entity.get(str));
listField.add(mapping);
}
if (listField.size() > 0) {
entity.put(infoName, listField);
return;
}
}
throw new BusinessException(infoName + "构造失败!");
}
}
...@@ -135,6 +135,34 @@ ...@@ -135,6 +135,34 @@
<action name="voteView_*" class="com.jw.app.vote.action.viewAction" method="{1}"> <action name="voteView_*" class="com.jw.app.vote.action.viewAction" method="{1}">
<result name="{1}">/jwapp/pages/vote/{1}.jsp</result> <result name="{1}">/jwapp/pages/vote/{1}.jsp</result>
</action> </action>
<!-- 代办管理 -->
<action name="todoAct_*" class="com.jw.app.todo.action.actAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<!-- 会议管理 -->
<action name="meetingAct_*" class="com.jw.app.meeting.action.actAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="todoData_*" class="com.jw.app.todo.action.dataAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="meetingData_*" class="com.jw.app.meeting.action.dataAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="todoView_*" class="com.jw.app.todo.action.viewAction" method="{1}">
<result name="todoProcTab">/jwapp/pages/todo/todoTab.jsp</result>
<result name="todoOaTab">/jwapp/pages/todo/todoTab.jsp</result>
<result name="todoTab">/jwapp/pages/todo/todoTab.jsp</result>
<result name="todoTabDetail">/jwapp/pages/todo/todoTabDetail.jsp</result>
</action>
<!-- 通知公告 --> <!-- 通知公告 -->
<action name="noticeAct_*" class="com.jw.app.notice.action.actAction" method="{1}"> <action name="noticeAct_*" class="com.jw.app.notice.action.actAction" method="{1}">
<result name="json" type="json"> <result name="json" type="json">
...@@ -178,6 +206,26 @@ ...@@ -178,6 +206,26 @@
<action name="friendlinkView_*" class="com.jw.app.friendlink.action.viewAction" method="{1}"> <action name="friendlinkView_*" class="com.jw.app.friendlink.action.viewAction" method="{1}">
<result name="{1}">/jwapp/pages/friendlink/{1}.jsp</result> <result name="{1}">/jwapp/pages/friendlink/{1}.jsp</result>
</action> </action>
<action name="meetingView_*" class="com.jw.app.meeting.action.viewAction" method="{1}">
<result name="{1}">/jwapp/pages/meeting/{1}.jsp</result>
</action>
<!-- 日志管理 -->
<action name="logAct_*" class="com.jw.app.log.action.actAction"
method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="logData_*" class="com.jw.app.log.action.dataAction"
method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="logView_*" class="com.jw.app.log.action.viewAction"
method="{1}">
<result name="{1}">/jwapp/pages/log/{1}.jsp</result>
</action>
</package> </package>
<package name="src_jwapp_store" extends="gaowj"> <package name="src_jwapp_store" extends="gaowj">
......
...@@ -18,18 +18,7 @@ import com.jw.app.business.BgmkBusiness; ...@@ -18,18 +18,7 @@ import com.jw.app.business.BgmkBusiness;
public class actAction extends BasicAction { public class actAction extends BasicAction {
/**
*
*/
/**
*
*/
private static final long serialVersionUID = -2059356249335526616L; private static final long serialVersionUID = -2059356249335526616L;
/**
*
*/
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
......
...@@ -23,22 +23,16 @@ import com.jw.app.business.BgmkBusiness; ...@@ -23,22 +23,16 @@ import com.jw.app.business.BgmkBusiness;
public class dataAction extends BasicAction{ public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 8400799803941083524L; private static final long serialVersionUID = 8400799803941083524L;
/**
*
*/
private static final String console = null; private static final String console = null;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数 private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页 private int page = 1;// 当前第几页
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
return jsonObject; return jsonObject;
} }
......
...@@ -8,18 +8,8 @@ import com.gaowj.business.util.RequestUtils; ...@@ -8,18 +8,8 @@ import com.gaowj.business.util.RequestUtils;
public class viewAction extends BasicAction { public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 847847227972540472L; private static final long serialVersionUID = 847847227972540472L;
/**
*
*/
public String bgmkTab() throws BusinessException{ public String bgmkTab() throws BusinessException{
return "bgmkTab"; return "bgmkTab";
} }
......
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;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_reply(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
}
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 MeetingBusiness {
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
void insert_meeting(Map<String, Object> entity) throws BusinessException;
/**
* 更新
*
* @param entity
* @throws BusinessException
*/
void update_meeting(Map<String, Object> entity) throws BusinessException;
/**
* 删除记录
*
* @param entity
* @throws BusinessException
*/
void delete_meeting(List<String> list) throws BusinessException;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_meeting(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException;
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
List<Map<String, Object>> list_meeting(Map<String, Object> query) throws BusinessException;
/**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int listCount_meeting(Map<String, Object> query) throws BusinessException;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_check_in(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException;
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
List<Map<String, Object>> list_check_in(Map<String, Object> query) throws BusinessException;
/**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int listCount_check_in(Map<String, Object> query) throws BusinessException;
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
void insert_check_in(Map<String, Object> entity) throws BusinessException;
}
package com.jw.app.business;
import org.springframework.stereotype.Service;
import com.gaowj.business.base.BaseBusiness;
@Service
public interface TodoBusiness extends BaseBusiness {
}
...@@ -60,14 +60,6 @@ public interface VoteBusiness { ...@@ -60,14 +60,6 @@ public interface VoteBusiness {
List<Map<String, Object>> list_vote(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_vote(Map<String, Object> query) throws BusinessException;
/** /**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int listCount_vote(Map<String, Object> query) throws BusinessException;
/**
* 获取选项 * 获取选项
* *
* @param entity * @param entity
...@@ -89,8 +81,7 @@ public interface VoteBusiness { ...@@ -89,8 +81,7 @@ public interface VoteBusiness {
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
void update_endvote(Map<String, Object> entity) throws BusinessException; void update_endVote(Map<String, Object> entity) throws BusinessException;
/** /**
* 分页获取记录 * 分页获取记录
...@@ -98,7 +89,8 @@ public interface VoteBusiness { ...@@ -98,7 +89,8 @@ public interface VoteBusiness {
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
Page<Map<String, Object>> list_ongoing(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException; Page<Map<String, Object>> list_ongoing(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException;
/** /**
* 获取所有记录 * 获取所有记录
...@@ -109,15 +101,6 @@ public interface VoteBusiness { ...@@ -109,15 +101,6 @@ public interface VoteBusiness {
List<Map<String, Object>> list_ongoing(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_ongoing(Map<String, Object> query) throws BusinessException;
/** /**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int listCount_ongoing(Map<String, Object> query) throws BusinessException;
/**
* 分页获取记录 * 分页获取记录
* *
* @param entity * @param entity
...@@ -134,22 +117,11 @@ public interface VoteBusiness { ...@@ -134,22 +117,11 @@ public interface VoteBusiness {
List<Map<String, Object>> list_ended(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_ended(Map<String, Object> query) throws BusinessException;
/** /**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int listCount_ended(Map<String, Object> query) throws BusinessException;
/**
* 获取用户选择 * 获取用户选择
* *
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
List<Map<String, Object>> list_userchecked(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_userChecked(Map<String, Object> query) throws BusinessException;
} }
...@@ -34,6 +34,12 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -34,6 +34,12 @@ public class BgmkBusinessImpl implements BgmkBusiness {
if(entity.get("UUID")==null){ if(entity.get("UUID")==null){
entity.put("UUID", java.util.UUID.randomUUID().toString()); entity.put("UUID", java.util.UUID.randomUUID().toString());
} }
if(entity.get("USER_ID")==null){
entity.put("USER_ID", SessionUtil.getCode());
}
if(entity.get("DEPT_ID")==null){
entity.put("DEPT_ID", SessionUtil.getEmdepart());
}
if(entity.get("CREATE_TIME")==null){ if(entity.get("CREATE_TIME")==null){
entity.put("CREATE_TIME", new Date()); entity.put("CREATE_TIME", new Date());
} }
...@@ -48,10 +54,6 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -48,10 +54,6 @@ public class BgmkBusinessImpl implements BgmkBusiness {
entity.put("DEPT_NAME", SessionUtil.getEmdepartname()); entity.put("DEPT_NAME", SessionUtil.getEmdepartname());
} }
// if(entity.get("SAVEDAYS")==null){
// String ls_savedays = PropUtil.getValue("set_savedays", "quartz_service", "14");
// entity.put("SAVEDAYS", Integer.parseInt(ls_savedays));
// }
//动态传值插入 //动态传值插入
List<String> infoListKey = new ArrayList<String>(); List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>(); List<Object> infoList = new ArrayList<Object>();
...@@ -141,7 +143,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -141,7 +143,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
//获取列表 //获取列表
List<Map<String, Object>> items = bgmkDAO.list_bgmk_employee(new RowBounds(pageStart, pageSize), query); List<Map<String, Object>> items = bgmkDAO.list_bgmk(new RowBounds(pageStart, pageSize), query);
//获取列表个数 //获取列表个数
int count = listCount_bgmk_employee(query); int count = listCount_bgmk_employee(query);
...@@ -159,7 +161,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -159,7 +161,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
public List<Map<String, Object>> list_bgmk_employee(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_bgmk_employee(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk_employee"+query); List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk_employee"+query);
if(list_data==null || list_data.size()==0){ if(list_data==null || list_data.size()==0){
list_data=bgmkDAO.list_bgmk_employee(query); list_data=bgmkDAO.list_bgmk(query);
CacheKit.put("ehcache10", "bgmk_employee"+query, list_data); CacheKit.put("ehcache10", "bgmk_employee"+query, list_data);
} }
return list_data; return list_data;
...@@ -167,7 +169,7 @@ public class BgmkBusinessImpl implements BgmkBusiness { ...@@ -167,7 +169,7 @@ public class BgmkBusinessImpl implements BgmkBusiness {
@Override @Override
public int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException { public int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException {
return bgmkDAO.listCount_bgmk_employee(query); return bgmkDAO.listCount_bgmk(query);
} }
} }
......
...@@ -21,11 +21,6 @@ public interface bgmkDAO { ...@@ -21,11 +21,6 @@ public interface bgmkDAO {
int listCount_bgmk(Map<String, Object> query) throws BusinessException ; int listCount_bgmk(Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_bgmk_employee(RowBounds rowbounds, Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_bgmk_employee(Map<String,Object> query) throws BusinessException ;
int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException ;
} }
...@@ -2,53 +2,9 @@ ...@@ -2,53 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jw.app.business.bgmk.bgmkDAO"> <mapper namespace="com.jw.app.business.bgmk.bgmkDAO">
<insert id="insert_bgmk" parameterType="map"> <sql id="where_bg">
insert into WORK_BG(
<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_bgmk" parameterType="map">
<![CDATA[
update WORK_BG set
]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where> <where>
<if test="UUID != null and UUID != ''"> <trim prefixOverrides="AND |OR">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="delete_bgmk" parameterType="list">
<![CDATA[
delete from WORK_BG where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_bgmk" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''"> <if test="UUID != null and UUID != ''">
and f.UUID = #{UUID} and f.UUID = #{UUID}
</if> </if>
...@@ -85,142 +41,68 @@ ...@@ -85,142 +41,68 @@
<if test="CREATE_TIME != null and CREATE_TIME != ''"> <if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME} and f.CREATE_TIME = #{CREATE_TIME}
</if> </if>
</trim>
</where>
</sql>
order by f.CREATE_TIME DESC <insert id="insert_bgmk" parameterType="map">
</select> insert into WORK_BG(
<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>
<select id="listCount_bgmk" parameterType="map" resultType="int"> <update id="update_bgmk" parameterType="map">
<![CDATA[ <![CDATA[
select count(*) c from WORK_BG f where 1=1 update WORK_BG set
]]> ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''"> <if test="UUID != null and UUID != ''">
and f.UUID = #{UUID} and UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if> </if>
</where>
</update>
</select> <delete id="delete_bgmk" parameterType="list">
<![CDATA[
delete from WORK_BG where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_bgmk_employee" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_bgmk" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
select f.* select f.*
from WORK_BG f where 1=1 from WORK_BG f where 1=1
]]> ]]>
<if test="UUID != null and UUID != ''"> <include refid="where_bg" />
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
order by f.CREATE_TIME DESC order by f.CREATE_TIME DESC
</select> </select>
<select id="listCount_bgmk_employee" parameterType="map" resultType="int"> <select id="listCount_bgmk" parameterType="map" resultType="int">
<![CDATA[ <![CDATA[
select count(*) c from WORK_BG f where 1=1 select count(*) c from WORK_BG f where 1=1
]]> ]]>
<if test="UUID != null and UUID != ''"> <include refid="where_bg" />
and f.UUID = #{UUID}
</if>
<if test="USER_NAME != null and USER_NAME != ''">
and f.USER_NAME like '%${USER_NAME}%'
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPT_NAME != null and DEPT_NAME != ''">
and f.DEPT_NAME = #{DEPT_NAME}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT = #{CONTENT}
</if>
<if test="GZYS != null and GZYS != ''">
and f.GZYS = #{GZYS}
</if>
<if test="BG_TIME != null and BG_TIME != ''">
and f.BG_TIME = #{BG_TIME}
</if>
<if test="BG_TYPE != null and BG_TYPE != ''">
and f.BG_TYPE = #{BG_TYPE}
</if>
<if test="USER_TYPE != null and USER_TYPE != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="CREATOR_ID != null and CREATOR_ID != ''">
and f.CREATOR_ID = #{CREATOR_ID}
</if>
<if test="CREATE_TIME != null and CREATE_TIME != ''">
and f.CREATE_TIME = #{CREATE_TIME}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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_byLogId(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 = null;
if (list_data == null || list_data.size() == 0) {
list_data = logDAO.list_log(query);
}
return list_data;
}
@Override
public int listCount_log(Map<String, Object> query) throws BusinessException {
return logDAO.listCount_log(query);
}
@Override
public Page<Map<String, Object>> list_reply(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException {
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = logDAO.list_reply(new RowBounds(pageStart, pageSize),
query);
// 获取列表个数
int count = listCount_reply(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_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("REPLY_TIME", new Date());
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> 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_byLogId(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_byLogId" 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
manage.*,
info1.real_name new_create,
info2.real_name new_update,
reply.*
FROM
log_manage manage
LEFT JOIN `uicm_user_info` info1 ON info1.user_id = manage.create_id
LEFT JOIN `uicm_user_info` info2 ON info2.user_id = manage.update_id
LEFT JOIN ( SELECT log_id, count( * ) reply_count FROM log_reply GROUP BY
log_id ) reply ON manage.uuid = reply.log_id
<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
package com.jw.app.business.meeting;
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.MeetingBusiness;
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 MeetingBusinessImpl implements MeetingBusiness {
private meetingDAO meetingDAO;
public meetingDAO getmeetingDAO() {
return meetingDAO;
}
public void setmeetingDAO(meetingDAO meetingDAO) {
this.meetingDAO = meetingDAO;
}
@Override
public void insert_meeting(Map<String, Object> entity) throws BusinessException {
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.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);
// 插入
meetingDAO.insert_meeting(entity);
}
}
@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_ID", SessionUtil.getCode());
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.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);
// 插入
meetingDAO.insert_check_in(entity);
}
}
}
@Override
public void update_meeting(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);
//
meetingDAO.update_meeting(entity);
}
}
@Override
public void delete_meeting(List<String> list) throws BusinessException {
meetingDAO.delete_meeting(list);
meetingDAO.delete_check_in(list);
}
@Override
public Page<Map<String, Object>> list_meeting(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException {
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = meetingDAO.list_meeting(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_meeting(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 Page<Map<String, Object>> list_check_in(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException {
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = meetingDAO.list_check_in(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_check_in(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_check_in(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = null;
if (list_data == null || list_data.size() == 0) {
list_data = meetingDAO.list_check_in(query);
}
return list_data;
}
@Override
public int listCount_check_in(Map<String, Object> query) throws BusinessException {
return meetingDAO.listCount_check_in(query);
}
@Override
public List<Map<String, Object>> list_meeting(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 = meetingDAO.list_meeting(query);
CacheKit.put("ehcache10", "kqmk" + query, list_data);
}
return list_data;
}
@Override
public int listCount_meeting(Map<String, Object> query) throws BusinessException {
return meetingDAO.listCount_meeting(query);
}
}
package com.jw.app.business.meeting;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface meetingDAO {
void insert_meeting(Map<String, Object> entity) throws BusinessException;
void insert_check_in(Map<String, Object> entity) throws BusinessException;
void update_meeting(Map<String, Object> entity) throws BusinessException;
void delete_meeting(List<String> list) throws BusinessException;
void delete_check_in(List<String> list) throws BusinessException;
List<Map<String, Object>> list_meeting(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_meeting(Map<String, Object> query) throws BusinessException;
int listCount_meeting(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_check_in(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_check_in(Map<String, Object> query) throws BusinessException;
int listCount_check_in(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.meeting.meetingDAO">
<sql id="WHERE">
<where>
<trim prefixOverrides="and">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="MEETING_ID != null and MEETING_ID != ''">
and f.MEETING_ID = #{MEETING_ID}
</if>
<if test="MEETING_NAME != null and MEETING_NAME != ''">
and f.MEETING_NAME like concat('%',#{MEETING_NAME},'%')
</if>
<if test="MEETING_CONTENT != null and MEETING_CONTENT != ''">
and f.MEETING_CONTENT like
concat('%',#{MEETING_CONTENT},'%')
</if>
<if test="PARTICIPANTS_NAME != null and PARTICIPANTS_NAME != ''">
and f.PARTICIPANTS_NAME = #{PARTICIPANTS_NAME}
</if>
<if test="VENUE != null and VENUE != ''">
and f.VENUE = #{VENUE}
</if>
<if test="CREATE_ID != null and CREATE_ID != ''">
and f.CREATE_ID like concat('%',#{CREATE_ID},'%')
</if>
<if test="START_TIME != null and START_TIME != ''">
and f.CREATE_TIME &gt;= #{START_TIME}
</if>
<if test="END_TIME != null and END_TIME != ''">
and f.CREATE_TIME &lt;= #{END_TIME}
</if>
<if test="UPDATE_ID != null and UPDATE_ID != ''">
and f.UPDATE_ID = #{UPDATE_ID}
</if>
<if test="UPDATE_TIME != null and UPDATE_TIME != ''">
and f.UPDATE_TIME = #{UPDATE_TIME}
</if>
</trim>
</where>
</sql>
<insert id="insert_meeting" parameterType="map">
insert into MEETING_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>
<insert id="insert_check_in" parameterType="map">
insert into MEETING_CHECK_IN(
<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_meeting" parameterType="map">
<![CDATA[
update MEETING_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_meeting" parameterType="list">
<![CDATA[
delete from MEETING_MANAGE where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<delete id="delete_check_in" parameterType="list">
<![CDATA[
delete from MEETING_CHECK_IN where MEETING_ID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_meeting" parameterType="map" resultType="upperCaseKeyMap">
SELECT * FROM
(
SELECT
manage.*,
SUM( CASE WHEN check_in.uuid IS NULL THEN
0 ELSE 1 END ) AS
meeting_count
FROM
( SELECT * FROM `meeting_manage`)
manage
LEFT JOIN ( SELECT * FROM
`meeting_check_in`
<where>
<trim prefixOverrides="and">
<if test="PARTICIPANTS_NAME != null and PARTICIPANTS_NAME != ''">
and PARTICIPANTS_NAME = #{PARTICIPANTS_NAME}
</if>
</trim>
</where>
) check_in ON manage.uuid = check_in.meeting_id
GROUP BY
manage.uuid
) f
<include refid="WHERE"></include>
order by f.CREATE_TIME DESC
</select>
<select id="listCount_meeting" parameterType="map" resultType="int">
SELECT count(*) FROM
(
SELECT
manage.*,
SUM( CASE WHEN check_in.uuid IS
NULL THEN 0 ELSE 1 END ) AS
meeting_count
FROM
( SELECT * FROM
`meeting_manage`) manage
LEFT JOIN ( SELECT * FROM
`meeting_check_in`
<where>
<trim prefixOverrides="and">
<if test="PARTICIPANTS_NAME != null and PARTICIPANTS_NAME != ''">
and PARTICIPANTS_NAME = #{PARTICIPANTS_NAME}
</if>
</trim>
</where>
) check_in ON manage.uuid = check_in.meeting_id
GROUP BY
manage.uuid
) f
<include refid="WHERE"></include>
</select>
<select id="list_check_in" parameterType="map" resultType="upperCaseKeyMap">
select check_in.*,info.real_name,unit.name,info.telephone
from
meeting_check_in check_in
LEFT JOIN `uicm_user_info` info on
info.user_id=check_in.create_id
left join uicm_v_unit unit
on
unit.uuid=info.unit_id
where check_in.meeting_id=#{MEETING_ID}
</select>
</mapper>
\ No newline at end of file
package com.jw.app.business.todo;
import java.util.Date;
import java.util.Map;
import com.gaowj.business.base.impl.BaseBusinessImpl;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.TodoBusiness;
public class TodoBusinessImpl extends BaseBusinessImpl implements TodoBusiness {
public void setTodoDAO(TodoDAO todoDAO) {
this.dao = todoDAO;
}
@Override
public void makeQuery(Map<String, Object> query) throws BusinessException {
//主题
if (query.get("TITLE") != null && !"".equals(query.get("TITLE"))) {
query.put("TITLE", "%" + query.get("TITLE") + "%");
}
//代办状态
if (!"0".equals(query.get("DO_STATE"))&&!"1".equals(query.get("DO_STATE"))) {
query.remove("DO_STATE");
}
//角色条件
if ("2".equals(query.get("ROLE"))) {
// 接收者是当前登录人
query.put("RECIPIENT", SessionUtil.getCode());
} else if ("1".equals(query.get("ROLE"))) {
// 发起者是当前登录人
query.put("SENDER", SessionUtil.getCode());
} else {
// 发送人或者接收人是当前登录人
query.put("SENDER_OR_RECIPIENT", SessionUtil.getCode());
}
}
@Override
public void makeInsertEntity(Map<String, Object> entity) throws BusinessException {
// 发送人是当前登录人
entity.put("SENDER", SessionUtil.getCode());
// 设置发起时间
entity.put("LAUNCH_TIME", new Date());
// 设置未读
entity.put("READ_STATE", 0);
// 设置未办
entity.put("DO_STATE", 0);
}
@Override
public void makeUpdateEntity(Map<String, Object> entity) throws BusinessException {
//因为是从datagrid的数据来的,可能存在物理表中没有的字段,需要删除
entity.remove("SEND_REAL_NAME");
entity.remove("RECIPIENT_REAL_NAME");
entity.remove("OPETYPE");
}
}
package com.jw.app.business.todo;
import com.gaowj.business.base.impl.BaseDAO;
public interface TodoDAO extends BaseDAO{
}
<?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.todo.TodoDAO">
<sql id="TABLE_NAME">
TODO_SYSTEM
</sql>
<sql id="WHERE">
<where>
<trim prefixOverrides="and">
<if test="UUID != null and UUID != ''">
and t.UUID = #{UUID}
</if>
<if test="DO_STATE != null and DO_STATE != ''">
and t.DO_STATE = #{DO_STATE}
</if>
<if test="TYPE != null and TYPE != ''">
and t.TYPE = #{TYPE}
</if>
<if test="TITLE != null and TITLE != ''">
and t.TITLE like #{TITLE}
</if>
<if test="RECIPIENT != null and RECIPIENT != ''">
and t.RECIPIENT = #{RECIPIENT}
</if>
<if test="SENDER != null and SENDER != ''">
and t.SENDER = #{SENDER}
</if>
<if test="SENDER_OR_RECIPIENT != null and SENDER_OR_RECIPIENT != ''">
and (t.RECIPIENT = #{SENDER_OR_RECIPIENT} or t.SENDER = #{SENDER_OR_RECIPIENT})
</if>
</trim>
</where>
</sql>
<insert id="insertInfo" parameterType="map">
insert into
<include refid="TABLE_NAME"></include>
(
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
${info.key},
</foreach>
</trim>
) values(
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
#{info.value},
</foreach>
</trim>
)
</insert>
<update id="updateInfo" parameterType="map">
update
<include refid="TABLE_NAME"></include>
set
<trim prefix="" suffixOverrides=",">
<foreach collection="infos" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="deleteInfo" parameterType="list">
delete from
<include refid="TABLE_NAME"></include>
where UUID IN
<foreach collection="list" item="UUID" open="(" separator="," close=")">
#{UUID}
</foreach>
</delete>
<select id="listInfo" parameterType="map" resultType="upperCaseKeyMap">
select * from (
select todo.*,user_info.real_name as send_real_name
,user_info2.real_name as recipient_real_name from <include refid="TABLE_NAME"></include> todo
LEFT JOIN uicm_user_info user_info
on todo.sender=user_info.user_id
LEFT JOIN uicm_user_info user_info2
on todo.recipient=user_info2.user_id
)
t
<include refid="WHERE"></include>
</select>
<select id="listInfoCount" parameterType="map" resultType="int">
select count(*) from
<include refid="TABLE_NAME"></include>
t
<include refid="WHERE"></include>
</select>
</mapper>
\ No newline at end of file
...@@ -43,7 +43,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -43,7 +43,7 @@ public class VoteBusinessImpl implements VoteBusiness {
entity.put("START_TIME", new Date()); entity.put("START_TIME", new Date());
entity.put("CREATE_ID", SessionUtil.getCode()); entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date()); 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("UPDATE_TIME", new Date());
entity.put("STATUS_FLAG", 1); entity.put("STATUS_FLAG", 1);
...@@ -70,7 +70,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -70,7 +70,7 @@ public class VoteBusinessImpl implements VoteBusiness {
item.put("UUID", java.util.UUID.randomUUID().toString()); item.put("UUID", java.util.UUID.randomUUID().toString());
item.put("CREATE_ID", SessionUtil.getCode()); item.put("CREATE_ID", SessionUtil.getCode());
item.put("CREATE_TIME", SessionUtil.getCurrenttime()); 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("MANAGE_ID", entity.get("UUID"));
item.put("UPDATE_TIME", SessionUtil.getCurrenttime()); item.put("UPDATE_TIME", SessionUtil.getCurrenttime());
item.put("SORT_NUM", i); item.put("SORT_NUM", i);
...@@ -106,7 +106,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -106,7 +106,7 @@ public class VoteBusinessImpl implements VoteBusiness {
itemmap.put("VOTE_TIME", SessionUtil.getCurrenttime()); itemmap.put("VOTE_TIME", SessionUtil.getCurrenttime());
itemmap.put("CREATE_ID", SessionUtil.getCode()); itemmap.put("CREATE_ID", SessionUtil.getCode());
itemmap.put("CREATE_TIME", SessionUtil.getCurrenttime()); itemmap.put("CREATE_TIME", SessionUtil.getCurrenttime());
itemmap.put("UPDATE_ID", SessionUtil.getEmname()); itemmap.put("UPDATE_ID", SessionUtil.getCode());
itemmap.put("UPDATE_TIME", SessionUtil.getCurrenttime()); itemmap.put("UPDATE_TIME", SessionUtil.getCurrenttime());
// 动态传值插入 // 动态传值插入
List<String> infoListKey = new ArrayList<String>(); List<String> infoListKey = new ArrayList<String>();
...@@ -186,7 +186,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -186,7 +186,7 @@ public class VoteBusinessImpl implements VoteBusiness {
item.put("MANAGE_ID", entity.get("UUID")); item.put("MANAGE_ID", entity.get("UUID"));
item.put("CREATE_ID", SessionUtil.getCode()); item.put("CREATE_ID", SessionUtil.getCode());
item.put("CREATE_TIME", SessionUtil.getCurrenttime()); item.put("CREATE_TIME", SessionUtil.getCurrenttime());
item.put("UPDATE_ID", SessionUtil.getEmname()); item.put("UPDATE_ID", SessionUtil.getCode());
item.put("UPDATE_TIME", SessionUtil.getCurrenttime()); item.put("UPDATE_TIME", SessionUtil.getCurrenttime());
List<String> itemListKey = new ArrayList<String>(); List<String> itemListKey = new ArrayList<String>();
List<Object> itemList = new ArrayList<Object>(); List<Object> itemList = new ArrayList<Object>();
...@@ -218,6 +218,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -218,6 +218,7 @@ public class VoteBusinessImpl implements VoteBusiness {
if (listMoveUuid.size() > 0) { if (listMoveUuid.size() > 0) {
voteDAO.delete_item(listMoveUuid); voteDAO.delete_item(listMoveUuid);
voteDAO.delete_vote_action(listMoveUuid);
} }
} }
...@@ -239,22 +240,7 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -239,22 +240,7 @@ public class VoteBusinessImpl implements VoteBusiness {
public Page<Map<String, Object>> list_vote(int pageNo, int pageSize, Map<String, Object> query) public Page<Map<String, Object>> list_vote(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException { throws BusinessException {
query.put("CREATE_ID", SessionUtil.getCode()); query.put("CREATE_ID", SessionUtil.getCode());
// 计算起始记录 return list_vote_info(pageNo, pageSize, query);
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = voteDAO.list_vote(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_vote(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 @Override
...@@ -262,35 +248,24 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -262,35 +248,24 @@ public class VoteBusinessImpl implements VoteBusiness {
throws BusinessException { throws BusinessException {
// 计算起始记录 // 计算起始记录
query.put("STATUS_FLAG", 1); query.put("STATUS_FLAG", 1);
query.put("USER_ID", SessionUtil.getEmname()); return list_vote_info(pageNo, pageSize, query);
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = voteDAO.list_vote(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_vote(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 @Override
public Page<Map<String, Object>> list_ended(int pageNo, int pageSize, Map<String, Object> query) public Page<Map<String, Object>> list_ended(int pageNo, int pageSize, Map<String, Object> query)
throws BusinessException { throws BusinessException {
query.put("STATUS_FLAG", 2); query.put("STATUS_FLAG", 2);
return list_vote_info(pageNo, pageSize, query);
}
private Page<Map<String, Object>> list_vote_info(int pageNo, int pageSize, Map<String, Object> query) {
// 计算起始记录 // 计算起始记录
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
// 获取列表 // 获取列表
List<Map<String, Object>> items = voteDAO.list_vote(new RowBounds(pageStart, pageSize), query); List<Map<String, Object>> items = voteDAO.list_vote(new RowBounds(pageStart, pageSize), query);
// 获取列表个数 // 获取列表个数
int count = listCount_vote(query); int count = voteDAO.listCount_vote(query);
// 创建分页对象 // 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
...@@ -304,30 +279,14 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -304,30 +279,14 @@ public class VoteBusinessImpl implements VoteBusiness {
@Override @Override
public List<Map<String, Object>> list_vote(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_vote(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "vote" + query); List<Map<String, Object>> list_data = null;
if (list_data == null || list_data.size() == 0) { if (list_data == null || list_data.size() == 0) {
list_data = voteDAO.list_vote(query); list_data = voteDAO.list_vote(query);
CacheKit.put("ehcache10", "vote" + query, list_data);
} }
return list_data; return list_data;
} }
@Override @Override
public int listCount_vote(Map<String, Object> query) throws BusinessException {
return voteDAO.listCount_vote(query);
}
@Override
public int listCount_ongoing(Map<String, Object> query) throws BusinessException {
return voteDAO.listCount_vote(query);
}
@Override
public int listCount_ended(Map<String, Object> query) throws BusinessException {
return voteDAO.listCount_vote(query);
}
@Override
public List<Map<String, Object>> list_ongoing(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_ongoing(Map<String, Object> query) throws BusinessException {
return voteDAO.list_vote(query); return voteDAO.list_vote(query);
...@@ -345,16 +304,16 @@ public class VoteBusinessImpl implements VoteBusiness { ...@@ -345,16 +304,16 @@ public class VoteBusinessImpl implements VoteBusiness {
} }
@Override @Override
public List<Map<String, Object>> list_userchecked(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_userChecked(Map<String, Object> query) throws BusinessException {
return voteDAO.list_userchecked(query); return voteDAO.list_userChecked(query);
} }
@Override @Override
public void update_endvote(Map<String, Object> entity) throws BusinessException { public void update_endVote(Map<String, Object> entity) throws BusinessException {
// 动态传值修改 // 动态传值修改
entity.put("REALLY_END_TIME", new Date()); entity.put("REALLY_END_TIME", new Date());
entity.put("UPDATE_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); entity.put("STATUS_FLAG", 2);
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if (entity.keySet() != null) { if (entity.keySet() != null) {
......
...@@ -9,15 +9,15 @@ import com.gaowj.business.exception.BusinessException; ...@@ -9,15 +9,15 @@ import com.gaowj.business.exception.BusinessException;
public interface voteDAO { public interface voteDAO {
void insert_vote(Map<String,Object> entity) throws BusinessException ; void insert_vote(Map<String, Object> entity) throws BusinessException;
void insert_item(Map<String,Object> itemmap) throws BusinessException ; void insert_item(Map<String, Object> itemmap) throws BusinessException;
void insert_userVote(Map<String,Object> itemmap) throws BusinessException ; void insert_userVote(Map<String, Object> itemmap) throws BusinessException;
void update_vote(Map<String,Object> entity) throws BusinessException ; void update_vote(Map<String, Object> entity) throws BusinessException;
void update_item(Map<String,Object> item) throws BusinessException ; void update_item(Map<String, Object> item) throws BusinessException;
void delete_vote(List<String> list) throws BusinessException; void delete_vote(List<String> list) throws BusinessException;
...@@ -27,15 +27,14 @@ public interface voteDAO { ...@@ -27,15 +27,14 @@ public interface voteDAO {
void delete_item(List<String> list) throws BusinessException; void delete_item(List<String> list) throws BusinessException;
List<Map<String,Object>> list_vote(RowBounds rowbounds, Map<String, Object> query) throws BusinessException ; List<Map<String, Object>> list_vote(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String,Object>> list_vote(Map<String,Object> query) throws BusinessException ; List<Map<String, Object>> list_vote(Map<String, Object> query) throws BusinessException;
int listCount_vote(Map<String, Object> query) throws BusinessException ; int listCount_vote(Map<String, Object> query) throws BusinessException;
List<Map<String,Object>> list_item(Map<String,Object> query) throws BusinessException ; List<Map<String, Object>> list_item(Map<String, Object> query) throws BusinessException;
List<Map<String,Object>> list_userchecked(Map<String,Object> query) throws BusinessException ;
List<Map<String, Object>> list_userChecked(Map<String, Object> query) throws BusinessException;
} }
...@@ -168,7 +168,9 @@ ...@@ -168,7 +168,9 @@
( (
SELECT SELECT
manage.*, manage.*,
SUM( CASE WHEN action.uuid IS NULL THEN 0 ELSE 1 END ) AS vote_count SUM( CASE WHEN action.uuid IS NULL THEN 0
ELSE 1 END ) AS
vote_count
FROM FROM
( SELECT * FROM `vote_manage` ( SELECT * FROM `vote_manage`
<where> <where>
...@@ -201,7 +203,9 @@ ...@@ -201,7 +203,9 @@
( (
SELECT SELECT
manage.*, manage.*,
SUM( CASE WHEN action.uuid IS NULL THEN 0 ELSE 1 END ) AS vote_count SUM( CASE WHEN action.uuid IS NULL
THEN 0 ELSE 1 END ) AS
vote_count
FROM FROM
( SELECT * FROM `vote_manage` ( SELECT * FROM `vote_manage`
<where> <where>
...@@ -234,11 +238,12 @@ ...@@ -234,11 +238,12 @@
order by sort_num ASC order by sort_num ASC
</select> </select>
<select id="list_userchecked" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_userChecked" parameterType="map" resultType="upperCaseKeyMap">
select * select *
from VOTE_MANAGE_ACTION from VOTE_MANAGE_ACTION
where manage_id=#{MANAGE_ID} where manage_id=#{MANAGE_ID}
order by CREATE_TIME ASC order by
CREATE_TIME ASC
</select> </select>
......
...@@ -16,10 +16,7 @@ import net.sf.json.JSONObject; ...@@ -16,10 +16,7 @@ import net.sf.json.JSONObject;
public class actAction extends BasicAction { public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 3380082635300076202L;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
......
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 {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_reply(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);
// 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";
}
}
package com.jw.app.meeting.action;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import com.jw.app.business.MeetingBusiness;
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 = 6796801779614215504L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertMeeting() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
// 新增
business.insert_meeting(entity);
// 操作日志
// sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertMeeting", "" + entity, "增加测试数据", (String) entity.get("UUID"),
(String) entity.get("PARTICIPANTS_NAME"), "meetingdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertCheck_in() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
// 新增
business.insert_check_in(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 更新
*
* @param entity
* @throws BusinessException
*/
public String updateMeeting() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
// 去除不要更新的字段
entity.remove("OPETYPE");
// 修改
entity = QueryParamUtil.StringToDate(entity);
business.update_meeting(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateMeeting", "" + entity, "修改测试数据", (String) entity.get("UUID"),
(String) entity.get("PARTICIPANTS_NAME"), "meetingdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
/**
* 在软删除基础上删除记录
*
* @param entity
* @throws BusinessException
*/
public String deleteMeeting() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.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_meeting(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteMeeting", "" + ListKey, "删除测试数据", deletekey, "多个流水号", "meetingdemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.jw.app.meeting.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.MeetingBusiness;
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 = -3006159112969667743L;
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 {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_meeting(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";
}
public String listCheck_in() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
List<Map<String, Object>> listchecks = business.list_check_in(query);
// listchecks = QueryParamUtil.StringToDate(listchecks);
jsonObject = new JSONObject();
jsonObject.put("listchecks", QueryParamUtil.DateTimeToString(listchecks));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
public String listAll() throws BusinessException {
MeetingBusiness business = BusinessManager.getBusiness(MeetingBusiness.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_meeting(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";
}
}
package com.jw.app.meeting.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 = 6218516603254917664L;
public String meetingTab() throws BusinessException {
return "meetingTab";
}
public String check_inTab() throws BusinessException {
return "check_inTab";
}
public String meetingTabDetail() throws BusinessException {
Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "meetingTabDetail";
}
public String meetingAdvsearch() throws BusinessException {
Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "meetingAdvsearch";
}
public String check_userList() throws BusinessException {
Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "check_userList";
}
}
package com.jw.app.todo.action;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.BeanUtils;
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.jw.app.business.TodoBusiness;
import net.sf.json.JSONObject;
public class actAction extends BasicAction {
private static final long serialVersionUID = -2591076090760872233L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertInfo() throws BusinessException {
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
// 新增
if (entity.get("RECIPIENTS") != null && !"".equals(entity.get("RECIPIENTS"))) {
String recipients=entity.get("RECIPIENTS").toString();
entity.remove("RECIPIENTS");
for(String recipient:recipients.split(",")){
Map<String, Object> entityNew=new HashMap<String, Object>();
entityNew.putAll(entity);
entityNew.put("RECIPIENT", recipient);
business.insert(entityNew);
}
}
// 操作日志
// sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertTodo", "" + entity, "增加系统代办", (String) entity.get("UUID"), (String) entity.get("TITLE"), "todo");
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 更新
*
* @param entity
* @throws BusinessException
*/
public String updateInfo() throws BusinessException {
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
// 去除不要更新的字段
entity.remove("OPETYPE");
// 修改
entity = QueryParamUtil.StringToDate(entity);
business.update(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateTodo", "" + entity, "修改系统代办", (String) entity.get("UUID"), (String) entity.get("TITLE"), "todo");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
/**
* 删除记录
*
* @param entity
* @throws BusinessException
*/
public String deleteInfo() throws BusinessException {
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.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(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteTodo", "" + ListKey, "删除系统代办", deletekey, "多个流水号", "todo");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
public String updateDoState() throws BusinessException {
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
// 去除不要更新的字段
entity.remove("OPETYPE");
// 修改
entity = QueryParamUtil.StringToDate(entity);
entity.put("DO_STATE", 1);
entity.put("DO_TIME", new Date());
business.update(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateDoState", "" + entity, "修改系统代办状态为已办", (String) entity.get("UUID"), (String) entity.get("TITLE"), "todo");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
}
package com.jw.app.todo.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.jw.app.business.TodoBusiness;
import com.jw.app.business.VoteBusiness;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction{
private static final long serialVersionUID = 1829141492939513911L;
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 {
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list(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";
}
}
package com.jw.app.todo.action;
import java.util.Date;
import java.util.Map;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.TodoBusiness;
public class viewAction extends BasicAction {
private static final long serialVersionUID = -6259964352154128000L;
/**
* 普通代办列表页
*
* @return
* @throws BusinessException
* @date 2018-09-05 下午2:03:38
* @author luosz@jfbrother.com
*/
public String todoTab() throws BusinessException {
// 如果用户传过来type属性,也可以定位到对应的流程/oa列表
if ("1".equals(request.getParameter("type")) || "".equals("2".equals(request.getParameter("type")))) {
request.setAttribute("type", request.getParameter("type"));
} else {
request.setAttribute("type", 0);
}
return "todoTab";
}
/**
* 流程代办列表页
*
* @return
* @throws BusinessException
* @date 2018-09-05 下午2:03:47
* @author luosz@jfbrother.com
*/
public String todoProcTab() throws BusinessException {
request.setAttribute("type", 1);
return "todoTab";
}
/**
* Oa代办列表页
*
* @return
* @throws BusinessException
* @date 2018-09-05 下午2:03:56
* @author luosz@jfbrother.com
*/
public String todoOaTab() throws BusinessException {
request.setAttribute("type", 2);
return "todoTab";
}
public String todoTabDetail() throws BusinessException {
Map<String, Object> entity = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
if (SessionUtil.getCode().equals(entity.get("RECIPIENT")) && "0".equals(entity.get("READ_STATE"))) {
// 如果当前登录人为接收人,并且未读,则将状态改为已读,并记录阅读时间
entity.put("READ_STATE", 1);
entity.put("READ_TIME", new Date());
TodoBusiness business = BusinessManager.getBusiness(TodoBusiness.class);
business.update(entity);
}
return "todoTabDetail";
}
}
...@@ -31,28 +31,29 @@ public class actAction extends BasicAction { ...@@ -31,28 +31,29 @@ public class actAction extends BasicAction {
/** /**
* 插入 * 插入
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String insertVote() throws BusinessException { public String insertVote() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject(); jsonObject = new JSONObject();
try { try {
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段 // 去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//新增 // 新增
business.insert_vote(entity); business.insert_vote(entity);
// 操作日志 // 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类) // sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertVote", "" + entity, sysbusiness.insert_logBusiness("insertVote", "" + entity, "增加投票主题", (String) entity.get("UUID"),
"增加投票主题", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "votedemo1"); (String) entity.get("CONTENT"), "votedemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败")); jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
...@@ -63,21 +64,22 @@ public class actAction extends BasicAction { ...@@ -63,21 +64,22 @@ public class actAction extends BasicAction {
/** /**
* 插入用户投票 * 插入用户投票
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String insertUserVote() throws BusinessException { public String insertUserVote() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject(); jsonObject = new JSONObject();
try { try {
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段 // 去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//新增 // 新增
business.insert_userVote(entity); business.insert_userVote(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
...@@ -90,24 +92,25 @@ public class actAction extends BasicAction { ...@@ -90,24 +92,25 @@ public class actAction extends BasicAction {
/** /**
* 更新 * 更新
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String updateVote() throws BusinessException { public String updateVote() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
//去除不要更新的字段 // 去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//修改 // 修改
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
business.update_vote(entity); business.update_vote(entity);
// 操作日志 // 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateVote", "" + entity, sysbusiness.insert_logBusiness("updateVote", "" + entity, "修改投票主题", (String) entity.get("UUID"),
"修改投票主题",(String) entity.get("UUID"), (String) entity.get("CONTENT"),"votedemo1"); (String) entity.get("CONTENT"), "votedemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功")); jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败")); jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
...@@ -118,20 +121,21 @@ public class actAction extends BasicAction { ...@@ -118,20 +121,21 @@ public class actAction extends BasicAction {
/** /**
* 更新 * 更新
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String endVote() throws BusinessException { public String endVote() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
//去除不要更新的字段 // 去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//修改 // 修改
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
business.update_endvote(entity); business.update_endVote(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功")); jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败")); jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
...@@ -142,13 +146,14 @@ public class actAction extends BasicAction { ...@@ -142,13 +146,14 @@ public class actAction extends BasicAction {
/** /**
* 在软删除基础上删除记录 * 在软删除基础上删除记录
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String deleteVote() throws BusinessException { public String deleteVote() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE"); String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey); List<String> ListKey = QueryParamUtil.StringToList(deletekey);
...@@ -156,8 +161,7 @@ public class actAction extends BasicAction { ...@@ -156,8 +161,7 @@ public class actAction extends BasicAction {
business.delete_vote(ListKey); business.delete_vote(ListKey);
// 操作日志 // 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteVote", "" + ListKey, sysbusiness.insert_logBusiness("deleteVote", "" + ListKey, "删除投票主题", deletekey, "多个流水号", "votedemo1");
"删除投票主题", deletekey, "多个流水号","votedemo1");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功")); jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败")); jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
...@@ -166,5 +170,4 @@ public class actAction extends BasicAction { ...@@ -166,5 +170,4 @@ public class actAction extends BasicAction {
return "json"; return "json";
} }
} }
package com.jw.app.vote.action; package com.jw.app.vote.action;
import java.sql.SQLException; import java.sql.SQLException;
import java.text.ParseException; import java.text.ParseException;
import java.util.HashMap; import java.util.HashMap;
...@@ -21,41 +20,48 @@ import com.gaowj.business.util.SessionUtil; ...@@ -21,41 +20,48 @@ import com.gaowj.business.util.SessionUtil;
import com.gaowj.business.util.TestMd5; import com.gaowj.business.util.TestMd5;
import com.gaowj.standard.utils.CacheKit; import com.gaowj.standard.utils.CacheKit;
public class dataAction extends BasicAction{ public class dataAction extends BasicAction {
private static final long serialVersionUID = 1829141492939513911L; private static final long serialVersionUID = 1829141492939513911L;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数 private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页 private int page = 1;// 当前第几页
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
return jsonObject; return jsonObject;
} }
public void setJsonObject(JSONObject jsonObject) { public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject; this.jsonObject = jsonObject;
} }
public int getRows() { public int getRows() {
return rows; return rows;
} }
public void setRows(int rows) { public void setRows(int rows) {
this.rows = rows; this.rows = rows;
} }
public int getPage() { public int getPage() {
return page; return page;
} }
public void setPage(int page) { public void setPage(int page) {
this.page = page; this.page = page;
} }
/** /**
* 分页获取记录 * 分页获取记录
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String list() throws BusinessException { public String list() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_vote(pageNo,pageSize, query); Page<Map<String, Object>> pageRows = business.list_vote(pageNo, 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.DateTimeToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
...@@ -78,10 +84,10 @@ public class dataAction extends BasicAction{ ...@@ -78,10 +84,10 @@ public class dataAction extends BasicAction{
public String list_ongoing() throws BusinessException { public String list_ongoing() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_ongoing(pageNo,pageSize, query); Page<Map<String, Object>> pageRows = business.list_ongoing(pageNo, 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.DateTimeToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
...@@ -104,10 +110,10 @@ public class dataAction extends BasicAction{ ...@@ -104,10 +110,10 @@ public class dataAction extends BasicAction{
public String list_ended() throws BusinessException { public String list_ended() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_ended(pageNo,pageSize, query); Page<Map<String, Object>> pageRows = business.list_ended(pageNo, 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.DateTimeToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
...@@ -130,40 +136,41 @@ public class dataAction extends BasicAction{ ...@@ -130,40 +136,41 @@ public class dataAction extends BasicAction{
/** /**
* 获取所有记录 * 获取所有记录
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String listAll() throws BusinessException { public String listAll() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
try { try {
//表示获取前台表单提交的所有"FIELD_"开始的键值数据,例如FIELD_NAME,FIELD_CODE.... // 表示获取前台表单提交的所有"FIELD_"开始的键值数据,例如FIELD_NAME,FIELD_CODE....
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
//把前端传进来的字符型时间数据例 如DATE_2018-09-09转换成DATE型的时间数据。 // 把前端传进来的字符型时间数据例 如DATE_2018-09-09转换成DATE型的时间数据。
//主要和前端is_entity.FIELD_CREATE_TIME = strToDateObj(is_entity.FIELD_CREATE_TIME)配对使用。 // 主要和前端is_entity.FIELD_CREATE_TIME =
//前端提交前strToDateObj方法会把时间处理成DATE_2018-09-09再提交 // strToDateObj(is_entity.FIELD_CREATE_TIME)配对使用。
// 前端提交前strToDateObj方法会把时间处理成DATE_2018-09-09再提交
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
//session工具 // session工具
String code = SessionUtil.getCode();//当前用户ID String code = SessionUtil.getCode();// 当前用户ID
String emid = SessionUtil.getEmid();//当前用户帐号 String emid = SessionUtil.getEmid();// 当前用户帐号
String emname = SessionUtil.getEmname();//当前用户名称 String emname = SessionUtil.getEmname();// 当前用户名称
String emdepart = SessionUtil.getEmdepart();//当前用户部门id String emdepart = SessionUtil.getEmdepart();// 当前用户部门id
String emdepartname = SessionUtil.getEmdepartname();//当前用户部门名称 String emdepartname = SessionUtil.getEmdepartname();// 当前用户部门名称
String emsex = SessionUtil.getEmsex();//当前用户性别 String emsex = SessionUtil.getEmsex();// 当前用户性别
String loginip = SessionUtil.getLoginip();//当前用户登录IP String loginip = SessionUtil.getLoginip();// 当前用户登录IP
String clientip = SessionUtil.getClientIp();//获取客户端IP String clientip = SessionUtil.getClientIp();// 获取客户端IP
String quanxian = SessionUtil.getQuanxian();//获取当前用户使用模块清单 String quanxian = SessionUtil.getQuanxian();// 获取当前用户使用模块清单
String sessionid = SessionUtil.getSessionid();//获取当前用户sessionID String sessionid = SessionUtil.getSessionid();// 获取当前用户sessionID
String currenttimme = SessionUtil.getCurrenttime();//当前用户本次登录时间 String currenttimme = SessionUtil.getCurrenttime();// 当前用户本次登录时间
String beforetime = SessionUtil.getBeforetime();//当前用户上次登录时间 String beforetime = SessionUtil.getBeforetime();// 当前用户上次登录时间
//配置文件工具 // 配置文件工具
//表示获取src目录下quartz_service.properties文件中主键是login_main_url的值 // 表示获取src目录下quartz_service.properties文件中主键是login_main_url的值
String tt = PropUtil.getValue("login_main_url", "quartz_service", ""); String tt = PropUtil.getValue("login_main_url", "quartz_service", "");
List<Map<String, Object>> listData = business.list_vote(query); List<Map<String, Object>> listData = business.list_vote(query);
int listDataCount = listData.size(); int listDataCount = listData.size();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
...@@ -187,9 +194,9 @@ public class dataAction extends BasicAction{ ...@@ -187,9 +194,9 @@ public class dataAction extends BasicAction{
public String listItem() throws BusinessException { public String listItem() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
List<Map<String, Object>> listItems=business.list_item(query); List<Map<String, Object>> listItems = business.list_item(query);
jsonObject = new JSONObject(); jsonObject = new JSONObject();
jsonObject.put("listItems", listItems); jsonObject.put("listItems", listItems);
} catch (Exception e) { } catch (Exception e) {
...@@ -201,9 +208,9 @@ public class dataAction extends BasicAction{ ...@@ -201,9 +208,9 @@ public class dataAction extends BasicAction{
public String listUserChecked() throws BusinessException { public String listUserChecked() throws BusinessException {
VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class); VoteBusiness business = BusinessManager.getBusiness(VoteBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
List<Map<String, Object>> listusercheckeds=business.list_userchecked(query); List<Map<String, Object>> listusercheckeds = business.list_userChecked(query);
jsonObject = new JSONObject(); jsonObject = new JSONObject();
jsonObject.put("listusercheckeds", listusercheckeds); jsonObject.put("listusercheckeds", listusercheckeds);
} catch (Exception e) { } catch (Exception e) {
......
package com.jw.app.vote.action; package com.jw.app.vote.action;
import java.util.Map; import java.util.Map;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
...@@ -10,32 +9,32 @@ import com.gaowj.business.util.RequestUtils; ...@@ -10,32 +9,32 @@ import com.gaowj.business.util.RequestUtils;
public class viewAction extends BasicAction { public class viewAction extends BasicAction {
private static final long serialVersionUID = -6259964352154128000L; private static final long serialVersionUID = -6259964352154128000L;
public String ongoingVoteTab() throws BusinessException{ public String ongoingVoteTab() throws BusinessException {
return "ongoingVoteTab"; return "ongoingVoteTab";
} }
public String endedVoteTab() throws BusinessException{ public String endedVoteTab() throws BusinessException {
return "endedVoteTab"; return "endedVoteTab";
} }
public String voteTab() throws BusinessException{ public String voteTab() throws BusinessException {
return "voteTab"; return "voteTab";
} }
public String userVoteTabDetail() throws BusinessException{ public String userVoteTabDetail() throws BusinessException {
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query); request.setAttribute("is_row", query);
return "userVoteTabDetail"; return "userVoteTabDetail";
} }
public String voteTabDetail() throws BusinessException{ public String voteTabDetail() throws BusinessException {
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query); request.setAttribute("is_row", query);
return "voteTabDetail"; return "voteTabDetail";
} }
public String voteAdvsearch() throws BusinessException{ public String voteAdvsearch() throws BusinessException {
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query); request.setAttribute("is_row", query);
return "voteAdvsearch"; return "voteAdvsearch";
} }
......
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