讲解思路
- 会议通知SQL语句分析
- 反馈详情SQL语句分析
- 后台代码编写
- 前端代码编写
效果预览
会议查询
MeetingFeedBack.java
package com.zking.oa.model; import org.lisen.mvc.util.AutoIncrement; import org.lisen.mvc.util.Key; import org.lisen.mvc.util.Table; import com.zking.oa.util.CacheUtil; @Table("t_oa_meeting_feedback") public class MeetiingFeedback { @AutoIncrement @Key private Integer id; private Integer meetingId; private int personType; private int personId; private int result; private String reason; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getMeetingId() { return meetingId; } public void setMeetingId(Integer meetingId) { this.meetingId = meetingId; } public int getPersonType() { return personType; } public void setPersonType(int personType) { this.personType = personType; } public int getPersonId() { return personId; } public void setPersonId(int personId) { this.personId = personId; } public int getResult() { return result; } public void setResult(int result) { this.result = result; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public MeetiingFeedback(Integer id, Integer meetingId, int personType, int personId, int result, String reason) { super(); this.id = id; this.meetingId = meetingId; this.personType = personType; this.personId = personId; this.result = result; this.reason = reason; } public MeetiingFeedback() { super(); // TODO Auto-generated constructor stub } @Override public String toString() { return "MeetiingFeedback [id=" + id + ", meetingId=" + meetingId + ", personType=" + personType + ", personId=" + personId + ", result=" + result + ", reason=" + reason + "]"; } /** * 获取参与人员类型描述,是参与者还是列席者 * @return */ public String getMeetingJoinTypeName() { return CacheUtil.getMeetingJoinType(this.personId); } /** * 获取参与者名称 * @return */ public String getPersonName() { return CacheUtil.getUser(this.getPersonId()).getName(); } }
MeetingFeedBackDao.java
/** * 会议通知:查询出我(当前登陆用户)需要参与的会议及会议的反馈信息(参会、缺席以及未读) * @param back * @param pageBean * @return * @throws SQLException * @throws IllegalAccessException * @throws InstantiationException */ @Override public List<MeetiingFeedback> listMeetingFeedback(MeetiingFeedback meetingFeedback, PageBean pageBean) { String sql = "SELECT t1.id,t1.meetingId, t1.personType, t1.personId, t1.result, t1.reason\r\n" + " FROM t_oa_meeting_feedback t1\r\n" + " WHERE 1=1 "; List<Object> param = new ArrayList<Object>(); if(meetingFeedback != null && meetingFeedback.getResult()+"" != null) { sql += " and t1.result = ? "; param.add(meetingFeedback.getResult()); } if(meetingFeedback != null && meetingFeedback.getMeetingId() != null) { sql += " and t1.meetingId = ? "; param.add(meetingFeedback.getMeetingId()); } return DbTemplate.query(sql, param.toArray(), pageBean, MeetiingFeedback.class); }
MeetingFeedBackAction.java
/** * 查询会议相关人员的反馈信息 * @param req * @param resp */ public void listMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) { try { PageBean pageBean = new PageBean(); pageBean.setRequest(req); List<MeetiingFeedback> list = service.listMeetingFeedback(meetingFeedback, pageBean); CommonUtil.sendResponse(0, "会议反馈查询成功", pageBean.getTotal(), list, resp); } catch (Exception e) { e.printStackTrace(); CommonUtil.sendResponse(0, "会议反馈查失败", resp); } }
config.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE config[ <!ELEMENT config (action*)> <!ELEMENT action (forward*)> <!ELEMENT forward EMPTY> <!ATTLIST action path CDATA #REQUIRED type CDATA #REQUIRED > <!ATTLIST forward name CDATA #REQUIRED path CDATA #REQUIRED redirect (true|false) "false" > ]> <config> <action type="com.zking.oa.action.UserAction" path="/userAction"> </action> <action type="com.zking.oa.action.PermissionAction" path="/permissionAction"> </action> <action type="com.zking.oa.action.MeetinginfoAction" path="/meetinginfoAction"> </action> <action type="com.zking.oa.action.MeetingAuditAction" path="/meetingAuditAction"> </action> <action type="com.zking.oa.action.meetingFeedbackAction" path="/meetingFeedbackAction"> </action> </config>
DateUtil.java
package com.zking.oa.util; import java.text.SimpleDateFormat; import java.util.Date; /** * 日期帮助类 * @author lisensir */ public final class DateUtil { private DateUtil() {} private static final String FORMCAT_STR = "yyyy-MM-dd HH:mm:ss"; /** * 将日期格式化为yyyy-MM-dd HH:mm:ss格式的字符串 * @param date 需要格式化的日期 * @return */ public static String format(Date date) { if(date == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat(FORMCAT_STR); return sdf.format(date); } /** * 将日期格式化为yyyy-MM-dd HH:mm:ss格式的字符串 * @param date 需要格式化的日期 * @param format 指定的格式字符串 * @return */ public static String format(Date date, String format) { if(date == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } public static void main(String[] args) { Date date = new Date(System.currentTimeMillis()); String s = format(date); System.out.println(s); } }
meetingNotify.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <%@ include file="/common/head.jsp" %> <title>会议通知</title> <style> .layui-inline { margin-top: 20px; } .seatPicDiv { height: 180px; } .seatPic:active { height: 360px; } .layui-layer-page .layui-layer-content { /* 解决送审对话框中人员选择下拉框不能完全显示问题 */ overflow: visible;!important } </style> </head> <body> <!-- 查询条件 --> <div class="layui-inline"> <label class="layui-form-label">标题:</label> <div class="layui-input-block"> <input type="text" name="title" id="title" placeholder="会议标题" class="layui-input"> </div> </div> <div class="layui-inline"> <button class="layui-btn" id="queryMeetingInfo"><i class="layui-icon layui-icon-search"></i>查询</button> </div> <!-- 用户信息表格 --> <table class="layui-hide" id="meetingInfoTable" lay-filter="meetingInfoTable"></table> <!-- 使用了layui自定义语法,当会议不能送审或排座时将按钮显示为禁用状态 --> <script type="text/html" id="toolbar"> <button class="layui-btn layui-btn-sm" lay-event="feeback">反馈</button> </script> </body> </html>