首页 - 新闻 - 基于SpringBoot的发廊管理系统

基于SpringBoot的发廊管理系统

2023-10-04 03:14

目录

前言

1.技术栈

2。系统功能介绍

美容项目管理

产品库存管理

产品采购管理

会员卡管理

项目进度管理

产品购买信息

会员充值管理

3。核心代码

1。登录模块

2.文件上传模块

3。代码封装


前言

随着信息技术在管理中的应用日益深入和广泛,管理信息系统的实施在技术上也逐渐成熟。本文介绍了美发店管理系统的整个开发过程。通过分析美发店管理系统的缺点,创建了计算机管理的美发店管理系统解决方案。文章介绍了美发店管理系统的系统分析部分,包括可行性分析等。系统设计部分主要介绍了系统功能设计和数据库设计。

本发廊管理系统有管理员和用户两种角色。用户功能包括项目预约管理、产品购买管理、会员充值管理、余额查询管理。管理员功能包括个人中心、用户管理、美容项目管理、项目类型管理、项目预约管理、产品库存管理、产品进货管理、产品入库管理、会员卡管理、会员充值管理、余额查询管理、产品类型管理。 、系统管理等,因此具有一定的实用性。

本网站为B/S模式系统,采用SSM框架和MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单、功能齐全的特点,使得发廊管理系统的管理系统化、规范化。该系统的使用使管理人员从繁重的工作中解放出来,实现无纸化办公,可以有效提高发廊管理系统的管理效率。

1.技术栈


末尾获取源码SpringBoot+Vue+JS+jQuery+Ajax...

2。系统功能介绍

美容项目管理

美发店管理系统的系统管理员可以对美容商品进行管理,可以添加、修改、删除、查询美容商品信息。

产品库存管理

系统管理员可以对产品库存进行查看、修改、删除、查询等操作。

产品采购管理

管理员可以查看产品库存信息。

会员卡管理

管理员可以添加、修改、删除、查询会员卡信息。

项目进度管理

登录后,用户可以对项目预约信息进行预约操作。

产品购买信息

登录后,用户可以进行产品购买的支付操作。

会员充值管理

用户登录后,可以在会员充值中进行会员充值操作。

三、核心代码

1、登录模块


包 com.controller;导入 java.util.Arrays;
导入 java.util.Calendar;
导入 www.gsm-guard.net;
导入www.gsm-guard.net;导入javax.servlet.http.HttpServletRequest;导入org.springframework.beans.factory.annotation.Autowired;
导入 org.springframework.stereotype.Controller;
导入 org.springframework.web.bind.annotation.GetMapping;
导入 org.springframework.web.bind.annotation.PathVariable;
导入 org.springframework.web.bind.annotation.PostMapping;
导入 org.springframework.web.bind.annotation.RequestBody;
导入 org.springframework.web.bind.annotation.RequestMapping;
导入 org.springframework.web.bind.annotation.RequestParam;
导入 org.springframework.web.bind.annotation.ResponseBody;
导入 org.springframework.web.bind.annotation.RestController;导入 com.annotation.IgnoreAuth;导入 com.baomidou.mybatisplus.mapper.EntityWrapper;
导入com.entity.TokenEntity;
导入 com.entity.UserEntity;
导入com.service.TokenService;
导入com.service.UserService;
导入com.utils.CommonUtil;
导入www.gsm-guard.net5Util;
导入 com.utils.MPUtil;
导入com.utils.PageUtils;
导入com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping(“用户”)
@RestControllerpublic class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R 登录(字符串用户名, 字符串密码, 字符串验证码, HttpServletRequest 请求) { UserEntity user = www.gsm-guard.netOne(new EntityWrapper().eq("用户名", 用户名));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(www.gsm-guard.netOne(new EntityWrapper().eq("用户名", 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().eq("用户名", username));if(user==null) {return R.error("账户不存在");}user.setPassword("123456" );userService.update(user,null);return R.ok("密码已重置为:123456");}/*** List*/@RequestMapping("/page")public R page(@RequestParam Map  params,UserEntity user){EntityWrapper ew = new EntityWrapper();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 ew = new EntityWrapper();ew.allEq(MPUtil. allEQMapPre( user, "user")); return R.ok(). put("data", www.gsm-guard.netListView(ew));}/*** 信息*/@RequestMapping("/info/{id}" )public R info(@PathVariable("id") String id){UserEntity user = www.gsm-guard.netById(id);return R.ok().put("data", user);}/*** 获取用户的会话用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = www.gsm-guard.netById(id); return R.ok(). put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){// ValidatorUtils.validateEntity(user);if(www.gsm-guard.netOne(new EntityWrapper().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();}
}

 2、文件上传模块

package com.controller;导入java.io.File;
导入 java.io.FileNotFoundException;
导入java.io.IOException;
导入java.util.Arrays;
导入 www.gsm-guard.net;
导入java.util.HashMap;
导入java.util.List;
导入www.gsm-guard.net;
导入 java.util.Random;
导入 java.util.UUID;导入 org.apache.commons.io.FileUtils;
导入 org.apache.commons.lang3.StringUtils;导入 org.springframework.beans.factory.annotation.Autowired;
导入 org.springframework.http.HttpHeaders;
导入 org.springframework.http.HttpStatus;
导入 org.springframework.http.MediaType;
导入 org.springframework.http.ResponseEntity;
导入 org.springframework.util.ResourceUtils;
导入 org.springframework.web.bind.annotation.PathVariable;
导入 org.springframework.web.bind.annotation.RequestBody;
导入 org.springframework.web.bind.annotation.RequestMapping;
导入 org.springframework.web.bind.annotation.RequestParam;
导入 org.springframework.web.bind.annotation.RestController;
导入 org.springframework.web.multipart.MultipartFile;导入 com.annotation.IgnoreAuth;
导入 com.baomidou.mybatisplus.mapper.EntityWrapper;
导入com.entity.ConfigEntity;
导入com.entity.EIException;
导入com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping(“文件”)
@SuppressWarnings({"未选中","rawtypes"})public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@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);文件路径 = new File (ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}文件上传 = new File(path.getAbsolutePath()," /upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath) ()+"/"+文件名);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources \\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = www.gsm-guard.netOne(new EntityWrapper().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 download(@RequestParam String fileName) {try {文件路径 = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}文件上传 = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}文件 file = 新文件(upload.getAbsolutePath()+"/"+文件名);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403) ;}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("附件", 文件名);返回新的 ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}返回新的 ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);}}

3、代码封装

package com.utils;导入java.util.HashMap;
import www.gsm-guard.net;/***返回数据*/
public class R extends HashMap {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code ", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r ;}public static R ok(Map map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put (字符串键, 对象值) {super.put(键, 值);返回这个;}
}