当前位置:网站首页>Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
2022-07-28 21:43:00 【Drunken cat (^ ェェ^)】
Catalog
One 、 Meeting notice query SQL
Two 、 Meeting feedback details SQL
3、 ... and 、 Meeting notification background code implementation
Four 、 Meeting feedback function is realized
5、 ... and 、 The feedback details function is realized
One 、 Meeting notice query SQL( difficulty )
Sign in xx account number , Find out what xx It's the participants 、 Sit here as nonvoting delegates 、 One of the hosts , Then find out
Query criteria : The logged in user id 2
analysis ( Tables involved ):
Meeting information sheet :t_oa_meeting_info
Meeting feedback form :t_oa_meeting_feedback
example : 1、 Query and bring xx id=2 Meeting information for :
SELECT * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,',',liexize,',',zhuchiren)) and state=4function SQL result :
2、 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 f.personId=2 ORDER BY result;function SQL result :
Two 、 Meeting feedback details SQL( difficulty )
analysis ( Tables involved ):
User table :t_oa_user
Meeting information sheet :t_oa_meeting_info
Meeting feedback form :t_oa_meeting_feedback
Query criteria : meeting id 12
1、 Get the meeting id by 12 Conference , Names of all participants
1) Get all the participants first id
SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from t_oa_meeting_info where id=12SQL Running results :
2) Then get the names of the corresponding participants
SELECT * from t_oa_user where FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from t_oa_meeting_info where id=12))SQL Running results :
2、 Connect Meeting information feedback form , Get the corresponding feedback ( unread 、 To participate in 、 Do not participate )
SELECT * from t_oa_user where FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from t_oa_meeting_info where id=12))SQL Running results :
3、 according to Group the meeting information feedback
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.resultSQL Running results :
3、 ... and 、 Meeting notification background code implementation
Here is a brief mention of The front-end code :
header.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <link rel="stylesheet" href="${pageContext.request.contextPath }/static/js/layui/css/layui.css"> <!-- introduce layui.js --> <script src="${pageContext.request.contextPath }/static/js/layui/layui.js"></script> <!-- Specify the root path of the entire project --> <base href="${pageContext.request.contextPath }/"/> <!-- Deposit layui Configuration file of extension module --> <script src="${pageContext.request.contextPath }/static/js/layui/config.js"></script> <input id="ctx" value="${pageContext.request.contextPath }" type="hidden"/> <title> Yuyuan studio </title>
front SQL Statements have been written , And then Start implementing background code 了 :
Entity class :MeetingFeedBack Corresponding meeting feedback form
package com.zking.entity;
import java.io.Serializable;
/**
* t_oa_meeting_feedback Meeting feedback form
* Entity class : Meeting feedback
* @author President Yang
*
*/
public class MeetingFeedBack implements Serializable {
private String id;
private Long meetingId;
private Integer personType;
private Long personId;
private Integer result;
private String reason;
// The title of the meeting
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 + "]";
}
}MeetingFeedBackDao:
package com.zking.dao;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import com.zking.entity.MeetingFeedBack;
import com.zking.util.BaseDao;
import com.zking.util.PageBean;
public class MeetingFeedBackDao extends BaseDao<MeetingFeedBack>{
// 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(canyuze,',',liexize,',',zhuchiren)) and state=4) t1\r\n" +
" LEFT JOIN t_oa_meeting_feedback f on t1.id=f.meetingId\r\n" +
" and f.personId="+back.getPersonId()+"\r\n" +
" ORDER BY result";
return super.executeQuery(sql, pageBean);
}
// back.getPersonId()
}
MeetingFeedBackAction:
package com.zking.web;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zking.dao.MeetingFeedBackDao;
import com.zking.entity.MeetingFeedBack;
import com.zking.framework.ActionSupport;
import com.zking.framework.ModelDriver;
import com.zking.util.PageBean;
import com.zking.util.R;
import com.zking.util.ResponseUtil;
public class MeetingFeedBackAction extends ActionSupport implements ModelDriver<MeetingFeedBack>{
private MeetingFeedBack back=new MeetingFeedBack();
private MeetingFeedBackDao backDao=new MeetingFeedBackDao();
@Override
public MeetingFeedBack getModel() {
return back;
}
// Meeting notice query
public String queryMeetingFeedBackByUserId(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean=new PageBean();
pageBean.setRequest(req);
List<Map<String, Object>> infos = backDao.queryMeetingFeedBackByUserId(back, pageBean);
// Be careful :layui Format of data table in
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 e2) {
e2.printStackTrace();
}
}
return null;
}
}
mvc.xml:
<action path="/feedBack" type="com.zking.web.MeetingFeedBackAction">
</action>The operation effect is as follows :

Four 、 Meeting feedback function is realized ( Whether to attend the meeting )

MeetingFeedBackDao:
// Meeting feedback
public int add(MeetingFeedBack back) throws Exception {
String sql="insert into t_oa_meeting_feedback values (?,?,?,?,?,?)";
// The front desk didn't deliver id Go backstage , So generate it yourself id
back.setId(UUID.randomUUID().toString().replace("-", ""));
return super.executeUpdate(sql, back, new String [] {"id","meetingId","personType","personId","result","reason"});
}MeetingFeedBackAction:
// Meeting feedback
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, " The feedback from the meeting was successful "));
}else {
ResponseUtil.writeJson(resp, R.error(0, " Meeting feedback failed "));
}
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, " Meeting feedback failed "));
} catch (Exception e2) {
e2.printStackTrace();
}
}
return null;
}
Next run :


Click the meeting feedback button :

We'll find that No 16 There is no more data , Enter the database to query Meeting information feedback form (t_oa_meeting_feedback):

The conference feedback function has been realized ~
5、 ... and 、 The feedback details function is realized
MeetingFeedBackDao:
// Meeting feedback details
public List<Map<String, Object>> queryMeetingBackByMeetingId(MeetingFeedBack back, PageBean pageBean) throws InstantiationException, IllegalAccessException, SQLException {
String sql="select \r\n" +
" t.result,GROUP_CONCAT(t.name) names\r\n" +
" from\r\n" +
" (select \r\n" +
" t1.name,IFNULL(f.result,-1) result\r\n" +
" from\r\n" +
" (SELECT * from t_oa_user where FIND_IN_SET(id, (SELECT CONCAT(canyuze,',',liexize,',',zhuchiren) from\r\n" +
" t_oa_meeting_info \r\n" +
" where id="+back.getMeetingId()+"))) t1\r\n" +
" left join t_oa_meeting_feedback f on t1.id=f.personId and f.meetingId="+back.getMeetingId()+") t\r\n" +
" GROUP BY t.result";
return super.executeQuery(sql, pageBean);
}MeetingFeedBackAction:
// Meeting feedback details
public String queryMeetingBackByMeetingId(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean=new PageBean();
pageBean.setRequest(req);
List<Map<String, Object>> lst = backDao.queryMeetingBackByMeetingId(back, pageBean);
// Be careful :layui Format of data table in
ResponseUtil.writeJson(resp, R.ok(0, " Meeting feedback details data query succeeded ",pageBean.getTotal(),lst));
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, " Meeting feedback details data query failed "));
} catch (Exception e2) {
e2.printStackTrace();
}
}
return null;
}Running effect :
For example, log in here ( Zhang Qiang ) account number , Yes The first 8 strip Give feedback :


It shows that Zhang Qiang is absent .
Then change login admin account number :

Check in my meeting Feedback details :
We can see Zhang Qiang in the list of absentees !
For accuracy , Then we test Add some participants , For example, Zhang San ,
We log in Zhang San account number :

Now it is unread , Click to attend :

After the meeting feedback is successful , Switch again admin account number ,
Check in my meeting Feedback details :

that Zhang San appeared in the list of participants ~
Today's function has been realized , Let's go on to ! Thank you for watching.
边栏推荐
- Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]
- 蚂蚁集团境外站点 Seata 实践与探索
- 凡尔赛天花板:“毕业两年月薪才35K,真是没出息啊~~”
- Invalid prompt object name in SQL Server
- 如何优雅的设计工作流引擎(荣耀典藏版)
- 面向千元级5G手机市场,联发科天玑700发布
- Bus, protocol, specification, interface, data acquisition and control system in industrial communication field
- Attribute based encryption simulation and code implementation (cp-abe) paper: ciphertext policy attribute based encryption
- Adventures of little mouse: behind the scenes gags of moss 2
- [极客大挑战 2019]Secret File&文件包含常用伪协议以及姿势
猜你喜欢

8、 QoS queue scheduling and message discarding

Timing analysis and constraints based on Xilinx

Pytorch学习记录(四):过拟合、卷积神经网络CNN

怎样巧用断言+异常处理类,使代码更简洁!(荣耀典藏版)

【Bluetooth蓝牙开发】八、BLE协议之传输层

入行4年,跳槽2次,我摸透了软件测试这一行~

The greatest romance of programmers~

技术选型Rust——事后分析

纳米金偶联抗体/蛋白试剂盒(20nm,1mg/100μg/500 μg偶联量)的制备
![Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]](/img/74/321a4a0fab0b0dbae53b2ea1faf814.png)
Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]
随机推荐
Cloud security core technology
The ref value ‘xxx‘ will likely have changed by the time this effect function runs.If this ref......
Layout the 6G track in advance! Ziguang zhanrui released the white paper "6G unbounded AI"
基于Paragraph-BERT-CRF的科技论文摘要语步功能信息识别方法研究
Paging function (board)
Another installation artifact
职场高薪 |「中高级测试」面试题
OA项目之会议通知(查询&是否参会&反馈详情)
Go concurrent programming basics
How to understand data mesh
8、 QoS queue scheduling and message discarding
基于Xception-TD的中华传统刺绣分类模型构建
Edited by vimtutor
[brother hero July training] day 28: dynamic planning
openEuler Embedded SIG | 分布式软总线
Mysql的B+树高度计算
基于复杂网络的大群体应急决策专家意见与信任信息融合方法及应用
蚂蚁集团境外站点 Seata 实践与探索
Analysis of critical path
Hold high the two flags of 5g and AI: Ziguang zhanrui Market Summit is popular in Shencheng






