自從成為自由職業后,我對假期一點沒有感覺!
甚至我忘了每天是幾月幾號!不裝b的說,我真的體會不到節假日的那種快樂了!
如果想出去逛街,我想出去爬山,我想去公園散心,我都會避開節假日!
前天,有個粉絲朋友找小孟,開發了一個系統,基本上一天就干完了!
2.5k,給一次遠程部署好了,
通常我開發費時間較多的就是溝通需求,一旦需求確認好,開發真的很快,我有自己封裝的框架,
?
當然前面,我也分享了很多的系統,也都開源了,大家拿去學習吧,
當然也分享了很多的SpringBoot的專案,這些專案真的很肝!
1,基于springboot的在線教育系統分享
2,基于springboot的活動管理小程式系統分享
3,基于springcloud的微服務專案分享【視頻教程+原始碼】
4,擼完這個springboot專案,我對boot輕車熟路【視頻教程+原始碼】
當然前面還開源了一個不錯的小程式,系統已經開源:
基于ssm+小程式的物業系統開源

下面介紹下開開發的這個系統:
一,系統開發介紹
本社區菜站服務平臺系統由兩部分組成,前端部分用小程式展現給普通用戶,后臺管理部分給菜站運營人員,普通用戶可以在小程式中申請成為站長,實作社區居民共享,為本社區的物流精準配送到家以減少疫情激增的物流壓力;后臺管理部分為PC端給供應商使用,供應商在后臺對商品進行管理,
本系統包括兩種角色:普通用戶和管理員,現在分別從這兩種角色出發對系統的功能進行描述,從普通用戶的角度出發,系統為其提供以下功能:用戶的注冊、登錄,用戶個人資訊管理,對生鮮商品的瀏覽查詢,購買商品,購物車管理,訂單查詢,從管理員角度看,系統的后臺功能主要包括:商品管理、用戶管理、交易管理,下面對系統功能進行詳細描述:
“普通用戶功能模塊”包括以下五個功能:
1.用戶注冊:新用戶注冊賬號后才可以登錄系統;
2.用戶登錄:未登錄用戶只可以查詢瀏覽商品,登錄以后的用戶才可以進行購買商品;
3.用戶個人資訊管理:登錄以后的用戶可以編輯完善自己的個人資訊,例如:修改昵稱,修改識訓地址等;
4.購物車管理:用戶可以將自己選中的商品加入購物車,方便一起結算,加入購物車中的商品可以更新商品數、移除購物車商品,
5.訂單管理:用戶可以查詢訂單、取消訂單、確認訂單,
“管理員功能模塊”屬于系統后臺的功能,用戶不能訪問,包括以下幾個方面:
1.用戶管理:后臺管理員可以看到注冊的普通用戶賬號等資訊,也可以對后臺的員工賬號進行管理,可以創建員工賬號、設定角色權限;
2.商品資訊管理:增加商品資訊、洗掉商品資訊、更新商品資訊、設定庫存;
3.一級分類管理:增加、洗掉、更新、洗掉一級分類;
4.二級分類管理:增加、洗掉、更新、洗掉二級分類;
5.交易管理:查看訂單、查看訂單詳情;
二,系統演示
?
?
?
?
?
?
?
?
三,系統核心代碼介紹
age({
data: {
defaultImageUrl: '../../imgs/default.png',
cart: [ ],
totalPrice: 0,
totalNum: 0
},
onShow(e) {
this.getCartInfo();
},
// 菜品的選中
getCartInfo() {
let user = wx.getStorageSync("user");
let url = '/pages/login/index?isTabBar=1&url=/pages/cartInfo/index';
if (!user) {
wx.navigateTo({
url: url,
})
return;
}
request({url: '/cartInfo?userId=' + user.id}).then(res => {
if (res.code === '0') {
console.log(res.data);
let cartList = res.data;
let totalPrice = 0;
let totalNum = 0;
cartList.forEach(item => {
totalNum += item.count;
totalPrice += item.count * item.price * item.discount;
let imgSrc = this.data.defaultImageUrl;
if (item.fileIds) {
let fileId = JSON.parse(item.fileIds)[0];
imgSrc = 'http://localhost:8888/files/download/' + fileId;
}
item.url = imgSrc;
})
this.setData({
cart: cartList,
totalNum: totalNum,
totalPrice: totalPrice.toFixed(2)
})
console.log(this.data.cart)
}
})
},
// 菜品數量的編輯功能
handleItemNumEdit(e) {
// 1 獲取傳遞過來的引數
const { operation, id } = e.currentTarget.dataset;
// 2 獲取購物車陣列
let cart = this.data.cart;
// 3 找到需要修改的菜品的索引
const index = cart.findIndex(v => v.id === id);
// 4 判斷是否要執行洗掉
if (cart[index].count === 1 && operation === -1) {
// 4.1 彈窗提示
wx.showModal({
content: '您是否要洗掉?',
success: (res) => {
if (res.confirm) {
let user = wx.getStorageSync("user");
request({url: '/cartInfo/goods/' + user.id + '/' + id, method: 'DELETE'}).then(res => {
if (res.code === '0') {
let cart = this.data.cart;
cart.splice(index, 1);
let totalPrice = 0;
let totalNum = 0;
cart.forEach(item => {
totalNum += item.count;
totalPrice += item.count * item.price * item.discount;
})
this.setData({
cart: cart,
totalPrice: totalPrice.toFixed(2),
totalNum: totalNum
})
} else {
wx.showToast({
title: res.msg,
icon: 'error'
})
}
})
}
}
})
} else {
// 4 進行修改數量
let cart = this.data.cart;
cart[index].count += operation;
// 重新計算一下總價
let totalPrice = 0;
let totalNum = 0;
cart.forEach(item => {
totalNum += item.count;
totalPrice += item.count * item.price * item.discount;
})
this.setData({
cart: cart,
totalPrice: totalPrice.toFixed(2),
totalNum: totalNum
})
}
},
Page({
data: {
defaultImageUrl: '../../imgs/default.png',
// 左側的選單資料
leftMenuList: [],
// 右側的菜品資料
rightContent: [],
goodsInfoList: [],
// 被點擊的左側的選單
currentIndex: 1,
// 右側內容的滾動條距離頂部的距離
scrollTop: 0
},
// 介面的回傳資料
Cates: [],
onl oad: function (options) {
this.getSwiperList();
this.getCates();
this.getGoodsList(1);
},
// 獲取分類資料
getCates() {
request({url: '/typeInfo/page/all'}).then(res => {
if (res.code === '0') {
this.setData({
leftMenuList: res.data.list
})
}
})
},
getGoodsList(goodId) {
request({url: '/goodsInfo/findByType/' + goodId}).then(res => {
if (res.code === '0') {
let list = res.data;
list.forEach((item, index) => {
let imgSrc = this.data.defaultImageUrl;
if (item.fileIds) {
let fileId = JSON.parse(item.fileIds)[0];
imgSrc = 'http://localhost:8888/files/download/' + fileId;
}
item.imgSrc = imgSrc;
})
this.setData({
rightContent: list
})
}
})
},
getSwiperList() {
request({url: '/goodsInfoCarousel/page/all'}).then(res => {
if (res.code === '0') {
let swiperList = res.data.list;
if (!swiperList && swiperList.length === 0) {
swiperList.push({imgSrc: this.data.defaultImageUrl});
swiperList.push({imgSrc: this.data.defaultImageUrl});
} else {
if (swiperList && swiperList.length > 3) {
swiperList = swiperList.slice(0, 3);
}
swiperList.forEach(item => {
if (!item.fileIds || item.fileIds === '[]') {
item.url = this.data.defaultImageUrl;
} else {
let fileArr = JSON.parse(item.fileIds);
item.url = 'http://localhost:8888/files/download/' + fileArr[0];
}
});
}
this.setData({
goodsInfoList: swiperList
})
} else {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
//小孟開發,技術交流V:kaifazixun
@RestController
public class AccountController {
@Resource
private UserInfoService userInfoService;
@GetMapping("/logout")
public Result logout(HttpServletRequest request) {
request.getSession().setAttribute("user", null);
return Result.success();
}
@GetMapping("/auth")
public Result getAuth(HttpServletRequest request) {
Object user = request.getSession().getAttribute("user");
if(user == null) {
return Result.error("401", "未登錄");
}
return Result.success((UserInfo)user);
}
/**
* 注冊
*/
@PostMapping("/register")
public Result<UserInfo> register(@RequestBody UserInfo userInfo, HttpServletRequest request) {
if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
throw new CustomException(ResultCode.PARAM_ERROR);
}
UserInfo register = userInfoService.add(userInfo);
HttpSession session = request.getSession();
session.setAttribute("user", register);
session.setMaxInactiveInterval(120 * 60);
return Result.success(register);
}
/**
* 登錄
*/
@PostMapping("/login")
public Result<UserInfo> login(@RequestBody UserInfo userInfo, HttpServletRequest request) {
if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
throw new CustomException(ResultCode.USER_ACCOUNT_ERROR);
}
UserInfo login = userInfoService.login(userInfo.getName(), userInfo.getPassword());
HttpSession session = request.getSession();
session.setAttribute("user", login);
session.setMaxInactiveInterval(120 * 60);
return Result.success(login);
}
四,系統資料庫介紹
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for cart_info
-- ----------------------------
DROP TABLE IF EXISTS `cart_info`;
CREATE TABLE `cart_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`count` int(0) NOT NULL DEFAULT 0 COMMENT '數量',
`goodsId` bigint(0) NOT NULL DEFAULT 0 COMMENT '所屬商品',
`userId` bigint(0) NOT NULL DEFAULT 0 COMMENT '所屬用戶',
`level` int(0) NULL DEFAULT NULL COMMENT '用戶等級',
`createTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '創建時間',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '購物車資訊表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of cart_info
-- ----------------------------
INSERT INTO `cart_info` VALUES (4, 1, 2, 3, NULL, '2021-04-14 20:12:38');
INSERT INTO `cart_info` VALUES (6, 1, 3, 7, NULL, '2021-04-14 17:08:53');
INSERT INTO `cart_info` VALUES (7, 1, 1, 10, NULL, '2021-04-14 17:22:18');
INSERT INTO `cart_info` VALUES (11, 1, 2, 21, NULL, '2021-04-14 15:50:01');
-- ----------------------------
-- Table structure for comment_info
-- ----------------------------
DROP TABLE IF EXISTS `comment_info`;
CREATE TABLE `comment_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '評價內容',
`goodsId` bigint(0) NOT NULL DEFAULT 0 COMMENT '所屬商品',
`userId` bigint(0) NOT NULL DEFAULT 0 COMMENT '評價人id',
`level` int(0) NULL DEFAULT NULL COMMENT '用戶等級',
`createTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '創建時間',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品評價表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of comment_info
-- ----------------------------
-- ----------------------------
-- Table structure for goods_info
-- ----------------------------
DROP TABLE IF EXISTS `goods_info`;
CREATE TABLE `goods_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品名稱',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品描述',
`price` double(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品價格',
`discount` double(10, 2) NULL DEFAULT 1.00 COMMENT '商品折扣',
`sales` int(0) NOT NULL DEFAULT 0 COMMENT '商品銷量',
`hot` int(0) NOT NULL DEFAULT 0 COMMENT '商品點贊數',
`recommend` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '否' COMMENT '是否是推薦',
`count` int(0) NOT NULL DEFAULT 0 COMMENT '商品庫存',
`typeId` bigint(0) NOT NULL DEFAULT 0 COMMENT '所屬類別',
`fileIds` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品圖片id,用英文逗號隔開',
`userId` bigint(0) NOT NULL DEFAULT 0 COMMENT '評價人id',
`level` int(0) NULL DEFAULT NULL COMMENT '用戶等級',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品詳情表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of goods_info
-- ----------------------------
INSERT INTO `goods_info` VALUES (1, '空心菜', '空心菜', 12.00, 0.80, 36, 256, '是', 394, 1, '[21]', 1, NULL);
INSERT INTO `goods_info` VALUES (2, '生菜', '生菜,就是好吃', 299.00, 0.80, 17, 2048, '是', 193, 1, '[22]', 1, NULL);
INSERT INTO `goods_info` VALUES (3, '土雞蛋', '土雞蛋,值得擁有,營養豐富', 399.00, 0.80, 29, 512, '是', 191, 2, '[23]', 1, NULL);
INSERT INTO `goods_info` VALUES (4, '馬鈴薯', '還好啦', 3999.00, 0.90, 0, 0, '否', 200, 1, '[19]', 1, NULL);
INSERT INTO `goods_info` VALUES (5, '瘦肉', '瘦肉', 20.00, 0.80, 0, 0, '否', 3, 3, '[20]', 1, NULL);
-- ----------------------------
-- Table structure for nx_system_file_info
-- ----------------------------
DROP TABLE IF EXISTS `nx_system_file_info`;
CREATE TABLE `nx_system_file_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`originName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '原始檔案名',
`fileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '存盤檔案名',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '檔案資訊表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of nx_system_file_info
-- ----------------------------
INSERT INTO `nx_system_file_info` VALUES (12, 'iphone12.jpg', 'iphone121606791180182.jpg');
INSERT INTO `nx_system_file_info` VALUES (13, '牛仔外套.jpg', '牛仔外套1606791664516.jpg');
INSERT INTO `nx_system_file_info` VALUES (14, '女裝.jpg', '女裝1606791689058.jpg');
INSERT INTO `nx_system_file_info` VALUES (15, '華為Meta30.jpg', '華為Meta301606791754239.jpg');
INSERT INTO `nx_system_file_info` VALUES (16, '30950.jpg', '309501608444761955.jpg');
INSERT INTO `nx_system_file_info` VALUES (17, 'u=2669303306,338188050&fm=26&gp=0.jpg', 'u=2669303306,338188050&fm=26&gp=01608454963850.jpg');
INSERT INTO `nx_system_file_info` VALUES (18, 'u=1646342622,2222263206&fm=26&gp=0.jpg', 'u=1646342622,2222263206&fm=26&gp=01608454991319.jpg');
INSERT INTO `nx_system_file_info` VALUES (19, 'timg.jpg', 'timg1608455054164.jpg');
INSERT INTO `nx_system_file_info` VALUES (20, '1799.gif', '17991608457607178.gif');
INSERT INTO `nx_system_file_info` VALUES (21, 'u=3337100505,326999387&fm=26&gp=0.jpg', 'u=3337100505,326999387&fm=26&gp=01618384992043.jpg');
INSERT INTO `nx_system_file_info` VALUES (22, 'u=252972411,229433572&fm=26&gp=0.jpg', 'u=252972411,229433572&fm=26&gp=01618385236566.jpg');
INSERT INTO `nx_system_file_info` VALUES (23, 'u=1946403887,466795329&fm=26&gp=0.jpg', 'u=1946403887,466795329&fm=26&gp=01618385447915.jpg');
-- ----------------------------
-- Table structure for order_goods_rel
-- ----------------------------
DROP TABLE IF EXISTS `order_goods_rel`;
CREATE TABLE `order_goods_rel` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`orderId` bigint(0) NULL DEFAULT NULL COMMENT '訂單ID',
`goodsId` bigint(0) NOT NULL DEFAULT 0 COMMENT '所屬商品',
`count` int(0) NULL DEFAULT NULL COMMENT '商品數量',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '訂單商品關系映射表' ROW_FORMAT = Dynamic;
我是小孟,分享各種專案經驗和面試資料,
一起加油進步,
求個三連,更多干貨的更新ing:
?
如果也想學習小程式的開發,我錄制了一個詳細的教程,下面領取,回復:小程式實戰
👇🏻 教程可通過搜索下方 公眾號 獲取👇🏻
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/305966.html
標籤:java
