目录
会议查询
是否参会
反馈详情
讲解思路
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 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
MeetingFeedBackAction.java
/**
* 查询会议相关人员的反馈信息
* @param req
* @param resp
*/
public void listMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean = new PageBean();
pageBean.setRequest(req);
List list = service.listMeetingFeedback(meetingFeedback, pageBean);
CommonUtil.sendResponse(0, "会议反馈查询成功", pageBean.getTotal(), list, resp);
} catch (Exception e) {
e.printStackTrace();
CommonUtil.sendResponse(0, "会议反馈查失败", resp);
}
}
config.xml
]>
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"%>
Insert title here
<%@ include file="/common/head.jsp" %>
会议通知
meetingNotify.js
MeetingFeedBackDao.java
/**
* 新增会议反馈
* @param back
*/
public void addMeetingFeedback(MeetiingFeedback back) {
String sql="insert into t_oa_meeting_feedback(meetingId,personType,personId,result,reason) values(?,?,?,?,?)";
super.executeUpdate(sql, new Object[] {
back.getMeetingId(),
back.getPersonType(),
back.getPersonId(),
back.getResult(),
back.getReason()
});
}
MeetingFeedBackAction.java
/**
* 增加会议反馈
* @param req
* @param resp
*/
public void addMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) {
try {
service.addMeetingFeedback(meetingFeedback);
CommonUtil.sendResponse(0, "会议反馈成功", resp);
} catch (Exception e) {
e.printStackTrace();
CommonUtil.sendResponse(0, "会议反馈失败", resp);
}
}
meetingNotify.js
addFeedBack.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@include file="/common/head.jsp" %>
addFeedBack.js
MeetingFeedBackDao.java
/**
* 根据会议ID获取会议反馈详情信息
* @param back
* @return
*/
@SuppressWarnings("unchecked")
public List
MeetingFeedBackAction.java
/**
* 查询会议相关人员的反馈信息
* @param req
* @param resp
*/
public void listMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean = new PageBean();
pageBean.setRequest(req);
List list = service.listMeetingFeedback(meetingFeedback, pageBean);
CommonUtil.sendResponse(0, "会议反馈查询成功", pageBean.getTotal(), list, resp);
} catch (Exception e) {
e.printStackTrace();
CommonUtil.sendResponse(0, "会议反馈查失败", resp);
}
}
myMeeting.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/common/head.jsp" %>
Insert title here
myMeeting.js