作者主页:源码空间站2022

简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

主要功能包括:

登录,管理员首页,点击球台开台,增加会员,查看-删除会员,充值会员,酒水外卖,营业额查看,打烊设置等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

5.数据库:MySql 5.7版本;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:HTML+CSS+JavaScript+jsp

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

4. 运行项目,输入localhost:8080/ 登录

运行截图

相关代码

AbstractController

package com.learn.controller;import com.learn.utils.ShiroUtils;
import com.learn.entity.SysUserEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;/*** Controller公共组件* * @author chenshun* @email sunlightcs@gmail.com* @date 2018年11月9日 下午9:42:26*/
public abstract class AbstractController {protected Logger logger = LoggerFactory.getLogger(getClass());protected SysUserEntity getUser() {return ShiroUtils.getUserEntity();}protected Long getUserId() {return getUser().getUserId();}
}

ZuoyeController

package com.learn.controller;import java.util.List;
import java.util.Map;import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
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.learn.entity.ZuoyeEntity;
import com.learn.service.ZuoyeService;
import com.learn.utils.PageUtils;
import com.learn.utils.Query;
import com.learn.utils.R;/*** 作业信息* * @author chenshun* @email sunlightcs@gmail.com* @date 2020-04-01 16:42:55*/
@RestController
@RequestMapping("zuoye")
public class ZuoyeController extends AbstractController {@Autowiredprivate ZuoyeService zuoyeService;/*** 列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params){if (super.getUserId() > 1)params.put("user", super.getUserId());//查询列表数据Query query = new Query(params);List<ZuoyeEntity> zuoyeList = zuoyeService.queryList(query);int total = zuoyeService.queryTotal(query);PageUtils pageUtil = new PageUtils(zuoyeList, total, query.getLimit(), query.getPage());return R.ok().put("page", pageUtil);}/*** 列表*/@RequestMapping("/list2")public R list2(@RequestParam Map<String, Object> params){Query query = new Query(params);List<ZuoyeEntity> zuoyeList = zuoyeService.queryList(query);return R.ok().put("list", zuoyeList );}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){ZuoyeEntity zuoye = zuoyeService.queryObject(id);return R.ok().put("zuoye", zuoye);}/*** 保存*/@RequestMapping("/save")public R save(@RequestBody ZuoyeEntity zuoye){if (zuoye.getUser() == null)zuoye.setUser(super.getUserId());zuoyeService.save(zuoye);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody ZuoyeEntity zuoye){zuoyeService.update(zuoye);return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){zuoyeService.deleteBatch(ids);return R.ok();}}

UploadController

package com.learn.controller;import com.learn.utils.MultipartFileUtil;
import com.learn.utils.R;
import com.learn.utils.RRException;
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 org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;/*** 文件上传** @author shenyt* @email syt12322@163.com* @date 2020-03-25 12:13:26*/
@RestController
@RequestMapping("file")
public class UploadController {public static String[] suffixs = {"IMG", "PNG", "JPG", "JPEG", "GIF", "BPM"};/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {if (file.isEmpty()) {throw new RRException("上传文件不能为空");}String url = MultipartFileUtil.uploadFile("/cdn", file, request);return R.ok().put("url", "/ssm_xueyeyujing_sys/"+url);}/*** 上传资讯内容的图片** @param upload   图片* @param response 响应*/@ResponseBody@RequestMapping("ckEditorUpload")public void uploadFile(MultipartFile upload, String CKEditorFuncNum, HttpServletRequest request, HttpServletResponse response) throws IOException {response.setContentType("text/html; charset=UTF-8");PrintWriter out = response.getWriter();try {String path = null;if (upload != null && !upload.isEmpty()) {String url = MultipartFileUtil.uploadFile("/cdn", upload, request);path = url;}// 返回“图像”选项卡并显示图片out.println("<script type=\"text/javascript\">");out.println("window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ",'" + path + "','')");out.println("</script>");} catch (RuntimeException e) {out.println("<script type=\"text/javascript\">");out.println("window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ",'','" + e.getMessage() + "');");out.println("</script>");}}}

SysUserController

package com.learn.controller;import com.learn.entity.SysUserEntity;
import com.learn.service.SysUserRoleService;
import com.learn.service.SysUserService;
import com.learn.utils.PageUtils;
import com.learn.utils.Query;
import com.learn.utils.R;
import com.learn.utils.ShiroUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.shiro.crypto.hash.Sha256Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;import java.util.List;
import java.util.Map;/*** 系统用户** @author chenshun* @email sunlightcs@gmail.com* @date 2018年10月31日 上午10:40:10*/
@RestController
@RequestMapping("/sys/user")
public class SysUserController extends AbstractController {@Autowiredprivate SysUserService sysUserService;@Autowiredprivate SysUserRoleService sysUserRoleService;/*** 所有用户列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params) {//查询列表数据Query query = new Query(params);List<SysUserEntity> userList = sysUserService.queryList(query);int total = sysUserService.queryTotal(query);PageUtils pageUtil = new PageUtils(userList, total, query.getLimit(), query.getPage());return R.ok().put("page", pageUtil);}@RequestMapping("/list2")public R list2(@RequestParam Map<String, Object> params) {//查询列表数据Query query = new Query(params);List<SysUserEntity> userList = sysUserService.queryList(query);return R.ok().put("list", userList);}/*** 获取登录的用户信息*/@RequestMapping("/info")public R info() {return R.ok().put("user", this.sysUserService.queryObject(getUser().getUserId()));}/*** 修改登录用户密码*/@RequestMapping("/password")public R password(String password, String newPassword) {//sha256加密password = new Sha256Hash(password).toHex();//sha256加密newPassword = new Sha256Hash(newPassword).toHex();//更新密码int count = sysUserService.updatePassword(getUserId(), password, newPassword);if (count == 0) {return R.error("原密码不正确");}//退出ShiroUtils.logout();return R.ok();}@RequestMapping("/updateInfo")public R updateInfo(@RequestBody SysUserEntity user) {this.sysUserService.update(user);return R.ok();}/*** 用户信息*/@RequestMapping("/info/{userId}")public R info(@PathVariable("userId") Long userId) {SysUserEntity user = sysUserService.queryObject(userId);//获取用户所属的角色列表List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);user.setRoleIdList(roleIdList);return R.ok().put("user", user);}/*** 保存用户*/@RequestMapping("/save")public R save(@RequestBody SysUserEntity user) {user.setCreateUserId(getUserId());sysUserService.save(user);return R.ok();}/*** 修改用户*/@RequestMapping("/update")public R update(@RequestBody SysUserEntity user) {user.setCreateUserId(getUserId());sysUserService.update(user);return R.ok();}/*** 删除用户*/@RequestMapping("/delete")public R delete(@RequestBody Long[] userIds) {if (ArrayUtils.contains(userIds, 1L) || ArrayUtils.contains(userIds, -1L)) {return R.error("系统管理员不能删除");}if (ArrayUtils.contains(userIds, getUserId())) {return R.error("当前用户不能删除");}sysUserService.deleteBatch(userIds);return R.ok();}
}

SysRoleController

package com.learn.controller;import com.learn.entity.SysRoleEntity;
import com.learn.service.SysRoleMenuService;
import com.learn.service.SysRoleService;
import com.learn.utils.PageUtils;
import com.learn.utils.Query;
import com.learn.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** 角色管理* * @author chenshun* @email sunlightcs@gmail.com* @date 2018年11月8日 下午2:18:33*/
@RestController
@RequestMapping("/sys/role")
public class SysRoleController extends AbstractController {@Autowiredprivate SysRoleService sysRoleService;@Autowiredprivate SysRoleMenuService sysRoleMenuService;/*** 角色列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params){//如果不是超级管理员,则只查询自己创建的角色列表
//      if(getUserId() != Constant.SUPER_ADMIN){
//          params.put("createUserId", getUserId());
//      }//查询列表数据Query query = new Query(params);List<SysRoleEntity> list = sysRoleService.queryList(query);int total = sysRoleService.queryTotal(query);PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());return R.ok().put("page", pageUtil);}/*** 角色列表*/@RequestMapping("/select")public R select(){Map<String, Object> map = new HashMap<>();//如果不是超级管理员,则只查询自己所拥有的角色列表
//      if(getUserId() != Constant.SUPER_ADMIN){
//          map.put("createUserId", getUserId());
//      }List<SysRoleEntity> list = sysRoleService.queryList(map);return R.ok().put("list", list);}/*** 角色信息*/@RequestMapping("/info/{roleId}")public R info(@PathVariable("roleId") Long roleId){SysRoleEntity role = sysRoleService.queryObject(roleId);//查询角色对应的菜单List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);role.setMenuIdList(menuIdList);return R.ok().put("role", role);}/*** 保存角色*/@RequestMapping("/save")public R save(@RequestBody SysRoleEntity role){role.setCreateUserId(getUserId());sysRoleService.save(role);return R.ok();}/*** 修改角色*/@RequestMapping("/update")public R update(@RequestBody SysRoleEntity role){role.setCreateUserId(getUserId());sysRoleService.update(role);return R.ok();}/*** 删除角色*/@RequestMapping("/delete")public R delete(@RequestBody Long[] roleIds){sysRoleService.deleteBatch(roleIds);return R.ok();}
}

如果也想学习本系统,下面领取。关注并回复:095ssm

Java项目:SSM台球室计费管理系统相关推荐

  1. 基于javaweb的台球室计费管理系统(java+ssm+jsp+html+javascript+mysql)

    基于javaweb的台球室计费管理系统(java+ssm+jsp+html+javascript+mysql) 运行环境 Java≥8.MySQL≥5.7.Tomcat≥8 开发工具 eclipse/ ...

  2. Java项目:台球室计费管理系统(java+SSM+JSP+HTML+JavaScript+mysql)

    源码获取:俺的博客首页 "资源" 里下载! 项目介绍 主要功能包括: 登录,管理员首页,点击球台开台,增加会员,查看-删除会员,充值会员,酒水外卖,营业额查看,打烊设置等功能. 环 ...

  3. 基于javaweb+mysql的台球室计费管理系统(java+SSM+JSP+HTML+JavaScript+mysql)

    项目介绍 主要功能包括: 登录,管理员首页,点击球台开台,增加会员,查看-删除会员,充值会员,酒水外卖,营业额查看,打烊设置等功能. 环境需要 1.运行环境:最好是java jdk 1.8,我们在这个 ...

  4. 基于Java毕业设计眼科医疗室信息管理系统源码+系统+mysql+lw文档+部署软件

    基于Java毕业设计眼科医疗室信息管理系统源码+系统+mysql+lw文档+部署软件 基于Java毕业设计眼科医疗室信息管理系统源码+系统+mysql+lw文档+部署软件 本源码技术栈: 项目架构:B ...

  5. 基于java项目ssm二手书交易平台设计与实现(论文+程序设计源码+数据库文件)

    1 绪论 4 1.1 项目开发背景 4 1.2 项目开发意义 5 1.3 项目主要的内容 5 2 相关技术介绍及系统环境开发条件 6 2.1相关技术介绍 6 2.2系统环境开发条件 7 3 系统的需求 ...

  6. 基于java(ssm)大学生社团管理系统源码成品(java毕业设计)

    基于java(ssm)大学生社团管理系统 大学生社团管理系统是基于java编程语言,mysql数据库,ssm框架和idea工具开发,本系统分为学生,管理员,社团负责人三个角色,学生可以注册登陆系统,查 ...

  7. 基于java(ssm)个人健康管理系统

    基于java(ssm)个人健康管理系统 健康管理系统是基于java编程语言,mysql数据库,ssm框架,idea开发工具进行开发,本设计主要分为用户,医师,管理员三个角色,其中用户的主要功能是注册, ...

  8. Java项目开发:学生社团管理系统

    Java项目开发:学生社团管理系统 @author:Mr.Gu @date:2021/5/31 文章目录 Java项目开发:学生社团管理系统 项目需求 开发环境 项目效果 二.项目源码 1.创建登录J ...

  9. Java项目开发,学生信息管理系统

    Java项目开发,学生信息管理系统 @author:Mr.Gu @date:2020/5/31 开发时间大二年级,数据结构综合实习 文章目录 Java项目开发,学生信息管理系统 开发效果 开发要求 开 ...

最新文章

  1. TCP/IP这本书讲TCP是从哪些方面保证可靠性的?
  2. 计算机网络-IP地址的分类
  3. dlopen函数的用法
  4. java集合——具体的集合
  5. spark sql 上个月_Spark学习之路 (十八)SparkSQL简单使用
  6. python中func函数用法_python之4类回调函数的使用方法
  7. HDU 2255 - 奔小康赚大钱
  8. linux vi 底行命令,Linux下vi命令详解
  9. 【视频来了】那些未曾学到的Esp8266技术干货,都在本系列公开课直播中一一吸收,奉献开源于国内物联网!
  10. 基于PHP的聚合数据车辆违章查询接口调用代码示例
  11. openwrt 软路由负载均衡
  12. 什么是技术债,为什么要还技术债?
  13. python父亲节快乐_打算送亲戚家孩子新年礼物,有哪些礼物孩子喜欢且有意义?...
  14. 营销活动·章鱼架构设计
  15. vue3.0在线编辑器codemirror开发
  16. C语言之栈实现(详细)
  17. USACO 1月 2021-2022 January Contest Bronze 题解
  18. 【设计模式】软件设计七大原则 ( 单一职责原则 | 代码示例 )
  19. JS调试的一些小技巧
  20. 电动汽车(EV)充电系统全球认证 - 主要测试标准清单及下载

热门文章

  1. 2022年电工初级电工证(五级)基础+专业知识试题及答案
  2. 安装office2007后,每次打开word、excel,出现“正在配置Micosoft office ....
  3. 谷歌地图在中国能使用了?谷歌官方回应 | 消息
  4. 一拳超人激励我的台词
  5. 计算机毕业论文内容参考|基于java的数据处理分析系统的设计与实现
  6. 成功率很高的硬盘坏道软修复方法——————【Badboy】
  7. 千万不要好奇 Redis 的宝藏功能
  8. \(^_^)/ ngnix、lighttpd、apache三大web服务器
  9. 职称英语和计算机什么时候报名,2009职称英语和职称计算机考试何时报名?
  10. 魔兽mac电脑版本,魔兽争霸3重制版魔兽争霸3在mac电脑上地图路径位置,魔兽争霸3mac版本地图下载路径