基于ssm后端的校车购票微信小程序源码和论文

  • 选题的目的和意义

本次开发的校车购票微信小程序相对于传统的APP脱离了平台的限制,只要完成开发即可在Android端和IOS端都可以访问,将传统的校车购票模式改进成了基于微信的小程序的移动模式,使校车购票脱离空间的限制,让用户通过微信平台可随时随地的进行查看自己乘坐的车辆信息,管理人员可管理车辆、安排车辆,可以提高校车购票效率,也加快了移动互联网时代发展的进程,可实现校园的信息化发展。

本次《校车购票微信小程序的设计与实现》设计主要体现于提高同学们对校车购票的需求分析、业务模型的建立、完成程序设计以及运行结果达到设计要求的能力。与此同时,我们在设计过程中进一步加强和巩固了所学到的知识,为今后工作和学习打下坚实了的基础。

  • 国内外研究现状和发展趋势

移动互联网的不断发展,手机的使用频率越来越频繁,移动互联网时代已经融入我们的生活,工信部数据显示我国移动电话用户将近13亿,移动互联网用户数量将近达到9亿,4G用户继续保持高速增长态势。5G时代的开启以及移动终端设备的普及为移动互联网注入了巨大的能量,PC端互联网已经处于日渐饱和的状态,而移动互联网却正在蓬勃发展,传统的互联网巨头们也都将目光聚集到移动互联网。

随着现代信息技术的快速崛起和发展,智能手机几乎已覆盖全国,微信公众平台在微信中的应用频率日益增加,首当其冲的就是Internet与智能手机的融合了,为微信的发展提供了丰富有力的条件。目前校车购票微信小程序还不成熟,大多数的校车购票系统都出现在传统的WEB应用上,在这个环境下,校车购票微信小程序属于一个崭新的应用。目前,绝大部分的网络应用都还是传统的WEB应用,但面对微信如此普及的今天,传统WEB的应用不能满足人们随时随地体验网络应用的想法,所以,出现在手机微信客户端的小程序将会越来越多,同时其发展的速度也会越来越快。校车购票系统作为传统WEB应用,也必将在手机微信平台上得到应用。

  • 研究(设计)目标和内容

1.研究目标

(1)完成基于校车购票微信小程序开发,实现用户注册登录、车辆管理以及安排车辆的重要功能。

(2)完成系统代码的设计和使用文档的编写。

(3)完成毕业设计文档的编写。

2.研究内容

本校车购票微信小程序主要实现微信端学生功能模块和服务端管理员功能模块两大部分,具体如下:

服务端管理员功能模块

(1)管理学生的注册信息

(2)管理车辆信息

(3)安排车辆接送学生 乘坐车辆车牌号,到达时间等

微信端学生功能模块

(1)注册个人信息

(2)查看自己乘坐的车辆信息

四、研究(设计)技术路线、研究方法、研究提纲

1.研究的方法

文献研究法:查阅软件工程、数据库开发、微信开发者工具等的相关资料。查阅软件工程各类文档的编写方法。通过网上查阅并参考相关系统的业务及功能。

小组讨论:与同学进行讨论、请教指导老师,解决在程序设计中遇到的问题

调查法:调查当前市场上所用的类似系统的设计理念

功能分析法:通过说明现象怎样满足一个系统的需要来解释现实现象。

2.研究措施

a.完成系统调查,分析整个系统的业务流程,根据每个模块的功能实现需求分析。

b.进行系统总体设计。

c.数据库设计

建立概念模型,并用E-R图描述;

将概念模型转换成关系模式,进行实体与联系的描述

数据库结构的详细设计

d.系统实现

本系统采用微信开发者工具、Java语言进行开发设计;

数据库选择MYSQL数据库。

运用图形界面、核心代码及相应的说明文字解析系统重要模块的实现过程和结果。

e.系统测试

结合软件工程中的测试方法,设计相应的测试用例,对系统进行简单测试。

3.论文提纲

1绪论

1.1研究背景

1.2研究现状

1.3论文组织结构

2系统关键技术

2.1微信小程序

2.2微信Web开发者工具

2.3 WXML 、WXS、JS小程序编写语言

2.4微信小程序API接口

2.5 MYSQL数据库

3系统分析

3.1可行性分析

3.2系统性能分析

3.3系统功能分析

3.4系统用例建模分析

3.5系统流程分析

4系统设计

4.1系统开发流程设计

4.2系统结构设计

4.3系统数据库设计

5系统的实现

5.1用户功能模块的实现

5.2管理员功能模块的实现

6系统测试

6.1测试概述

6.2测试原则

6.3测试方法

6.4测试结果分析

7总结

参考文献

致谢

基于ssm后端的校车购票微信小程序源码和论文weixin088

 

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.XueshengEntity;
import com.entity.view.XueshengView;

import com.service.XueshengService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 学生
 * 后端接口
 * @author 
 * @email 
 * @date 2021-05-12 21:06:40
 */
@RestController
@RequestMapping("/xuesheng")
public class XueshengController {
    @Autowired
    private XueshengService xueshengService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"xuesheng",  "学生" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody XueshengEntity xuesheng){
    	//ValidatorUtils.validateEntity(xuesheng);
    	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", xuesheng.getXuehao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		xuesheng.setId(uId);
        xueshengService.insert(xuesheng);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        XueshengEntity user = xueshengService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setMima("123456");
        xueshengService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,XueshengEntity xuesheng, 
		HttpServletRequest request){

        EntityWrapper<XueshengEntity> ew = new EntityWrapper<XueshengEntity>();
		PageUtils page = xueshengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuesheng), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,XueshengEntity xuesheng, 
		HttpServletRequest request){
        EntityWrapper<XueshengEntity> ew = new EntityWrapper<XueshengEntity>();
		PageUtils page = xueshengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuesheng), params), params));
        return R.ok().put("data", page);
    }

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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(XueshengEntity xuesheng){
        EntityWrapper< XueshengEntity> ew = new EntityWrapper< XueshengEntity>();
 		ew.allEq(MPUtil.allEQMapPre( xuesheng, "xuesheng")); 
		XueshengView xueshengView =  xueshengService.selectView(ew);
		return R.ok("查询学生成功").put("data", xueshengView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        XueshengEntity xuesheng = xueshengService.selectById(id);
        return R.ok().put("data", xuesheng);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        XueshengEntity xuesheng = xueshengService.selectById(id);
        return R.ok().put("data", xuesheng);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
    	xuesheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(xuesheng);
    	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", xuesheng.getXuehao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		xuesheng.setId(new Date().getTime());
        xueshengService.insert(xuesheng);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
    	xuesheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(xuesheng);
    	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", xuesheng.getXuehao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		xuesheng.setId(new Date().getTime());
        xueshengService.insert(xuesheng);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody XueshengEntity xuesheng, HttpServletRequest request){
        //ValidatorUtils.validateEntity(xuesheng);
        xueshengService.updateById(xuesheng);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        xueshengService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<XueshengEntity> wrapper = new EntityWrapper<XueshengEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = xueshengService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.WodechengchexinxiEntity;
import com.entity.view.WodechengchexinxiView;

import com.service.WodechengchexinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 我的乘车信息
 * 后端接口
 * @author 
 * @email 
 * @date 2021-05-12 21:06:40
 */
@RestController
@RequestMapping("/wodechengchexinxi")
public class WodechengchexinxiController {
    @Autowired
    private WodechengchexinxiService wodechengchexinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,WodechengchexinxiEntity wodechengchexinxi, 
		HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
    		wodechengchexinxi.setUserid((Long)request.getSession().getAttribute("userId"));
    	}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("xuesheng")) {
			wodechengchexinxi.setXuehao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<WodechengchexinxiEntity> ew = new EntityWrapper<WodechengchexinxiEntity>();
		PageUtils page = wodechengchexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wodechengchexinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,WodechengchexinxiEntity wodechengchexinxi, 
		HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("xuesheng")) {
			wodechengchexinxi.setXuehao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<WodechengchexinxiEntity> ew = new EntityWrapper<WodechengchexinxiEntity>();
		PageUtils page = wodechengchexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wodechengchexinxi), params), params));
        return R.ok().put("data", page);
    }

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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(WodechengchexinxiEntity wodechengchexinxi){
        EntityWrapper< WodechengchexinxiEntity> ew = new EntityWrapper< WodechengchexinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( wodechengchexinxi, "wodechengchexinxi")); 
		WodechengchexinxiView wodechengchexinxiView =  wodechengchexinxiService.selectView(ew);
		return R.ok("查询我的乘车信息成功").put("data", wodechengchexinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        WodechengchexinxiEntity wodechengchexinxi = wodechengchexinxiService.selectById(id);
        return R.ok().put("data", wodechengchexinxi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        WodechengchexinxiEntity wodechengchexinxi = wodechengchexinxiService.selectById(id);
        return R.ok().put("data", wodechengchexinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody WodechengchexinxiEntity wodechengchexinxi, HttpServletRequest request){
    	wodechengchexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(wodechengchexinxi);
    	wodechengchexinxi.setUserid((Long)request.getSession().getAttribute("userId"));

        wodechengchexinxiService.insert(wodechengchexinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody WodechengchexinxiEntity wodechengchexinxi, HttpServletRequest request){
    	wodechengchexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(wodechengchexinxi);
    	wodechengchexinxi.setUserid((Long)request.getSession().getAttribute("userId"));

        wodechengchexinxiService.insert(wodechengchexinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody WodechengchexinxiEntity wodechengchexinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(wodechengchexinxi);
        wodechengchexinxiService.updateById(wodechengchexinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        wodechengchexinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<WodechengchexinxiEntity> wrapper = new EntityWrapper<WodechengchexinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}
		if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
    		wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
    	}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("xuesheng")) {
			wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
		}

		int count = wodechengchexinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

  • 24
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值