- 一、后端
- 1、MeetingInfoDao
- 2、MeetingInfoAction
- 3、配置文件和服务器
- 二、前端
- 1、myMeeting.js
- 2、seatPic.jsp
- 3、myMeeting.jsp
- 4、导入外部js
- 三、运行效果
package com.zking.dao; import java.sql.SQLException; import java.util.List; import java.util.Map; import com.zking.entity.MeetingInfo; import com.zking.util.BaseDao; import com.zking.util.PageBean; import com.zking.util.StringUtils; public class MeetingInfoDao extends BaseDao2、MeetingInfoAction{ // 添加会议信息 public int add(MeetingInfo info) throws Exception { String sql = "insert into t_oa_meeting_info(title,content,canyuze,liexize,zhuchiren,rn" + "location,startTime,endTime,remark) values(?,?,?,?,?,?,?,?,?)"; return super.executeUpdate(sql, info, new String[] { "title", "content", "canyuze", "liexize", "zhuchiren", "location", "startTime", "endTime", "remark" }); } //我的会议SQL,后续其他的菜单也会使用 private String getSQL() { return "select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchirenrn" + ",b.name zhuchirenname,rn" + "a.location,rn" + "DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,rn" + "DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,rn" + "a.state,rn" + "(rn" + " case a.statern" + " when 0 then '取消会议'rn" + " when 1 then '新建'rn" + " when 2 then '待审核'rn" + " when 3 then '驳回'rn" + " when 4 then '待开'rn" + " when 5 then '进行中'rn" + " when 6 then '开启投票'rn" + " when 7 then '结束会议'rn" + " else '其他' endrn" + ") meetingstate,rn" + "a.seatPic,a.remark,a.auditor,rn" + "c.name auditornamern" + "from t_oa_meeting_info arn" + "inner join t_oa_user b on a.zhuchiren=b.idrn" + "left join t_oa_user c on a.auditor=c.id and 1=1 "; } //我的会议 public List
package com.zking.web; import java.util.Date; import java.util.List; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.beanutils.ConvertUtils; import com.zking.dao.MeetingInfoDao; import com.zking.entity.MeetingInfo; import com.zking.framework.ActionSupport; import com.zking.framework.ModelDriver; import com.zking.util.Base64ImageUtils; import com.zking.util.MyDateConverter; import com.zking.util.PageBean; import com.zking.util.PropertiesUtil; import com.zking.util.R; import com.zking.util.ResponseUtil; public class MeetingInfoAction extends ActionSupport implements ModelDriver3、配置文件和服务器{ private MeetingInfo info = new MeetingInfo(); private MeetingInfoDao meetingInfoDao = new MeetingInfoDao(); @Override public MeetingInfo getModel() { //方式二: ConvertUtils.register(new MyDateConverter(),Date.class); return info; } public String updateSeatPicById(HttpServletRequest req, HttpServletResponse resp) { try { // E:/temp/images/T280/abcdefg.png // 获取图片的存放地址 dirPath=E:/temp/images/T280/ String dirPath = PropertiesUtil.getValue("dirPath"); // 获取浏览器请求路径,为了后续保存到数据库 serverPath=/upload/paizuo/ String serverPath = PropertiesUtil.getValue("serverPath"); // 随机生成一个图片名称 String fileName = UUID.randomUUID().toString().replaceAll("-", "")+".png"; info.getSeatPic();//图片字符串 Base64ImageUtils.GenerateImage(info.getSeatPic().replaceAll("data:image/png;base64,", ""), dirPath+fileName); // 将seatPic中内容修改为 请求地址 info.setSeatPic(serverPath+fileName); // 修改会议排座 数据库图片 对应的数据库列段 int rs = meetingInfoDao.updateSeatPicById(info); if (rs > 0) { ResponseUtil.writeJson(resp, R.ok(200, "会议排座成功")); }else { ResponseUtil.writeJson(resp, R.error(0, "会议排座失败")); } } catch (Exception e) { e.printStackTrace(); try { ResponseUtil.writeJson(resp, R.error(0, "会议排座失败")); } catch (Exception e1) { e1.printStackTrace(); } } return null; } // 会议发布 public String add(HttpServletRequest req, HttpServletResponse resp) { try { int rs = meetingInfoDao.add(info); if (rs > 0) { ResponseUtil.writeJson(resp, R.ok(200, "会议发布成功")); }else { ResponseUtil.writeJson(resp, R.error(0, "会议发布失败")); } } catch (Exception e) { e.printStackTrace(); try { ResponseUtil.writeJson(resp, R.error(0, "会议发布失败")); } catch (Exception e1) { e1.printStackTrace(); } } return null; } // 我的会议 public String myInfos(HttpServletRequest req,HttpServletResponse resp) { try { PageBean pageBean = new PageBean(); pageBean.setRequest(req); List
dirPath=E:/temp/images/T280/ serverPath=/upload/paizuo/ dirPathSign=E:/temp/images/T280/sign/ serverPathSign=/upload/sign/
记得修改路径
记得定义form
methodName要调对方法
let layer,$,table,form;
var row;
layui.use(['jquery','layer','table','form'],function(){
layer=layui.layer,
$=layui.jquery,
form=layui.form,
table=layui.table;
//初始化表格
initTable();
//绑定查询按钮的点击事件
$('#btn_search').click(function(){
query();
});
//初始化审批人
initFormSelects();
//送审
$('#btn_auditor').click(function(){
$.post($("#ctx").val()+'/info.action',{
'methodName':'updateAuditorById',
'id':$('#meetingId').val(),
'auditor':$('#auditor').val()
},function(rs){
if(rs.success){
//关闭对话框
layer.closeAll();
//刷新列表
query();
}else{
layer.msg(rs.msg,{icon:5},function(){});
}
},'json');
return false;
});
});
//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: 120},
{field: 'endTime', title: '结束时间', width: 140},
{field: 'meetingstate', title: '会议状态', width: 120},
{field: 'seatPic', title: '会议排座', width: 140,templet: function(d){
console.log(d);
//得到当前行数据,并拼接成自定义模板
return '
'
}},
{field: 'auditorname', title: '审批人', width: 120},
{field: '', title: '操作', width: 220,toolbar:'#tbar'},
]]
});
//在页面中的1、
2、点击会议排座
3、排好后点击下载
4、排座完后点击送审
5、送审后即可
Java相关栏目本月热门文章
- 1【Linux驱动开发】设备树详解(二)设备树语法详解
- 2别跟客户扯细节
- 3Springboot+RabbitMQ+ACK机制(生产方确认(全局、局部)、消费方确认)、知识盲区
- 4【Java】对象处理流(ObjectOutputStream和ObjectInputStream)
- 5【分页】常见两种SpringBoot项目中分页技巧
- 6一文带你搞懂OAuth2.0
- 7我要写整个中文互联网界最牛逼的JVM系列教程 | 「JVM与Java体系架构」章节:虚拟机与Java虚拟机介绍
- 8【Spring Cloud】新闻头条微服务项目:FreeMarker模板引擎实现文章静态页面生成
- 9JavaSE - 封装、static成员和内部类
- 10树莓派mjpg-streamer实现监控及拍照功能调试
- 11用c++写一个蓝屏代码
- 12从JDK8源码中看ArrayList和LinkedList的区别
- 13idea 1、报错java: 找不到符号 符号: 变量 log 2、转换成Maven项目
- 14在openwrt使用C语言增加ubus接口(包含C uci操作)
- 15Spring 解决循环依赖
- 16SpringMVC——基于MVC架构的Spring框架
- 17Andy‘s First Dictionary C++ STL set应用
- 18动态内存管理
- 19我的创作纪念日
- 20Docker自定义镜像-Dockerfile
热门相关搜索
路由器设置
木托盘
宝塔面板
儿童python教程
心情低落
朋友圈
vim
双一流学科
专升本
我的学校
日记学校
西点培训学校
汽修学校
情书
化妆学校
塔沟武校
异形模板
西南大学排名
最精辟人生短句
6步教你追回被骗的钱
南昌大学排名
清朝十二帝
北京印刷学院排名
北方工业大学排名
北京航空航天大学排名
首都经济贸易大学排名
中国传媒大学排名
首都师范大学排名
中国地质大学(北京)排名
北京信息科技大学排名
中央民族大学排名
北京舞蹈学院排名
北京电影学院排名
中国戏曲学院排名
河北政法职业学院排名
河北经贸大学排名
天津中德应用技术大学排名
天津医学高等专科学校排名
天津美术学院排名
天津音乐学院排名
天津工业大学排名
北京工业大学耿丹学院排名
北京警察学院排名
天津科技大学排名
北京邮电大学(宏福校区)排名
北京网络职业学院排名
北京大学医学部排名
河北科技大学排名
河北地质大学排名
河北体育学院排名



