基于java民航售票管理系统源码(java毕业设计)
基于java民航售票管理系统
民航售票管理系统是基于java编程语言和mysql数据库开发的设计,本设计拥有用户和管理员两个角色,其中用户可以注册和登录系统,查询航班信息,在线订票,查看订单,账号充值等;管理员则是对用户信息,航班信息,订单信息,飞机信息,系统统计等功能进行管理。本设计界面简洁美观,功能完整,适合作为java毕业设计或java课程设计来参考和学习。
一.技术环境
JDK版本:1.8 及以上
IDE工具:eclipse
数据库: mysql 及5.5 以上
编程语言: Java
tomcat: 8.0 及以上
详细技术:HTML+CSS+JS+JSP+JAVA+SERVLET+MYSQL+JQUERY
二.项目文件(项目获取请看文末官网)
三.系统功能
四.代码示例
package com.lmu.controller;/*** 用户新增*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.Pager;
import com.lmu.utils.UserUtils;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.awt.event.FocusEvent;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;@Controller("userController")
@Scope("prototype")
public class UserController extends ActionSupport implements ModelDriven<User> {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Integer userId;private Map<String, Object> map = new HashMap();/*** list** @return*/public String list() throws IOException {User user1 = UserUtils.getUser();if (user1 == null || user1.getId() == null){ActionContext.getContext().put("login", 1);return SUCCESS;}Pager<User> pagers = null;Role role = user1.getRole();if (role.getEnName().equals("admin")) {pagers = userService.getList(user);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("user", user1);ActionContext.getContext().put("role", role);ActionContext.getContext().put("bean", user);return SUCCESS;} else if (role.getEnName().equals("xs") || role.getEnName().equals("js")) {pagers = userService.getList(user1);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("bean", user);return SUCCESS;}return null;}/*** 跳转add** @return*/public String add() {Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 查询修改** @return*/public String edit() {User bean = userService.findById(userId);Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("bean", bean);ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 审核** @return*/public void updateSh() throws IOException {user.setIsSh(1);userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}/*** 更新** @return*/public String update() throws IOException {if (user.getPass().equals("")){user.setPass(null);}userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);return SUCCESS;}/*** 保存** @return*/public void save() throws IOException {if (userService.getUser(user) != null){map.put("flag", false);map.put("url", "login_login.do");JsonUtils.toJson(map);} else {user.setTime(new Date());userService.save(user);map.put("flag", true);map.put("url", "login_login.do");JsonUtils.toJson(map);}}public void delete() throws IOException {User user1 = userService.findById(userId);user1.setIsDelete(1);userService.update(user1);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}@Overridepublic User getModel() {if (user == null) {user = new User();}return user;}public Integer getUserId() {return userId;}public void setUserId(Integer userId) {this.userId = userId;}public User getUser() {return user;}public void setUser(User user) {this.user = user;}
}
package com.lmu.controller;
/*** 和登陆有关的都在这里*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.UserUtils;import org.apache.commons.collections.map.HashedMap;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.io.IOException;
import java.util.HashMap;
import java.util.Map;@Controller("loginController")
@Scope("prototype")
public class LoginController extends ActionSupport {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Map<String, Object> map = new HashMap();public User getUser() {return user;}public void setUser(User user) {this.user = user;}public UserService getUserService() {return userService;}public void setUserService(UserService userService) {this.userService = userService;}/*** 用户登陆* @return*/public void index() throws IOException {User user1 = userService.getUser(user);if (user1 != null){if (user1.getIsSh() == 1){if (user1.getRole().getEnName().equals("admin")){ActionContext.getContext().getSession().put("user", user1);}if (user1.getRole().getEnName().equals("js")){ActionContext.getContext().getSession().put("user1", user1);}if (user1.getRole().getEnName().equals("xs")){ActionContext.getContext().getSession().put("user2", user1);}map.put("flag", 1);map.put("url", "login_indexs.do");map.put("id", user1.getId());JsonUtils.toJson(map);} else {map.put("flag", 2);JsonUtils.toJson(map);}} else {map.put("flag", 3);JsonUtils.toJson(map);}}public String indexs() throws IOException {User u = UserUtils.getUser();if (u != null){ActionContext.getContext().put("user", u);String ss = u.getRole().getEnName();ActionContext.getContext().put("role", u.getRole().getEnName());}return SUCCESS;}//登陆页面public String login() {return SUCCESS;}//退出public String tuichu() {ActionContext ac = ActionContext.getContext();Map session = ac.getSession();session.remove("userName");session.remove("userId");ServletActionContext.getRequest().getSession().invalidate();return "login";}}
五.项目截图
基于java民航售票管理系统源码(java毕业设计)相关推荐
- 基于Java的超市管理系统源码,数据库MySQL(附加论文13000字)
目录 1.摘要 2.社会背景 3.系统可行性研究 4.系统的功能结构(图) 5.功能需求 6.开发环境介绍 7.系统数据流(图) 8.数据库(E-R模型) 9.功能展示 10.论文目录结构 11.源码 ...
- java计算机毕业设计基于Ssm学生信息管理系统源码+数据库+系统+lw文档+mybatis+运行部署
java计算机毕业设计基于Ssm学生信息管理系统源码+数据库+系统+lw文档+mybatis+运行部署 java计算机毕业设计基于Ssm学生信息管理系统源码+数据库+系统+lw文档+mybatis+运 ...
- 计算机毕业设计Java汽车客运站票务管理系统(源码+系统+mysql数据库+lw文档)
计算机毕业设计Java汽车客运站票务管理系统(源码+系统+mysql数据库+lw文档) 计算机毕业设计Java汽车客运站票务管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构 ...
- java毕业设计生产管理系统源码+lw文档+mybatis+系统+mysql数据库+调试
java毕业设计生产管理系统源码+lw文档+mybatis+系统+mysql数据库+调试 java毕业设计生产管理系统源码+lw文档+mybatis+系统+mysql数据库+调试 本源码技术栈: 项目 ...
- 计算机毕业设计Java产品销售管理系统(源码+系统+mysql数据库+lw文档)
计算机毕业设计Java产品销售管理系统(源码+系统+mysql数据库+lw文档) 计算机毕业设计Java产品销售管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 ...
- 计算机毕业设计Java房产中介管理系统(源码+系统+mysql数据库+lW文档)
计算机毕业设计Java房产中介管理系统(源码+系统+mysql数据库+lW文档) 计算机毕业设计Java房产中介管理系统(源码+系统+mysql数据库+lW文档) 本源码技术栈: 项目架构:B/S架构 ...
- 计算机毕业设计Java电影售票系统(源码+系统+mysql数据库+lw文档)
计算机毕业设计Java电影售票系统(源码+系统+mysql数据库+lw文档) 计算机毕业设计Java电影售票系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 开发语 ...
- 计算机毕业设计Java企业人事管理系统(源码+系统+mysql数据库+lw文档)
计算机毕业设计Java企业人事管理系统(源码+系统+mysql数据库+lw文档) 计算机毕业设计Java企业人事管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 ...
- 计算机毕业设计Java医用物品管理系统(源码+系统+mysql数据库+lw文档)
计算机毕业设计Java医用物品管理系统(源码+系统+mysql数据库+lw文档) 计算机毕业设计Java医用物品管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 ...
- 计算机毕业设计Java学生公寓管理系统(源码+系统+mysql数据库+lw文档
计算机毕业设计Java学生公寓管理系统(源码+系统+mysql数据库+lw文档 计算机毕业设计Java学生公寓管理系统(源码+系统+mysql数据库+lw文档) 本源码技术栈: 项目架构:B/S架构 ...
最新文章
- numpy数组切片:一维/二维/数组
- PowerShell_零基础自学课程_8_高级主题:WMI对象和COM组件
- Topcoder SRM 628 DIV 2
- java batch_Java EE 7 Batch中传递属性/参数的2种方式
- 【转】LDA数学八卦
- 面试被问线程池,真香
- MySQL主从原理,基于快速学习一门技术的3种方式
- python 计算均值 方差 标准差
- 量化派周灏:从物理博士到科技公司 CEO,不变的是“格物致理”
- 耀之阳电商:拼多多买家降权是什么意思
- 城市虚拟交通系统与交通发展决策支持模式研究
- KOL垂直化,品牌营销策略如何变更?
- android gravity 属性解析
- Linux/Android——input_handler之evdev (四)
- 服装制鞋业的特点及管理(转)
- 计算机网络期末复习资料(一)
- Whale帷幄 - 企业数字化解决方案服务商 数字化方案提供商
- 统计词频 matlab,批量统计若干类词频总数方法
- 利用百度风云榜热搜引爆你的流量
- Android f_rndis 分析笔记
热门文章
- 货运与物流的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
- android button设置边框背景颜色
- 小程序上传图片报错MiniProgramError “createUploadTask:fail url not in domain list“ 解决方案
- 激光位移传感器与其他位移传感器比较
- nar-gab投稿记录
- Python+KinectV2——PyKinect
- 2种特殊电容:X电容和Y电容,
- java 2048思路_浅谈2048
- SpringBoot启动成功后,访问接口报错404(error:“Not Found“)
- Windows2016 主从CA(一、企业根CA与独立从CA)