基于SpringBoot+vue实现火车订票平台管理系统

 前言介绍(私信获取完整代码):

     随着网络的不断普及和发展,在网络技术的支持下,列车订票管理系统得到了迅速的发展。首先,我们要从用户的实际需求出发。通过了解用户的需求,开发有针对性的主页、个人中心、用户管理、车辆信息管理、订票信息管理、火车票订单管理、退票订单管理、系统管理等功能,网络的使用方便给用户带来了这个功能来调整系统,系统的设计让用户使用更加方便,本系统的主要目的是给用户带来快捷、高效、安全,用户只要在家里就可以操作。同时随着电子商务的发展,网上火车票订票管理系统也受到了广大用户的关注。

     互联网发展至今,已经解决了很多我们解决不了的难题,使得我们工作更加便捷,提高了我们的工作效率。目前各行各业都在运用网络信息管理程序,不同的用户也都接触到信息管理,特别是在各大电商行业广泛的应运起来。通过对当前网络环境发展的分析与总结,开发火车订票管理系统可以改变以往的火车订票管理系统方式,改变传统线下火车订票管理系统的状态,由于用户的不断增多,使用传统的线下火车订票管理系统模式已经远远不能满足于用户需求了,而且越来越多的国有企业也在开通线上进行火车订票管理系统,所以开发一个火车订票管理系统可以解决国有企业不利于线下火车订票管理系统的问题,设计的网站保证信息的完整安全,这样才能提高工作效率,保证系统安全正常的运行。

功能设计:

本火车订票管理系统主要包括二大功能模块,即用户功能模块和管理员功能模块。

(1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员功能来管理后台系统。主要功能有:首页、个人中心、用户管理、车型信息管理、车次信息管理、购票订单管理、改签订单管理、退票订单管理、系统管理等功能。管理员用例图如图所示。

(2)用户:首页、个人中心、购票订单管理、改签订单、退票订单管理等功能,用户如图所示。

(3)前台首页:首页、车次信息、火车资讯、个人中心、后台管理等功能,前台首页如图所示。

功能截图:

管理员登录:通过填写注册时输入的用户名、密码、角色进行登录

用户主页:

车次信息:

火车资讯:

个人中心:

改签信息:

订单信息:

后台管理:

用户管理:

车型管理:

车次管理:

订票管理:

退票管理:

改签管理:

火车资讯:

轮播图等

​​

关键源码:


/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	@Async
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		File upload = new File("D:/work/");
		if(!upload.exists()) {
			upload.mkdirs();
		}
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(upload+"/"+fileName);

		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public ResponseEntity<byte[]> download(@RequestParam String fileName) {
		try {
			File path = new File(ResourceUtils.getURL("classpath:static").getPath());
			if(!path.exists()) {
			    path = new File("");
			}
			File upload = new File(path.getAbsolutePath(),"/upload/");
			if(!upload.exists()) {
			    upload.mkdirs();
			}
			File file = new File(upload.getAbsolutePath()+"/"+fileName);
			if(file.exists()){
				/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
					getResponse().sendError(403);
				}*/
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

数据库设计:

 checixinxi表:

序号字段名称字段类型大小允许为空最大长度备注
1idInt410
2addtime150255
3checimingcheng150255
4huochemingchengDateTime8255
5chepai150255
6tupianDateTime8255
7qidianzhan150255
8zhongdianzhanDateTime8255
9tujing150255
10riqiDateTime8255
11chufashijian150255
12shizhangDateTime8255
13zuoweileixing150255
14jiageDateTime8255
15piaoshu150255

chexingxinxi表:

序号字段名称字段类型大小允许为空最大长度备注
1idInt410
2addtime150255
3huochebianhao150255
4huochemingchengDateTime8255
5shisu150255
6zuoweishuDateTime8255
7chepai150255

gaiqiandingdan表:

序号字段名称字段类型大小允许为空最大长度备注
1idInt410
2addtime150255
3dingdanbianhao150255
4checimingcheng150255
5chepaiDateTime8255
6qidianzhanshangpinleixingDateTime8255
7zhongdianzhan255
8zongjiageDateTime255
9gaiqianriqiDateTime255
10yonghumingDateTime255
11xingmingDateTime255
12shoujiDateTime255

goupiaodingdan表:

序号字段名称字段类型大小允许为空最大长度备注
1idInt410
2addtime150255
3dingdanbianhao150255
4checimingcheng150255
5chepaiDateTime8255
6qidianzhanDateTime255
7zhongdianzhan255
8chufashijianshangpinleixingDateTime8255
9zuoweileixingshangpinleixingDateTime8255
10jiageshangpinleixingDateTime8255
11piaoshushangpinleixingDateTime8255
12zongjiageshangpinleixingDateTime8255
13zongjiageshangpinleixingDateTime8255
14goumairiqishangpinleixingDateTime8255
15yonghumingshangpinleixingDateTime8255
16xingmingshangpinleixingDateTime8255
17shoujishangpinleixingDateTime8255
18shenfenzhengshangpinleixingDateTime8255

论文报告:

源码获取:

 大家点赞、收藏、关注、评论啦 、查看👇👇🏻👇🏻主页👇🏻👇🏻

打卡 文章 更新 208/  365天

  • 11
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

进击的代码家

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值