文章目录
- 1. JvaaEE SSM+JSP 水果订单管理系统大作业
- 1.1 介绍
- 1.2 设计说明
- 1.3 系统主要表设计:
- 1.4 功能展示
- 1.4.1 注册功能:
- 1.4.2 登录功能:
- 1.4.3 零售商管理功能展示:
- 1.4.4 用户设置功能展示:
- 1.4.5 货物管理功能展示:
- 1.4.6 购销合同功能展示:
- 1.5 补充:数据库文件
1. JvaaEE SSM+JSP 水果订单管理系统大作业
1.1 介绍
资源位置:
百度网盘资源链接:因为上面的资源还在审核,所以我在网盘上存了一份分享出来。
链接:https://pan.baidu.com/s/1ikyrt0ybmOuTT5mTj-V0fg
提取码:3210
说明:
运行sql后,配置Tomcat即可运行。
介绍:
半期作业,匆忙赶制的,细节处可能不够完善,但SSM和Java Web技术是没有问题的。纯JSP+SSM开发,弹窗,JS等等都是手动加上去的。
1.2 设计说明
果农与零售商贸易关系图:
果农与零售商经济关系图:
系统用例图:
系统功能结构图:
系统数据关系图:
1.3 系统主要表设计:
用户信息表 user:
- 首先是用户表 该系统会为用户提供登录注册功能,所以用户表中需要存储 基本信息和账号密码。
- 这里的 userid 字段的数据类型为 varchar ,因为系统选择 UUID 主键生成策略,而不是自增主键,这样便于以后数据的迁移和合并。
水果商品信息表 commodities:
- 由于该系统服务于果农,所以商品类型自然是水果,那么表结构的设计应遵循水果的基本属性。
- 水果商品表中除了有水果的名称、价格及产地外,还包括水果信息录入系统的时间,这样便于管理者浏览和检查商品录入的情况
附属品信息表:accessory
可以看到,除了附属品主键外,还有附属品所属的商品 ID 外键 其余是附属品的基本信息和创建时间 。后面会通过中间表将 属品与商品 采购合同关联起来。
零售商信息表 retailer:
该表中除了零售商的基本信息以外,还有 个状态宇段,当用户不再和某个零售商合作时可以将其设置为停用(数字 0)状态,这样用户在创建采购合同时就不会看到该零售商。如果用户想恢复与该零售商的合作,将状态改为启用(数字 1)即可。
采购合同表 contract:
最重要的 是关联关系最多的表,即采购合同表。采购合同表主要用来确定零售商的订货信息,以及总金额的计算。
该表中的 type 代表运输类型,分为省内(数字 1)和省外(数字 2)。该表除了包含采购合同的基本信息外,还有一个采购商的外键 id ,水果商品的 id 并不记录在该表中,因为合同与商品是一对多的关系。可以使用中间表来表示。
中间表 middle_tab:
在中间表中,将采购合同和附属商品进行了关联,另外还增加了商品的数量统计,以便后期按照商品的单价和数量来计算最终价格
系统数据概念模型图:
1.4 功能展示
1.4.1 注册功能:
1.4.2 登录功能:
说明:添加了登录拦截器,只有登录成功后才可以访问主页。
1.4.3 零售商管理功能展示:
1.4.4 用户设置功能展示:
1.4.5 货物管理功能展示:
1.4.6 购销合同功能展示:
1.5 补充:数据库文件
/*
Navicat Premium Data Transfer
Source Server : 本地数据库
Source Server Type : MySQL
Source Server Version : 80025
Source Host : localhost:3306
Source Schema : fruit_manage
Target Server Type : MySQL
Target Server Version : 80025
File Encoding : 65001
Date: 10/11/2021 09:26:13
*/
CREATE DATABASE fruit_manage;
use fruit_manage;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for accessory
-- ----------------------------
DROP TABLE IF EXISTS `accessory`;
CREATE TABLE `accessory` (
`accessoryid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`fruitid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`price` double NULL DEFAULT NULL,
`createtime` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`accessoryid`) USING BTREE,
UNIQUE INDEX `accessory_PK`(`accessoryid`) USING BTREE,
INDEX `关系4_FK`(`fruitid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of accessory
-- ----------------------------
INSERT INTO `accessory` VALUES ('05827d14-9d54-4f8f-bb1a-5c4756d9da98', '88e6ec6c-6d17-43a7-8782-48957ajskdf', '黄桃', 2, '2021-11-09 22:57:58');
-- ----------------------------
-- Table structure for commodities
-- ----------------------------
DROP TABLE IF EXISTS `commodities`;
CREATE TABLE `commodities` (
`fruitid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`price` double NULL DEFAULT NULL,
`locality` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`createtime` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`fruitid`) USING BTREE,
UNIQUE INDEX `commodities_PK`(`fruitid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of commodities
-- ----------------------------
INSERT INTO `commodities` VALUES ('3e99a681-77db-420b-8b61-de012b0a6d39', '周天骄', 2, '江苏省', '2021-11-09 12:00:30');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-38904ajskdh', '黄桃', 2, '浙江省金华市', '2017-09-09 09:34:12');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-48957ajskdf', '火龙果', 6.68, '浙江省绍兴市', '2017-09-09 09:35:17');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-89asdjh389a', '大菠萝', 0.3, '江苏省', '2017-09-09 09:36:44');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-9534sd23h90', '柚子', 0.5, '上海市金山区', '2017-09-09 09:37:51');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-csrjdsk8347', '猕猴桃', 2.2, '上海市嘉定区', '2017-09-09 09:38:03');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-d1eae391234', '苹果', 0.7, '山东省青岛市', '2017-09-09 09:39:22');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-d1eae394106', '橘子', 1.6, '上海市普陀区', '2017-09-09 09:40:11');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-d1eae84dj46', '香蕉', 1.3, '江苏省昆山市', '2017-09-09 09:41:23');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-dhk327894aj', '柿子', 0.5, '江苏省苏州市', '2017-09-09 09:42:52');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-dijhksd2367', '榴莲', 13, '江苏省盐城县', '2017-09-09 09:43:31');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-jhk8340a783', '荔枝', 1.8, '江苏省无锡市', '2017-09-09 09:44:05');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-kduidfh3435', '西瓜', 0.3, '江苏省常州市', '2017-09-09 09:45:14');
INSERT INTO `commodities` VALUES ('88e6ec6c-6d17-43a7-8782-xce3940hsd4', '大芒果', 3.6, '浙江省杭州市', '2017-09-09 09:46:34');
-- ----------------------------
-- Table structure for contract
-- ----------------------------
DROP TABLE IF EXISTS `contract`;
CREATE TABLE `contract` (
`contractid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`retailerid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`type` int(0) NULL DEFAULT NULL,
`createtime` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`contractid`) USING BTREE,
UNIQUE INDEX `contract_PK`(`contractid`) USING BTREE,
INDEX `关系1_FK`(`retailerid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of contract
-- ----------------------------
INSERT INTO `contract` VALUES ('4ac05318-8149-4bd9-a0d6-218e51953eba', '90h7dv5c-9j87-24r6-9087-anune089x325', '636479467952', 1, '2021-11-10 01:37:48');
INSERT INTO `contract` VALUES ('5636d4e7-36c3-4f5d-b11c-049c8c1f8945', '351ab130-07c4-4a82-b713-8f71328111bc', '636478148605', 0, '2017-09-25 19:13:20');
INSERT INTO `contract` VALUES ('8ba217d4-61fb-4c28-87e2-4fdcdd5b73bd', '88e6ec6c-6d17-43a7-8782-d1eae394d802', '636479463299', 1, '2021-11-10 01:37:43');
-- ----------------------------
-- Table structure for middle_tab
-- ----------------------------
DROP TABLE IF EXISTS `middle_tab`;
CREATE TABLE `middle_tab` (
`middleid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`contractid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`fruitid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`number` int(0) NULL DEFAULT NULL,
PRIMARY KEY (`middleid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of middle_tab
-- ----------------------------
INSERT INTO `middle_tab` VALUES ('012ac2b0-4dd9-46ba-9d5a-4f7d52e92fc8', '5636d4e7-36c3-4f5d-b11c-049c8c1f8945', '88e6ec6c-6d17-43a7-8782-d1eae391234', 5);
INSERT INTO `middle_tab` VALUES ('5160829a-f22c-418d-9a21-68faa3cbdc83', '4ac05318-8149-4bd9-a0d6-218e51953eba', '88e6ec6c-6d17-43a7-8782-d1eae391234', 5);
INSERT INTO `middle_tab` VALUES ('9b17fc9c-3be8-47e1-af63-d393d51dcf2b', '5636d4e7-36c3-4f5d-b11c-049c8c1f8945', '88e6ec6c-6d17-43a7-8782-38904ajskdh', 0);
INSERT INTO `middle_tab` VALUES ('a5a8cde8-09c5-4006-8da3-46ad1ae7268d', '5636d4e7-36c3-4f5d-b11c-049c8c1f8945', '88e6ec6c-6d17-43a7-8782-jhk8340a783', 3);
INSERT INTO `middle_tab` VALUES ('b13bc528-db03-423f-a73b-839d2bb3b880', '5636d4e7-36c3-4f5d-b11c-049c8c1f8945', '88e6ec6c-6d17-43a7-8782-48957ajskdf', 0);
-- ----------------------------
-- Table structure for retailer
-- ----------------------------
DROP TABLE IF EXISTS `retailer`;
CREATE TABLE `retailer` (
`retailerid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`telphone` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`address` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`status` int(0) NULL DEFAULT NULL,
`createtime` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`retailerid`) USING BTREE,
UNIQUE INDEX `retailer_PK`(`retailerid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of retailer
-- ----------------------------
INSERT INTO `retailer` VALUES ('161f8581-d666-416b-84db-49810a82259e', '天骄', '18108385440', '虹口', 1, '2021-11-09 11:40:20');
INSERT INTO `retailer` VALUES ('351ab130-07c4-4a82-b713-8f71328111bc', '刘成成', '13566666666', '上海市黄浦区', 1, '2017-09-09 09:31:17');
INSERT INTO `retailer` VALUES ('35f97b4b-3cf0-429f-9f10-01a4d87158fb', '旭旭', '131111', '虹', 1, '2021-11-09 09:48:32');
INSERT INTO `retailer` VALUES ('45j8r40p-4fu7-87t4-8723-sdfjh789x907', '石恩华', '13777777778', '上海市普陀区', 1, '2017-09-02 12:33:40');
INSERT INTO `retailer` VALUES ('88e6ec6c-6d17-43a7-8782-d1eae394d802', '蒋虎子', '13888888888', '上海市嘉定区', 1, '2017-09-02 12:31:20');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x021', '胡晓', '15522222222', '上海市闵行区', 1, '2017-09-04 09:14:55');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x096', '蒋俊佳', '13666666666', '上海市宝山区', 1, '2017-09-03 09:14:55');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x294', '施俊', '18108385440', '上海市浦东新区', 1, '2017-09-04 09:16:55');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x325', '钱晓晓', '15533333333', '上海市长宁区', 1, '2017-09-04 09:17:55');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x365', '王二小', '13555555555', '上海市杨浦区', 1, '2017-09-04 09:18:55');
INSERT INTO `retailer` VALUES ('90h7dv5c-9j87-24r6-9087-anune089x476', '任宇', '13222222222', '上海市虹口区', 1, '2017-09-04 09:19:55');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`userid` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
`telphone` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
PRIMARY KEY (`userid`) USING BTREE,
UNIQUE INDEX `user_PK`(`userid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('3af57d0545766ec940d2c32a6567cc06ae5', 'jack', '1234', '张三', '15588888888');
INSERT INTO `user` VALUES ('4fff37bc-53f7-48f8-a19a-e90d54e08629', 'admin', '123456', '天骄', '18108385440');
INSERT INTO `user` VALUES ('734hdak3kfd389jgh3kll4590wejrh983jk', 'tom', '4321', '张茜茜', '13888888888');
INSERT INTO `user` VALUES ('88e6ec6c-6d17-43a7-8782-d1eae394d802', 'jackson', '2222', '刘霜', '13782345627');
SET FOREIGN_KEY_CHECKS = 1;