03.OA项目之我的会议(查询&会议排座&送审)

目录

会议查询

会议排座

会议送审


思路:

  • 关键性会议SQL的编写
  • 后台实现
  • 前台实现

会议查询

MeetingInfoDao.java

//	通用的会议查询SQL语句,包含会议信息表数据,主持人姓名、审批人姓名、会议状态
	private String getSQL() {
		return "SELECT a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren,b.`name`,a.location\r\n" + 
				",DATE_FORMAT(a.startTime,'%Y-%m-%d %H:%i:%s') as startTime\r\n" + 
				",DATE_FORMAT(a.endTime,'%Y-%m-%d %H:%i:%s') as endTime\r\n" + 
				",a.state\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" + 
				"else '结束会' end\r\n" + 
				") as meetingState\r\n" + 
				",a.seatPic,a.remark,a.auditor,c.`name` as 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> myInfos(MeetingInfo info, PageBean pageBean) throws Exception {
		String sql = getSQL();
		String title = info.getTitle();
		if(StringUtils.isNotBlank(title)) {
			sql += " and title like '%"+title+"%'";
		}
		//根据当前登陆用户ID作为主持人字段的条件
		sql+=" and zhuchiren="+info.getZhuchiren();
		//按照会议ID降序排序
		sql+=" order by a.id desc";
		System.out.println(sql);
		return super.executeQuery(sql, pageBean);
	}

MeetingInfoAction.java

// 我的会议
	public String myInfos(HttpServletRequest req, HttpServletResponse resp) {
		try {
			PageBean pageBean = new PageBean();
			pageBean.setRequest(req);
			List> infos = meetingInfoDao.myInfos(info, pageBean);
			ResponseUtil.writeJson(resp, R.ok(0, "我的会议查询成功!!!", pageBean.getTotal(), infos));
		} catch (Exception e) {
			e.printStackTrace();
			try {
				ResponseUtil.writeJson(resp, R.error(0, "我的会议查询失败!!!"));
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
		return null;
	}

myMeeting.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>




<%@ include file="/common/head.jsp" %>
Insert title here





    
	

myMeeting.js

会议排座

思路

  • 会议排座插件介绍
  • 会议排座功能开发
  • 送审功能开发

03.OA项目之我的会议(查询&会议排座&送审)_第1张图片

 

03.OA项目之我的会议(查询&会议排座&送审)_第2张图片

 MeetingInfoDao.java

//	根据会议ID更新会议的排座图片
	public int updateSeatPicById(MeetingInfo info) throws Exception {
		String sql="update t_oa_meeting_info set seatPic=? where id=?";
		return super.executeUpdate(sql, info, new String[] {"seatPic","id"});
	}
	
	//	根据会议ID查询相关用户
	public List queryUserByMeetingId(Long meetingId) throws Exception{
		String sql="select * from t_oa_user where FIND_IN_SET(id,"
				+ "(select concat(canyuze,',',liexize,',',zhuchiren) "
				+ "from t_oa_meeting_info where id="+meetingId+"))";
		return super.executeQuery(sql, User.class, null);
	}

MeetingInfoAction.java

 

/**
	 * 保存排座图片到服务器的指定目录,并更新相关会议信息的排座图片字段
	 * @param req
	 * @param resp
	 */
	public void addArrangeSeat(HttpServletRequest req, HttpServletResponse resp) {
		
		try {
			String fName = UUID.randomUUID().toString().replace("-", "").concat(".jpg");
			String path = "D:\\temp\\images\\seatPic\\uploads\\" + fName;
			String base64Image = meetinginfo.getSeatPic().replace("data:image/png;base64,", "");
			//生成图片
			Base64ImageUtils.GenerateImage(base64Image, path);
			
			//更新会议信息表中的排座信息,需要设置tomcat的设置增加一个扩展web模块
			meetinginfo.setSeatPic("/uploads/"+fName);
			service.updateSeatPicById(meetinginfo);
			CommonUtil.sendResponse(0, "排座成功", resp);
		} catch (Exception e) {
			e.printStackTrace();
			CommonUtil.sendResponse(-1, "排座失败", resp);
		}
		
	}

resource.properties

String path = "D:\\temp\\images\\seatPic\\uploads\\" + fName;

在tomcat中需要配置图片映射关系  

03.OA项目之我的会议(查询&会议排座&送审)_第3张图片

 myMeeting.js

seatPic.jsp

注:添加jQuery、html2canvas相关插件

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>









会议座位安排



    

会议送审

MeetingInfoDao.java

//	根据会议ID更新会议的审批人(送审)
	@Override
	public void updateMeetingState(Meetinginfo meetingInfo) {
		String sql = "update t_oa_meeting_info set state = ? where id = ?";
		DbTemplate.update(sql, new Object[] {meetingInfo.getState(), meetingInfo.getId()});
	}

MeetingInfoAction.java

/**
	 * 会议送审,能够送审的前提是该会议已经排座,否则不能送审,此外
	 * 对于审核通过,结束,取消,进行中等状态的会议不能执行送审
	 * @param rep
	 * @param resp
	 */
	public void sendAudit(HttpServletRequest rep, HttpServletResponse resp) {
		
		try {
			service.sendAudit(meetinginfo);
			CommonUtil.sendResponse(0, "送审成功", resp);
		} catch (Exception e) {
			e.printStackTrace();
			CommonUtil.sendResponse(-1, "送审失败", resp);
		}
		
	}

myMeeting.js

你可能感兴趣的:(OA会议专栏,python,开发语言,mvc,servlet,eclipse,java,layui)