当前位置:网站首页>Meeting notice of meeting OA
Meeting notice of meeting OA
2022-07-29 02:26:00 【I love coriander TVT】
Catalog
Two 、 Meeting feedback details
Today's meeting to share with you OA Meeting notification function in the project , I divide the meeting notice into two parts to realize , Meeting notice and feedback details .
One 、 Notice of meeting
1、 Notice of meeting SQL Statement writing ( difficulty )
Let's start with the function find_in_set(id, Conditions ) To find out the meeting information of the meeting we want to query
No matter whether the meeting gets feedback or not, we need to find out , So we have to use the left outer connection , The meeting information table is the main table , The meeting feedback details table is used as the slave table , This can ensure that our data will not be lost
-- Meeting notice query sql
-- Query meeting id by 2 Meeting information for
SELECT * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT
(canyuze,liexize,zhuchiren)) and state = 4
-- Whether the meeting gets feedback or not , You have to find out , So choose external connection , The meeting information table is mainly
SELECT
IFNULL(f.result,-1) result,t1.*
from
(SELECT * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT
(canyuze,liexize,zhuchiren)) and state = 4)t1
left join t_oa_meeting_feedback f on t1.id = f.meetingId and personId =2
ORDER BY result
2、 Background coding
Because we need to use a new table, meeting feedback details table t_oa_meeting_feedback, So we need to create an entity class with this table
package com.zking.entity;
import java.io.Serializable;
/**
* Meeting feedback form
* @author Administrator
*
*/
public class MeetingFeedBack implements Serializable {
private String id;
private Long meetingId;
private Integer personType;
private Long personId;
private Integer result;
private String reason;
private String title;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Long getMeetingId() {
return meetingId;
}
public void setMeetingId(Long meetingId) {
this.meetingId = meetingId;
}
public Integer getPersonType() {
return personType;
}
public void setPersonType(Integer personType) {
this.personType = personType;
}
public Long getPersonId() {
return personId;
}
public void setPersonId(Long personId) {
this.personId = personId;
}
public Integer getResult() {
return result;
}
public void setResult(Integer result) {
this.result = result;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public MeetingFeedBack() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "MeetingFeedBack [id=" + id + ", meetingId=" + meetingId + ", personType=" + personType + ", personId="
+ personId + ", result=" + result + ", reason=" + reason + "]";
}
}
Dao layer
// Meeting notice query
public List<Map<String, Object>> queryMeetingFeedBackByUserId(MeetingFeedBack back, PageBean pageBean)
throws SQLException, InstantiationException, IllegalAccessException {
String sql = "SELECT\r\n" +
" IFNULL(f.result,-1) result,t1.* \r\n" +
" from\r\n" +
" (SELECT * from t_oa_meeting_info where FIND_IN_SET(\"+back.getPersonId()+\",CONCAT\r\n" +
" (canyuze,liexize,zhuchiren)) and state = 4)t1 \r\n" +
" left join t_oa_meeting_feedback f on t1.id = f.meetingId and personId ="+back.getPersonId()+"\r\n" +
" ORDER BY result";
return super.executeQuery(sql, pageBean);
}
web layer
// Meeting notice query
public String myInfos(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean = new PageBean();
pageBean.setRequest(req);
List<Map<String, Object>> infos = backDao.queryMeetingFeedBackByUserId(back, pageBean);
ResponseUtil.writeJson(resp, R.ok(0, " Meeting notification data query succeeded " , pageBean.getTotal(), infos));
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, " Meeting notification data query failed "));
} catch (Exception e1) {
e1.printStackTrace();
}
}
return null;
}
xml To configure
<action path="/feedback" type="com.zking.web.MeetingFeedBackAction">
</action>
3、 Front end coding
JSp Interface
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/meetingNotify.js"></script>
</head>
<style>
body{
margin:15px;
}
.layui-table-cell {height: inherit;}
.layui-layer-page .layui-layer-content { overflow: visible !important;}
</style>
<body>
<!-- Search bar -->
<div class="layui-form-item" style="margin:15px 0px;">
<div class="layui-inline">
<label class="layui-form-label"> The title of the meeting </label>
<div class="layui-input-inline">
<input type="hidden" id="personId" value="${user.id }"/>
<input type="text" id="title" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button id="btn_search" type="button" class="layui-btn"><i class="layui-icon layui-icon-search"></i> Inquire about </button>
</div>
</div>
<!-- Data table -->
<table id="tb" lay-filter="tb" class="layui-table" style="margin-top:-15px"></table>
<script type="text/html" id="tbar">
{
{# if(d.result==-1){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"> Whether to attend the meeting </a>
{
{# } }}
</script>
</body>
</html>
js Code
let layer,table,$,form,test;
var row;
layui.use(['layer','table','jquery','form','test'],function(){
layer=layui.layer,
table=layui.table,
form=layui.form,
test=layui.test,
$=layui.jquery;
initTable();
// Query events
$('#btn_search').click(function(){
query();
});
});
// Initialize the data table ( My approval )
function initTable(){
table.render({ // Perform rendering
elem: '#tb', // Specify the original table element selector ( recommend id Selectors )
height: 400, // Custom height
loading: false, // Whether to load the bar ( Default true)
cols: [[ // Set the header
{field: 'id', title: ' Conference number ', width: 90},
{field: 'title', title: ' The title of the meeting ', width: 120},
{field: 'location', title: ' Place of meeting ', width: 140},
{field: 'startTime', title: ' Starting time ', width: 120,
templet:function(d){
return test.toDate(new Date(d.startTime));
}
},
{field: 'endTime', title: ' End time ', width: 120,
templet:function(d){
return test.toDate(new Date(d.endTime));
}
},
//{field: 'meetingState', title: ' Meeting status ', width: 120},
/*{field: 'seatPic', title: ' Meeting row ', width: 120,
templet: function(d){
if(d.seatPic==null || d.seatPic=="")
return " Not yet seated ";
else
return "<img width='120px' src='"+d.seatPic+"'/>";
}
},*/
{field: 'result', title: ' Feedback status ', width: 120,
templet: function(d){
if(d.result==1)
return " Participation ";
else if(d.result==2)
return " absent ";
else
return " unread ";
}
},
{field: '', title: ' operation ', width: 200,toolbar:'#tbar'},
]]
});
}
// Click to query
function query(){
table.reload('tb', {
url: $("#ctx").val()+'/feedBack.action', // Request address
method: 'POST', // Request mode ,GET perhaps POST
loading: true, // Whether to load the bar ( Default true)
page: true, // Pagination or not
where: { // Set additional parameters for asynchronous data interface , Arbitrarily set
'methodName':'queryMeetingFeedBackByUserId',
'personId':$('#personId').val(),
'title':$('#title').val(),
},
request: { // Custom paging request parameter name
pageName: 'page', // Parameter name of page number , Default :page
limitName: 'rows' // Parameter name of data volume per page , Default :limit
},
done: function (res, curr, count) {
console.log(res);
}
});
// Toolbar events
table.on('tool(tb)', function(obj){ // notes :tool Is the toolbar event name ,test yes table Properties of the original container lay-filter=" Corresponding value "
row = obj.data; // Get current row data
var layEvent = obj.event; // get lay-event Corresponding value ( It can also be in the header event The corresponding value of the parameter )
var tr = obj.tr; // Get the current line tr Of DOM object ( If any )
console.log(row);
if(layEvent === 'edit'){ // Whether to attend the meeting
openLayer(row.id);
} else {
}
});
}
function openLayer(id){
layer.open({
type: 2, //layer Provides 5 Layer type . The values that can be passed in are :0( Message box , Default )1( Page layer )2(iframe layer )3( Loading layer )4(tips layer )
title: ' Meeting feedback ', // Dialog title
area: ['660px', '400px'], // Wide and high
skin: 'layui-layer-rim', // Style class name
content: 'jsp/meeting/addFeedBack.jsp?id='+id, // Pop up content . You can pass in ordinary html Content , You can also specify DOM, With more type Different but different
btn:[' Meeting feedback ',' close '],
yes:function(index,layero){
//layer.msg(' preservation ');
// Call the getData Method , Get sub pages quickly form The form data
let data= $(layero).find("iframe")[0].contentWindow.getData();
addMeetingFeedBack(data);
},
btn2:function(){
layer.closeAll();
}
});
}
// Notice of the meeting Participation / Feedback from not attending the meeting
function addMeetingFeedBack(params){
params['methodName']="add";
console.log(params);
$.post($("#ctx").val()+'/feedBack.action',params,function(rs){
if(rs.success){
layer.closeAll();
query();
}else{
layer.msg(rs.msg,{icon:5},function(){});
}
},'json');
}
Two 、 Meeting feedback details
1、 Meeting feedback details SQL Statement writing
First, query all participants of a meeting ( participants 、 Non voting attendees 、 host ) Of id( In the meeting information table ), Then connect the user table according to id Get the names of the participants . Reconnect the feedback form , Get the corresponding feedback ( unread 、 To participate in 、 Do not participate ), Finally, group processing is carried out according to the feedback , Reference to function GROUP_CONCAT
select
t.result,GROUP_CONCAT(t.name) names
from
(select
t1.name,IFNULL(f.result,-1)result
from
(SELECT * from t_oa_user where FIND_IN_SET(id,(SELECT CONCAT
(canyuze,',',liexize,',',zhuchiren) from t_oa_meeting_info where id = 12))) t1
left JOIN t_oa_meeting_feedback f on t1.id = f.personId and f.meetingId = 12) t
GROUP BY t.result
2、 Background coding
Dao layer
// Meeting feedback
public int add(MeetingFeedBack back) throws Exception {
String sql = "insert into t_oa_meeting_feedback values(?,?,?,?,?,?)";
back.setId(UUID.randomUUID().toString().replaceAll("-", ""));
return super.executeUpdate(sql, back,new String[] {"id","meetingId","personType","personId","result","reason"});
}
Web layer
public String add(HttpServletRequest req, HttpServletResponse resp) {
try {
// rs yes sql Number of lines affected by statement execution
int rs = backDao.add(back);
if(rs > 0) {
ResponseUtil.writeJson(resp, R.ok(200, " Conference information data added successfully "));
}else {
ResponseUtil.writeJson(resp, R.error(0, " Failed to add conference information data "));
}
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, " Failed to add conference information data "));
} catch (Exception e1) {
e1.printStackTrace();
}
}
return null;
}
Front desk code
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/addFeedBack.js"></script>
</head>
<style>
body{
margin:5px;
}
</style>
<body>
<div style="padding:10px;">
<form class="layui-form layui-form-pane" lay-filter="back">
<!-- <div class="layui-form-item">
<button type="submit" class="layui-btn" lay-submit="" lay-filter="meeting"> Submit... Immediately </button>
<button id="reset" type="reset" class="layui-btn layui-btn-primary"> Reset </button>
</div> -->
<input type="hidden" name="meetingId" value="${param.id }"/>
<input type="hidden" name="personId" value="${sessionScope.user.id }"/>
<div class="layui-form-item">
<label class="layui-form-label"> The type of people </label>
<div class="layui-input-block">
<select id="personType" name="personType">
<option value=""> Please select the personnel type </option>
<option value="1"> Participation </option>
<option value="2"> Attend as nonvoting delegates </option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"> Feedback results </label>
<div class="layui-input-block">
<select id="result" name="result">
<option value=""> Please select the feedback result </option>
<option value="1"> To participate in </option>
<option value="2"> Do not participate </option>
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label"> Reasons for not participating in the meeting </label>
<div class="layui-input-block">
<textarea placeholder=" Please enter the content " name="reason" class="layui-textarea"></textarea>
</div>
</div>
</form>
</div>
</body>
</html>
js Code
let layer,table,$,form,test;
var row;
layui.use(['layer','table','jquery','form','test'],function(){
layer=layui.layer,
table=layui.table,
form=layui.form,
test=layui.test,
$=layui.jquery;
initTable();
// Query events
$('#btn_search').click(function(){
query();
});
});
// Initialize the data table ( My approval )
function initTable(){
table.render({ // Perform rendering
elem: '#tb', // Specify the original table element selector ( recommend id Selectors )
height: 400, // Custom height
loading: false, // Whether to load the bar ( Default true)
cols: [[ // Set the header
{field: 'id', title: ' Conference number ', width: 90},
{field: 'title', title: ' The title of the meeting ', width: 120},
{field: 'location', title: ' Place of meeting ', width: 140},
{field: 'startTime', title: ' Starting time ', width: 120,
templet:function(d){
return test.toDate(new Date(d.startTime));
}
},
{field: 'endTime', title: ' End time ', width: 120,
templet:function(d){
return test.toDate(new Date(d.endTime));
}
},
//{field: 'meetingState', title: ' Meeting status ', width: 120},
/*{field: 'seatPic', title: ' Meeting row ', width: 120,
templet: function(d){
if(d.seatPic==null || d.seatPic=="")
return " Not yet seated ";
else
return "<img width='120px' src='"+d.seatPic+"'/>";
}
},*/
{field: 'result', title: ' Feedback status ', width: 120,
templet: function(d){
if(d.result==1)
return " Participation ";
else if(d.result==2)
return " absent ";
else
return " unread ";
}
},
{field: '', title: ' operation ', width: 200,toolbar:'#tbar'},
]]
});
}
// Click to query
function query(){
table.reload('tb', {
url: $("#ctx").val()+'/feedBack.action', // Request address
method: 'POST', // Request mode ,GET perhaps POST
loading: true, // Whether to load the bar ( Default true)
page: true, // Pagination or not
where: { // Set additional parameters for asynchronous data interface , Arbitrarily set
'methodName':'queryMeetingFeedBackByUserId',
'personId':$('#personId').val(),
'title':$('#title').val(),
},
request: { // Custom paging request parameter name
pageName: 'page', // Parameter name of page number , Default :page
limitName: 'rows' // Parameter name of data volume per page , Default :limit
},
done: function (res, curr, count) {
console.log(res);
}
});
// Toolbar events
table.on('tool(tb)', function(obj){ // notes :tool Is the toolbar event name ,test yes table Properties of the original container lay-filter=" Corresponding value "
row = obj.data; // Get current row data
var layEvent = obj.event; // get lay-event Corresponding value ( It can also be in the header event The corresponding value of the parameter )
var tr = obj.tr; // Get the current line tr Of DOM object ( If any )
console.log(row);
if(layEvent === 'edit'){ // Whether to attend the meeting
openLayer(row.id);
} else {
}
});
}
function openLayer(id){
layer.open({
type: 2, //layer Provides 5 Layer type . The values that can be passed in are :0( Message box , Default )1( Page layer )2(iframe layer )3( Loading layer )4(tips layer )
title: ' Meeting feedback ', // Dialog title
area: ['660px', '400px'], // Wide and high
skin: 'layui-layer-rim', // Style class name
content: 'jsp/meeting/addFeedBack.jsp?id='+id, // Pop up content . You can pass in ordinary html Content , You can also specify DOM, With more type Different but different
btn:[' Meeting feedback ',' close '],
yes:function(index,layero){
//layer.msg(' preservation ');
// Call the getData Method , Get sub pages quickly form The form data
let data= $(layero).find("iframe")[0].contentWindow.getData();
addMeetingFeedBack(data);
},
btn2:function(){
layer.closeAll();
}
});
}
// Notice of the meeting Participation / Feedback from not attending the meeting
function addMeetingFeedBack(params){
params['methodName']="add";
console.log(params);
$.post($("#ctx").val()+'/feedBack.action',params,function(rs){
if(rs.success){
layer.closeAll();
query();
}else{
layer.msg(rs.msg,{icon:5},function(){});
}
},'json');
}
边栏推荐
- 连PostgreSQL问题:expected authentication request from server, but received v
- The first of the five tips for using browsers efficiently is the most practical
- Responsive dream weaving template home decoration website
- Idea connection database
- Virsh console connection failure
- 4年测试经验,好不容易进了阿里,两个月后我选择了裸辞...
- 7/28 Gauss elimination to solve linear equations + Gauss elimination to solve XOR linear equations + find the combination number II
- 【golang学习笔记2.2】 Map、结构体和接口
- Prometheus + AlertManager 消息预警
- Pointer - golden stage
猜你喜欢
响应式织梦模板户外露营类网站
Day 15 (VLAN related knowledge)
Responsive dream weaving template makeup website
Internet of things development -- mqtt message server emqx
How to customize a new tab in Duoyu security browser?
Character flow comprehensive exercise problem solving process
外包公司“混”了2年,我只认真做了5件事,如今顺利拿到字节 Offer。
C语言提高篇(一)
Excel 打开包含汉字的 csv 文件出现乱码该怎么办?
防止勒索软件攻击数据的十种方法
随机推荐
Click the button to slide to the specified position
详解JS的四种异步解决方案:回调函数、Promise、Generator、async/await
JVM memory overflow online analysis dump file and online analysis open.Hprof file to get JVM operation report how jvisualvm online analysis
Eight practical new functions of es2022
[cloud native] what is the microservice architecture
“两个披萨”团队的分支管理实践
密码安全如何保障?安全浏览器如何管理密码?
记一次 ERROR scheduler.AsyncEventQueue: Dropping event from queue shared导致OOM
进程间通信---对管道的详细讲解(图文案例讲解)
如果非要在多线程中使用 ArrayList 会发生什么?
即时通讯场景下安全合规的实践和经验
H5 background music is played automatically by touch
TI C6000 TMS320C6678 DSP+ Zynq-7045的PS + PL异构多核案例开发手册(2)
网络安全漏洞管理的探索与实践
DevOps 团队如何抵御 API 攻击?
Pointer - golden stage
Responsive Zhimeng template decoration design website
MySQL之数据查询(多表查询)
多边形点测试
How to customize a new tab in Duoyu security browser?