OA项目之会议通知(查询&是否参会&反馈详情)

目录

会议查询

是否参会

反馈详情


讲解思路

  • 会议通知SQL语句分析

  • 反馈详情SQL语句分析

  • 后台代码编写

  • 前端代码编写

    效果预览

    OA项目之会议通知(查询&是否参会&反馈详情)_第1张图片

     

    OA项目之会议通知(查询&是否参会&反馈详情)_第2张图片

    OA项目之会议通知(查询&是否参会&反馈详情)_第3张图片

会议查询

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 param = new ArrayList();
		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 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> queryBackPersons(MeetiingFeedback back){
		String sql="select " + 
				"f.result,GROUP_CONCAT(u.name) as name " + 
				"from " + 
				"t_oa_meeting_feedback f,t_oa_user u " + 
				"where f.personId=u.id and meetingId="+back.getMeetingId()+" group by f.result";
		System.out.println(sql);
		return super.executeQuery(sql, null, new convert>() {
			@Override
			public List> forEach(ResultSet rs) throws Exception {
				return CommonUtils.toList(rs);
			}
		});
	}

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

你可能感兴趣的:(OA会议专栏,数据库,layui.js,OA会议,web,eclipse,tomcat,java)