目录
结尾名片获取源码
开发语言:Java
框架:SpringBoot
持久化框架:Mybatis-plus
JDK版本:JDK1.8
服务器:tomcat7\8\9
数据库:mysql 5.7以上
数据库工具:Navicat11以上
开发软件:eclipse/myeclipse/idea
Maven:Maven3.5.4
浏览器:谷歌浏览器\Edge
功能描述
当今社会已经步入了科学技术进步和经济社会快速发展的新时期,国际信息和学术交流也不断加强,计算机技术对经济社会发展和人民生活改善的影响也日益突出,人类的生存和思考方式也产生了变化。传统趵突泉景区的智慧导游采取了人工的管理方法,但这种管理方法存在着许多弊端,比如效率低下、安全性低以及信息传输的不准确等,同时由于趵突泉景区的智慧导游中会形成众多的个人文档和信息系统数据,通过人工方法对景点信息、语言导览、酒店信息、美食信息等进行集中管理会形成检索、更改和维护等较为麻烦的管理问题,同时由于广大用户对网络技术的需求也日益高涨,于是信息技术也需要继续开展全新的改革以满足时代的需求。根据此问题,研发一套趵突泉景区的智慧导游小程序,既能够大大提高信息的检索、变更与维护的工作效率,也能够方便微信小程序的管理运用,从而减少信息管理成本,提高效率。
该趵突泉景区的智慧导游小程序采用Uni-weixin、SpringBoot架构技术,前端以小程序页面呈现给用户,结合后台java语言使页面更加完善,后台使用MySQL数据库进行数据存储。该微信小程序主要设计并完成了管理过程中的用户注册登录、个人信息修改、用户、景点类型、景点信息、门票预定、房间类型等功能。该微信小程序操作简便,界面设计简洁,不但可以基本满足本行业的日常管理工作,同时又可以有效减少人员成本和时间成本,为趵突泉景区的智慧导游管理工作提供了方便。
系统设计
趵突泉景区的智慧导游小程序根据权限类型进行分类,主要可分为用户微信端和管理员服务端二大模块。用户微信端模块主要实现了修改个人信息,查看景点信息、语言导览、酒店信息、美食信息、特产信息、景区资讯等操作,加强了用户的操作体验。管理员服务端模块主要根据管理员对整个系统的管理进行设计,提高了管理的效率和规范[11]。系统总体模块设计如下图所示:
功能展示
当游客打开微信小程序的网址后,首先看到的就是微信小程序首页界面。在这里,游客能够看到趵突泉景区的智慧导游小程序的低部导航条显示首页、景点信息、语言导览、酒店信息、美食信息、特产信息、景区资讯、地图、我的等,如图5-1所示。
当用户进入微信小程序进行相关操作前必须先注册登录,在注册页面填写用户名、密码、姓名、性别、头像、邮箱、手机等信息,然后点击注册,如图5-2所示。
用户登录,用户在登录页面通过填写账号、密码,完成登录,如图5-3所示。
用户点击景点信息,在景点信息页面的输入栏填写景点名称,进行搜索,然后可以查看景点名称、景点类型、等级、图片、票价、票数、开放时间、服务电话、详细地址等信息,也可以点击购票、收藏或评论等操作,如图5-4所示。
用户点击酒店信息,在酒店信息页面的输入栏填写酒店名称,进行搜索,然后可以查看酒店名称、酒店等级、房间类型、图片、房间数量、价格、咨询电话、详细地址等信息,也可以点击预定、收藏或评论等操作,如图5-5所示。
用户点击我的页面,在我的页面可以对门票预定、酒店预定、订单信息、我的收藏管理,进行详细操作,如图5-6所示。
管理员登录,在登录页面选择正确输入用户名和密码后,点击登录操作;如图5-7所示。
管理员进入系统主页面,主要功能包括对系统首页、个人中心、用户管理、景点类型管理、景点信息管理、门票预定管理、房间类型管理、酒店信息管理、酒店预定管理、美食类型管理、美食信息管理、订单信息管理、语言导览管理、特产类型管理、特产信息管理、特产购买管理、系统管理等进行操作。如图5-8所示:
管理员点击用户管理,在用户管理页面的输入用户名、姓名、性别、头像、邮箱、手机等信息,进行查询、新增或者删除用户信息等操作,如图5-9所示。
管理员点击景点信息管理,在景点信息管理页面的输入景点名称、景点类型、等级、图片、票价、票数、开放时间、服务电话、详细地址等信息,进行查询、新增或者删除景点信息等操作,如图5-10所示。
管理员点击门票预定管理,在门票预定管理页面的输入订单编号、景点名称、图片、票价、票数、总价、购买时间、用户名、姓名、手机、是否支付等信息,进行查询或者删除门票预定等操作,如图5-11所示。
管理员点击房间类型管理,在房间类型管理页面的对房间类型等信息,进行查询或者删除房间类型等操作,如图5-12所示。
管理员点击酒店信息管理,在酒店信息管理页面的对酒店名称、酒店等级、房间类型、图片、房间数量、价格、咨询电话、详细地址等信息,进行查询或者删除酒店信息等操作,如图5-13所示。
实现代码
Controller层
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@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();
}
}
Dao层
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;
/**
* 用户
*/
public interface UserDao extends BaseMapper<UserEntity> {
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
}
Server层
package com.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.UserEntity;
import com.utils.PageUtils;
/**
* 系统用户
*/
public interface UserService extends IService<UserEntity> {
PageUtils queryPage(Map<String, Object> params);
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
}
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.UserDao;
import com.entity.UserEntity;
import com.service.UserService;
import com.utils.PageUtils;
import com.utils.Query;
/**
* 系统用户
*/
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<UserEntity> page = this.selectPage(
new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>()
);
return new PageUtils(page);
}
@Override
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<UserEntity> wrapper) {
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
}
权限验证
package com.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
/**
* 权限(Token)验证
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
* 不需要验证权限的方法直接放过
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close();
}
}
// throw new EIException("请先登录", 401);
return false;
}
}
为什么选择我?
选择我作为您的毕业设计系统开发伙伴,是基于以下几个关键理由:
专业经验:我拥有丰富的软件开发经验,特别是在教育技术和信息系统方面。我了解毕业设计流程的复杂性,能够针对性地提供解决方案,确保系统的实用性和高效性。
定制化服务:我明白每个教育机构都有其独特的需求和挑战。我将与您紧密合作,深入了解您的具体要求,从而开发出完全符合您需求的定制化系统。
技术专长:我对最新的编程语言和开发工具有深入的了解,能够运用先进的技术来构建安全、稳定且易于维护的系统。无论是前端用户体验还是后端数据处理,我都能够提供专业的技术支持。
项目管理能力:我具备良好的项目管理技能,能够确保项目按时按质完成。我会制定详细的项目计划,并与您保持密切沟通,确保项目的每个阶段都能满足预期目标。
持续支持与维护:系统开发完成后,我将提供持续的技术支持和维护服务。这包括定期的系统更新、故障排除以及根据用户反馈进行的功能改进。
成本效益:我提供的是高性价比的服务。通过高效的项目管理和合理的资源配置,我能够在保证质量的前提下,为您节省不必要的开支。
综上所述,我的专业技能、定制化服务、技术专长、项目管理能力以及对客户的长期承诺,都是您选择我作为毕业设计系统开发伙伴的有力理由。
项目推荐
👇题目未定的小伙伴可以看看下面找找灵感👇
Java 微信小程序(UNIAPP、云原生)合集
Java Android合集
Java SSM框架合集
Python Djaogo框架合集
获取源码
大家点赞、关注加收藏!👇下方名片获取源码啦!👇

389

被折叠的 条评论
为什么被折叠?



