当前位置:网站首页>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');
}边栏推荐
- [cloud native and 5g] micro services support 5g core network
- Responsive dream weaving template outdoor camping website
- Installation guide for proftpd Secure FTP server with TLS encryption enabled
- What should I do if excel opens a CSV file containing Chinese characters and there is garbled code?
- Navigation -- realize data transmission and data sharing between fragments
- Interprocess communication - detailed explanation of the pipeline (explanation of graphic cases)
- 开启TLS加密的Proftpd安全FTP服务器安装指南
- Work queue_ queue
- 网络安全漏洞管理的探索与实践
- Eight practical new functions of es2022
猜你喜欢

Navigation -- realize data transmission and data sharing between fragments

Day 14: continued day 13 label related knowledge

裂开了,一次连接池参数导致的雪崩问题

第十五天(VLAN相关知识)

Day 15 (VLAN related knowledge)

密码安全如何保障?安全浏览器如何管理密码?

What should I do if excel opens a CSV file containing Chinese characters and there is garbled code?

Jetpack -- navigation realizes page Jump

What is scope and scope chain

Practice and experience of security compliance in instant messaging scenarios
随机推荐
WebView attack
Control buzzer based on C51
Summarize in the middle of the year | talk to yourself, live in the present, and count every step
Eight practical new functions of es2022
[mqtt from introduction to improvement series | 09] Wireshark packet capturing and analyzing mqtt messages
Virsh console connection failure
Even PostgreSQL problem: expected authentication request from server, but received V
ES6 语法扩展
Prometheus + AlertManager 消息预警
Explain asynchronous tasks in detail: task status and lifecycle management
The outsourcing company "mixed" for two years, and I only did five things seriously. Now I get byte offer smoothly.
全志T3/A40i工业核心板,4核[email protected],国产化率达100%
Awvs cannot start problem
Prevent repeated clicks
实验二:Arduino的三色灯实验
The first of the five tips for using browsers efficiently is the most practical
Responsive Zhimeng template decoration design website
自定义mvc原理和框架实现
基于对象的实时空间音频渲染丨Dev for Dev 专栏
Click the button to slide to the specified position