!423 AppSampleE服务端代码及后台管理页面
Merge pull request !423 from lank/server_sample_e
4
OAT.xml
@ -67,6 +67,10 @@ Note:If the text contains special characters, please escape them according to th
|
||||
</filefilter>
|
||||
<filefilter name="defaultPolicyFilter" desc="License文件头校验策略的过滤条件" >
|
||||
<filteritem type="filepath" name="sample/ServerSampleD/java/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sample/mapper/xml/VideoMapper.xml" desc="xml配置文件,无需添加License头"/>
|
||||
<filteritem type="filepath" name="sample/ServerSampleE/java/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sample/mapper/xml/BusinessCommentMapper.xml" desc="xml配置文件,无需添加License头"/>
|
||||
<filteritem type="filepath" name="sample/ServerSampleE/java/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sample/mapper/xml/BusinessGoodsMapper.xml" desc="xml配置文件,无需添加License头"/>
|
||||
<filteritem type="filepath" name="sample/ServerSampleE/java/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sample/mapper/xml/BusinessMapper.xml" desc="xml配置文件,无需添加License头"/>
|
||||
<filteritem type="filepath" name="sample/ServerSampleE/java/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sample/mapper/xml/GroupSiteMapper.xml" desc="xml配置文件,无需添加License头"/>
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
</oatconfig>
|
||||
|
@ -2,7 +2,7 @@ OpenHarmony Sample仿应用后台服务
|
||||
===============
|
||||
|
||||
## 简介
|
||||
本服务为[xts_tools sample](https://gitee.com/openharmony/xts_tools) sample中AppSampleD、AppSampleE提供的后台服务,如视频上传、视频审核、消息发送、商家列表及定位等,同时提供了相应的web后台管理页面,体验端云侧应用系统闭环。本服务使用了[JeecgBoot](http://www.jeecg.com) 低代码开发平台,能够快速的开发和部署。
|
||||
本服务为[xts_tools sample](https://gitee.com/openharmony/xts_tools) sample中AppSampleD提供的后台服务,如视频上传、视频审核、消息发送等,同时提供了相应的web后台管理页面,体验端云侧应用系统闭环。本服务使用了[JeecgBoot](http://www.jeecg.com) 低代码开发平台,能够快速的开发和部署。
|
||||
|
||||
|
||||
## JeecgBoot源码下载
|
||||
|
@ -170,10 +170,10 @@ INSERT INTO `jeecg-boot`.`sys_user` (`id`, `username`, `realname`, `password`, `
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735104068424167426', '', 'oh-sample', '/oh-sample', 'layouts/RouteView', 1, '', NULL, 0, NULL, '0', 1.00, 0, 'ant-design:insert-row-above-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:07:01', 'admin', '2023-12-14 09:38:13', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106177429270529', '1735104068424167426', '短视频应用', '/oh-sample/video', 'oh-sample/video', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:video-camera-add-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:15:24', 'admin', '2023-12-14 09:17:28', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106861096628225', '1735104068424167426', '外卖应用', '/oh-sample/mt', 'oh-sample/mt', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:shopping-cart-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:07', 'admin', '2023-12-14 09:22:53', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106998653022209', '1735106861096628225', '商家列表', '/oh-sample/mt/business/index', 'oh-sample/mt/business/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:unordered-list-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:40', 'admin', '2023-12-14 09:37:12', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107116215169025', '1735106861096628225', '站点列表', '/oh-sample/mt/site/index', 'oh-sample/mt/site/index', 1, '', NULL, 1, NULL, '0', 2.00, 0, 'ant-design:shop-twotone', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:08', 'admin', '2023-12-14 09:37:17', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107238571405314', '1735106861096628225', '商品列表', '/oh-sample/mt/goods/index', 'oh-sample/mt/goods/index', 1, '', NULL, 1, NULL, '0', 3.00, 0, 'ant-design:shopping-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:37', 'admin', '2023-12-14 09:37:23', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106861096628225', '1735104068424167426', '外卖应用', '/oh-sample/takeaway', 'oh-sample/takeaway', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:shopping-cart-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:07', 'admin', '2023-12-14 09:22:53', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106998653022209', '1735106861096628225', '商家列表', '/oh-sample/takeaway/business/index', 'oh-sample/takeaway/business/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:unordered-list-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:40', 'admin', '2023-12-14 09:37:12', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107116215169025', '1735106861096628225', '站点列表', '/oh-sample/takeaway/site/index', 'oh-sample/takeaway/site/index', 1, '', NULL, 1, NULL, '0', 2.00, 0, 'ant-design:shop-twotone', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:08', 'admin', '2023-12-14 09:37:17', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107238571405314', '1735106861096628225', '商品列表', '/oh-sample/takeaway/goods/index', 'oh-sample/takeaway/goods/index', 1, '', NULL, 1, NULL, '0', 3.00, 0, 'ant-design:shopping-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:37', 'admin', '2023-12-14 09:37:23', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735111480019382274', '1735106177429270529', '视频审核列表', '/oh-sample/video/index', 'oh-sample/video/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:36:28', NULL, NULL, 0, 0, NULL, 0);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1735113660168269825', '进口/国产', 'made', NULL, 0, 'admin', '2023-12-14 09:45:08', NULL, NULL, 0, 0, NULL);
|
||||
|
42
sample/ServerSampleE/README.md
Normal file
@ -0,0 +1,42 @@
|
||||
OpenHarmony Sample仿应用后台服务
|
||||
===============
|
||||
|
||||
## 简介
|
||||
本服务为[xts_tools sample](https://gitee.com/openharmony/xts_tools) sample中AppSampleE提供的后台服务,如商家列表,商品列表,评论,站点及定位等,同时提供了相应的web后台管理页面,体验端云侧应用系统闭环。本服务使用了[JeecgBoot](http://www.jeecg.com) 低代码开发平台,能够快速的开发和部署。
|
||||
|
||||
|
||||
## JeecgBoot源码下载
|
||||
|
||||
- 源码 :https://gitee.com/jeecg/jeecg-boot
|
||||
|
||||
##### 项目说明
|
||||
|
||||
![](img/20231221112242.png)
|
||||
|
||||
|
||||
## 技术文档
|
||||
|
||||
- 官方文档:[http://help.jeecg.com](http://help.jeecg.com)
|
||||
- 官方网站: [http://www.jeecg.com](http://www.jeecg.com)
|
||||
|
||||
|
||||
## 安装与使用
|
||||
- 按照Jeecg官方文档安装部署后,使用Navicat Premium工具或者其他数据库工具执行本应用服务需要的数据库文件脚本oh-sample.sql;
|
||||
|
||||
![](img/20231214111722.png)
|
||||
|
||||
- 将java目录下jeecg-boot-base-core、jeecg-module-system的文件放置JeecgBoot SpringBoot后台项目源码对应目录中,如重复,使用本服务的文件,然后启动项目;
|
||||
|
||||
![](img/20231214112603.png)
|
||||
![](img/20231214112841.png)
|
||||
|
||||
- 将前端web目录下的的oh-sample文件夹放置JeecgBoot前端源码对应目录中,修改对应服务器地址后,启动项目;
|
||||
|
||||
![](img/20231214113132.png)
|
||||
![](img/20231214113701.png)
|
||||
|
||||
- 可使用默认账号13700000001、13700000002、13700000003,密码123456登录查看本服务提供的管理页面或者使用管理员账号admmin/123456体验整个系统;
|
||||
|
||||
![](img/20231214114121.png)
|
||||
![](img/20231226170839.png)
|
||||
![](img/20231226170917.png)
|
BIN
sample/ServerSampleE/img/20231214111722.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
sample/ServerSampleE/img/20231214112603.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
sample/ServerSampleE/img/20231214112841.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
sample/ServerSampleE/img/20231214113132.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
sample/ServerSampleE/img/20231214113701.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
sample/ServerSampleE/img/20231214114121.png
Normal file
After Width: | Height: | Size: 172 KiB |
BIN
sample/ServerSampleE/img/20231214171919.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
sample/ServerSampleE/img/20231221112242.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
sample/ServerSampleE/img/20231226170839.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
sample/ServerSampleE/img/20231226170917.png
Normal file
After Width: | Height: | Size: 189 KiB |
234
sample/ServerSampleE/java/db/oh-sample.sql
Normal file
@ -0,0 +1,234 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : jeecg-boot
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50741
|
||||
Source Host : localhost:3306
|
||||
Source Schema : jeecg-boot
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50741
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 14/12/2023 09:58:00
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oh_sample_short_video
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oh_sample_short_video`;
|
||||
CREATE TABLE `oh_sample_short_video`
|
||||
(
|
||||
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '视频名称',
|
||||
`url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '视频链接',
|
||||
`status` int(1) NULL DEFAULT 0 COMMENT '状态',
|
||||
`del_flag` int(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oh_sample_business
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oh_sample_business`;
|
||||
CREATE TABLE `oh_sample_business` (
|
||||
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商家名称',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面',
|
||||
`is_open` int(1) NULL DEFAULT NULL COMMENT '是否营业0否1是',
|
||||
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
||||
`longitude` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
|
||||
`latitude` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
|
||||
`phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商家手机号',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '结束时间',
|
||||
`notice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '公告',
|
||||
`start_price` float NULL DEFAULT NULL COMMENT '起送价格',
|
||||
`delivery_price` float NULL DEFAULT NULL COMMENT '配送费',
|
||||
`del_flag` int(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
`distance` double NULL DEFAULT NULL COMMENT '距离',
|
||||
`score` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评分',
|
||||
`monthly_sale` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月销',
|
||||
`per_capita` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '人均',
|
||||
`delivery_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '配送时间',
|
||||
`ranking` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '排名',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oh_sample_business_comment
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oh_sample_business_comment`;
|
||||
CREATE TABLE `oh_sample_business_comment`
|
||||
(
|
||||
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`business_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商家id',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
|
||||
`user_name` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论用户名',
|
||||
`star` int(1) NULL DEFAULT NULL COMMENT '评级1-5',
|
||||
`content` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
|
||||
`del_flag` int(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oh_sample_business_goods
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oh_sample_business_goods`;
|
||||
CREATE TABLE `oh_sample_business_goods`
|
||||
(
|
||||
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`business_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面',
|
||||
`price` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '价格',
|
||||
`sale_price` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '折后价',
|
||||
`price_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '价格说明',
|
||||
`sales_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '销量',
|
||||
`total_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '总量',
|
||||
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
`standards` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规格',
|
||||
`weight` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '重量',
|
||||
`brand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌',
|
||||
`breed` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品种',
|
||||
`made` int(2) NULL DEFAULT NULL COMMENT '国产0,进口1',
|
||||
`producer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产地',
|
||||
`quality_date` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '保质期',
|
||||
`packing` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '包装方式',
|
||||
`category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别',
|
||||
`taste` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '口味',
|
||||
`keep_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '储存方式',
|
||||
`del_flag` int(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oh_sample_group_site
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oh_sample_group_site`;
|
||||
CREATE TABLE `oh_sample_group_site`
|
||||
(
|
||||
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
|
||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商家名称',
|
||||
`cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面',
|
||||
`is_open` int(1) NULL DEFAULT NULL COMMENT '是否营业0否1是',
|
||||
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
||||
`longitude` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
|
||||
`latitude` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '结束时间',
|
||||
`notice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '公告',
|
||||
`del_flag` int(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
`distance` double NULL DEFAULT NULL COMMENT '距离',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_user` (`id`, `username`, `realname`, `password`, `salt`, `avatar`, `birthday`, `sex`, `email`, `phone`, `org_code`, `status`, `del_flag`, `third_id`, `third_type`, `activiti_sync`, `work_no`, `post`, `telephone`, `create_by`, `create_time`, `update_by`, `update_time`, `user_identity`, `depart_ids`, `client_id`, `login_tenant_id`, `bpm_status`) VALUES ('1735185182555668482', '13700000001', 'oh_sample_1', '0a2336450341645a716669413a1b0c52', 'oU4VHkXh', NULL, NULL, NULL, '13700000001@163.com', '13700000001', NULL, 1, 0, NULL, NULL, 1, '1', 'wcpjwwunmr', NULL, 'admin', '2023-12-14 14:29:20', NULL, NULL, 1, '', NULL, NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_user` (`id`, `username`, `realname`, `password`, `salt`, `avatar`, `birthday`, `sex`, `email`, `phone`, `org_code`, `status`, `del_flag`, `third_id`, `third_type`, `activiti_sync`, `work_no`, `post`, `telephone`, `create_by`, `create_time`, `update_by`, `update_time`, `user_identity`, `depart_ids`, `client_id`, `login_tenant_id`, `bpm_status`) VALUES ('1735185294220623873', '13700000002', 'oh_sample_2', '5bdaf0a843efdafeddf60b8d0c7a75d0', 'Z4CjoI2U', NULL, NULL, NULL, '13700000002@163.com', '13700000002', NULL, 1, 0, NULL, NULL, 1, '2', 'wcpjwwunmr', NULL, 'admin', '2023-12-14 14:29:47', NULL, NULL, 1, '', NULL, NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_user` (`id`, `username`, `realname`, `password`, `salt`, `avatar`, `birthday`, `sex`, `email`, `phone`, `org_code`, `status`, `del_flag`, `third_id`, `third_type`, `activiti_sync`, `work_no`, `post`, `telephone`, `create_by`, `create_time`, `update_by`, `update_time`, `user_identity`, `depart_ids`, `client_id`, `login_tenant_id`, `bpm_status`) VALUES ('1735185403566129153', '13700000003', 'oh_sample_3', '1f44876976e04ae134eddc7482cd7460', 'KLBnYPbC', NULL, NULL, NULL, '13700000003@163.com', '13700000003', NULL, 1, 0, NULL, NULL, 1, '3', 'wcpjwwunmr', NULL, 'admin', '2023-12-14 14:30:13', NULL, NULL, 1, '', NULL, NULL, NULL);
|
||||
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735104068424167426', '', 'oh-sample', '/oh-sample', 'layouts/RouteView', 1, '', NULL, 0, NULL, '0', 1.00, 0, 'ant-design:insert-row-above-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:07:01', 'admin', '2023-12-14 09:38:13', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106177429270529', '1735104068424167426', '短视频应用', '/oh-sample/video', 'oh-sample/video', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:video-camera-add-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:15:24', 'admin', '2023-12-14 09:17:28', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106861096628225', '1735104068424167426', '外卖应用', '/oh-sample/takeaway', 'oh-sample/takeaway', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:shopping-cart-outlined', 0, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:07', 'admin', '2023-12-14 09:22:53', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735106998653022209', '1735106861096628225', '商家列表', '/oh-sample/takeaway/business/index', 'oh-sample/takeaway/business/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:unordered-list-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:18:40', 'admin', '2023-12-14 09:37:12', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107116215169025', '1735106861096628225', '站点列表', '/oh-sample/takeaway/site/index', 'oh-sample/takeaway/site/index', 1, '', NULL, 1, NULL, '0', 2.00, 0, 'ant-design:shop-twotone', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:08', 'admin', '2023-12-14 09:37:17', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735107238571405314', '1735106861096628225', '商品列表', '/oh-sample/takeaway/goods/index', 'oh-sample/takeaway/goods/index', 1, '', NULL, 1, NULL, '0', 3.00, 0, 'ant-design:shopping-outlined', 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:19:37', 'admin', '2023-12-14 09:37:23', 0, 0, NULL, 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1735111480019382274', '1735106177429270529', '视频审核列表', '/oh-sample/video/index', 'oh-sample/video/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-12-14 09:36:28', NULL, NULL, 0, 0, NULL, 0);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1735113660168269825', '进口/国产', 'made', NULL, 0, 'admin', '2023-12-14 09:45:08', NULL, NULL, 0, 0, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1735114494528581633', '审核状态', 'check_status', NULL, 0, 'admin', '2023-12-14 09:48:27', NULL, NULL, 0, 0, NULL);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1739838713310814210', '1735113660168269825', '进口', '2', NULL, 1, 1, 'admin', '2023-12-27 10:40:49', NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1739838686651817985', '1735113660168269825', '国产', '1', NULL, 1, 1, 'admin', '2023-12-27 10:40:42', NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1739838622470578178', '1735114494528581633', '审核不通过', '2', NULL, 1, 1, 'admin', '2023-12-27 10:40:27', NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1739838590564507649', '1735114494528581633', '审核通过', '1', NULL, 1, 1, 'admin', '2023-12-27 10:40:19', NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1739838540337717249', '1735114494528581633', '未审核', '0', NULL, 1, 1, 'admin', '2023-12-27 10:40:07', NULL, NULL);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_position` (`id`, `code`, `name`, `post_rank`, `company_id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `tenant_id`) VALUES ('1735119103519223810', 'wcpjwwunmr', 'oh-sample', NULL, NULL, 'admin', '2023-12-14 10:06:46', NULL, NULL, 'A01', 0);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_role` (`id`, `role_name`, `role_code`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `tenant_id`) VALUES ('1735118567969517570', 'oh-sample', 'oh_sample', 'OH Sample示例', 'admin', '2023-12-14 10:04:38', NULL, NULL, 0);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147061915650', '1735118567969517570', '1735104068424167426', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147061915651', '1735118567969517570', '1735106177429270529', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147070304257', '1735118567969517570', '1735111480019382274', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147070304258', '1735118567969517570', '1735106861096628225', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147070304259', '1735118567969517570', '1735106998653022209', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147070304260', '1735118567969517570', '1735107116215169025', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196147070304261', '1735118567969517570', '1735107238571405314', NULL, '2023-12-14 15:12:55', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088681398274', 'f6817f48af4fb3af11b9e8bf182f618b', '1735104068424167426', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592578', 'f6817f48af4fb3af11b9e8bf182f618b', '1735106177429270529', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592579', 'f6817f48af4fb3af11b9e8bf182f618b', '1735111480019382274', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592580', 'f6817f48af4fb3af11b9e8bf182f618b', '1735106861096628225', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592581', 'f6817f48af4fb3af11b9e8bf182f618b', '1735106998653022209', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592582', 'f6817f48af4fb3af11b9e8bf182f618b', '1735107116215169025', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
INSERT INTO `jeecg-boot`.`sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`) VALUES ('1735196088685592583', 'f6817f48af4fb3af11b9e8bf182f618b', '1735107238571405314', NULL, '2023-12-14 15:12:41', '0:0:0:0:0:0:0:1');
|
||||
|
||||
INSERT INTO `jeecg-boot`.`sys_user_role` (`id`, `user_id`, `role_id`, `tenant_id`) VALUES ('1735202450614288385', '1735185403566129153', '1735118567969517570', 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_user_role` (`id`, `user_id`, `role_id`, `tenant_id`) VALUES ('1735202471145406466', '1735185294220623873', '1735118567969517570', 0);
|
||||
INSERT INTO `jeecg-boot`.`sys_user_role` (`id`, `user_id`, `role_id`, `tenant_id`) VALUES ('1735202493056450562', '1735185182555668482', '1735118567969517570', 0);
|
||||
|
||||
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_short_video` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `url`, `status`, `del_flag`, `cover`, `remark`) VALUES ('1', NULL, '2023-12-14 13:39:21', NULL, '2023-12-14 13:39:36', '2023再见,2024加油!', 'opt/upFiles/video/test2.mp4', 0, 0, NULL, '奋斗,努力!');
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_short_video` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `url`, `status`, `del_flag`, `cover`, `remark`) VALUES ('2', NULL, '2023-12-14 13:52:00', NULL, '2023-12-14 13:52:04', '好风景', 'opt/upFiles/video/test.mp4', 0, 0, NULL, NULL);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `phone_number`, `start_time`, `end_time`, `notice`, `start_price`, `delivery_price`, `del_flag`, `distance`, `score`, `monthly_sale`, `per_capita`, `delivery_time`, `ranking`) VALUES ('1735112443329376257', 'admin', '2023-12-14 09:40:18', '13700000001', '2023-12-14 13:51:12', '绿野水果', 'temp/mt.png', 1, '长沙市岳麓区金茂览秀城3F305', '112.900443', '28.0939', '17365456544', '8::00', '18:00', '新店运营!活动多多!', 5, 2, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `phone_number`, `start_time`, `end_time`, `notice`, `start_price`, `delivery_price`, `del_flag`, `distance`, `score`, `monthly_sale`, `per_capita`, `delivery_time`, `ranking`) VALUES ('1735145719947456513', '13700000001', '2023-12-14 11:52:32', '13700000001', '2023-12-14 13:51:01', '商家3', NULL, 1, '长沙市岳麓区上回路88号', '112.900443', '28.1958', NULL, '8::00', '24:00', NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `phone_number`, `start_time`, `end_time`, `notice`, `start_price`, `delivery_price`, `del_flag`, `distance`, `score`, `monthly_sale`, `per_capita`, `delivery_time`, `ranking`) VALUES ('1735146768917721089', '13700000001', '2023-12-14 11:56:42', '13700000001', '2023-12-14 13:51:08', '商家2', NULL, 1, '深圳市南山产业园14栋', '112.945791', '28.0939', NULL, '8::00', '24:00', NULL, 2, 3, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `phone_number`, `start_time`, `end_time`, `notice`, `start_price`, `delivery_price`, `del_flag`, `distance`, `score`, `monthly_sale`, `per_capita`, `delivery_time`, `ranking`) VALUES ('1735146876761665538', '13700000001', '2023-12-14 11:57:08', '13700000001', '2023-12-14 13:51:05', '商家1', NULL, 0, '深圳市南山产业园10栋', '112.945791', '28.0939', '13700000001', '8::00', '24:00', '哈哈哈哈哈哈哈哈哈哈或或或或或', 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735113203391787009', '1735112443329376257', 'admin', '2023-12-14 09:43:19', 'admin', '2023-12-14 09:46:03', '赣州蜜橙', NULL, '4.8/斤', '3.8/斤', NULL, '100kg', '1000kg', '很好吃的赣州蜜橙!', '约2000g/份', '2000g', '赣州蜜橙', '橙子', 2, '赣州', '2023-12-29', '袋装', '水果', '酸甜', '常温', 0);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735144596624764930', '1735112443329376257', '13700000001', '2023-12-14 11:48:04', NULL, NULL, '湘西香柚', NULL, '4.8/斤', '3.8/斤', NULL, '22', '2222', '湘西香柚,又香又甜!', '约250g/个', '250g', '湘西香柚', '柚子', 2, '湘西', '2023-12-31', '袋装', '水果', '酸甜', '常温', 0);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735147314898661377', '1735146768917721089', '13700000001', '2023-12-14 11:58:52', '13700000001', '2023-12-14 12:00:58', '商品1', NULL, '10', '10', NULL, '0', '100kg', '哒哒哒哒哒哒', '约2000g/份', NULL, '红富士', '苹果', 2, '中国', '2025-01-01', '袋装', '水果', '33', '冷藏', 0);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735147721351884801', '1735145719947456513', '13700000001', '2023-12-14 12:00:29', NULL, NULL, '商品', NULL, '4.8/斤', '3.8/斤', NULL, '100kg', '1000kg', '啊啊啊啊啊啊啊啊啊啊啊', '约2000g/份', '2000g', '红富士', '榴莲', 1, '欧洲', '2024-12-14', '袋装', '水果', '酸甜', '常温', 0);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735148168150118401', '1735146876761665538', '13700000001', '2023-12-14 12:02:15', NULL, NULL, '菠萝', NULL, '10', '3.8/斤', NULL, '100kg', '2222', '啊啊啊啊啊啊啊啊', '约2000g/份', NULL, '菠萝', '菠萝', 1, '东南亚', '2023-12-14', '袋装', '水果', '菠萝', '常温', 0);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_business_goods` (`id`, `business_id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `price`, `sale_price`, `price_explain`, `sales_number`, `total_number`, `description`, `standards`, `weight`, `brand`, `breed`, `made`, `producer`, `quality_date`, `packing`, `category`, `taste`, `keep_type`, `del_flag`) VALUES ('1735174913712553985', '1735112443329376257', '13700000001', '2023-12-14 13:48:32', NULL, NULL, '商品3', NULL, '4.8/斤', '3.8/斤', NULL, '100kg', '100kg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, '水果', NULL, NULL, 0);
|
||||
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_group_site` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `start_time`, `end_time`, `notice`, `del_flag`, `distance`) VALUES ('1735148355887165442', '13700000001', '2023-12-14 12:03:00', '13700000001', '2023-12-14 12:04:20', '站点名称1', 'temp/mt.png', 1, '长沙市桐梓坡西路8888号', '112.900443', '22.35', '8::00', '18:00', '红红火火恍恍惚惚', 0, NULL);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_group_site` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `start_time`, `end_time`, `notice`, `del_flag`, `distance`) VALUES ('1735148510505988097', '13700000001', '2023-12-14 12:03:37', NULL, NULL, '站点名称2', 'temp/mt.png', 1, '长沙市岳麓区金茂览秀城', '11.33', '22.35', '8::00', '18:00', 'wwwwwwwwwww', 0, NULL);
|
||||
INSERT INTO `jeecg-boot`.`oh_sample_group_site` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `name`, `cover`, `is_open`, `address`, `longitude`, `latitude`, `start_time`, `end_time`, `notice`, `del_flag`, `distance`) VALUES ('1735148634997125122', '13700000001', '2023-12-14 12:04:07', NULL, NULL, '站点名称3', 'temp/mt.png', 0, '长沙市桐梓坡西路', '112.900443', NULL, '6:00', '18:00', '啊啊啊啊啊啊', 0, NULL);
|
||||
|
||||
SET
|
||||
FOREIGN_KEY_CHECKS = 1;
|
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessComment;
|
||||
import org.jeecg.modules.sample.service.IBusinessCommentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 商家评论
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sample/businessComment")
|
||||
@Api(tags = "oh-sample仿商家评论")
|
||||
public class BusinessCommentController {
|
||||
@Autowired
|
||||
private IBusinessCommentService commentService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param comment 商家评论
|
||||
* @param pageNo 分页参数-页码
|
||||
* @param pageSize 分页参数-每页条数
|
||||
* @param req HttpServletRequest
|
||||
* @return 评论列表
|
||||
*/
|
||||
@ApiOperation(value = "评论列表", notes = "评论列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "/list")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
public Result<?> list(OhSampleBusinessComment comment,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OhSampleBusinessComment> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(comment, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<OhSampleBusinessComment> page = new Page<OhSampleBusinessComment>(pageNo, pageSize);
|
||||
|
||||
IPage<OhSampleBusinessComment> pageList = commentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param comment 评论
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "评论添加")
|
||||
@ApiOperation(value = "评论添加", notes = "评论添加")
|
||||
public Result<?> add(@RequestBody OhSampleBusinessComment comment) {
|
||||
commentService.save(comment);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param comment 评论
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@AutoLog(value = "评论编辑", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
@ApiOperation(value = "评论编辑", notes = "评论编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody OhSampleBusinessComment comment) {
|
||||
commentService.updateById(comment);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id 评论id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@AutoLog(value = "评论删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@ApiOperation(value = "删除通过ID删除评论", notes = "删除通过ID删除评论")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
commentService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 评论ids
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除评论", notes = "批量删除评论")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
commentService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.math3.util.Precision;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusiness;
|
||||
import org.jeecg.modules.sample.service.IBusinessService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商家
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sample/business")
|
||||
@Api(tags = "oh-sample仿商家")
|
||||
public class BusinessController {
|
||||
private final double earthRadius = 6371d; // 地球平均半径,单位为千米
|
||||
|
||||
@Autowired
|
||||
private IBusinessService mtBusinessService;
|
||||
|
||||
/**
|
||||
* 根据经纬度计算距离
|
||||
*
|
||||
* @param lat1 第一点的纬度坐标
|
||||
* @param lng1 第一点的经度坐标
|
||||
* @param lat2 第二点的纬度坐标
|
||||
* @param lng2 第二点的经度坐标
|
||||
* @return 两点之间的距离,单位为千米
|
||||
*/
|
||||
private double calculateDistance(double lat1, double lng1, double lat2, double lng2) {
|
||||
double radLat1 = Math.toRadians(lat1);
|
||||
double radLat2 = Math.toRadians(lat2);
|
||||
double a = radLat1 - radLat2;
|
||||
double b = Math.toRadians(lng1) - Math.toRadians(lng2);
|
||||
double s = 2d * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
|
||||
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
|
||||
s = s * earthRadius;
|
||||
s = Precision.round(s, 2); // 保留两位小数
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param mtBusiness 商家
|
||||
* @param pageNo 分页参数-页码
|
||||
* @param pageSize 分页参数-每页条数
|
||||
* @param req HttpServletRequest
|
||||
* @return 商家列表
|
||||
*/
|
||||
@ApiOperation(value = "商家列表", notes = "商家列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "/list")
|
||||
public Result<?> list(OhSampleBusiness mtBusiness,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LambdaQueryWrapper<OhSampleBusiness> query = new LambdaQueryWrapper<>();
|
||||
query.eq(OhSampleBusiness::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(OhSampleBusiness::getCreateTime);
|
||||
if (oConvertUtils.isNotEmpty(mtBusiness.getName())) {
|
||||
query.like(OhSampleBusiness::getName, mtBusiness.getName());
|
||||
}
|
||||
List<OhSampleBusiness> mtBusinessList = mtBusinessService.list(query);
|
||||
if (oConvertUtils.isNotEmpty(mtBusiness.getLongitude()) &&
|
||||
oConvertUtils.isNotEmpty(mtBusiness.getLatitude())) {
|
||||
double longitude = Double.parseDouble(mtBusiness.getLongitude());
|
||||
double latitude = Double.parseDouble(mtBusiness.getLatitude());
|
||||
mtBusinessList.forEach(item -> {
|
||||
double dis = calculateDistance(latitude, longitude,
|
||||
Double.parseDouble(item.getLatitude()), Double.parseDouble(item.getLongitude()));
|
||||
item.setDistance(dis);
|
||||
});
|
||||
// 按距离排序
|
||||
Collections.sort(mtBusinessList, new Comparator<OhSampleBusiness>() {
|
||||
@Override
|
||||
public int compare(OhSampleBusiness arg0, OhSampleBusiness arg1) {
|
||||
return arg0.getDistance().compareTo(arg1.getDistance());
|
||||
}
|
||||
});
|
||||
}
|
||||
Page<OhSampleBusiness> page = new Page<OhSampleBusiness>(pageNo, pageSize);
|
||||
page.setRecords(mtBusinessList);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id 商家id
|
||||
* @return 商家详情
|
||||
*/
|
||||
@GetMapping(value = "/detail")
|
||||
@AutoLog(value = "商家详情")
|
||||
@ApiOperation(value = "商家详情", notes = "商家详情")
|
||||
public Result<?> detail(@RequestParam(name = "id") String id) {
|
||||
OhSampleBusiness business = mtBusinessService.getById(id);
|
||||
return Result.OK(business);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param business 商家
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "商家添加")
|
||||
@ApiOperation(value = "商家添加", notes = "商家添加")
|
||||
public Result<?> add(@RequestBody OhSampleBusiness business) {
|
||||
System.out.println("business= " + business.toString());
|
||||
mtBusinessService.save(business);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param business 商家
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@AutoLog(value = "商家编辑", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
@ApiOperation(value = "商家编辑", notes = "商家编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody OhSampleBusiness business) {
|
||||
mtBusinessService.updateById(business);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id 商家id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@AutoLog(value = "商家删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@ApiOperation(value = "删除通过ID删除商家", notes = "删除通过ID删除商家")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mtBusinessService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 商家ids
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除商家", notes = "批量删除商家")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mtBusinessService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessGoods;
|
||||
import org.jeecg.modules.sample.service.IBusinessGoodsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 商家商品
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sample/businessGoods")
|
||||
@Api(tags = "oh-sample仿商家商品")
|
||||
public class BusinessGoodsController {
|
||||
@Autowired
|
||||
private IBusinessGoodsService mtBusinessService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param mtBusiness 商品
|
||||
* @param pageNo 分页参数-页码
|
||||
* @param pageSize 分页参数-每页条数
|
||||
* @param req HttpServletRequest
|
||||
* @return 商品列表
|
||||
*/
|
||||
@ApiOperation(value = "商品列表", notes = "商品列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "/list")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
public Result<?> list(OhSampleBusinessGoods mtBusiness,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OhSampleBusinessGoods> queryWrapper = QueryGenerator.initQueryWrapper(mtBusiness,
|
||||
req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<OhSampleBusinessGoods> page = new Page<OhSampleBusinessGoods>(pageNo, pageSize);
|
||||
|
||||
IPage<OhSampleBusinessGoods> pageList = mtBusinessService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id 商品id
|
||||
* @return 商品详情
|
||||
*/
|
||||
@GetMapping(value = "/detail")
|
||||
@AutoLog(value = "商品详情")
|
||||
@ApiOperation(value = "商品详情", notes = "商品详情")
|
||||
public Result<?> detail(@RequestParam(name = "id") String id) {
|
||||
OhSampleBusinessGoods goods = mtBusinessService.getById(id);
|
||||
return Result.OK(goods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param goods 商品
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "商品添加")
|
||||
@ApiOperation(value = "商品添加", notes = "商品添加")
|
||||
public Result<?> add(@RequestBody OhSampleBusinessGoods goods) {
|
||||
mtBusinessService.save(goods);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param goods 商品
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@AutoLog(value = "商品编辑", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
@ApiOperation(value = "商品编辑", notes = "商品编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody OhSampleBusinessGoods goods) {
|
||||
mtBusinessService.updateById(goods);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id 商品id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@AutoLog(value = "商品删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@ApiOperation(value = "删除通过ID删除商品", notes = "删除通过ID删除商品")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
mtBusinessService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 商品ids
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除商品", notes = "批量删除商品")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
mtBusinessService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.math3.util.Precision;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.sample.entity.OhSampleGroupSite;
|
||||
import org.jeecg.modules.sample.service.IGroupSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sample/groupSite")
|
||||
@Api(tags = "oh-sample仿站点")
|
||||
public class GroupSiteController {
|
||||
private final double earthRadius = 6371d; // 地球平均半径,单位为千米
|
||||
|
||||
@Autowired
|
||||
private IGroupSiteService siteService;
|
||||
|
||||
/**
|
||||
* 根据经纬度计算距离
|
||||
*
|
||||
* @param lat1 第一点的纬度坐标
|
||||
* @param lng1 第一点的经度坐标
|
||||
* @param lat2 第二点的纬度坐标
|
||||
* @param lng2 第二点的经度坐标
|
||||
* @return 两点之间的距离,单位为千米
|
||||
*/
|
||||
private double calculateDistance(double lat1, double lng1, double lat2, double lng2) {
|
||||
double radLat1 = Math.toRadians(lat1);
|
||||
double radLat2 = Math.toRadians(lat2);
|
||||
double a = radLat1 - radLat2;
|
||||
double b = Math.toRadians(lng1) - Math.toRadians(lng2);
|
||||
double s = 2d * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
|
||||
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
|
||||
s = s * earthRadius;
|
||||
s = Precision.round(s, 2); // 保留两位小数
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param site 站点
|
||||
* @param pageNo 分页参数-页码
|
||||
* @param pageSize 分页参数-每页条数
|
||||
* @param req HttpServletRequest
|
||||
* @return 站点列表
|
||||
*/
|
||||
@ApiOperation(value = "站点列表", notes = "站点列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "/list")
|
||||
public Result<?> list(OhSampleGroupSite site,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LambdaQueryWrapper<OhSampleGroupSite> query = new LambdaQueryWrapper<>();
|
||||
query.eq(OhSampleGroupSite::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(OhSampleGroupSite::getCreateTime);
|
||||
if (oConvertUtils.isNotEmpty(site.getName())) {
|
||||
query.like(OhSampleGroupSite::getName, site.getName());
|
||||
}
|
||||
List<OhSampleGroupSite> siteList = siteService.list(query);
|
||||
if (oConvertUtils.isNotEmpty(site.getLongitude()) && oConvertUtils.isNotEmpty(site.getLatitude())) {
|
||||
double longitude = Double.parseDouble(site.getLongitude());
|
||||
double latitude = Double.parseDouble(site.getLatitude());
|
||||
|
||||
siteList.forEach(item -> {
|
||||
double dis = calculateDistance(latitude, longitude, Double.parseDouble(item.getLatitude()),
|
||||
Double.parseDouble(item.getLongitude()));
|
||||
item.setDistance(dis);
|
||||
});
|
||||
// 按距离排序
|
||||
Collections.sort(siteList, new Comparator<OhSampleGroupSite>() {
|
||||
@Override
|
||||
public int compare(OhSampleGroupSite arg0, OhSampleGroupSite arg1) {
|
||||
return arg0.getDistance().compareTo(arg1.getDistance());
|
||||
}
|
||||
});
|
||||
}
|
||||
Page<OhSampleGroupSite> page = new Page<OhSampleGroupSite>(pageNo, pageSize);
|
||||
page.setRecords(siteList);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param business 站点
|
||||
* @return 添加结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "站点添加")
|
||||
@ApiOperation(value = "站点添加", notes = "站点添加")
|
||||
public Result<?> add(@RequestBody OhSampleGroupSite business) {
|
||||
siteService.save(business);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param business 站点
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@AutoLog(value = "站点编辑", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
@ApiOperation(value = "站点编辑", notes = "站点编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody OhSampleGroupSite business) {
|
||||
siteService.updateById(business);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id 站点id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@AutoLog(value = "站点删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@ApiOperation(value = "删除通过ID删除站点", notes = "删除通过ID删除站点")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
siteService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 站点ids
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除站点", notes = "批量删除站点")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
siteService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 商家
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "商家", description = "商家")
|
||||
public class OhSampleBusiness extends JeecgEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商家名称
|
||||
*/
|
||||
@Excel(name = "名称", width = 100)
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商家封面
|
||||
*/
|
||||
@Excel(name = "封面", width = 100)
|
||||
@ApiModelProperty(value = "封面")
|
||||
private String cover;
|
||||
|
||||
/**
|
||||
* 是否营业
|
||||
*/
|
||||
@Excel(name = "是否营业", width = 15, dicCode = "yn")
|
||||
@ApiModelProperty(value = "是否营业")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Excel(name = "地址", width = 255)
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度", width = 32)
|
||||
@ApiModelProperty(value = "经度")
|
||||
private String longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Excel(name = "纬度", width = 32)
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private String latitude;
|
||||
|
||||
/**
|
||||
* 2个经纬度之间距离,单位千米
|
||||
*/
|
||||
private Double distance;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Excel(name = "开始时间")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Excel(name = "结束时间")
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 公告
|
||||
*/
|
||||
@Excel(name = "公告")
|
||||
@ApiModelProperty(value = "公告")
|
||||
private String notice;
|
||||
|
||||
/**
|
||||
* 起送价格
|
||||
*/
|
||||
@Excel(name = "起送价格")
|
||||
@ApiModelProperty(value = "起送价格")
|
||||
private Float startPrice;
|
||||
|
||||
/**
|
||||
* 配送费
|
||||
*/
|
||||
@Excel(name = "配送费")
|
||||
@ApiModelProperty(value = "配送费")
|
||||
private Float deliveryPrice;
|
||||
|
||||
/**
|
||||
* 商家手机号
|
||||
*/
|
||||
@Excel(name = "商家手机号")
|
||||
@ApiModelProperty(value = "商家手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
@Excel(name = "评分")
|
||||
@ApiModelProperty(value = "评分")
|
||||
private String score;
|
||||
|
||||
/**
|
||||
* 月销
|
||||
*/
|
||||
@Excel(name = "月销")
|
||||
@ApiModelProperty(value = "月销")
|
||||
private String monthlySale;
|
||||
|
||||
/**
|
||||
* 人均
|
||||
*/
|
||||
@Excel(name = "人均")
|
||||
@ApiModelProperty(value = "人均")
|
||||
private String perCapita;
|
||||
|
||||
/**
|
||||
* 配送时间
|
||||
*/
|
||||
@Excel(name = "配送时间")
|
||||
@ApiModelProperty(value = "配送时间")
|
||||
private String deliveryTime;
|
||||
|
||||
/**
|
||||
* 排名
|
||||
*/
|
||||
@Excel(name = "排名")
|
||||
@ApiModelProperty(value = "排名")
|
||||
private String ranking;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15, dicCode = "del_flag")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 商家评论
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "商家评论", description = "商家评论")
|
||||
public class OhSampleBusinessComment extends JeecgEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商家id
|
||||
*/
|
||||
@Excel(name = "商家id", width = 36)
|
||||
@ApiModelProperty(value = "商家id")
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Excel(name = "用户名", width = 36)
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
@Excel(name = "评分", width = 2)
|
||||
@ApiModelProperty(value = "评分")
|
||||
private Integer star;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Excel(name = "内容")
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15, dicCode = "del_flag")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 商家商品
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "商家商品", description = "商家商品")
|
||||
public class OhSampleBusinessGoods extends JeecgEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商家id
|
||||
*/
|
||||
@Excel(name = "商家id", width = 36)
|
||||
@ApiModelProperty(value = "商家id")
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Excel(name = "商品名称", width = 100)
|
||||
@ApiModelProperty(value = "商品名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品封面
|
||||
*/
|
||||
@Excel(name = "商品封面", width = 100)
|
||||
@ApiModelProperty(value = "商品封面")
|
||||
private String cover;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@Excel(name = "价格")
|
||||
@ApiModelProperty(value = "价格")
|
||||
private String price;
|
||||
|
||||
/**
|
||||
* 折后价格
|
||||
*/
|
||||
@Excel(name = "折后价格")
|
||||
@ApiModelProperty(value = "折后价格")
|
||||
private String salePrice;
|
||||
|
||||
/**
|
||||
* 价格说明
|
||||
*/
|
||||
@Excel(name = "价格说明", width = 100)
|
||||
@ApiModelProperty(value = "价格说明")
|
||||
private String priceExplain;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
@Excel(name = "销量", width = 10)
|
||||
@ApiModelProperty(value = "销量")
|
||||
private String salesNumber;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@Excel(name = "总量", width = 10)
|
||||
@ApiModelProperty(value = "总量")
|
||||
private String totalNumber;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述")
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Excel(name = "规格")
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String standards;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
@Excel(name = "重量")
|
||||
@ApiModelProperty(value = "重量")
|
||||
private String weight;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@Excel(name = "品牌")
|
||||
@ApiModelProperty(value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
@Excel(name = "品种")
|
||||
@ApiModelProperty(value = "品种")
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* 进口/国产
|
||||
*/
|
||||
@Excel(name = "进口/国产", width = 15, dicCode = "made")
|
||||
@ApiModelProperty(value = "国产0,进口1")
|
||||
private Integer made;
|
||||
|
||||
/**
|
||||
* 产地
|
||||
*/
|
||||
@Excel(name = "产地")
|
||||
@ApiModelProperty(value = "产地")
|
||||
private String producer;
|
||||
|
||||
/**
|
||||
* 保质期
|
||||
*/
|
||||
@Excel(name = "保质期")
|
||||
@ApiModelProperty(value = "保质期")
|
||||
private String qualityDate;
|
||||
|
||||
/**
|
||||
* 包装方式
|
||||
*/
|
||||
@Excel(name = "包装方式")
|
||||
@ApiModelProperty(value = "包装方式")
|
||||
private String packing;
|
||||
|
||||
/**
|
||||
* 类别
|
||||
*/
|
||||
@Excel(name = "类别")
|
||||
@ApiModelProperty(value = "类别")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 口味
|
||||
*/
|
||||
@Excel(name = "口味")
|
||||
@ApiModelProperty(value = "口味")
|
||||
private String taste;
|
||||
|
||||
/**
|
||||
* 储存方式
|
||||
*/
|
||||
@Excel(name = "储存方式")
|
||||
@ApiModelProperty(value = "储存方式")
|
||||
private String keepType;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15, dicCode = "del_flag")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "站点", description = "站点")
|
||||
public class OhSampleGroupSite extends JeecgEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "名称", width = 100)
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
@Excel(name = "封面", width = 100)
|
||||
@ApiModelProperty(value = "封面")
|
||||
private String cover;
|
||||
|
||||
/**
|
||||
* 是否营业
|
||||
*/
|
||||
@Excel(name = "是否营业", width = 15, dicCode = "yn")
|
||||
@ApiModelProperty(value = "是否营业")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Excel(name = "地址", width = 255)
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 2个经纬度之间距离,单位千米
|
||||
*/
|
||||
private Double distance;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Excel(name = "经度", width = 32)
|
||||
@ApiModelProperty(value = "经度")
|
||||
private String longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Excel(name = "纬度", width = 32)
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private String latitude;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Excel(name = "开始时间")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Excel(name = "结束时间")
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 公告
|
||||
*/
|
||||
@Excel(name = "公告")
|
||||
@ApiModelProperty(value = "公告")
|
||||
private String notice;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15, dicCode = "del_flag")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessComment;
|
||||
|
||||
/**
|
||||
* BusinessCommentMapper
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface BusinessCommentMapper extends BaseMapper<OhSampleBusinessComment> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessGoods;
|
||||
|
||||
/**
|
||||
* BusinessGoodsMapper
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface BusinessGoodsMapper extends BaseMapper<OhSampleBusinessGoods> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusiness;
|
||||
|
||||
/**
|
||||
* BusinessMapper
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface BusinessMapper extends BaseMapper<OhSampleBusiness> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.sample.entity.OhSampleGroupSite;
|
||||
|
||||
/**
|
||||
* GroupSiteMapper
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface GroupSiteMapper extends BaseMapper<OhSampleGroupSite> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.sample.mapper.BusinessCommentMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.sample.mapper.BusinessGoodsMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.sample.mapper.BusinessMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.sample.mapper.GroupSiteMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessComment;
|
||||
|
||||
/**
|
||||
* 评论服务类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface IBusinessCommentService extends IService<OhSampleBusinessComment> {
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessGoods;
|
||||
|
||||
/**
|
||||
* 商品服务类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface IBusinessGoodsService extends IService<OhSampleBusinessGoods> {
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusiness;
|
||||
|
||||
/**
|
||||
* 商家服务类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface IBusinessService extends IService<OhSampleBusiness> {
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.sample.entity.OhSampleGroupSite;
|
||||
|
||||
/**
|
||||
* 站点服务类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
public interface IGroupSiteService extends IService<OhSampleGroupSite> {
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessComment;
|
||||
import org.jeecg.modules.sample.mapper.BusinessCommentMapper;
|
||||
import org.jeecg.modules.sample.service.IBusinessCommentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 评论服务实现类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessCommentServiceImpl extends ServiceImpl<BusinessCommentMapper,
|
||||
OhSampleBusinessComment> implements IBusinessCommentService {
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusinessGoods;
|
||||
import org.jeecg.modules.sample.mapper.BusinessGoodsMapper;
|
||||
import org.jeecg.modules.sample.service.IBusinessGoodsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 商品服务实现类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessGoodsServiceImpl extends ServiceImpl<BusinessGoodsMapper,
|
||||
OhSampleBusinessGoods> implements IBusinessGoodsService {
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.sample.entity.OhSampleBusiness;
|
||||
import org.jeecg.modules.sample.mapper.BusinessMapper;
|
||||
import org.jeecg.modules.sample.service.IBusinessService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 商家服务实现类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, OhSampleBusiness> implements IBusinessService {
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jeecg.modules.sample.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.sample.entity.OhSampleGroupSite;
|
||||
import org.jeecg.modules.sample.mapper.GroupSiteMapper;
|
||||
import org.jeecg.modules.sample.service.IGroupSiteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 站点服务实现类
|
||||
*
|
||||
* @since:2023-06-10
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class GroupSiteServiceImpl extends ServiceImpl<GroupSiteMapper, OhSampleGroupSite> implements IGroupSiteService {
|
||||
|
||||
}
|
@ -0,0 +1,255 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit" width="40%">
|
||||
<BasicForm :labelWidth="100" :actionColOptions="{ span: 24 }" :labelCol="{ span: 8 }" @register="registerForm"
|
||||
:disabled="isDisabled" />
|
||||
<a-tabs defaultActiveKey="1" v-if="isUpdate">
|
||||
<a-tab-pane tab="商品" key="1">
|
||||
<div style="width:100%;display: flex;justify-content: right;margin-bottom: 10px;" v-if="!isDisabled">
|
||||
<a-button type="primary" @click="handleAdd">新增</a-button>
|
||||
</div>
|
||||
|
||||
<a-table ref="table" size="small" rowKey="id" class="j-table-force-nowrap" :columns="columns1" :dataSource="data1"
|
||||
:pagination="ipagination1" :loading="loading1" @change="handleTableChange1">
|
||||
<template #imgSlot="{ text, record }">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
|
||||
<img v-else :src="getImgView(text)" :preview="getImgView(text)" alt="{{record.name}}" class="anty-img-wrap" />
|
||||
</template>
|
||||
|
||||
|
||||
<template #action="{ text, record }">
|
||||
<a @click="handleDetail1(record)">详情</a>
|
||||
<template v-if="!isDisabled">
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-tab-pane>
|
||||
|
||||
<a-tab-pane tab="评价" key="2" forceRender>
|
||||
<a-table ref="table" size="small" rowKey="id" class="j-table-force-nowrap" :columns="columns2" :dataSource="data2"
|
||||
:pagination="ipagination2" :loading="loading2" @change="handleTableChange2">
|
||||
|
||||
<template #action="{ text, record }">
|
||||
<a @click="handleDetail2(record)">详情</a>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<GoodsModal @register="registerGoodsModal" @success="list1(1)" :isDisabled="isDisabledGoods" />
|
||||
<CommentModal @register="registerCommentModal" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema, columnsGoods, columnsComment } from './business.data';
|
||||
import { saveOrUpdate, listComment } from './business.api';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import GoodsModal from '../goods/GoodsModal.vue';
|
||||
import CommentModal from './CommentModal.vue';
|
||||
import { listGoods, deleteGoods } from '../goods/goods.api';
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDisabledGoods = ref(true);
|
||||
const [registerGoodsModal, { openModal: openGoodsModal }] = useModal();
|
||||
const [registerCommentModal, { openModal: openCommentModal }] = useModal();
|
||||
|
||||
//自定义接受参数
|
||||
const props = defineProps({
|
||||
//是否禁用页面
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const businessModel = ref({ id: null, businessId: null });
|
||||
|
||||
const ipagination1 = ref<any>({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条';
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0,
|
||||
});
|
||||
const ipagination2 = ref<any>({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条';
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0,
|
||||
});
|
||||
const columns1 = ref(columnsGoods);
|
||||
const columns2 = ref(columnsComment);
|
||||
const data1 = ref<any>([]);
|
||||
const data2 = ref<any>([]);
|
||||
const loading1 = ref(false);
|
||||
const loading2 = ref(false);
|
||||
|
||||
//表单配置
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showOkBtn: !props.isDisabled });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
businessModel.value = data.record;
|
||||
if (data.createBy) {
|
||||
await setFieldsValue({ createBy: data.createBy });
|
||||
}
|
||||
if (data.createTime) {
|
||||
await setFieldsValue({ createTime: data.createTime });
|
||||
}
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
if (unref(isUpdate)) {
|
||||
list1(1);
|
||||
list2(1);
|
||||
}
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (props.isDisabled ? '详情' : !unref(isUpdate) ? '新增' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success', values);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取预览图片
|
||||
*/
|
||||
function getImgView(text) {
|
||||
if (text && text.indexOf(',') > 0) {
|
||||
text = text.substring(0, text.indexOf(','));
|
||||
}
|
||||
return getFileAccessHttpUrl(text);
|
||||
}
|
||||
|
||||
function list1(flag: number) {
|
||||
if (flag === 1) {
|
||||
ipagination1.value.current = 1;
|
||||
}
|
||||
loading1.value = true;
|
||||
const params = {
|
||||
businessId: businessModel.value.id,
|
||||
pageNo: ipagination1.value.current,
|
||||
pageSize: ipagination1.value.pageSize
|
||||
};
|
||||
listGoods(params).then((data) => {
|
||||
data1.value = data.records;
|
||||
ipagination1.value.total = data.total;
|
||||
loading1.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function list2(flag: number) {
|
||||
if (flag === 1) {
|
||||
ipagination2.value.current = 1;
|
||||
}
|
||||
loading2.value = true;
|
||||
const params = {
|
||||
businessId: businessModel.value.id,
|
||||
pageNo: ipagination2.value.current,
|
||||
pageSize: ipagination2.value.pageSize
|
||||
};
|
||||
listComment(params).then((data) => {
|
||||
data2.value = data.records;
|
||||
ipagination2.value.total = data.total;
|
||||
loading2.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
isDisabledGoods.value = false;
|
||||
openGoodsModal(true, {
|
||||
record: { businessId: businessModel.value.id },
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
function handleEdit(record) {;
|
||||
isDisabledGoods.value = false;
|
||||
openGoodsModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
function handleDetail1(record) {
|
||||
isDisabledGoods.value = true;
|
||||
openGoodsModal(true, {
|
||||
record,
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
function handleDetail2(record) {
|
||||
openCommentModal(true, {
|
||||
record,
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
async function handleDelete(record) {
|
||||
await deleteGoods({ id: record.id }, list1);
|
||||
}
|
||||
|
||||
function handleTableChange1(pagination, filters, sorter) {
|
||||
ipagination1.value = pagination;
|
||||
list1(0);
|
||||
}
|
||||
|
||||
function handleTableChange2(pagination, filters, sorter) {
|
||||
ipagination2.value = pagination;
|
||||
list2(0);
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="查看详情" :minHeight="200" :showCancelBtn="false"
|
||||
:showOkBtn="false">
|
||||
<a-card class="daily-article">
|
||||
<a-card-meta :description="'用户名:' + comment.userName + ' 评价时间: ' + comment.createTime"> </a-card-meta>
|
||||
<a-rate v-model:value="comment.star" style="margin-top: 8px;" />
|
||||
<a-divider />
|
||||
<span v-html="comment.content" class="article-content"></span>
|
||||
</a-card>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
|
||||
import { ref } from 'vue';
|
||||
const comment = ref({
|
||||
userName: '',
|
||||
createTime: '',
|
||||
star: 0,
|
||||
content: ''
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal] = useModalInner(async (data) => {
|
||||
comment.value = data.record;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
LIST = '/sample/business/list',
|
||||
SAVE = '/sample/business/add',
|
||||
EDIT = '/sample/business/edit',
|
||||
DELETE = '/sample/business/delete',
|
||||
DELETE_BATCH = '/sample/business/deleteBatch',
|
||||
LIST_COMMENT = '/sample/businessComment/list',
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
*/
|
||||
export const list = (params): Promise<string> => defHttp.get({ url: Api.LIST, params });
|
||||
|
||||
/**
|
||||
* 评论列表接口
|
||||
*/
|
||||
export const listComment = (params): Promise<string> => defHttp.get({ url: Api.LIST_COMMENT, params });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const deleteBusiness = (params, handleSuccess): Promise<void> => {
|
||||
return defHttp.delete({ url: Api.DELETE, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchDeleteBusiness = (params, handleSuccess): void => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.DELETE_BATCH, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate): Promise<string> => {
|
||||
const url = isUpdate ? Api.EDIT : Api.SAVE;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Avatar } from 'ant-design-vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import type { Component } from 'vue';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '封面',
|
||||
dataIndex: 'cover',
|
||||
width: 100,
|
||||
customRender: ({ text }): Component => {
|
||||
return h(Avatar, {
|
||||
src: getFileAccessHttpUrl(text),
|
||||
shape: 'square',
|
||||
size: 'default',
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否营业',
|
||||
dataIndex: 'isOpen',
|
||||
customRender: ({ text }): Component => {
|
||||
return render.renderDict(text, 'yn');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
{
|
||||
title: '距离',
|
||||
dataIndex: 'distance',
|
||||
customRender: ({ text }): string => {
|
||||
return text != null ? text + 'km' : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '营业开始时间',
|
||||
dataIndex: 'startTime',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '营业结束时间',
|
||||
dataIndex: 'endTime',
|
||||
width: 120,
|
||||
},
|
||||
];
|
||||
|
||||
export const columnsGoods: BasicColumn[] = [
|
||||
{
|
||||
title: '商品名称',
|
||||
dataIndex: 'name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '封面',
|
||||
dataIndex: 'cover',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
slots: { customRender: 'imgSlot' },
|
||||
},
|
||||
{
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
];
|
||||
|
||||
export const columnsComment: BasicColumn[] = [
|
||||
{
|
||||
title: '用户',
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '评分',
|
||||
dataIndex: 'star',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '内容',
|
||||
dataIndex: 'content',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '商家名称',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
field: 'longitude',
|
||||
label: '经度',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
field: 'latitude',
|
||||
label: '纬度',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'id',
|
||||
label: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
label: 'createBy',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: 'createTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '商家名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入商家名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'isOpen',
|
||||
label: '是否营业',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: {
|
||||
dictCode: 'yn',
|
||||
placeholder: '请选择',
|
||||
stringToNumber: true,
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'address',
|
||||
label: '地址',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入地址',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'longitude',
|
||||
label: '经度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入经度',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'latitude',
|
||||
label: '纬度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入纬度',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
label: '营业开始时间',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入开始时间',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'endTime',
|
||||
label: '营业结束时间',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入结束时间',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'startPrice',
|
||||
label: '起送费',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入起送费',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deliveryPrice',
|
||||
label: '配送费',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
placeholder: '请输入配送费',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cover',
|
||||
label: '封面',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
fileMax: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'phoneNumber',
|
||||
label: '商家号码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入商家号码',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'notice',
|
||||
label: '公告',
|
||||
component: 'InputTextArea',
|
||||
labelLength: 8,
|
||||
componentProps: {
|
||||
placeholder: '请输入公告',
|
||||
},
|
||||
},
|
||||
];
|
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"> 新增</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<BusinessModal @register="registerModal" @success="reload" :isDisabled="isDisabled" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="system-position" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { list, deleteBusiness, batchDeleteBusiness } from './business.api';
|
||||
import { columns, searchFormSchema } from './business.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import BusinessModal from './BusinessModal.vue';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
// 列表页面公共参数、方法
|
||||
const { tableContext } = useListPage({
|
||||
designScope: 'position-template',
|
||||
tableProps: {
|
||||
title: '商家列表',
|
||||
api: list,
|
||||
columns: columns,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const isDisabled = ref(false);
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 操作列定义
|
||||
*/
|
||||
function getActions(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情页面
|
||||
*/
|
||||
function handleDetail(record) {
|
||||
isDisabled.value = true;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record) {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteBusiness({ id: record.id }, reload);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteBusiness({ ids: selectedRowKeys.value }, () => {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit" width="40%">
|
||||
<BasicForm :labelWidth="100" :actionColOptions="{ span: 24 }" :labelCol="{ span: 8 }" @register="registerForm"
|
||||
:disabled="isDisabled" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, defineProps } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from './goods.data';
|
||||
import { saveOrUpdateGoods } from './goods.api';
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const businessId = ref(null);
|
||||
|
||||
//自定义接受参数
|
||||
const props = defineProps({
|
||||
//是否禁用页面
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
//表单配置
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showOkBtn: !props.isDisabled });
|
||||
isUpdate.value = data?.isUpdate;
|
||||
businessId.value = data?.record?.businessId;
|
||||
if (data.createBy) {
|
||||
await setFieldsValue({ createBy: data.createBy });
|
||||
}
|
||||
if (data.createTime) {
|
||||
await setFieldsValue({ createTime: data.createTime });
|
||||
}
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (props.isDisabled ? '详情' : !unref(isUpdate) ? '新增' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
values.businessId = businessId.value;
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdateGoods(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success', values);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
<Image :src="goodsModel.cover" style="width:100%;" :preview="true" />
|
||||
<div class="content">
|
||||
<span class="font-18 black">{{ goodsModel.name }}</span>
|
||||
<span class="font-12 gray ">销量{{ goodsModel.salesNumber }}</span>
|
||||
<div class="font-12"><span class="red">¥</span><span class="font-18 red bold" v-if="goodsModel.salePrice">{{
|
||||
goodsModel.salePrice
|
||||
}}</span><span v-if="goodsModel.salePrice" class="light-gray del">¥</span><span
|
||||
:class="goodsModel.salePrice ? 'light-gray del' : 'font-18 red bold'">{{ goodsModel.price }}</span>
|
||||
</div>
|
||||
<a-divider />
|
||||
<div class="business">
|
||||
<Image :src="businessModel.cover" style="height: 60px;" />
|
||||
<div style="margin-left: 8px;">
|
||||
<div class="font-16 black">{{ businessModel.name }}</div>
|
||||
<div style="margin-top: 12px;" class="font-12 black">地址:{{ businessModel.address }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-divider />
|
||||
<div>
|
||||
<div class="font-14 black" style="margin-bottom: 6px;">商品详情</div>
|
||||
<div class="font-12"><span class="light-gray " style="margin-right: 12px;">规格</span><span class="black">{{
|
||||
goodsModel.standards }}</span></div>
|
||||
<div class="font-12"><span class="light-gray " style="margin-right: 12px;">重量</span><span class="black">{{
|
||||
goodsModel.weight }}</span></div>
|
||||
<div class="font-12"><span class="light-gray " style="margin-right: 12px;">商品类别</span><span class="black">{{
|
||||
goodsModel.category }}</span></div>
|
||||
<div class="font-12"><span class="light-gray " style="margin-right: 12px;">包装方式</span><span class="black">{{
|
||||
goodsModel.packing }}</span></div>
|
||||
<div class="font-12"><span class="light-gray " style="margin-right: 12px;">储存方式</span><span class="black">{{
|
||||
goodsModel.keepType }}</span></div>
|
||||
</div>
|
||||
<a-divider />
|
||||
<div>
|
||||
<div style="margin-bottom: 6px;"><span class="font-12 black">价格说明</span>
|
||||
<Icon icon="ant-design:question-circle-outlined" :size="14" />
|
||||
</div>
|
||||
<div class="font-12 gray">{{ goodsModel.priceExplain }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="system-position" setup>
|
||||
import { Image } from 'ant-design-vue';
|
||||
import Icon from '/@/components/Icon';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { detail, detailBusiness } from './goods.api';
|
||||
import { ref } from 'vue';
|
||||
const route = useRoute();
|
||||
const goodsId = ref(route.query?.id);
|
||||
const goodsModel = ref({
|
||||
businessId: '',
|
||||
cover: '',
|
||||
name: '',
|
||||
price: '',
|
||||
salePrice: '0',
|
||||
salesNumber: '0',
|
||||
standards: '',
|
||||
weight: '',
|
||||
packing: '',
|
||||
category: '',
|
||||
keepType: '',
|
||||
priceExplain: ''
|
||||
});
|
||||
|
||||
const businessModel = ref({
|
||||
cover: '',
|
||||
name: '',
|
||||
address: null
|
||||
});
|
||||
|
||||
function getDetail() {
|
||||
detail({ id: goodsId.value }).then((data) => {
|
||||
data.cover = getFileAccessHttpUrl(data.cover);
|
||||
goodsModel.value = data;
|
||||
getBusinessDetail(goodsModel.value.businessId);
|
||||
});
|
||||
}
|
||||
|
||||
function getBusinessDetail(id) {
|
||||
detailBusiness({ id: id }).then((data) => {
|
||||
data.cover = getFileAccessHttpUrl(data.cover);
|
||||
businessModel.value = data;
|
||||
});
|
||||
}
|
||||
|
||||
getDetail();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 12px;
|
||||
|
||||
.business {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.black {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.light-gray {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.font-18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.font-16 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.font-14 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.font-12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.del {
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
LIST = '/sample/businessGoods/list',
|
||||
DETAIL = '/sample/businessGoods/detail',
|
||||
DETAIL_BUSINESS = '/sample/business/detail',
|
||||
SAVE = '/sample/businessGoods/add',
|
||||
EDIT = '/sample/businessGoods/edit',
|
||||
DELETE = '/sample/businessGoods/delete',
|
||||
DELETE_BATCH = '/sample/businessGoods/deleteBatch',
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
*/
|
||||
export const listGoods = (params): Promise<string> => defHttp.get({ url: Api.LIST, params });
|
||||
|
||||
/**
|
||||
* 详情接口
|
||||
*/
|
||||
export const detail = (params): Promise<string> => defHttp.get({ url: Api.DETAIL, params });
|
||||
|
||||
/**
|
||||
* 商家详情接口
|
||||
*/
|
||||
export const detailBusiness = (params): Promise<string> => defHttp.get({ url: Api.DETAIL_BUSINESS, params });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const deleteGoods = (params, handleSuccess): Promise<void> => {
|
||||
return defHttp.delete({ url: Api.DELETE, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchDeleteGoods = (params, handleSuccess): void => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.DELETE_BATCH, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
*/
|
||||
export const saveOrUpdateGoods = (params, isUpdate): Promise<string> => {
|
||||
const url = isUpdate ? Api.EDIT : Api.SAVE;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
@ -0,0 +1,332 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Avatar } from 'ant-design-vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import type { Component } from 'vue';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '封面',
|
||||
dataIndex: 'cover',
|
||||
width: 100,
|
||||
customRender: ({ text }): Component => {
|
||||
return h(Avatar, {
|
||||
src: getFileAccessHttpUrl(text),
|
||||
shape: 'square',
|
||||
size: 'default',
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
dataIndex: 'price',
|
||||
},
|
||||
{
|
||||
title: '总量',
|
||||
dataIndex: 'totalNumber',
|
||||
},
|
||||
{
|
||||
title: '销量',
|
||||
dataIndex: 'salesNumber',
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
dataIndex: 'standards',
|
||||
},
|
||||
{
|
||||
title: '重量',
|
||||
dataIndex: 'weight',
|
||||
},
|
||||
{
|
||||
title: '品牌',
|
||||
dataIndex: 'brand',
|
||||
},
|
||||
{
|
||||
title: '品种',
|
||||
dataIndex: 'breed',
|
||||
},
|
||||
{
|
||||
title: '产地',
|
||||
dataIndex: 'producer',
|
||||
},
|
||||
{
|
||||
title: '国产/进口',
|
||||
dataIndex: 'made',
|
||||
customRender: ({ text }): Component => {
|
||||
return render.renderDict(text, 'made');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '保质期',
|
||||
dataIndex: 'qualityDate',
|
||||
},
|
||||
{
|
||||
title: '包装方式',
|
||||
dataIndex: 'packing',
|
||||
},
|
||||
{
|
||||
title: '类别',
|
||||
dataIndex: 'category',
|
||||
},
|
||||
{
|
||||
title: '口味',
|
||||
dataIndex: 'taste',
|
||||
},
|
||||
{
|
||||
title: '储存方式',
|
||||
dataIndex: 'keepType',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '商品名称',
|
||||
component: 'JInput',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
field: 'category',
|
||||
label: '类别',
|
||||
component: 'JInput',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
];
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'id',
|
||||
label: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
label: 'createBy',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: 'createTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '商品名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入商品名称',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'category',
|
||||
label: '类别',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入类别',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
label: '价格',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入价格',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'salePrice',
|
||||
label: '折后价格',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入折后价格',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'totalNumber',
|
||||
label: '总量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入总量',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'salesNumber',
|
||||
label: '销量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入销量',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'standards',
|
||||
label: '规格',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入规格',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'weight',
|
||||
label: '重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入重量',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'brand',
|
||||
label: '品牌',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入品牌',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'breed',
|
||||
label: '品种',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入品种',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'producer',
|
||||
label: '产地',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入产地',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'made',
|
||||
label: '进口/国产',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'made',
|
||||
placeholder: '请选择',
|
||||
stringToNumber: true,
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'packing',
|
||||
label: '包装方式',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入包装方式',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'taste',
|
||||
label: '口味',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入口味',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'keepType',
|
||||
label: '存储方式',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入存储方式',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'qualityDate',
|
||||
label: '保质期',
|
||||
component: 'DatePicker',
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: '请选择保质期',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cover',
|
||||
label: '封面',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
fileMax: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
label: '描述',
|
||||
component: 'InputTextArea',
|
||||
labelLength: 8,
|
||||
componentProps: {
|
||||
placeholder: '请输入描述',
|
||||
},
|
||||
},
|
||||
];
|
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"> 新增</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<GoodsModal @register="registerModal" @success="reload" :isDisabled="isDisabled" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="system-position" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { listGoods, deleteGoods, batchDeleteGoods } from './goods.api';
|
||||
import { columns, searchFormSchema } from './goods.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import GoodsModal from './GoodsModal.vue';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
// 列表页面公共参数、方法
|
||||
const { tableContext } = useListPage({
|
||||
designScope: 'position-template',
|
||||
tableProps: {
|
||||
title: '商品列表',
|
||||
api: listGoods,
|
||||
columns: columns,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const isDisabled = ref(false);
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 操作列定义
|
||||
*/
|
||||
function getActions(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情页面
|
||||
*/
|
||||
function handleDetail(record) {
|
||||
isDisabled.value = true;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record) {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteGoods({ id: record.id }, reload);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteGoods({ ids: selectedRowKeys.value }, () => {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit" width="40%">
|
||||
<BasicForm :labelWidth="100" :actionColOptions="{ span: 24 }" :labelCol="{ span: 8 }" @register="registerForm"
|
||||
:disabled="isDisabled" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, defineProps } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from './site.data';
|
||||
import { saveOrUpdate } from './site.api';
|
||||
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
|
||||
// 自定义接受参数
|
||||
const props = defineProps({
|
||||
// 是否禁用页面
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
// 表单配置
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
// 表单赋值
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
// 重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showOkBtn: !props.isDisabled });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (data.createBy) {
|
||||
await setFieldsValue({ createBy: data.createBy });
|
||||
}
|
||||
if (data.createTime) {
|
||||
await setFieldsValue({ createTime: data.createTime });
|
||||
}
|
||||
if (unref(isUpdate)) {
|
||||
// 表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 设置标题
|
||||
const title = computed(() => (props.isDisabled ? '详情' : !unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
||||
// 表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
// 提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
// 关闭弹窗
|
||||
closeModal();
|
||||
// 刷新列表
|
||||
emit('success', values);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"> 新增</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<SiteModal @register="registerModal" @success="reload" :isDisabled="isDisabled" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="system-position" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { list, deleteSite, batchDeleteSite } from './site.api';
|
||||
import { columns, searchFormSchema } from './site.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import SiteModal from './SiteModal.vue';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
// 列表页面公共参数、方法
|
||||
const { tableContext } = useListPage({
|
||||
designScope: 'position-template',
|
||||
tableProps: {
|
||||
title: '商家列表',
|
||||
api: list,
|
||||
columns: columns,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const isDisabled = ref(false);
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 操作列定义
|
||||
*/
|
||||
function getActions(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情页面
|
||||
*/
|
||||
function handleDetail(record) {
|
||||
isDisabled.value = true;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record) {
|
||||
isDisabled.value = false;
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteSite({ id: record.id }, reload);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeleteSite({ ids: selectedRowKeys.value }, () => {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
LIST = '/sample/groupSite/list',
|
||||
SAVE = '/sample/groupSite/add',
|
||||
EDIT = '/sample/groupSite/edit',
|
||||
DELETE = '/sample/groupSite/delete',
|
||||
DELETE_BATCH = '/sample/groupSite/deleteBatch',
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
*/
|
||||
export const list = (params): Promise<string> => defHttp.get({ url: Api.LIST, params });
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export const deleteSite = (params, handleSuccess): Promise<void> => {
|
||||
return defHttp.delete({ url: Api.DELETE, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export const batchDeleteSite = (params, handleSuccess): void => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.DELETE_BATCH, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate): Promise<string> => {
|
||||
const url = isUpdate ? Api.EDIT : Api.SAVE;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Avatar } from 'ant-design-vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import type { Component } from 'vue';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '封面',
|
||||
dataIndex: 'cover',
|
||||
width: 100,
|
||||
customRender: ({ text }): Component => {
|
||||
return h(Avatar, {
|
||||
src: getFileAccessHttpUrl(text),
|
||||
shape: 'square',
|
||||
size: 'default',
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否营业',
|
||||
dataIndex: 'isOpen',
|
||||
customRender: ({ text }): Component => {
|
||||
return render.renderDict(text, 'yn');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
{
|
||||
title: '距离',
|
||||
dataIndex: 'distance',
|
||||
customRender: ({ text }): string => {
|
||||
return text != null ? text + 'km' : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '营业开始时间',
|
||||
dataIndex: 'startTime',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '营业结束时间',
|
||||
dataIndex: 'endTime',
|
||||
width: 120,
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '站点名称',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
field: 'longitude',
|
||||
label: '经度',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
field: 'latitude',
|
||||
label: '纬度',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'id',
|
||||
label: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
label: 'createBy',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: 'createTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '商家名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入商家名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'isOpen',
|
||||
label: '是否营业',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: {
|
||||
dictCode: 'yn',
|
||||
placeholder: '请选择',
|
||||
stringToNumber: true,
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'address',
|
||||
label: '地址',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入地址',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'longitude',
|
||||
label: '经度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入经度',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'latitude',
|
||||
label: '纬度',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入纬度',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
label: '营业开始时间',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入开始时间',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'endTime',
|
||||
label: '营业结束时间',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入结束时间',
|
||||
},
|
||||
colProps: {
|
||||
span: 11,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cover',
|
||||
label: '封面',
|
||||
component: 'JImageUpload',
|
||||
required: true,
|
||||
componentProps: {
|
||||
fileMax: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'notice',
|
||||
label: '公告',
|
||||
component: 'InputTextArea',
|
||||
labelLength: 8,
|
||||
componentProps: {
|
||||
placeholder: '请输入公告',
|
||||
},
|
||||
},
|
||||
];
|