当前位置:网站首页>Conference OA Project My Conference
Conference OA Project My Conference
2022-08-11 07:09:00 【Yu Musheng】
目录
一、会议OA名称介绍
我的会议:当前登录账号,是 某会议 主持人,则查询出来
我的审批:当前登录账号,是 某会议 designated approver of,And the meeting status is pending,则查询出来
会议通知:当前登录账号,只要是 某会议 的参与者、列席者、主持人中的一员,And there is no feedback from the meeting,则查询出来
待开会议:当前登录账号,只要是 某会议 的参与者、列席者、主持人中的一员,并且会议状态是待开,则查询出来
历史会议:当前登录账号,只要是 某会议 的参与者、列席者、主持人中的一员,And the conference status is over,则查询出来
所有会议:当前登录账号,只要是 某会议 的参与者、列席者、主持人、审批人中的一员,那么必须查询出来
二、我的会议SQL语句编写
第一版:
select a.*,b.name zhuchirenname,c.name auditorname
from t_oa_meeting_info a,
t_oa_user b,
t_oa_user c
where a.zhuchiren = b.id and a.auditor = c.id;
效果:
第二版:
According to the effect of the above picture, you can know that there is no approver for the meeting,So you need to query the table,The meeting information table is used as the main table,用户表作为从表,The conference information table is connected to the user table on the left
select a.*,b.name zhuchirenname,c.name auditorname
from t_oa_meeting_info a
inner join t_oa_user b on a.zhuchiren = b.id
left join t_oa_user c on a.auditor = c.id
效果:
第三版:
According to the above picture effect andSQL语句可以知道,The time field needs to be formatted,Otherwise, a string of numbers will be displayed on the page,会议状态是数字,The front end needs to display the description of the conference status
select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren
,b.name zhuchirenname,
a.location,
DATE_FORMAT(a.startTime,'%Y-%m-%d %h-%m-%s') startTime,
DATE_FORMAT(a.endTime,'%Y-%m-%d %h-%m-%s') endTime,
a.state,
(
case a.state
when 0 then '取消会议'
when 1 then '新建'
when 2 then '待审核'
when 3 then '驳回'
when 4 then '待开'
when 4 then '进行中'
when 6 then '开启投票'
when 7 then '结束会议'
else '其他' end
) meetingstate,
a.seatPic,a.remark,a.auditor,
c.name auditorname
from t_oa_meeting_info a
inner join t_oa_user b on a.zhuchiren = b.id
left join t_oa_user c on a.auditor = c.id;
效果:
三、我的会议后台
将写好的sql语句封装成一个方法
// 我的会议sql,后续其他的菜单也会使用
private String getSQL() {
return "select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren\r\n" +
",b.name zhuchirenname,\r\n" +
"a.location,\r\n" +
"DATE_FORMAT(a.startTime,'%Y-%m-%d %h-%m-%s') startTime,\r\n" +
"DATE_FORMAT(a.endTime,'%Y-%m-%d %h-%m-%s') endTime,\r\n" +
"a.state,\r\n" +
"(\r\n" +
" case a.state\r\n" +
" when 0 then '取消会议'\r\n" +
" when 1 then '新建'\r\n" +
" when 2 then '待审核'\r\n" +
" when 3 then '驳回'\r\n" +
" when 4 then '待开'\r\n" +
" when 4 then '进行中'\r\n" +
" when 6 then '开启投票'\r\n" +
" when 7 then '结束会议'\r\n" +
" else '其他' end\r\n" +
" \r\n" +
") meetingstate,\r\n" +
"a.seatPic,a.remark,a.auditor,\r\n" +
"c.name auditorname \r\n" +
"from t_oa_meeting_info a\r\n" +
"inner join t_oa_user b on a.zhuchiren = b.id\r\n" +
"left join t_oa_user c on a.auditor = c.id and 1=1";
}
编写方法:
// 我的会议
public List<Map<String, Object>> myInfos(MeetingInfo info, PageBean pageBean)
throws SQLException, InstantiationException, IllegalAccessException {
String sql = getSQL();
// 会议标题查询
String title = info.getTitle();
if(StringUtils.isNotBlank(title)) {
sql +=" and title like '%"+title+"%'";
}
sql +=" and zhuchiren = "+info.getZhuchiren();
return super.executeQuery(sql, pageBean);
}
}
web层:
MeetingAction:
我的会议
public String myInfos(HttpServletRequest req, HttpServletResponse resp) {
try {
PageBean pageBean = new PageBean();
pageBean.setRequest(req);
List<Map<String, Object>> list = infodao.myInfos(info, pageBean);
//注意:Layuiin the format of the data table
ResponseUtil.writeJson(resp, R.ok(0, "我的会议数据查询成功", pageBean.getTotal(), list));
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, "我的会议数据查询失败"));
} catch (Exception e1) {
e1.printStackTrace();
}
}
return null;
}
四、前端
前端页面
<%@ 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/myMeeting.js"></script>
<title>用户管理</title>
</head>
<style>
body{
margin:15px;
}
.layui-table-cell {height: inherit;}
.layui-layer-page .layui-layer-content { overflow: visible !important;}
</style>
<body>
<!-- 搜索栏 -->
<div class="layui-form-item" style="margin:15px 0px;">
<div class="layui-inline">
<label class="layui-form-label">会议标题</label>
<div class="layui-input-inline">
<input type="hidden" id="zhuchiren" 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> 查询</button>
</div>
</div>
<!-- 数据表格 -->
<table id="tb" lay-filter="tb" class="layui-table" style="margin-top:-15px"></table>
<!-- 对话框(送审) -->
<div id="audit" style="display:none;">
<form style="margin:20px 15px;" class="layui-form layui-form-pane" lay-filter="audit">
<div class="layui-inline">
<label class="layui-form-label">送审人</label>
<div class="layui-input-inline">
<input type="hidden" id="meetingId" value=""/>
<select id="auditor" style="poistion:relative;z-index:1000">
<option value="">---请选择---</option>
</select>
</div>
<div class="layui-input-inline">
<button id="btn_auditor" class="layui-btn">送审</button>
</div>
</div>
</form>
</div>
<!-- 对话框(反馈详情) -->
<div id="feedback" style="display:none;padding:15px;">
<fieldset class="layui-elem-field layui-field-title">
<legend>参会人员</legend>
</fieldset>
<blockquote class="layui-elem-quote" id="meeting_ok"></blockquote>
<fieldset class="layui-elem-field layui-field-title">
<legend>缺席人员</legend>
</fieldset>
<blockquote class="layui-elem-quote" id="meeting_no"></blockquote>
<fieldset class="layui-elem-field layui-field-title">
<legend>未读人员</legend>
</fieldset>
<blockquote class="layui-elem-quote" id="meeting_noread"></blockquote>
</div>
<script type="text/html" id="tbar">
{
{# if(d.state==1 || d.state==3){ }}
<a class="layui-btn layui-btn-xs" lay-event="seat">会议排座</a>
<a class="layui-btn layui-btn-xs" lay-event="send">送审</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{
{# } }}
{
{# if(d.state!=1 && d.state!=2 && d.state!=3){ }}
<a class="layui-btn layui-btn-xs" lay-event="back">反馈详情</a>
{
{# } }}
</script>
</body>
</html>
js文件代码:
let layer,$,table;
var row;
layui.use(['jquery', 'layer', 'table'], function(){
layer = layui.layer
,$ = layui.jquery
,table = layui.table;
//初始化数据表格
initTable();
//绑定查询按钮的点击事件
$('#btn_search').click(function(){
query();
});
});
//1.初始化数据表格
function initTable(){
table.render({ //执行渲染
elem: '#tb', //指定原始表格元素选择器(推荐id选择器)
// url: 'user.action?methodName=list', //请求地址
height: 340, //自定义高度
loading: false, //是否显示加载条(默认 true)
cols: [[ //设置表头
{field: 'id', title: '会议编号', width: 120},
{field: 'title', title: '会议标题', width: 120},
{field: 'location', title: '会议地点', width: 140},
{field: 'startTime', title: '开始时间', width: 140},
{field: 'endTime', title: '结束时间', width: 140},
{field: 'meetingstate', title: '会议状态', width: 140},
{field: 'seatPic', title: '会议排座', width: 140,templet: function(d){
console.log(d);
//得到当前行数据,并拼接成自定义模板
return '<img src="'+d.seatPic+'">'
}},
{field: 'auditor', title: '审批人', width: 140},
{field: '', title: '操作', width: 220,toolbar:'#tbar'},
]]
});
//在页面中的<table>中必须配置lay-filter="tb_goods"属性才能触发属性!!!
table.on('tool(tb)', function (obj) {
row = obj.data;
if (obj.event == "seat") {
layer.msg("排座");
}else if(obj.event == "send"){
layer.msg("送审");
}else if(obj.event == "del"){
layer.msg("取消会议");
}else if(obj.event == "back"){
layer.msg("反馈详情");
}
});
}
//2.点击查询
function query(){
console.log($("#ctx").val())
table.reload('tb', {
url: 'info.action', //请求地址
method: 'POST', //请求方式,GET或者POST
loading: true, //是否显示加载条(默认 true)
page: true, //是否分页
where: { //设定异步数据接口的额外参数,任意设
'methodName':'myInfos',
'title':$('#title').val(),
'zhuchiren':$("#zhuchiren").val()
},
request: { //自定义分页请求参数名
pageName: 'page', //页码的参数名称,默认:page
limitName: 'rows' //每页数据量的参数名,默认:limit
}
});
}
图片暂时没有......
边栏推荐
猜你喜欢
局域网文件传输
智能合约 ——— app评分合约
HCIP实验(pap、chap、HDLC、MGRE、RIP)
detectron2,手把手教你训练mask_rcnn
文本三剑客——awk 截取+过滤+统计
解决win10安装portal v13/v15要求反复重启问题。
ETCD cluster fault emergency recovery - local data is available
HCIA实验
(2) Software Testing Theory (*Key Use Case Method Writing)
SECURITY DAY06 ( iptables firewall, filter table control, extended matching, typical application of nat table)
随机推荐
Map Reduce
照片的35x45,300dpi怎么弄
防火墙-0-管理地址
HPC平台搭建
window10吐槽
No threat of science and technology - TVD vulnerability information daily - 2022-7-21
SECURITY DAY05(Kali系统 、 扫描与抓包 、 SSH基本防护、服务安全 )
ETCD Single-Node Fault Emergency Recovery
SSH服务详解
从mask-rcnn到shp
arcgis填坑_4
【LeetCode】306.累加数(思路+题解)
命令输出给变量
CLUSTER DAY04 (Block Storage Use Cases, Distributed File Systems, Object Storage)
CLUSTER DAY03 (Ceph overview, the deployment of Ceph CLUSTER, Ceph block storage)
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-28
局域网文件传输
detectron2,手把手教你训练mask_rcnn
AUTOMATION DAY06 (Ansible Advanced, Ansible Role)
HCIA知识复习