当前位置:网站首页>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.
边栏推荐
- Capture video by buffering
- 作价11.5亿元,1206件设备注入合资公司!SK海力士抢食大陆晶圆代工市场!
- 基于多模态融合的非遗图片分类研究
- 世界肝炎日 | 基层也能享受三甲资源,智慧医疗系统如何解决“看病难”?
- It is said that Microsoft has obtained the supply license for Xianghua! Will Huawei usher in the full lifting of the ban?
- Achieve waterfall effect
- 1945. sum of digits after string conversion
- 网格数据生成函数meshgrid
- The University was abandoned for three years, the senior taught himself for seven months, and found a 12K job
- Cy3/cy5/cy5.5/cy7 fluorescent labeling antibody / protein Kit (10~100mg labeling amount)
猜你喜欢

The University was abandoned for three years, the senior taught himself for seven months, and found a 12K job

Api 接口优化的几个技巧

职场高薪 |「中高级测试」面试题

How to skillfully use assertion + exception handling classes to make the code more concise! (glory Collection Edition)

Timing analysis and constraints based on Xilinx

Why on earth is it not recommended to use select *?

蚂蚁集团境外站点 Seata 实践与探索

技术选型Rust——事后分析
![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]

How to measure software architecture
随机推荐
Pytorch学习记录(三):随机梯度下降、神经网络与全连接
Layout the 6G track in advance! Ziguang zhanrui released the white paper "6G unbounded AI"
Niuke turns on the camera and the picture disappears a few seconds later | the picture flashes when the camera is turned on
华为发布首款电驱动系统DriveONE:充电10分钟续航200km
How to understand data mesh
30. Learn highcharts label rotation histogram
MATLAB从入门到精通 第1章 MATLAB入门
Timing analysis and constraints based on Xilinx
Matlab|基础知识总结一
What is the purpose of database read-write separation [easy to understand]
An end-to-end aspect level emotion analysis method for government app reviews based on brnn
Discussion: if you want to land Devops, is it enough to only consider a good PAAS container platform?
两个全局变量__dirname和__filename 、fs模块常用功能进一步介绍
How to measure software architecture
[极客大挑战 2019]Secret File&文件包含常用伪协议以及姿势
C process control statement
Leetcode 19. delete the penultimate node of the linked list [knowledge points: speed pointer, recursion, stack]
面向千元级5G手机市场,联发科天玑700发布
学习Typescript(二)
网格数据生成函数meshgrid






