基于SSM的进销存管理系统设计与实现
末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:采用JSP技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是
目录
一、项目简介
二、系统功能
三、系统项目截图
管理员功能介绍
员工管理
公告管理
商品管理
商品类型管理
四、核心代码
登录相关
文件上传
封装
一、项目简介
现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本进销存管理系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此进销存管理系统利用当下成熟完善的SSM框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发。实现了会员基础数据的管理,商品的入库与销售,设备管理,盘点管理,公告管理等功能。进销存管理系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。
二、系统功能

三、系统项目截图
管理员功能介绍
员工管理
此页面提供给管理员的功能有:新增员工,修改员工,删除员工。
公告管理
此页面提供给管理员的功能有:新增公告,删除公告,修改公告。

商品管理
此页面提供给管理员的功能有:新增商品,修改商品,删除商品。
商品类型管理
此页面提供给管理员的功能有:新增商品类型,删除商品类型,修改商品类型。
四、核心代码
登录相关
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{@Autowiredprivate UserService userService;@Autowiredprivate 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();}
}
文件上传
package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
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 org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","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);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();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);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 = 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);}}
封装
package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {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<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}
相关文章:
基于SSM的进销存管理系统设计与实现
末尾获取源码 开发语言:Java Java开发工具:JDK1.8 后端框架:SSM 前端:采用JSP技术开发 数据库:MySQL5.7和Navicat管理工具结合 服务器:Tomcat8.5 开发软件:IDEA / Eclipse 是否Maven项目&#x…...
Django DRF限流组件
在DRF中,限流发生在认证、权限之后,限流组件的使用步骤: 1、编写自定义限流类; 2、在settings.py中配置redis; 3、安装django-redis; 4、启动redis服务; 5、局部应用,一般是在核心的视图中使用&…...
UEC++ day7
敌人NPC机制 敌人机制分析与需求 新建一个character类来作为敌人,直接建蓝图设置骨骼网格,因为敌人可能多种就不规定死,然后这个敌人肯定需要两个触发器,一个用于大范围巡逻,一个用于是否达到主角近点进行攻击 注意我…...
win11,安装python,pip,和opencv
1,安装python 在应用商店,输入python,下载安装 2,安装pip 在cmd中,输入pip install SomePackage,安装某一个版本的pip 3,安装opencv 在cmd中,输入 pip3 install opencv-contrib-python -i https://pyp…...
kafka入门(一):kafka消息发送与消费
kafka的基础概念 Producer (消息生产者) 向主题发布消息的客户端应用程序称为生产者(Producer),生产者用于持续不断的向某个主题发送消息。 Consumer (消息消费者) 订阅主题消息的客户端程序称为消费者(Consumer),消费者用于处理生产者产生的消息。 Co…...
CMap数据库筛选化学药物
数据库clue.io 文献链接:连接图谱:使用基因表达特征连接小分子、基因和疾病 |科学 (science.org) 基本模式:利用CMap将差异基因列表与数据库参考数据集比对;根据差异表达基因在参考基因表达谱富集情况得到一个相关性分数&#…...
mysql命令行(mysql-client)连接数据库
有时项目连接不上数据库,报错鉴权失败,先用mysql工具连接下,容易发现问题。 直接输入mysql看是否已安装,如果没有就安装下。 yum -y install mysql-client; 这个名称一直记不准,有时记为mysql-cli,结果发现…...
sklearn中的TfidfTransformer和gensim中的TfidfModel的区别
sklearn.feature_extraction.text.TfidfTransformer 和 gensim.models.TfidfModel 都是用于计算文本数据的 TF-IDF 值的工具。它们的主要区别在于实现方式和输入数据的格式。 1、实现方式和输入数据格式: TfidfTransformer 是 scikit-learn 中的一个类,…...
spring注解
spring注解 Configuration 用于标注配置类Bean 结合Configuration(full mode)使用或结合Component(light mode)使用。可以导入第三方组件,入方法有参数默认从IOC容器中获取,可以指定initMethod和destroyMethod 指定初…...
SpringCloud实用篇02
SpringCloud实用篇02 0.学习目标 1.Nacos配置管理 Nacos除了可以做注册中心,同样可以做配置管理来使用。 1.1.统一配置管理 当微服务部署的实例越来越多,达到数十、数百时,逐个修改微服务配置就会让人抓狂,而且很容易出错。我…...
Nginx快速入门教程,域名转发、负载均衡
1.Nginx简介 Nginx是⽬前最流⾏的Web服务器, 最开始是由⼀个叫做igor的俄罗斯的程序员开发的, 2019年3⽉11⽇被美国的F5公司以6.7亿美元的价格收购, 现在Nginx是F5公司旗下的⼀款产品了。 2.Nginx的版本 Nginx开源版本主要分为两种&#x…...
ElasticSearch之健康状态
参考Cluster health API。 命令样例,如下: curl -X GET "https://localhost:9200/_cluster/health?wait_for_statusyellow&timeout50s&pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPHQBEs5*lo7F9&qu…...
java io流中为什么使用缓冲流就能加快文件读写速度
FileInputStream的read方法底层确实是通过调用JDK层面的read方法,并且这个JDK层面的read方法底层是使用C语言编写的,以实现高效的文件读取功能。但是它会涉及多次内核态与操作系统交互。当我们使用FileInputStream的read方法读取文件时,首先会…...
【鸿蒙最新全套教程】<HarmonyOS第一课>1、运行Hello World
下载与安装DevEco Studio 在HarmonyOS应用开发学习之前,需要进行一些准备工作,首先需要完成开发工具DevEco Studio的下载与安装以及环境配置。 进入DevEco Studio下载官网,单击“立即下载”进入下载页面。 DevEco Studio提供了Windows版本和…...
求二叉树中指定节点所在的层数(可运行)
运行环境.cpp 我这里设置的是查字符e的层数,大家可以在main函数里改成自己想查的字符。(输入的字符一定是自己树里有的)。 如果没有输出结果,一定是建树错误!!!!!&…...
Ubuntu18 Opencv3.4.12 viz 3D显示安装、编译、移植
Opencv3.*主模块默认包括两个3D库 calib3d用于相机校准和三维重建 ,viz用于三维图像显示,其中viz是cmake选配。 参考: https://docs.opencv.org/3.4.12/index.html 下载linux版本的源码 sources。 查看cmake apt list --installed | grep…...
EPSon打印机更换色带
1、打印机色带拆装视频 打印机色带更换 2、色带盒四周有多个卡扣,需从右到左依次轻微用力掰开,使盖板与盒体脱离,注意不要掰断卡扣。 3、如何将色带放入打印机色带盒? A、色带放入盒体时不可打乱打结,以免卡带&#x…...
电脑游戏录屏软件,记录游戏高光时刻
电脑游戏录制是游戏爱好者分享游戏乐趣、技巧和成就的绝佳方式,此时,一款好用的录屏软件就显得尤为重要。本文将为大家介绍三款电脑游戏录屏软件,通过对这三款软件的分步骤详细介绍,让大家更加了解它们的特点及使用方法。 电脑游戏…...
Hadoop性能调优建议
一、服务器配置 1. BIOS配置: 关闭smmu/关闭cpu预取/performance策略 2. 硬盘优化 raid0 打卡cache /jbod scheduler/sector_size/read_ahead_kb 3. 网卡优化 rx_buff/ring_buffer/lro/中断绑核/驱动升级 4. 内存插法:要用均衡插法…...
算法的奥秘:常见的六种算法(算法导论笔记2)
算法的奥秘:种类、特性及应用详解(算法导论笔记1) 上期总结算法的种类和大致介绍,这一期主要讲常见的六种算法详解以及演示。 排序算法: 排序算法是一类用于对一组数据元素进行排序的算法。根据不同的排序方式和时间复…...
Beyond Compare 5激活终极方案:3步完成开源密钥生成器部署与应用
Beyond Compare 5激活终极方案:3步完成开源密钥生成器部署与应用 【免费下载链接】BCompare_Keygen Keygen for BCompare 5 项目地址: https://gitcode.com/gh_mirrors/bc/BCompare_Keygen 还在为Beyond Compare 5的30天试用期到期而烦恼吗?面对频…...
Pixel Couplet Gen部署案例:边缘设备(Jetson Nano)运行轻量化Pixel Couplet Gen
Pixel Couplet Gen部署案例:边缘设备(Jetson Nano)运行轻量化Pixel Couplet Gen 1. 项目介绍 Pixel Couplet Gen是一款基于ModelScope大模型驱动的创新型春联生成器,它将传统春节文化与现代像素艺术完美融合。与传统春联生成工具…...
番茄小说下载器:一站式离线阅读解决方案终极指南
番茄小说下载器:一站式离线阅读解决方案终极指南 【免费下载链接】Tomato-Novel-Downloader 番茄小说下载器不精简版 项目地址: https://gitcode.com/gh_mirrors/to/Tomato-Novel-Downloader 你是否经常在番茄小说上发现精彩的小说,却因为网络不稳…...
Class D音频放大器原理与工程实践解析
1. Class D音频放大器:从原理到实战的全方位解析 作为一名在音频电子领域深耕多年的工程师,我见证了Class D放大器从实验室概念到消费电子标配的完整发展历程。2006年ADI发布的这篇技术白皮书堪称Class D领域的里程碑文献,今天我将结合自己十…...
在客服工单分类场景中使用Taotoken聚合API提升效率
在客服工单分类场景中使用Taotoken聚合API提升效率 对于客服系统开发者而言,处理海量工单的意图识别与摘要生成是一项高频且关键的任务。直接对接单一模型服务商,可能会面临模型能力与成本难以平衡、供应商切换繁琐、团队密钥管理分散等问题。Taotoken作…...
编译器---GNU(gcc与g++)
概述 GCC(GNU Compiler Collection)和 G 是软件开发中常用的编译工具,它们在 GNU 项目中扮演着重要角色,为开发者提供了强大的编译能力。 基本概念 GCC GCC 即 GNU 编译器套件,它最初是作为 C 语言的编译器而开发的&am…...
qbicc:基于LLVM的激进Java AOT编译器,探索无GC的极致静态化
1. 项目概述:一个面向Java的激进本地化编译器在Java生态里,我们习惯了“一次编写,到处运行”的承诺,JVM(Java虚拟机)作为中间层,负责将字节码翻译成机器指令。但这也带来了众所周知的代价&#…...
六层板孔金属化检验别大意!4个致命孔缺陷
六层板过孔是层间连接核心,孔金属化检验常敷衍:看孔口无毛刺、测孔径合格就放行,结果过回流焊(260℃)后,孔壁开裂、孔铜脱落、空洞、孔偏,层间断路、信号中断,整板报废。某车载客户惨…...
规范驱动开发:从OpenAPI到自动化代码与测试的工程实践
1. 项目概述:当规范成为代码的“第一推动力”在软件开发这个行当里待久了,你会发现一个有趣的现象:很多团队在项目初期都雄心勃勃,制定了详尽的接口文档、设计规范,但一到编码阶段,这些文档往往就被束之高阁…...
OpenCode插件实战:一键打通ChatGPT Plus,解锁GPT-5 Codex代码生成
1. 项目概述:一个为OpenCode注入灵魂的认证插件如果你和我一样,是个喜欢折腾命令行工具、追求极致开发效率的“懒人”,那你肯定对OpenCode不陌生。它就像一个命令行里的“超级副驾”,你动动嘴皮子(其实是敲敲键盘&…...
