文章目录
- 前言
- 技术介绍
- 功能介绍
- 核心代码
- 数据库参考
- 系统效果图
前言
时代在飞速进步,每个行业都在努力发展现在先进技术,通过这些先进的技术来提高自己的水平和优势,大型超市数据处理系统当然不能排除在外。大型超市数据处理系统是在实际应用和软件工程的开发原理之上,运用Python语言以及springboot框架进行开发。首先要进行需求分析,分析出大型超市数据处理系统的主要功能,然后设计了系统结构。整体设计包括系统的功能、系统总体结构、系统数据结构和对系统安全性进行设计;最后要对系统进行测试,还要对测试的结果进行总结和分析,为以后系统的维护提供方便,也为以后类似系统的开发提供参考和帮助。这种个性化的网络系统管理更重视相互协调和管理合作,能激发管理者的创造性和主动性,这对大型超市数据处理系统来说非常有益。
技术介绍
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven
功能介绍
系统启动后,在登录界面,输入正确的账号、密码、角色,选择进入管理员界面或用户界面,管理员界面是用来管理页面与系统的所有功能,用户界面可以正常的使用,并对生鲜信息、系统公告、留言反馈等进行份内的操作,系统登录结构图如图4-1所示。
图4-1 系统登录结构图
管理员模块属于是网站的后台,进入之后有大量的管理员功能,管理员也可以使用用户模块的功能,为了维护网站的稳定与页面的布局,将管理员模块的功能详细化后可以使用系统管理对页面进行布局修改,可以发布公告提示用户规范,用户模块只可以对生鲜信息、系统公告等进行查询等,并且更改个人信息,大型超市数据处理系统总体结构图如图4-2所示。
图4-2 大型超市数据处理系统总体结构图
核心代码
package com.example.controller;import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Caiwu;
import com.example.exception.CustomException;
import com.example.service.CaiwuService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.CaiwuVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;@RestController
@RequestMapping(value = "/caiwu")
public class CaiwuController {@Resourceprivate CaiwuService caiwuService;@PostMappingpublic Result<Caiwu> add(@RequestBody CaiwuVo caiwu) {caiwuService.add(caiwu);return Result.success(caiwu);}@PostMapping("/deleteList")public Result<Caiwu> deleteList(@RequestBody CaiwuVo caiwu) {caiwuService.deleteList(caiwu.getList());return Result.success();}@DeleteMapping("/{id}")public Result delete(@PathVariable Long id) {caiwuService.delete(id);return Result.success();}@PutMappingpublic Result update(@RequestBody CaiwuVo caiwu) {caiwuService.update(caiwu);return Result.success();}@GetMapping("/{id}")public Result<Caiwu> detail(@PathVariable Integer id) {Caiwu caiwu = caiwuService.findById(id);return Result.success(caiwu);}@GetMappingpublic Result<List<Caiwu>> all() {return Result.success(caiwuService.list());}@PostMapping("/page")public Result<CaiwuVo> page(@RequestBody CaiwuVo caiwuVo) {return Result.success(caiwuService.findPage(caiwuVo));}@PostMapping("/login")public Result login(@RequestBody Caiwu caiwu, HttpServletRequest request) {if (StrUtil.isBlank(caiwu.getZhanghao()) || StrUtil.isBlank(caiwu.getMima())) {throw new CustomException(ResultCode.PARAM_LOST_ERROR);}Caiwu login = caiwuService.login(caiwu);
// if(!login.getStatus()){
// return Result.error("1001","状态限制,无法登录系统");
// }if(login != null) {HashMap hashMap = new HashMap();hashMap.put("user", login);Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,caiwu.getId());String token = JwtUtil.creatToken(map);hashMap.put("token", token);return Result.success(hashMap);}else {return Result.error();}}@PutMapping("/updatePassword")public Result updatePassword(@RequestBody Caiwu info, HttpServletRequest request) {Caiwu caiwu = caiwuService.findById(info.getId());String oldPassword = SecureUtil.md5(info.getMima());if (!oldPassword.equals(caiwu.getMima())) {return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);}info.setMima(SecureUtil.md5(info.getNewPassword()));Caiwu caiwu1 = new Caiwu();BeanUtils.copyProperties(info, caiwu1);caiwuService.update(caiwu1);return Result.success();}
}
数据库参考
--
-- Current Database: `springboot4wx9pqc4`
--/*!40000 DROP DATABASE IF EXISTS `springboot4wx9pqc4`*/;CREATE DATABASE /*!32312 IF NOT EXISTS*/ `springboot4wx9pqc4` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;USE `springboot4wx9pqc4`;--
-- Table structure for table `config`
--DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`name` varchar(100) NOT NULL COMMENT '配置参数名称',`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',`url` varchar(500) DEFAULT NULL COMMENT 'url',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
/*!40101 SET character_set_client = @saved_cs_client */;--
-- Dumping data for table `config`
--LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'picture1','upload/picture1.jpg',NULL),(2,'picture2','upload/picture2.jpg',NULL),(3,'picture3','upload/picture3.jpg',NULL);
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;--
-- Table structure for table `gongyingshang`
--DROP TABLE IF EXISTS `gongyingshang`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gongyingshang` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`changjiazhanghao` varchar(200) NOT NULL COMMENT '厂家账号',`mima` varchar(200) NOT NULL COMMENT '密码',`changjiamingcheng` varchar(200) DEFAULT NULL COMMENT '厂家名称',`changjiadizhi` varchar(200) DEFAULT NULL COMMENT '厂家地址',`zhuceziben` varchar(200) DEFAULT NULL COMMENT '注册资本',`lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',`yingyezhizhao` longtext COMMENT '营业执照',`shangpinleibie` varchar(200) NOT NULL COMMENT '商品类别',PRIMARY KEY (`id`),UNIQUE KEY `changjiazhanghao` (`changjiazhanghao`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='供应商';
/*!40101 SET character_set_client = @saved_cs_client */;--
-- Dumping data for table `gongyingshang`
--LOCK TABLES `gongyingshang` WRITE;
/*!40000 ALTER TABLE `gongyingshang` DISABLE KEYS */;
INSERT INTO `gongyingshang` VALUES (31,'2024-01-12 06:53:21','厂家账号1','123456','厂家名称1','厂家地址1','注册资本1','13823888881','upload/gongyingshang_yingyezhizhao1.jpg','商品类别1'),(32,'2024-01-12 06:53:21','厂家账号2','123456','厂家名称2','厂家地址2','注册资本2','13823888882','upload/gongyingshang_yingyezhizhao2.jpg','商品类别2'),(33,'2024-01-12 06:53:21','厂家账号3','123456','厂家名称3','厂家地址3','注册资本3','13823888883','upload/gongyingshang_yingyezhizhao3.jpg','商品类别3'),(34,'2024-01-12 06:53:21','厂家账号4','123456','厂家名称4','厂家地址4','注册资本4','13823888884','upload/gongyingshang_yingyezhizhao4.jpg','商品类别4'),(35,'2024-01-12 06:53:21','厂家账号5','123456','厂家名称5','厂家地址5','注册资本5','13823888885','upload/gongyingshang_yingyezhizhao5.jpg','商品类别5'),(36,'2024-01-12 06:53:21','厂家账号6','123456','厂家名称6','厂家地址6','注册资本6','13823888886','upload/gongyingshang_yingyezhizhao6.jpg','商品类别6'),(37,'2024-01-12 06:53:21','厂家账号7','123456','厂家名称7','厂家地址7','注册资本7','13823888887','upload/gongyingshang_yingyezhizhao7.jpg','商品类别7'),(38,'2024-01-12 06:53:21','厂家账号8','123456','厂家名称8','厂家地址8','注册资本8','13823888888','upload/gongyingshang_yingyezhizhao8.jpg','商品类别8');
/*!40000 ALTER TABLE `gongyingshang` ENABLE KEYS */;
UNLOCK TABLES;--
-- Table structure for table `gongzuorenyuan`
--DROP TABLE IF EXISTS `gongzuorenyuan`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gongzuorenyuan` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`yuangonghao` varchar(200) NOT NULL COMMENT '员工号',`mima` varchar(200) NOT NULL COMMENT '密码',`yuangongxingming` varchar(200) NOT NULL COMMENT '员工姓名',`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',`nianling` int(11) DEFAULT NULL COMMENT '年龄',`shoujihaoma` varchar(200) DEFAULT NULL COMMENT '手机号码',`touxiang` longtext COMMENT '头像',PRIMARY KEY (`id`),UNIQUE KEY `yuangonghao` (`yuangonghao`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='工作人员';
/*!40101 SET character_set_client = @saved_cs_client */;--
-- Dumping data for table `gongzuorenyuan`
--LOCK TABLES `gongzuorenyuan` WRITE;
/*!40000 ALTER TABLE `gongzuorenyuan` DISABLE KEYS */;
INSERT INTO `gongzuorenyuan` VALUES (11,'2024-01-12 06:53:21','员工号1','123456','员工姓名1','男',1,'13823888881','upload/gongzuorenyuan_touxiang1.jpg'),(12,'2024-01-12 06:53:21','员工号2','123456','员工姓名2','男',2,'13823888882','upload/gongzuorenyuan_touxiang2.jpg'),(13,'2024-01-12 06:53:21','员工号3','123456','员工姓名3','男',3,'13823888883','upload/gongzuorenyuan_touxiang3.jpg'),(14,'2024-01-12 06:53:21','员工号4','123456','员工姓名4','男',4,'13823888884','upload/gongzuorenyuan_touxiang4.jpg'),(15,'2024-01-12 06:53:21','员工号5','123456','员工姓名5','男',5,'13823888885','upload/gongzuorenyuan_touxiang5.jpg'),(16,'2024-01-12 06:53:21','员工号6','123456','员工姓名6','男',6,'13823888886','upload/gongzuorenyuan_touxiang6.jpg'),(17,'2024-01-12 06:53:21','员工号7','123456','员工姓名7','男',7,'13823888887','upload/gongzuorenyuan_touxiang7.jpg'),(18,'2024-01-12 06:53:21','员工号8','123456','员工姓名8','男',8,'13823888888','upload/gongzuorenyuan_touxiang8.jpg');
/*!40000 ALTER TABLE `gongzuorenyuan` ENABLE KEYS */;
UNLOCK TABLES;--
-- Table structure for table `jinhuodingdan`
--DROP TABLE IF EXISTS `jinhuodingdan`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jinhuodingdan` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`jinhuobianhao` varchar(200) DEFAULT NULL COMMENT '进货编号',`pici` varchar(200) NOT NULL COMMENT '批次',`shangpinmingcheng` varchar(200) DEFAULT NULL COMMENT '商品名称',`guige` varchar(200) DEFAULT NULL COMMENT '规格',`shuliang` int(11) DEFAULT NULL COMMENT '进货数量',`jinhuodanjia` double DEFAULT NULL COMMENT '进货单价',`jinhuojine` double DEFAULT NULL COMMENT '进货金额',`pinpai` varchar(200) DEFAULT NULL COMMENT '品牌',`changjiazhanghao` varchar(200) NOT NULL COMMENT '厂家账号',`changjiamingcheng` varchar(200) DEFAULT NULL COMMENT '厂家名称',`jinhuoyuanyin` longtext COMMENT '进货原因',`jinhuoriqi` date DEFAULT NULL COMMENT '进货日期',`yuangonghao` varchar(200) DEFAULT NULL COMMENT '员工号',`yuangongxingming` varchar(200) DEFAULT NULL COMMENT '员工姓名',`zhuangtai` varchar(200) DEFAULT NULL COMMENT '状态',`sfsh` varchar(200) DEFAULT '待审核' COMMENT '是否审核',`shhf` longtext COMMENT '审核回复',`ispay` varchar(200) DEFAULT '未支付' COMMENT '是否支付',PRIMARY KEY (`id`),UNIQUE KEY `pici` (`pici`),UNIQUE KEY `jinhuobianhao` (`jinhuobianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='进货订单';
/*!40101 SET character_set_client = @saved_cs_client */;
系统效果图