会议OA项目(六)--- (待开会议、历史会议、所有会议)

本文档介绍了如何实现会议OA项目的待开会议、历史会议和所有会议的功能。首先进行需求分析,明确了历史会议需展示已结束的会议,待开会议展示待开始的会议,所有会议展示参与者、列席者或主人的相关会议。接着,详细展示了后端的MeetingInfoDao和MeetingInfoAction的编码实现,以及前端jsp和js文件的编写过程。最后,呈现了系统的运行效果。
摘要由CSDN通过智能技术生成

前言

        上一篇分享了会议通知以及会议反馈,根据需求来今天应该到了,历史会议、待开会议以及所有会议了。


一、需求分析

历史会议:登录人员,属于参与者列席者或者主人其中一个时,并且会议状态为已结束时,要将数据查询出来。

待开会议:登录人员,属于参与者列席者或者主人其中一个时,并且会议状态为待开时,要将数据查询出来。

所有会议:登录人员,属于参与者列席者或者主人其中一个时,要将数据查询出来。

编写SQL语句

 待开会议

select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren 
				,b.name zhuchirenname,
				a.location,
				DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
				DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime, 
				a.state, 
				(case a.state
				when 0 then '取消会议'
				when 1 then '新建' 
				when 2 then '待审核' 
				when 3 then '驳回' 
				when 4 then '待开'
				when 5 then '进行中'
				when 6 then '开启投票' 
				when 7 then '结束会议'
				else '其他' end
				) meetingstate,
				a.seatPic,a.remark,a.auditor, 
				c.name auditorname 
				from t_oa_meeting_info a 
				inner join t_oa_user b on a.zhuchiren=b.id 
				left join t_oa_user c on a.auditor=c.id where 1=1 
				and state = 4 and FIND_IN_SET(6,CONCAT(canyuze,',',liexize,',',zhuchiren))

所有会议

​
select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren 
				,b.name zhuchirenname,
				a.location,
				DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
				DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime, 
				a.state, 
				(case a.state
				when 0 then '取消会议'
				when 1 then '新建' 
				when 2 then '待审核' 
				when 3 then '驳回' 
				when 4 then '待开'
				when 5 then '进行中'
				when 6 then '开启投票' 
				when 7 then '结束会议'
				else '其他' end
				) meetingstate,
				a.seatPic,a.remark,a.auditor, 
				c.name auditorname 
				from t_oa_meeting_info a 
				inner join t_oa_user b on a.zhuchiren=b.id 
				left join t_oa_user c on a.auditor=c.id where 1=1 
				and FIND_IN_SET(6,CONCAT(a.canyuze,',',a.liexize,',',a.zhuchiren,',',IFNULL(a.auditor,-1)))

​

历史会议

​
select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren 
				,b.name zhuchirenname,
				a.location,
				DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
				DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime, 
				a.state, 
				(case a.state
				when 0 then '取消会议'
				when 1 then '新建' 
				when 2 then '待审核' 
				when 3 then '驳回' 
				when 4 then '待开'
				when 5 then '进行中'
				when 6 then '开启投票' 
				when 7 then '结束会议'
				else '其他' end
				) meetingstate,
				a.seatPic,a.remark,a.auditor, 
				c.name auditorname 
				from t_oa_meeting_info a 
				inner join t_oa_user b on a.zhuchiren=b.id 
				left join t_oa_user c on a.auditor=c.id where 1=1 
				and state = 7 and FIND_IN_SET(6,CONCAT(canyuze,',',liexize,',',zhuchiren))

​

 二、编码

        后端:

        MeetingInfoDao

package com.zking.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.zking.entity.MeetingInfo;
import com.zking.util.BaseDao;
import com.zking.util.PageBean;
import com.zking.util.StringUtils;

public class MeetingInfoDao extends BaseDao<MeetingInfo> {
	// 添加会议信息
	public int add(MeetingInfo info) throws Exception {
		String sql = "insert into t_oa_meeting_info(title,content,canyuze,liexize,zhuchiren,\r\n"
				+ "location,startTime,endTime,remark) values(?,?,?,?,?,?,?,?,?)";
		return super.executeUpdate(sql, info, new String[] { "title", "content", "canyuze", "liexize", "zhuchiren",
				"location", "startTime", "endTime", "remark" });
	}
	
	//我的会议SQL,后续其他的菜单也会使用
	private String getSQL() {
		return "select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren\r\n" + 
				",b.name zhuchirenname,\r\n" + 
				"a.location,\r\n" + 
				"DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,\r\n" + 
				"DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,\r\n" + 
				"a.state,\r\n" + 
				"(\r\n" + 
				"	case a.state\r\n" + 
				"	when 0 then '取消会议'\r\n" + 
				"	when 1 then '新建'\r\n" + 
				"	when 2 then '待审核'\r\n" + 
				"	when 3 then '驳回'\r\n" + 
				"	when 4 then '待开'\r\n" + 
				"	when 5 then '进行中'\r\n" + 
				"	when 6 then '开启投票'\r\n" + 
				"	when 7 then '结束会议'\r\n" + 
				"	else '其他' end\r\n" + 
				") meetingstate,\r\n" + 
				"a.seatPic,a.remark,a.auditor,\r\n" + 
				"c.name auditorname\r\n" + 
				"from t_oa_meeting_info a\r\n" + 
				"inner join t_oa_user b on a.zhuchiren=b.id\r\n" + 
				"left join t_oa_user c on a.auditor=c.id where 1=1 ";
	}
	//我的会议
	public List<Map<String, Object>> myInfos(MeetingInfo info, PageBean pageBean)
			throws SQLException, InstantiationException, IllegalAccessException {
		String sql = getSQL();
		//会议标题
		String title = info.getTitle();
		if(StringUtils.isNotBlank(title)) {
			sql+=" and title like '%"+title+"%'";
		}
		sql+=" and zhuchiren="+info.getZhuchiren();
//		排序按照降序展示
		sql+=" order by a.id desc ";
		return super.executeQuery(sql, pageBean);
	}

//	设置会议排座图片
	public int updateSeatPicById(MeetingInfo info) throws Exception {
		String sql =" update t
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值