Commit e4a89b10 by 罗绍泽

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

# Conflicts:
#	WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
#	src/struts-ext.xml
parents 30477210 e981d246
......@@ -11,7 +11,6 @@
<value>classpath:com/jw/app/business/portal/apps/appsDAO.xml</value>
<value>classpath:com/jw/app/business/portal/content/ContentDAO.xml</value>
<value>classpath:com/jw/app/business/table/TableDAO.xml</value>
<value>classpath:com/jw/app/business/portlet/PortletDAO.xml</value>
<value>classpath:com/jw/app/business/apps/AppsDAO.xml</value>
<value>classpath:com/jw/app/business/store/storeDAO.xml</value>
......@@ -24,6 +23,9 @@
<value>classpath:com/jw/app/business/portal/role/appsRoleDAO.xml</value>
<value>classpath:com/jw/app/business/vote/voteDAO.xml</value>
<value>classpath:com/jw/app/business/attendance/attendanceDAO.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/notice/noticeDAO.xml</value>
</list>
</property>
</bean>
......@@ -90,6 +92,18 @@
<property name="mapperInterface" value="com.jw.app.business.attendance.attendanceDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="bgmkDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.bgmk.bgmkDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="friendlinkDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.friendlink.friendlinkDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="noticeDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.notice.noticeDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<!-- BusinessInterFace -->
<bean id="PortletBusiness"
class="com.jw.app.business.portlet.PortletBusinessImpl">
......@@ -147,6 +161,19 @@
<property name="attendanceDAO" ref="attendanceDAO"/>
</bean>
<bean id="BgmkBusiness"
class="com.jw.app.business.bgmk.BgmkBusinessImpl">
<property name="bgmkDAO" ref="bgmkDAO"/>
</bean>
<bean id="FriendLinkBusiness"
class="com.jw.app.business.friendlink.FriendLinkBusinessImpl">
<property name="friendlinkDAO" ref="friendlinkDAO"/>
</bean>
<bean id="NoticeBusiness"
class="com.jw.app.business.notice.NoticeBusinessImpl">
<property name="noticeDAO" ref="noticeDAO"/>
</bean>
<!-- DAO -->
<bean id="portletDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.portlet.PortletDAO"/>
......
......@@ -69,7 +69,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://cas.jfbrother.com:9003/cas-jfsso/login</param-value><!-- cas 服务器登录 地址 http://IP:PORT/CasWebProName/login -->
<param-value>http://cas.jfbrother.com/cas-jfsso/login</param-value><!-- cas 服务器登录 地址 http://IP:PORT/CasWebProName/login -->
</init-param>
<init-param>
<!-- 这里的server是服务端的IP -->
......@@ -89,7 +89,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>http://cas.jfbrother.com:9003/cas-jfsso</param-value><!-- cas 服务器地址 http://IP:PORT/CasWebProName -->
<param-value>http://cas.jfbrother.com/cas-jfsso</param-value><!-- cas 服务器地址 http://IP:PORT/CasWebProName -->
</init-param>
<init-param>
<param-name>serverName</param-name>
......
......@@ -2,6 +2,7 @@
*
*/
function getbaidu(contentid){
UE.getEditor(contentid).destroy();
var ue = UE.getEditor(contentid,{ //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars:[ [
// 'fullscreen',
......
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="bgmkTab">
<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">
<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>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="advsearch" style="overflow:auto;"></div>
<div id="uploadcommon" 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/bgmk/js/bgmkModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/bgmk/js/bgmkEmployeeTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="bgmkTab">
<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="bgmkTab_searchForm" style="float:left">
姓名: <input class="easyui-textbox" id="FIELD_USER_NAME" name="FIELD_USER_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>
<div id="advsearch" style="overflow:auto;"></div>
<div id="uploadcommon" 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/bgmk/js/bgmkModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/bgmk/js/bgmkTab.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="USER_TYPE" data-options="required:true" name="FIELD_USER_TYPE" style="width:150px " value="${is_row.USER_TYPE}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>工作内容:</span>
</td>
<td style="height:150px" >
<input class="easyui-textbox" data-options="multiline:true ,required:true" id="CONTENT" name="FIELD_CONTENT" style="width:400px ; height:140px" value="${is_row.CONTENT}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>工作用时:</span>
</td>
<td>
<input class="easyui-numberspinner" data-options="min:0,max:10 ,required:true" id="GZYS" name="FIELD_GZYS" style="width:150px" value="${is_row.GZYS}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>报工时间:</span>
</td>
<td>
<input class="easyui-datebox" data-options="min:0,max:10 ,required:true" id="BG_TIME" name="FIELD_BG_TIME" style="width:150px" value="${is_row.BG_TIME}"/>
</td>
</tr>
</table>
</form>
\ No newline at end of file
<%@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="USER_TYPE" data-options="required:true" name="FIELD_USER_TYPE" style="width:150px " value="${is_row.USER_TYPE}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>工作内容:</span>
</td>
<td style="height:150px" >
<input class="easyui-textbox" data-options="multiline:true ,required:true" id="CONTENT" name="FIELD_CONTENT" style="width:400px ; height:140px" value="${is_row.CONTENT}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>工作用时:</span>
</td>
<td>
<input class="easyui-numberspinner" data-options="min:0,max:10 ,required:true" id="GZYS" name="FIELD_GZYS" style="width:150px" value="${is_row.GZYS}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>报工时间:</span>
</td>
<td>
<input class="easyui-datebox" data-options="min:0,max:10 ,required:true" id="BG_TIME" name="FIELD_BG_TIME" style="width:150px" value="${is_row.BG_TIME}"/>
</td>
</tr>
</table>
</form>
\ No newline at end of file
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载人员类型数据
var v_typequery = {};
v_typequery.FIELD_tableName = "DM_USER_TYPE";
var v_typequery_data = standardModel.dataAction.listAllCache(v_typequery);
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title="报工模块&nbsp;&nbsp;";
var is_column = [ [
{field : 'CONTENT',title : '工作内容',width : 300,align : 'center'},
{field : 'BG_TIME',title : '报工时间',width : 80,align : 'center'},
{field : 'GZYS',title : '工作用时',width : 80,align : 'center'},
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
reportgrid("list",ls_title,gaowj.WEB_APP_NAME + "/bgmkData_listEmployee",queryData,is_column,60,80);
/****/
/****/
/**
* 序号:4
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("bgmkView_bgmkTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
$('#USER_TYPE').combobox({
data : v_typequery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
}
//保存
function insertData(is_entity){
var v_result = bgmkModule.bgmkActAction.insertBgmk(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("bgmkView_bgmkTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
$('#USER_TYPE').combobox({
data : v_typequery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
}
//保存
function updateData(is_entity){
v_result = bgmkModule.bgmkActAction.updateBgmk(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:5
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#bgmkTab_searchForm")[0].reset();
}
/****/
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = bgmkModule.bgmkActAction.deleteBgmk(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = bgmkModule.bgmkActAction.deleteBgmk(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
//此乃本模块与后台交互的方法接口部分
var bgmkModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
bgmkModule.prototype = BusinessObject;
//插入报工数据
bgmkModule.prototype.insertBgmk = function(){};
//修改报工数据
bgmkModule.prototype.updateBgmk = function(){};
//删除报工数据
bgmkModule.prototype.deleteBgmk = function(){};
//报工数据_分页
bgmkModule.prototype.list = function(){};
//报工所有数据
bgmkModule.prototype.listAll = function(){};
//创建一个数据操作对象,然后再后续使用
bgmkModule.bgmkActAction = new bgmkModule("json").delegate("bgmkAct");
//创建一个数据获取对象,然后再后续使用
bgmkModule.bgmkDataAction = new bgmkModule("json").delegate("bgmkData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载人员类型数据
var v_typequery = {};
v_typequery.FIELD_tableName = "DM_USER_TYPE";
var v_typequery_data = standardModel.dataAction.listAllCache(v_typequery);
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title="报工模块&nbsp;&nbsp;";
var is_column = [ [
{field : 'USER_NAME',title : '人员姓名',width : 100,align : 'center'},
{field : 'DEPT_NAME',title : '人员部门',width : 80,align : 'center'},
{field : 'CONTENT',title : '工作内容',width : 300,align : 'center'},
{field : 'BG_TIME',title : '报工时间',width : 80,align : 'center'},
{field : 'GZYS',title : '工作用时',width : 80,align : 'center'},
{field : 'USER_TYPE',title : '人员类型',width : 100,align : 'center',
formatter : function(value) {
return getCodeName(v_typequery_data.rowSet, value);
}
},
{field : 'CREATOR_ID',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 100,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/bgmkData_list",queryData,is_column,60,80);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function formatMenu(value, data,index) {
var returnData="";
return returnData
+ "<span class=\"icon-ext-moremenu\" style=\"padding-left:20px;*width:20px;\"></span>"
+ "<span data-p1="+index+" class=\"easyui-tooltip\" style=\"color:blue;cursor:pointer;\">更多</span>";
}
//上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"editRow('"
+ index + "')\">编辑</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a> ";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 2;
return is_menu_count;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("bgmkView_bgmkTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
$('#USER_TYPE').combobox({
data : v_typequery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
}
//保存
function insertData(is_entity){
var v_result = bgmkModule.bgmkActAction.insertBgmk(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("bgmkView_bgmkTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
$('#USER_TYPE').combobox({
data : v_typequery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
}
//保存
function updateData(is_entity){
v_result = bgmkModule.bgmkActAction.updateBgmk(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = bgmkModule.bgmkActAction.deleteBgmk(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = bgmkModule.bgmkActAction.deleteBgmk(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#bgmkTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#bgmkTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab">
<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="friendlinkTab_searchForm" style="float:left">
标题: <input class="easyui-textbox" id="FIELD_TITLE" name="FIELD_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="/jfV5portal/lib/plug/jqueryColour/spectrum.js"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/friendlink/js/friendlinkModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/friendlink/js/friendlinkTab.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_USER_ID" id="USER_ID" value="${is_row.USER_ID}" />
<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" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>链接:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" data-options="required:true" id="URL" name="FIELD_URL" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>排序:</span>
</td>
<td style="width: 85%">
<input class="easyui-numberspinner" data-options="min:0,max:8 ,required:true" id="SORT" name="FIELD_SORT" style="width:150px" />
</td>
</tr>
</table>
</form>
\ No newline at end of file
//此乃本模块与后台交互的方法接口部分
var friendlinkModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
friendlinkModule.prototype = BusinessObject;
//获取当前登录人的友情链接信息
friendlinkModule.prototype.listFriendLinkInfo = function(){};
//保存当前登录人的友情链接信息
friendlinkModule.prototype.saveFriendLinkInfo = function(){};
//删除当前登录人的友情链接信息
friendlinkModule.prototype.removeFriendLinkInfo = function(){};
//创建一个数据操作对象,然后再后续使用
friendlinkModule.act = new friendlinkModule("json").delegate("friendlinkAct");
//创建一个数据获取对象,然后再后续使用
friendlinkModule.data = new friendlinkModule("json").delegate("friendlinkData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/****/
/**
* 序号:2
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title="友情链接";
var is_column = [ [
{field : 'TITLE',title : '标题',width : 380,align : 'left'},
{field : 'URL',title : '链接',width : 380,align : 'left'},
{field : 'SORT',title : '排序',width : 50,align : 'left'},
{field : 'CREATE_ID',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 120,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/friendlinkData_listFriendLinkInfo",queryData,is_column,60,80);
/****/
/**
* 序号:3
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 2;
return is_menu_count;
}
/****/
/**
* 序号:4
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("friendlinkView_friendlinkTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
}
//保存
function insertData(is_entity){
var v_result = friendlinkModule.act.saveFriendLinkInfo(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("friendlinkView_friendlinkTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
$("#inputForm").form('load',get_FIELD(is_row));
}
//保存
function updateData(is_entity){
var v_result = friendlinkModule.act.saveFriendLinkInfo(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.UUID = code;
var v_result = friendlinkModule.act.removeFriendLinkInfo(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.UUID = code;
var v_result = friendlinkModule.act.removeFriendLinkInfo(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#friendlinkTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#friendlinkTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
//此乃本模块与后台交互的方法接口部分
var noticeModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
noticeModule.prototype = BusinessObject;
//获取当前登录人的友情链接信息
noticeModule.prototype.listNoticeInfo = function(){};
//保存当前登录人的友情链接信息
noticeModule.prototype.saveNoticeInfo = function(){};
//删除当前登录人的友情链接信息
noticeModule.prototype.removeNoticeInfo = function(){};
//创建一个数据操作对象,然后再后续使用
noticeModule.act = new noticeModule("json").delegate("noticeAct");
//创建一个数据获取对象,然后再后续使用
noticeModule.data = new noticeModule("json").delegate("noticeData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/****/
/**
* 序号:2
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title="友情链接";
var is_column = [ [
{field : 'TITLE',title : '标题',width : 380,align : 'center'},
{field : 'RELEASE_TIME',title : '发布时间',width : 120,align : 'center'},
{field : 'CREATE_ID',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 120,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
}
//展示列表
datagrid("list",ls_title,gaowj.WEB_APP_NAME + "/noticeData_listNoticeInfo",queryData,is_column,60,80);
/****/
/**
* 序号:3
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间: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>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 2;
return is_menu_count;
}
/****/
/**
* 序号:4
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("noticeView_noticeTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
//UE.getEditor("TITLE");
//UE.getEditor('TEXT').destroy();
//var ue = UE.getEditor('TEXT');
//getbaidu
//console.log(ue)
getbaidu('TEXT');
}
//保存
function insertData(is_entity){
var v_result = noticeModule.act.saveNoticeInfo(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("noticeView_noticeTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
getbaidu('TEXT');
$("#inputForm").form('load',get_FIELD(is_row));
}
//保存
function updateData(is_entity){
var v_result = noticeModule.act.saveNoticeInfo(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.UUID = code;
var v_result = noticeModule.act.removeNoticeInfo(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.UUID = code;
var v_result = noticeModule.act.removeNoticeInfo(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#noticeTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#noticeTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab">
<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="noticeTab_searchForm" style="float:left">
标题: <input class="easyui-textbox" id="FIELD_TITLE" name="FIELD_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/common/js/baiduediter.js"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/notice/js/noticeModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/notice/js/noticeTab.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_USER_ID" id="USER_ID" value="${is_row.USER_ID}" />
<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" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>正文:</span>
</td>
<td style="width: 85%">
<script id="TEXT" name="FIELD_TEXT" type="text/plain">
</script>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>发布时间:</span>
</td>
<td style="width: 85%">
<input class="easyui-datetimebox" data-options="required:true" id="RELEASE_TIME" name="FIELD_RELEASE_TIME" style="width:150px" />
</td>
</tr>
</table>
</form>
\ No newline at end of file
package com.jw.app.bgmk;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONObject;
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;
import com.jw.app.business.BgmkBusiness;
public class actAction extends BasicAction {
/**
*
*/
/**
*
*/
private static final long serialVersionUID = -2059356249335526616L;
/**
*
*/
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
* @param entity
* @throws BusinessException
*/
public String insertBgmk() throws BusinessException {
BgmkBusiness business = BusinessManager.getBusiness(BgmkBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段
entity.remove("OPETYPE");
//新增
business.insert_bgmk(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertBgmk", "" + entity,
"增加报工数据", (String) entity.get("UUID"), (String) entity.get("NAME"), "bgmkdemo1");
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
/**
* 更新
* @param entity
* @throws BusinessException
*/
public String updateBgmk() throws BusinessException {
BgmkBusiness business = BusinessManager.getBusiness(BgmkBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
//去除不要更新的字段
entity.remove("OPETYPE");
//修改
entity = QueryParamUtil.StringToDate(entity);
business.update_bgmk(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateBgmk", "" + entity,
"修改报工数据",(String) entity.get("UUID"), (String) entity.get("NAME"),"bgmkdemo1");
//
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace();
}
return "json";
}
/**
* 在软删除基础上删除记录
* @param entity
* @throws BusinessException
*/
public String deleteBgmk() throws BusinessException {
BgmkBusiness business = BusinessManager.getBusiness(BgmkBusiness.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_bgmk(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteBgmk", "" + ListKey,
"删除报工数据", deletekey, "多个流水号","bgmkdemo1");
//
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.jw.app.bgmk;
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.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;
import com.jw.app.business.BgmkBusiness;
public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 8400799803941083524L;
/**
*
*/
private static final String console = null;
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 {
BgmkBusiness business = BusinessManager.getBusiness(BgmkBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_bgmk(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(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 listEmployee() throws BusinessException {
BgmkBusiness business = BusinessManager.getBusiness(BgmkBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_bgmk_employee(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(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.bgmk;
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 = 847847227972540472L;
/**
*
*/
public String bgmkTab() throws BusinessException{
return "bgmkTab";
}
public String bgmkTabDetail() throws BusinessException{
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "bgmkTabDetail";
}
public String bgmkEmployeeTab() throws BusinessException{
return "bgmkEmployeeTab";
}
public String bgmkEmployeeTabDetail() throws BusinessException{
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "bgmkTabEmployeeDetail";
}
public String bgmkAdvsearch() throws BusinessException{
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "bgmkAdvsearch";
}
}
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 BgmkBusiness {
/**
* 插入
* @param entity
* @throws BusinessException
*/
void insert_bgmk(Map<String,Object> entity) throws BusinessException ;
/**
* 更新
* @param entity
* @throws BusinessException
*/
void update_bgmk(Map<String,Object> entity) throws BusinessException ;
/**
* 删除记录
* @param entity
* @throws BusinessException
*/
void delete_bgmk(List<String> list)throws BusinessException;
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_bgmk(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_bgmk(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_bgmk(Map<String, Object> query) throws BusinessException ;
//个人报工
Page<Map<String, Object>> list_bgmk_employee(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_bgmk_employee(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException ;
}
package com.jw.app.business;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface FriendLinkBusiness {
Page<Map<String, Object>> list_friendlink(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
Map<String, Object> save_friendlink(Map<String, Object> info) throws BusinessException;
void delete_friendlink(String uuid) throws BusinessException;
}
package com.jw.app.business;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface NoticeBusiness {
Page<Map<String, Object>> list_notice(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
Map<String, Object> save_notice(Map<String, Object> info) throws BusinessException;
void delete_notice(String uuid) throws BusinessException;
}
package com.jw.app.business.bgmk;
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.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
import com.gaowj.standard.utils.CacheKit;
import com.jw.app.business.BgmkBusiness;
public class BgmkBusinessImpl implements BgmkBusiness {
private bgmkDAO bgmkDAO;
public bgmkDAO getBgmkDAO() {
return bgmkDAO;
}
public void setBgmkDAO(bgmkDAO bgmkDAO) {
this.bgmkDAO = bgmkDAO;
}
@Override
public void insert_bgmk(Map<String, Object> entity) throws BusinessException {
if(entity.get("UUID")==null){
entity.put("UUID", java.util.UUID.randomUUID().toString());
}
if(entity.get("CREATE_TIME")==null){
entity.put("CREATE_TIME", new Date());
}
if(entity.get("USER_NAME")==null){
entity.put("USER_NAME", SessionUtil.getEmname());
}
if(entity.get("CREATOR_ID")==null){
entity.put("CREATOR_ID", SessionUtil.getCode());
}
if(entity.get("DEPT_NAME")==null){
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<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);
// 插入
bgmkDAO.insert_bgmk(entity);
}
}
@Override
public void update_bgmk(Map<String, Object> entity) throws BusinessException {
//动态传值修改
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);
//
bgmkDAO.update_bgmk(entity);
}
}
@Override
public void delete_bgmk(List<String> list) throws BusinessException {
bgmkDAO.delete_bgmk(list);
}
//管理类报工
@Override
public Page<Map<String, Object>> list_bgmk(int pageNo, int pageSize,Map<String, Object> query) throws BusinessException {
//计算起始记录
int pageStart = (pageNo - 1) * pageSize;
//获取列表
List<Map<String, Object>> items = bgmkDAO.list_bgmk(new RowBounds(pageStart, pageSize), query);
//获取列表个数
int count = listCount_bgmk(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_bgmk(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk"+query);
if(list_data==null || list_data.size()==0){
list_data=bgmkDAO.list_bgmk(query);
CacheKit.put("ehcache10", "bgmk"+query, list_data);
}
return list_data;
}
@Override
public int listCount_bgmk(Map<String, Object> query) throws BusinessException {
return bgmkDAO.listCount_bgmk(query);
}
//个人报工
@Override
public Page<Map<String, Object>> list_bgmk_employee(int pageNo, int pageSize,Map<String, Object> query) throws BusinessException {
query.put("USER_NAME", SessionUtil.getEmid());
//计算起始记录
int pageStart = (pageNo - 1) * pageSize;
//获取列表
List<Map<String, Object>> items = bgmkDAO.list_bgmk_employee(new RowBounds(pageStart, pageSize), query);
//获取列表个数
int count = listCount_bgmk_employee(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_bgmk_employee(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> list_data = CacheKit.get("ehcache10", "bgmk_employee"+query);
if(list_data==null || list_data.size()==0){
list_data=bgmkDAO.list_bgmk_employee(query);
CacheKit.put("ehcache10", "bgmk_employee"+query, list_data);
}
return list_data;
}
@Override
public int listCount_bgmk_employee(Map<String, Object> query) throws BusinessException {
return bgmkDAO.listCount_bgmk_employee(query);
}
}
package com.jw.app.business.bgmk;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface bgmkDAO {
void insert_bgmk(Map<String,Object> entity) throws BusinessException ;
void update_bgmk(Map<String,Object> entity) throws BusinessException ;
void delete_bgmk(List<String> list) throws BusinessException;
List<Map<String,Object>> list_bgmk(RowBounds rowbounds, Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_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 ;
}
<?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.bgmk.bgmkDAO">
<insert id="insert_bgmk" parameterType="map">
insert into C_T_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 C_T_WORK_BG 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_bgmk" parameterType="list">
<![CDATA[
delete from C_T_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 C_T_WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
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
</select>
<select id="listCount_bgmk" parameterType="map" resultType="int">
<![CDATA[
select count(*) c from C_T_WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
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 id="list_bgmk_employee" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from C_T_WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
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
</select>
<select id="listCount_bgmk_employee" parameterType="map" resultType="int">
<![CDATA[
select count(*) c from C_T_WORK_BG f where 1=1
]]>
<if test="UUID != null and UUID != ''">
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>
</mapper>
\ No newline at end of file
package com.jw.app.business.friendlink;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.FriendLinkBusiness;
import com.jw.app.business.utils.DateTools;
public class FriendLinkBusinessImpl implements FriendLinkBusiness {
private friendlinkDAO friendlinkDAO;
public friendlinkDAO getFriendlinkDAO() {
return friendlinkDAO;
}
public void setFriendlinkDAO(friendlinkDAO friendlinkDAO) {
this.friendlinkDAO = friendlinkDAO;
}
@Override
public Page<Map<String, Object>> list_friendlink(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
if (query.get("USER_ID") == null || "".equals(query.get("USER_ID"))) {
// 默认查询当前登陆人
query.put("USER_ID", SessionUtil.getEmid());
}
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
List<Map<String, Object>> items = friendlinkDAO.list_friendlink(new RowBounds(pageStart, pageSize), query);
int count = friendlinkDAO.list_count_friendlink(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 Map<String, Object> save_friendlink(Map<String, Object> info) throws BusinessException {
if (info.get("UUID") == null || "".equals(info.get("UUID"))) {
//判断目前总条数是不是<=8条
Map<String, Object> query=new HashMap<String, Object>();
query.put("CREATE_ID", SessionUtil.getEmid());
int count = friendlinkDAO.list_count_friendlink(query);
if(count>=8){
info.put("ERROR", "-1");
}
// 表示新增
info.put("UUID", UUID.randomUUID().toString());
if (info.get("USER_ID") == null || "".equals(info.get("USER_ID"))) {
// 如果没有传USER_ID过来,则使用当前登录人id
info.put("USER_ID", SessionUtil.getEmid());
}
info.put("CREATE_ID", SessionUtil.getEmid());
info.put("CREATE_TIME", new Date());
info.put("UPDATE_ID", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
friendlinkDAO.insert_friendlink(info);
} else {
// 表示更新
info.put("UPDATE_USER", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
// 防止修改记录的所属人
info.remove("USER_ID");
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
if ("UUID".equals(k)) {
continue;
}
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
friendlinkDAO.update_friendlink(info);
}
return info;
}
@Override
public void delete_friendlink(String uuid) throws BusinessException {
for (String u : uuid.split(",")) {
friendlinkDAO.delete_friendlink(u);
}
}
}
package com.jw.app.business.friendlink;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface friendlinkDAO {
List<Map<String, Object>> list_friendlink(Map<String, Object> query) throws BusinessException;
int list_count_friendlink(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_friendlink(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
void insert_friendlink(Map<String, Object> info) throws BusinessException;
void update_friendlink(Map<String, Object> info) throws BusinessException;
void delete_friendlink(String uuid) 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.friendlink.friendlinkDAO">
<sql id="where">
<where>
<trim prefixOverrides="AND |OR">
<if test="TITLE != null and TITLE != ''">
and t.TITLE like '%${TITLE}%'
</if>
<if test="URL != null and URL != ''">
and t.URL = #{URL}
</if>
<if test="SORT != null and SORT != ''">
and t.SORT = #{SORT}
</if>
<if test="USER_ID != null and USER_ID != ''">
and t.USER_ID = #{USER_ID}
</if>
</trim>
</where>
</sql>
<select id="list_friendlink" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select * from b_t_ufp_friendlink t
]]>
<include refid="where" />
ORDER BY t.sort
</select>
<select id="list_count_friendlink" parameterType="map" resultType="int">
<![CDATA[
select count(*) from b_t_ufp_friendlink t
]]>
<include refid="where" />
ORDER BY t.sort
</select>
<insert id="insert_friendlink" parameterType="java.util.List">
insert into b_t_ufp_friendlink(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_friendlink" parameterType="java.util.List">
update b_t_ufp_friendlink set
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete id="delete_friendlink" parameterType="String">
delete from b_t_ufp_friendlink where UUID=#{uuid}
</delete>
</mapper>
\ No newline at end of file
package com.jw.app.business.notice;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.NoticeBusiness;
import com.jw.app.business.utils.DateTools;
import groovy.sql.InParameter;
public class NoticeBusinessImpl implements NoticeBusiness {
private noticeDAO noticeDAO;
public noticeDAO getNoticeDAO() {
return noticeDAO;
}
public void setNoticeDAO(noticeDAO noticeDAO) {
this.noticeDAO = noticeDAO;
}
@Override
public Page<Map<String, Object>> list_notice(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
if (query.get("USER_ID") == null || "".equals(query.get("USER_ID"))) {
// 默认查询当前登陆人
query.put("USER_ID", SessionUtil.getEmid());
}
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
List<Map<String, Object>> items = noticeDAO.list_notice(new RowBounds(pageStart, pageSize), query);
int count = noticeDAO.list_count_notice(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 Map<String, Object> save_notice(Map<String, Object> info) throws BusinessException {
if (info.get("UUID") == null || "".equals(info.get("UUID"))) {
// 表示新增
info.put("UUID", UUID.randomUUID().toString());
if (info.get("USER_ID") == null || "".equals(info.get("USER_ID"))) {
// 如果没有传USER_ID过来,则使用当前登录人id
info.put("USER_ID", SessionUtil.getEmid());
}
info.put("CREATE_ID", SessionUtil.getEmid());
info.put("CREATE_TIME", new Date());
info.put("UPDATE_ID", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
noticeDAO.insert_notice(info);
} else {
// 表示更新
info.put("UPDATE_USER", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
// 防止修改记录的所属人
info.remove("USER_ID");
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
if ("UUID".equals(k)) {
continue;
}
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
noticeDAO.update_notice(info);
}
return info;
}
@Override
public void delete_notice(String uuid) throws BusinessException {
for (String u : uuid.split(",")) {
noticeDAO.delete_notice(u);
}
}
}
package com.jw.app.business.notice;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface noticeDAO {
List<Map<String, Object>> list_notice(Map<String, Object> query) throws BusinessException;
int list_count_notice(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_notice(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
void insert_notice(Map<String, Object> info) throws BusinessException;
void update_notice(Map<String, Object> info) throws BusinessException;
void delete_notice(String uuid) 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.notice.noticeDAO">
<sql id="where">
<where>
<trim prefixOverrides="AND |OR">
<if test="TITLE != null and TITLE != ''">
and t.TITLE like '%${TITLE}%'
</if>
<if test="TEXT != null and TEXT != ''">
and t.TEXT = #{TEXT}
</if>
<if test="RELEASE_TIME != null and RELEASE_TIME != ''">
and t.RELEASE_TIME = #{RELEASE_TIME}
</if>
<if test="USER_ID != null and USER_ID != ''">
and t.USER_ID = #{USER_ID}
</if>
</trim>
</where>
</sql>
<select id="list_notice" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select * from b_t_ufp_notice t
]]>
<include refid="where" />
ORDER BY t.CREATE_TIME
</select>
<select id="list_count_notice" parameterType="map" resultType="int">
<![CDATA[
select count(*) from b_t_ufp_notice t
]]>
<include refid="where" />
ORDER BY t.CREATE_TIME
</select>
<insert id="insert_notice" parameterType="java.util.List">
insert into b_t_ufp_notice(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_notice" parameterType="java.util.List">
update b_t_ufp_notice set
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete id="delete_notice" parameterType="String">
delete from b_t_ufp_notice where UUID=#{uuid}
</delete>
</mapper>
\ No newline at end of file
package com.jw.app.friendlink.action;
import java.util.HashMap;
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.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.jw.app.business.CalendarBusiness;
import com.jw.app.business.FriendLinkBusiness;
import com.jw.app.business.utils.Status;
import net.sf.json.JSONObject;
public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 3380082635300076202L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 保存友情链接信息
*
* @return
* @throws BusinessException
*/
public String saveFriendLinkInfo() throws BusinessException {
Map<String, Object> info = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
FriendLinkBusiness business = BusinessManager.getBusiness(FriendLinkBusiness.class);
try {
info = QueryParamUtil.StringToDate(info);
info.remove("OPETYPE");
info=business.save_friendlink(info);
jsonObject.putAll(Status.getStatus(Status.UPDATE_OK));
} catch (Exception e) {
if("-1".equals(info.get("ERROR"))){
Map<String, Object> map=new HashMap<String, Object>();
map.put("VALUE", "保存失败,快速链接不得超过8条!");
jsonObject.putAll(map);
}else{
jsonObject.putAll(Status.getStatus(Status.UPDATE_ERR));
}
}
return "json";
}
/**
* 删除友情链接信息
*
* @return
* @throws BusinessException
*/
public String removeFriendLinkInfo() throws BusinessException {
FriendLinkBusiness business = BusinessManager.getBusiness(FriendLinkBusiness.class);
try {
business.delete_friendlink(RequestUtils.getString(request, "UUID"));
jsonObject.putAll(Status.getStatus(Status.DELETE_OK));
} catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.DELETE_ERR));
}
return "json";
}
}
package com.jw.app.friendlink.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.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.jw.app.business.CalendarBusiness;
import com.jw.app.business.FriendLinkBusiness;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = -3043201121825378378L;
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
rows = getPageSize();
return rows;
}
public void setRows(int rows) {
setPageSize(rows);
this.rows = getPageSize();
}
public int getPage() {
page = getPageNo();
return page;
}
public void setPage(int page) {
setPageNo(page);
this.page = getPageNo();
}
/**
* 获取友情链接列表
*
* @return
* @throws BusinessException
*/
public String listFriendLinkInfo() throws BusinessException {
FriendLinkBusiness business = BusinessManager.getBusiness(FriendLinkBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageData = business.list_friendlink(pageNo,pageSize,query);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(pageData.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageData.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.friendlink.action;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 3972629140430315958L;
public String friendlinkTab() throws BusinessException{
return "friendlinkTab";
}
public String friendlinkTabDetail() throws BusinessException{
return "friendlinkTabDetail";
}
}
package com.jw.app.notice.action;
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.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.jw.app.business.NoticeBusiness;
import com.jw.app.business.utils.Status;
import net.sf.json.JSONObject;
public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = -1447740171556559942L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 保存通知公告信息
*
* @return
* @throws BusinessException
*/
public String saveNoticeInfo() throws BusinessException {
Map<String, Object> info = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
NoticeBusiness business = BusinessManager.getBusiness(NoticeBusiness.class);
try {
info = QueryParamUtil.StringToDate(info);
info.remove("OPETYPE");
business.save_notice(info);
jsonObject.putAll(Status.getStatus(Status.UPDATE_OK));
} catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.UPDATE_ERR));
}
return "json";
}
/**
* 删除通知公告信息
*
* @return
* @throws BusinessException
*/
public String removeNoticeInfo() throws BusinessException {
NoticeBusiness business = BusinessManager.getBusiness(NoticeBusiness.class);
try {
business.delete_notice(RequestUtils.getString(request, "UUID"));
jsonObject.putAll(Status.getStatus(Status.DELETE_OK));
} catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.DELETE_ERR));
}
return "json";
}
}
package com.jw.app.notice.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.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.jw.app.business.NoticeBusiness;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 7316326558049664123L;
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
rows = getPageSize();
return rows;
}
public void setRows(int rows) {
setPageSize(rows);
this.rows = getPageSize();
}
public int getPage() {
page = getPageNo();
return page;
}
public void setPage(int page) {
setPageNo(page);
this.page = getPageNo();
}
/**
* 获取通知公告信息列表
*
* @return
* @throws BusinessException
*/
public String listNoticeInfo() throws BusinessException {
NoticeBusiness business = BusinessManager.getBusiness(NoticeBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageData = business.list_notice(pageNo,pageSize,query);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(pageData.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageData.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.notice.action;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 3950314332893826524L;
public String noticeTab() throws BusinessException{
return "noticeTab";
}
public String noticeTabDetail() throws BusinessException{
return "noticeTabDetail";
}
}
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