Commit 7ca3676e by 朱天成

会议管理

parent 1042d8f0
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<value>classpath:com/jw/app/business/userchoice/userchoiceDAO.xml</value> <value>classpath:com/jw/app/business/userchoice/userchoiceDAO.xml</value>
<value>classpath:com/jw/app/business/calendar/calendarDAO.xml</value> <value>classpath:com/jw/app/business/calendar/calendarDAO.xml</value>
<value>classpath:com/jw/app/business/vote/voteDAO.xml</value> <value>classpath:com/jw/app/business/vote/voteDAO.xml</value>
<value>classpath:com/jw/app/business/meeting/meetingDAO.xml</value>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -75,6 +76,10 @@ ...@@ -75,6 +76,10 @@
<property name="mapperInterface" value="com.jw.app.business.vote.voteDAO"/> <property name="mapperInterface" value="com.jw.app.business.vote.voteDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/> <property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean> </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>
<!-- BusinessInterFace --> <!-- BusinessInterFace -->
<bean id="PortletBusiness" <bean id="PortletBusiness"
class="com.jw.app.business.portlet.PortletBusinessImpl"> class="com.jw.app.business.portlet.PortletBusinessImpl">
...@@ -126,6 +131,11 @@ ...@@ -126,6 +131,11 @@
<property name="voteDAO" ref="voteDAO"/> <property name="voteDAO" ref="voteDAO"/>
</bean> </bean>
<bean id="MeetingBusiness"
class="com.jw.app.business.meeting.MeetingBusinessImpl">
<property name="meetingDAO" ref="meetingDAO"/>
</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"/>
......
<%@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="会议签到管理&nbsp;&nbsp;<font color='#993300'></font>";
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':'保存失败'}}}]
<%@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
...@@ -123,6 +123,23 @@ ...@@ -123,6 +123,23 @@
method="{1}"> method="{1}">
<result name="{1}">/jwapp/pages/vote/{1}.jsp</result> <result name="{1}">/jwapp/pages/vote/{1}.jsp</result>
</action> </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="meetingData_*" class="com.jw.app.meeting.action.dataAction"
method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="meetingView_*" class="com.jw.app.meeting.action.viewAction"
method="{1}">
<result name="{1}">/jwapp/pages/meeting/{1}.jsp</result>
</action>
</package> </package>
<package name="src_jwapp_store" extends="gaowj"> <package name="src_jwapp_store" extends="gaowj">
<action name="storeAct_*" class="com.jw.app.store.action.actAction" <action name="storeAct_*" class="com.jw.app.store.action.actAction"
......
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.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.getEmname());
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 {
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("PARTICIPANTS_NAME", SessionUtil.getEmname());
entity.put("CHECK_IN_TIME", new Date());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("CREATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getEmname());
entity.put("UPDATE_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.getEmname());
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 {
// 计算起始记录
query.put("USER_ID", SessionUtil.getEmname());
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 = CacheKit.get("ehcache10", "meeting"+query);
if(list_data==null || list_data.size()==0){
list_data=meetingDAO.list_check_in(query);
CacheKit.put("ehcache10", "kqmk"+query, list_data);
}
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.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";
}
}
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