Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ff940777f | |||
| 1cdbf43f29 | |||
| 89c233ca9f | |||
| 5a45668c61 | |||
| 22fc268fcb | |||
| 077fb92772 | |||
| a1c4ae3564 | |||
| 98fc7be679 | |||
| ab85648edf | |||
| cba541169d | |||
| 53e88feefe | |||
|
|
73748a6fc0 | ||
|
|
a6b1cb2ac9 | ||
|
|
ecb8f31850 | ||
|
|
4711bb8cbc | ||
|
|
40f0ecd162 | ||
|
|
27e51b6278 | ||
|
|
eeab4e5ea3 | ||
|
|
a5f992c090 | ||
|
|
a99402c6b0 | ||
|
|
ce643990d8 | ||
|
|
7afa85b941 | ||
|
|
257dc16c94 | ||
|
|
5987f02e4e | ||
|
|
525cf97121 | ||
|
|
cde19e180a | ||
|
|
360c497c49 | ||
|
|
038a09f286 | ||
|
|
bd9c07313f | ||
|
|
fb863ef9d1 | ||
|
|
d92b69e1f1 | ||
|
|
2f54798561 | ||
|
|
d80bea35c6 | ||
|
|
083b4e0bf1 | ||
|
|
4675e14813 | ||
|
|
cdaeb3d908 | ||
|
|
baaec3f5dc | ||
|
|
61f5816910 | ||
|
|
203749552d | ||
|
|
d36f914aa3 | ||
|
|
d07d884286 | ||
|
|
ba3fe6a242 | ||
| 94f5254e5c | |||
|
|
5e5c13329f | ||
|
|
10f8e8251b | ||
| bb4432e643 | |||
| 3d072958d6 | |||
| 98bb3529ea | |||
| e384dc1163 | |||
| c2adf5155f | |||
| a55fa06c74 | |||
| 731eaf3629 | |||
| 3af438bcb7 | |||
| 8e2c28ef36 | |||
| d010e55b76 | |||
| 71519a730b | |||
| 4708c10358 | |||
| 55a99fdf7b | |||
| 0d168cc260 | |||
| 2bbecd241a | |||
| 6010f4efe9 | |||
| 01671a3ed2 | |||
| e731ef8bcd | |||
| 6230c36cf2 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -31,6 +31,8 @@ target/*
|
||||
/.nb-gradle/
|
||||
/build/
|
||||
.idea
|
||||
.cursor
|
||||
.lingma
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16
pom.xml
16
pom.xml
@@ -47,6 +47,22 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.yaml</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
暂未适配 IBM DB2 数据库,如果你有需要,可以微信联系 wangwenbin-server 一起建设。
|
||||
|
||||
你需要把表结构与数据导入到 DM 数据库,我来测试与适配代码。
|
||||
113
sql/mysql/ai-manage.sql
Normal file
113
sql/mysql/ai-manage.sql
Normal file
@@ -0,0 +1,113 @@
|
||||
DROP TABLE IF EXISTS `tz_ai_sample`;
|
||||
CREATE TABLE `tz_ai_sample`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`sample_file_id` bigint NOT NULL COMMENT '样本文件id',
|
||||
`sample_name` varchar(64) NULL DEFAULT '' COMMENT '样本名称',
|
||||
`sample_time` varchar(16) NULL DEFAULT '' COMMENT '样本时长',
|
||||
`sample_mine_type` varchar(16) NULL DEFAULT '' COMMENT '样本格式',
|
||||
`sample_size` varchar(16) NULL DEFAULT '' COMMENT '样本大小',
|
||||
`remark` varchar(255) NULL DEFAULT '' COMMENT '样本注释',
|
||||
`creator` varchar(64) NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_create_time` (`create_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '样本库';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_sample_tag_relate`;
|
||||
CREATE TABLE `tz_ai_sample_tag_relate`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`sample_id` bigint NOT NULL COMMENT '样本id',
|
||||
`sample_tag_id` bigint NOT NULL COMMENT '样本标签id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '样本-标签关联表';
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_sample_tag`;
|
||||
CREATE TABLE `tz_ai_sample_tag`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`tag_name` varchar(64) NULL DEFAULT '' COMMENT '标签名称',
|
||||
`creator` varchar(64) NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_create_time` (`create_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '样本标签库';
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_sample_tag_group`;
|
||||
CREATE TABLE `tz_ai_sample_tag_group`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`group_name` varchar(64) NULL DEFAULT '' COMMENT '分组名称',
|
||||
`creator` varchar(64) NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_create_time` (`create_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '样本标签分组库';
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_sample_tag_group_relate`;
|
||||
CREATE TABLE `tz_ai_sample_tag_group_relate`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`sample_tag_id` bigint NOT NULL COMMENT '样本标签id',
|
||||
`sample_tag_group_id` bigint NOT NULL COMMENT '样本标签分组id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '样本标签-分组关联表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_dialog`;
|
||||
CREATE TABLE `tz_ai_dialog`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`title` varchar(128) DEFAULT '' COMMENT '对话标题',
|
||||
`user_id` bigint NOT NULL COMMENT '用户id',
|
||||
`dialog_status` int DEFAULT NULL COMMENT '对话状态(1active, 2archived, 3deleted)',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='ai-对话表';
|
||||
|
||||
DROP TABLE IF EXISTS `tz_ai_dialog_message`;
|
||||
CREATE TABLE `tz_ai_dialog_message`
|
||||
(
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`dialog_id` bigint NOT NULL COMMENT '对话id',
|
||||
`content_text` text COMMENT '内容',
|
||||
`content_type` int DEFAULT NULL COMMENT '文本类型(1text,2file)',
|
||||
`message_order` int DEFAULT NULL COMMENT '对话中的顺序',
|
||||
`message_status` int DEFAULT NULL COMMENT '消息状态 1正常 0删除',
|
||||
`pet_id` bigint DEFAULT NULL COMMENT '宠物id',
|
||||
`pet_name` varchar(255) DEFAULT NULL COMMENT '宠物名称',
|
||||
`pet_avatar` varchar(255) DEFAULT NULL COMMENT '宠物头像',
|
||||
`pet_type` varchar(64) DEFAULT NULL COMMENT '宠物类型',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`trans_result` text COMMENT '回答结果',
|
||||
`content_duration` bigint DEFAULT NULL COMMENT '文件时长',
|
||||
`trans_status` int DEFAULT NULL COMMENT '翻译状态(1成功 0失败)',
|
||||
`source_result` text COMMENT '原始结果',
|
||||
`file_name` varchar(255) DEFAULT NULL COMMENT '文件名称',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='ai-对话消息表';
|
||||
|
||||
|
||||
0
sql/mysql/tashow-order.sql
Normal file
0
sql/mysql/tashow-order.sql
Normal file
8
sql/tools/.gitignore
vendored
8
sql/tools/.gitignore
vendored
@@ -1,8 +0,0 @@
|
||||
# 忽略python虚拟环境
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
@@ -1,130 +0,0 @@
|
||||
## 0. 友情提示
|
||||
|
||||
在 `sql/tools` 目录下,我们提供一些数据库相关的工具,包括测试数据库的快速启动、MySQL 转换其它数据库等等。
|
||||
|
||||
注意!所有的操作,必须在 `sql/tools` 目录下执行。
|
||||
|
||||
## 1. 测试数据库的快速启动
|
||||
|
||||
基于 Docker Compose,快速启动 MySQL、Oracle、PostgreSQL、SQL Server 等数据库。
|
||||
|
||||
注意!使用 Docker Compose 启动完测试数据后,因为会自动导入项目的 SQL 脚本,所以可能需要等待 1-2 分钟。
|
||||
|
||||
### 1.1 MySQL
|
||||
|
||||
```Bash
|
||||
docker compose up -d mysql
|
||||
```
|
||||
|
||||
#### 1.2 Oracle
|
||||
|
||||
```Bash
|
||||
## x86 版本
|
||||
docker compose up -d oracle
|
||||
|
||||
## MacBook Apple Silicon
|
||||
docker compose up -d oracle_m1
|
||||
```
|
||||
|
||||
> 注意:如果使用 MacBook Apple Silicon 版本,它的 ORACLE_SID 不是 XE,而是 FREE!!!
|
||||
|
||||
### 1.3 PostgreSQL
|
||||
|
||||
```Bash
|
||||
docker compose up -d postgres
|
||||
```
|
||||
|
||||
### 1.4 SQL Server
|
||||
|
||||
```Bash
|
||||
docker compose up -d sqlserver
|
||||
# 注意:启动完 sqlserver 后,需要手动再执行如下命令,因为 SQL Server 不支持初始化脚本
|
||||
docker compose exec sqlserver bash /tmp/create_schema.sh
|
||||
```
|
||||
|
||||
### 1.5 DM 达梦
|
||||
|
||||
① 下载达梦 Docker 镜像:<https://eco.dameng.com/download/> 地址,点击“Docker 镜像”选项,进行下载。
|
||||
|
||||
② 加载镜像文件,在镜像 tar 文件所在目录运行:
|
||||
|
||||
```Bash
|
||||
docker load -i dm8_20240715_x86_rh6_rq_single.tar
|
||||
```
|
||||
|
||||
③ 在项目 `sql/tools` 目录下运行:
|
||||
|
||||
```Bash
|
||||
docker compose up -d dm8
|
||||
# 注意:启动完 dm 后,需要手动再执行如下命令,因为 dm 不支持初始化脚本
|
||||
docker compose exec dm8 bash -c '/opt/dmdbms/bin/disql SYSDBA/SYSDBA001 \`/tmp/schema.sql'
|
||||
exit
|
||||
```
|
||||
|
||||
### 1.6 KingbaseES 人大金仓
|
||||
|
||||
① 下载人大金仓 Docker 镜像:
|
||||
|
||||
* [x86_64 版本](https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/x86_64/kdb_x86_64_V009R001C001B0025.tar) 【Windows 选择这个】
|
||||
* [aarch64 版本](https://kingbase.oss-cn-beijing.aliyuncs.com/KESV8R3/V009R001C001B0025-安装包-docker/aarch64/kdb_aarch64_V009R001C001B0025.tar) 【MacBook Apple Silicon 选择这个】
|
||||
|
||||
② 加载镜像文件,在镜像 tar 文件所在目录运行:
|
||||
|
||||
```Bash
|
||||
docker load -i kdb_x86_64_V009R001C001B0025.tar
|
||||
```
|
||||
|
||||
③ 在项目 `sql/tools` 目录下运行:
|
||||
|
||||
```Bash
|
||||
docker compose up -d kingbase
|
||||
# 注意:启动完 kingbase 后,需要手动再执行如下命令
|
||||
docker compose exec kingbase bash -c 'ksql -U $DB_USER -d test -f /tmp/schema.sql'
|
||||
```
|
||||
|
||||
### 1.7 华为 OpenGauss
|
||||
|
||||
```Bash
|
||||
docker compose up -d opengauss
|
||||
# 注意:启动完 opengauss 后,需要手动再执行如下命令
|
||||
docker compose exec opengauss bash -c '/usr/local/opengauss/bin/gsql -U $GS_USERNAME -W $GS_PASSWORD -d postgres -f /tmp/schema.sql'
|
||||
```
|
||||
|
||||
## 1.X 容器的销毁重建
|
||||
|
||||
开发测试过程中,有时候需要创建全新干净的数据库。由于测试数据 Docker 容器采用数据卷 Volume 挂载数据库实例的数据目录,因此销毁数据需要停止容器后,删除数据卷,然后再重新创建容器。
|
||||
|
||||
以 postgres 为例,操作如下:
|
||||
|
||||
```Bash
|
||||
docker compose down postgres
|
||||
docker volume rm ruoyi-vue-pro_postgres
|
||||
```
|
||||
|
||||
## 2. MySQL 转换其它数据库
|
||||
|
||||
项目提供了 `sql/tools/convertor.py` 脚本,支持将 MySQL 转换为 Oracle、PostgreSQL、SQL Server、达梦、人大金仓、OpenGauss 等数据库的脚本。
|
||||
|
||||
### 2.1 实现原理
|
||||
|
||||
通过读取 MySQL 的 `sql/mysql/ruoyi-vue-pro.sql` 数据库文件,转换成对应的数据库脚本。
|
||||
|
||||
### 2.2 使用方法
|
||||
|
||||
① 安装依赖库 `simple-ddl-parser`
|
||||
|
||||
```bash
|
||||
pip install simple-ddl-parser
|
||||
# pip3 install simple-ddl-parser
|
||||
```
|
||||
|
||||
② 在 `sql/tools/` 目录下,执行如下命令打印生成 postgres 的脚本内容,其他可选参数有:`oracle`、`sqlserver`、`dm8`、`kingbase`、`opengauss`:
|
||||
|
||||
```Bash
|
||||
python3 convertor.py postgres
|
||||
# python3 convertor.py postgres > tmp.sql
|
||||
```
|
||||
|
||||
程序将 SQL 脚本打印到终端,可以重定向到临时文件 `tmp.sql`。
|
||||
|
||||
确认无误后,可以利用 IDEA 进行格式化。当然,也可以直接导入到数据库中。
|
||||
@@ -1,844 +0,0 @@
|
||||
# encoding=utf8
|
||||
"""芋道系统数据库迁移工具
|
||||
|
||||
Author: dhb52 (https://gitee.com/dhb52)
|
||||
|
||||
pip install simple-ddl-parser
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import pathlib
|
||||
import re
|
||||
import time
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict, Generator, Optional, Tuple, Union
|
||||
|
||||
from simple_ddl_parser import DDLParser
|
||||
|
||||
PREAMBLE = """/*
|
||||
Yudao Database Transfer Tool
|
||||
|
||||
Source Server Type : MySQL
|
||||
|
||||
Target Server Type : {db_type}
|
||||
|
||||
Date: {date}
|
||||
*/
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def load_and_clean(sql_file: str) -> str:
|
||||
"""加载源 SQL 文件,并清理内容方便下一步 ddl 解析
|
||||
|
||||
Args:
|
||||
sql_file (str): sql文件路径
|
||||
|
||||
Returns:
|
||||
str: 清理后的sql文件内容
|
||||
"""
|
||||
REPLACE_PAIR_LIST = (
|
||||
(" CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ", " "),
|
||||
(" KEY `", " INDEX `"),
|
||||
("UNIQUE INDEX", "UNIQUE KEY"),
|
||||
("b'0'", "'0'"),
|
||||
("b'1'", "'1'"),
|
||||
)
|
||||
|
||||
content = open(sql_file).read()
|
||||
for replace_pair in REPLACE_PAIR_LIST:
|
||||
content = content.replace(*replace_pair)
|
||||
content = re.sub(r"ENGINE.*COMMENT", "COMMENT", content)
|
||||
content = re.sub(r"ENGINE.*;", ";", content)
|
||||
return content
|
||||
|
||||
|
||||
class Convertor(ABC):
|
||||
def __init__(self, src: str, db_type) -> None:
|
||||
self.src = src
|
||||
self.db_type = db_type
|
||||
self.content = load_and_clean(self.src)
|
||||
self.table_script_list = re.findall(r"CREATE TABLE [^;]*;", self.content)
|
||||
|
||||
@abstractmethod
|
||||
def translate_type(self, type: str, size: Optional[Union[int, Tuple[int]]]) -> str:
|
||||
"""字段类型转换
|
||||
|
||||
Args:
|
||||
type (str): 字段类型
|
||||
size (Optional[Union[int, Tuple[int]]]): 字段长度描述, 如varchar(255), decimal(10,2)
|
||||
|
||||
Returns:
|
||||
str: 类型定义
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gen_create(self, table_ddl: Dict) -> str:
|
||||
"""生成 create 脚本
|
||||
|
||||
Args:
|
||||
table_ddl (Dict): 表DDL
|
||||
|
||||
Returns:
|
||||
str: 生成脚本
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gen_pk(self, table_name: str) -> str:
|
||||
"""生成主键定义
|
||||
|
||||
Args:
|
||||
table_name (str): 表名
|
||||
|
||||
Returns:
|
||||
str: 生成脚本
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
"""生成索引定义
|
||||
|
||||
Args:
|
||||
table_ddl (Dict): 表DDL
|
||||
|
||||
Returns:
|
||||
str: 生成脚本
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||
"""生成字段/表注释
|
||||
|
||||
Args:
|
||||
table_sql (str): 原始表SQL
|
||||
table_name (str): 表名
|
||||
|
||||
Returns:
|
||||
str: 生成脚本
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gen_insert(self, table_name: str) -> str:
|
||||
"""生成 insert 语句块
|
||||
|
||||
Args:
|
||||
table_name (str): 表名
|
||||
|
||||
Returns:
|
||||
str: 生成脚本
|
||||
"""
|
||||
pass
|
||||
|
||||
def gen_dual(self) -> str:
|
||||
"""生成虚拟 dual 表
|
||||
|
||||
Returns:
|
||||
str: 生成脚本, 默认返回空脚本, 表示当前数据库无需手工创建
|
||||
"""
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def inserts(table_name: str, script_content: str) -> Generator:
|
||||
PREFIX = f"INSERT INTO `{table_name}`"
|
||||
|
||||
# 收集 `table_name` 对应的 insert 语句
|
||||
for line in script_content.split("\n"):
|
||||
if line.startswith(PREFIX):
|
||||
head, tail = line.replace(PREFIX, "").split(" VALUES ", maxsplit=1)
|
||||
head = head.strip().replace("`", "").lower()
|
||||
tail = tail.strip().replace(r"\"", '"')
|
||||
# tail = tail.replace("b'0'", "'0'").replace("b'1'", "'1'")
|
||||
yield f"INSERT INTO {table_name.lower()} {head} VALUES {tail}"
|
||||
|
||||
@staticmethod
|
||||
def index(ddl: Dict) -> Generator:
|
||||
"""生成索引定义
|
||||
|
||||
Args:
|
||||
ddl (Dict): 表DDL
|
||||
|
||||
Yields:
|
||||
Generator[str]: create index 语句
|
||||
"""
|
||||
|
||||
def generate_columns(columns):
|
||||
keys = [
|
||||
f"{col['name'].lower()}{' ' + col['order'].lower() if col['order'] != 'ASC' else ''}"
|
||||
for col in columns[0]
|
||||
]
|
||||
return ", ".join(keys)
|
||||
|
||||
for no, index in enumerate(ddl["index"], 1):
|
||||
columns = generate_columns(index["columns"])
|
||||
table_name = ddl["table_name"].lower()
|
||||
yield f"CREATE INDEX idx_{table_name}_{no:02d} ON {table_name} ({columns})"
|
||||
|
||||
@staticmethod
|
||||
def filed_comments(table_sql: str) -> Generator:
|
||||
for line in table_sql.split("\n"):
|
||||
match = re.match(r"^`([^`]+)`.* COMMENT '([^']+)'", line.strip())
|
||||
if match:
|
||||
field = match.group(1)
|
||||
comment_string = match.group(2).replace("\\n", "\n")
|
||||
yield field, comment_string
|
||||
|
||||
def table_comment(self, table_sql: str) -> str:
|
||||
match = re.search(r"COMMENT \= '([^']+)';", table_sql)
|
||||
return match.group(1) if match else None
|
||||
|
||||
def print(self):
|
||||
"""打印转换后的sql脚本到终端"""
|
||||
print(
|
||||
PREAMBLE.format(
|
||||
db_type=self.db_type,
|
||||
date=time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
)
|
||||
)
|
||||
|
||||
dual = self.gen_dual()
|
||||
if dual:
|
||||
print(
|
||||
f"""-- ----------------------------
|
||||
-- Table structure for dual
|
||||
-- ----------------------------
|
||||
{dual}
|
||||
"""
|
||||
)
|
||||
|
||||
error_scripts = []
|
||||
for table_sql in self.table_script_list:
|
||||
ddl = DDLParser(table_sql.replace("`", "")).run()
|
||||
|
||||
# 如果parse失败, 需要跟进
|
||||
if len(ddl) == 0:
|
||||
error_scripts.append(table_sql)
|
||||
continue
|
||||
|
||||
table_ddl = ddl[0]
|
||||
table_name = table_ddl["table_name"]
|
||||
|
||||
# 忽略 quartz 的内容
|
||||
if table_name.lower().startswith("qrtz"):
|
||||
continue
|
||||
|
||||
# 为每个表生成个5个基本部分
|
||||
create = self.gen_create(table_ddl)
|
||||
pk = self.gen_pk(table_name)
|
||||
index = self.gen_index(table_ddl)
|
||||
comment = self.gen_comment(table_sql, table_name)
|
||||
inserts = self.gen_insert(table_name)
|
||||
|
||||
# 组合当前表的DDL脚本
|
||||
script = f"""{create}
|
||||
|
||||
{pk}
|
||||
|
||||
{index}
|
||||
|
||||
{comment}
|
||||
|
||||
{inserts}
|
||||
"""
|
||||
|
||||
# 清理
|
||||
script = re.sub("\n{3,}", "\n\n", script).strip() + "\n"
|
||||
|
||||
print(script)
|
||||
|
||||
# 将parse失败的脚本打印出来
|
||||
if error_scripts:
|
||||
for script in error_scripts:
|
||||
print(script)
|
||||
|
||||
|
||||
class PostgreSQLConvertor(Convertor):
|
||||
def __init__(self, src):
|
||||
super().__init__(src, "PostgreSQL")
|
||||
|
||||
def translate_type(self, type: str, size: Optional[Union[int, Tuple[int]]]):
|
||||
"""类型转换"""
|
||||
|
||||
type = type.lower()
|
||||
|
||||
if type == "varchar":
|
||||
return f"varchar({size})"
|
||||
if type == "int":
|
||||
return "int4"
|
||||
if type == "bigint" or type == "bigint unsigned":
|
||||
return "int8"
|
||||
if type == "datetime":
|
||||
return "timestamp"
|
||||
if type == "bit":
|
||||
return "bool"
|
||||
if type in ("tinyint", "smallint"):
|
||||
return "int2"
|
||||
if type == "text":
|
||||
return "text"
|
||||
if type in ("blob", "mediumblob"):
|
||||
return "bytea"
|
||||
if type == "decimal":
|
||||
return (
|
||||
f"numeric({','.join(str(s) for s in size)})" if len(size) else "numeric"
|
||||
)
|
||||
|
||||
def gen_create(self, ddl: Dict) -> str:
|
||||
"""生成 create"""
|
||||
|
||||
def _generate_column(col):
|
||||
name = col["name"].lower()
|
||||
if name == "deleted":
|
||||
return "deleted int2 NOT NULL DEFAULT 0"
|
||||
|
||||
type = col["type"].lower()
|
||||
full_type = self.translate_type(type, col["size"])
|
||||
nullable = "NULL" if col["nullable"] else "NOT NULL"
|
||||
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
|
||||
return f"{name} {full_type} {nullable} {default}"
|
||||
|
||||
table_name = ddl["table_name"].lower()
|
||||
columns = [f"{_generate_column(col).strip()}" for col in ddl["columns"]]
|
||||
filed_def_list = ",\n ".join(columns)
|
||||
script = f"""-- ----------------------------
|
||||
-- Table structure for {table_name}
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS {table_name};
|
||||
CREATE TABLE {table_name} (
|
||||
{filed_def_list}
|
||||
);"""
|
||||
|
||||
return script
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
return "\n".join(f"{script};" for script in self.index(ddl))
|
||||
|
||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||
"""生成字段及表的注释"""
|
||||
|
||||
script = ""
|
||||
for field, comment_string in self.filed_comments(table_sql):
|
||||
script += (
|
||||
f"COMMENT ON COLUMN {table_name}.{field} IS '{comment_string}';" + "\n"
|
||||
)
|
||||
|
||||
table_comment = self.table_comment(table_sql)
|
||||
if table_comment:
|
||||
script += f"COMMENT ON TABLE {table_name} IS '{table_comment}';\n"
|
||||
|
||||
return script
|
||||
|
||||
def gen_pk(self, table_name) -> str:
|
||||
"""生成主键定义"""
|
||||
return f"ALTER TABLE {table_name} ADD CONSTRAINT pk_{table_name} PRIMARY KEY (id);\n"
|
||||
|
||||
def gen_insert(self, table_name: str) -> str:
|
||||
"""生成 insert 语句,以及根据最后的 insert id+1 生成 Sequence"""
|
||||
|
||||
inserts = list(Convertor.inserts(table_name, self.content))
|
||||
## 生成 insert 脚本
|
||||
script = ""
|
||||
last_id = 0
|
||||
if inserts:
|
||||
inserts_lines = "\n".join(inserts)
|
||||
script += f"""\n\n-- ----------------------------
|
||||
-- Records of {table_name.lower()}
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
BEGIN;
|
||||
{inserts_lines}
|
||||
COMMIT;
|
||||
-- @formatter:on"""
|
||||
match = re.search(r"VALUES \((\d+),", inserts[-1])
|
||||
if match:
|
||||
last_id = int(match.group(1))
|
||||
|
||||
# 生成 Sequence
|
||||
script += (
|
||||
"\n\n"
|
||||
+ f"""DROP SEQUENCE IF EXISTS {table_name}_seq;
|
||||
CREATE SEQUENCE {table_name}_seq
|
||||
START {last_id + 1};"""
|
||||
)
|
||||
|
||||
return script
|
||||
|
||||
def gen_dual(self) -> str:
|
||||
return """DROP TABLE IF EXISTS dual;
|
||||
CREATE TABLE dual
|
||||
(
|
||||
id int2
|
||||
);
|
||||
|
||||
COMMENT ON TABLE dual IS '数据库连接的表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of dual
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
INSERT INTO dual VALUES (1);
|
||||
-- @formatter:on"""
|
||||
|
||||
|
||||
class OracleConvertor(Convertor):
|
||||
def __init__(self, src):
|
||||
super().__init__(src, "Oracle")
|
||||
|
||||
def translate_type(self, type: str, size: Optional[Union[int, Tuple[int]]]):
|
||||
"""类型转换"""
|
||||
type = type.lower()
|
||||
|
||||
if type == "varchar":
|
||||
return f"varchar2({size if size < 4000 else 4000})"
|
||||
if type == "int":
|
||||
return "number"
|
||||
if type == "bigint" or type == "bigint unsigned":
|
||||
return "number"
|
||||
if type == "datetime":
|
||||
return "date"
|
||||
if type == "bit":
|
||||
return "number(1,0)"
|
||||
if type in ("tinyint", "smallint"):
|
||||
return "smallint"
|
||||
if type == "text":
|
||||
return "clob"
|
||||
if type in ("blob", "mediumblob"):
|
||||
return "blob"
|
||||
if type == "decimal":
|
||||
return (
|
||||
f"number({','.join(str(s) for s in size)})" if len(size) else "number"
|
||||
)
|
||||
|
||||
def gen_create(self, ddl) -> str:
|
||||
"""生成 CREATE 语句"""
|
||||
|
||||
def generate_column(col):
|
||||
name = col["name"].lower()
|
||||
if name == "deleted":
|
||||
return "deleted number(1,0) DEFAULT 0 NOT NULL"
|
||||
|
||||
type = col["type"].lower()
|
||||
full_type = self.translate_type(type, col["size"])
|
||||
nullable = "NULL" if col["nullable"] else "NOT NULL"
|
||||
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
|
||||
# Oracle 中 size 不能作为字段名
|
||||
field_name = '"size"' if name == "size" else name
|
||||
# Oracle DEFAULT 定义在 NULLABLE 之前
|
||||
return f"{field_name} {full_type} {default} {nullable}"
|
||||
|
||||
table_name = ddl["table_name"].lower()
|
||||
columns = [f"{generate_column(col).strip()}" for col in ddl["columns"]]
|
||||
field_def_list = ",\n ".join(columns)
|
||||
script = f"""-- ----------------------------
|
||||
-- Table structure for {table_name}
|
||||
-- ----------------------------
|
||||
CREATE TABLE {table_name} (
|
||||
{field_def_list}
|
||||
);"""
|
||||
|
||||
# oracle INSERT '' 不能通过 NOT NULL 校验
|
||||
script = script.replace("DEFAULT '' NOT NULL", "DEFAULT '' NULL")
|
||||
|
||||
return script
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
return "\n".join(f"{script};" for script in self.index(ddl))
|
||||
|
||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||
script = ""
|
||||
for field, comment_string in self.filed_comments(table_sql):
|
||||
script += (
|
||||
f"COMMENT ON COLUMN {table_name}.{field} IS '{comment_string}';" + "\n"
|
||||
)
|
||||
|
||||
table_comment = self.table_comment(table_sql)
|
||||
if table_comment:
|
||||
script += f"COMMENT ON TABLE {table_name} IS '{table_comment}';\n"
|
||||
|
||||
return script
|
||||
|
||||
def gen_pk(self, table_name: str) -> str:
|
||||
"""生成主键定义"""
|
||||
return f"ALTER TABLE {table_name} ADD CONSTRAINT pk_{table_name} PRIMARY KEY (id);\n"
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
return "\n".join(f"{script};" for script in self.index(ddl))
|
||||
|
||||
def gen_insert(self, table_name: str) -> str:
|
||||
"""拷贝 INSERT 语句"""
|
||||
inserts = []
|
||||
for insert_script in Convertor.inserts(table_name, self.content):
|
||||
# 对日期数据添加 TO_DATE 转换
|
||||
insert_script = re.sub(
|
||||
r"('\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}')",
|
||||
r"to_date(\g<1>, 'SYYYY-MM-DD HH24:MI:SS')",
|
||||
insert_script,
|
||||
)
|
||||
inserts.append(insert_script)
|
||||
|
||||
## 生成 insert 脚本
|
||||
script = ""
|
||||
last_id = 0
|
||||
if inserts:
|
||||
inserts_lines = "\n".join(inserts)
|
||||
script += f"""\n\n-- ----------------------------
|
||||
-- Records of {table_name.lower()}
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
{inserts_lines}
|
||||
COMMIT;
|
||||
-- @formatter:on"""
|
||||
match = re.search(r"VALUES \((\d+),", inserts[-1])
|
||||
if match:
|
||||
last_id = int(match.group(1))
|
||||
|
||||
# 生成 Sequence
|
||||
script += f"""
|
||||
|
||||
CREATE SEQUENCE {table_name}_seq
|
||||
START WITH {last_id + 1};"""
|
||||
|
||||
return script
|
||||
|
||||
|
||||
class SQLServerConvertor(Convertor):
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
Convertor (_type_): _description_
|
||||
"""
|
||||
|
||||
def __init__(self, src):
|
||||
super().__init__(src, "Microsoft SQL Server")
|
||||
|
||||
def translate_type(self, type: str, size: Optional[Union[int, Tuple[int]]]):
|
||||
"""类型转换"""
|
||||
|
||||
type = type.lower()
|
||||
|
||||
if type == "varchar":
|
||||
return f"nvarchar({size if size < 4000 else 4000})"
|
||||
if type == "int":
|
||||
return "int"
|
||||
if type == "bigint" or type == "bigint unsigned":
|
||||
return "bigint"
|
||||
if type == "datetime":
|
||||
return "datetime2"
|
||||
if type == "bit":
|
||||
return "varchar(1)"
|
||||
if type in ("tinyint", "smallint"):
|
||||
return "tinyint"
|
||||
if type == "text":
|
||||
return "nvarchar(max)"
|
||||
if type in ("blob", "mediumblob"):
|
||||
return "varbinary(max)"
|
||||
if type == "decimal":
|
||||
return (
|
||||
f"numeric({','.join(str(s) for s in size)})" if len(size) else "numeric"
|
||||
)
|
||||
|
||||
def gen_create(self, ddl: Dict) -> str:
|
||||
"""生成 create"""
|
||||
|
||||
def _generate_column(col):
|
||||
name = col["name"].lower()
|
||||
if name == "id":
|
||||
return "id bigint NOT NULL PRIMARY KEY IDENTITY"
|
||||
if name == "deleted":
|
||||
return "deleted bit DEFAULT 0 NOT NULL"
|
||||
|
||||
type = col["type"].lower()
|
||||
full_type = self.translate_type(type, col["size"])
|
||||
nullable = "NULL" if col["nullable"] else "NOT NULL"
|
||||
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
|
||||
return f"{name} {full_type} {default} {nullable}"
|
||||
|
||||
table_name = ddl["table_name"].lower()
|
||||
columns = [f"{_generate_column(col).strip()}" for col in ddl["columns"]]
|
||||
filed_def_list = ",\n ".join(columns)
|
||||
script = f"""-- ----------------------------
|
||||
-- Table structure for {table_name}
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS {table_name}
|
||||
GO
|
||||
CREATE TABLE {table_name} (
|
||||
{filed_def_list}
|
||||
)
|
||||
GO"""
|
||||
|
||||
return script
|
||||
|
||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||
"""生成字段及表的注释"""
|
||||
|
||||
script = ""
|
||||
|
||||
for field, comment_string in self.filed_comments(table_sql):
|
||||
script += f"""EXEC sp_addextendedproperty
|
||||
'MS_Description', N'{comment_string}',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'{table_name}',
|
||||
'COLUMN', N'{field}'
|
||||
GO
|
||||
|
||||
"""
|
||||
|
||||
table_comment = self.table_comment(table_sql)
|
||||
if table_comment:
|
||||
script += f"""EXEC sp_addextendedproperty
|
||||
'MS_Description', N'{table_comment}',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'{table_name}'
|
||||
GO
|
||||
|
||||
"""
|
||||
return script
|
||||
|
||||
def gen_pk(self, table_name: str) -> str:
|
||||
"""生成主键定义"""
|
||||
return ""
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
"""生成 index"""
|
||||
return "\n".join(f"{script}\nGO" for script in self.index(ddl))
|
||||
|
||||
def gen_insert(self, table_name: str) -> str:
|
||||
"""生成 insert 语句"""
|
||||
|
||||
# 收集 `table_name` 对应的 insert 语句
|
||||
inserts = []
|
||||
for insert_script in Convertor.inserts(table_name, self.content):
|
||||
# SQLServer: 字符串前加N,hack,是否存在替换字符串内容的风险
|
||||
insert_script = insert_script.replace(", '", ", N'").replace(
|
||||
"VALUES ('", "VALUES (N')"
|
||||
)
|
||||
# 删除 insert 的结尾分号
|
||||
insert_script = re.sub(";$", r"\nGO", insert_script)
|
||||
inserts.append(insert_script)
|
||||
|
||||
## 生成 insert 脚本
|
||||
script = ""
|
||||
if inserts:
|
||||
inserts_lines = "\n".join(inserts)
|
||||
script += f"""\n\n-- ----------------------------
|
||||
-- Records of {table_name.lower()}
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
SET IDENTITY_INSERT {table_name.lower()} ON
|
||||
GO
|
||||
{inserts_lines}
|
||||
SET IDENTITY_INSERT {table_name.lower()} OFF
|
||||
GO
|
||||
COMMIT
|
||||
GO
|
||||
-- @formatter:on"""
|
||||
|
||||
return script
|
||||
|
||||
def gen_dual(self) -> str:
|
||||
return """DROP TABLE IF EXISTS dual
|
||||
GO
|
||||
CREATE TABLE dual
|
||||
(
|
||||
id int
|
||||
)
|
||||
GO
|
||||
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'数据库连接的表',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'dual'
|
||||
GO
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of dual
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
INSERT INTO dual VALUES (1)
|
||||
GO
|
||||
-- @formatter:on"""
|
||||
|
||||
|
||||
class DM8Convertor(Convertor):
|
||||
def __init__(self, src):
|
||||
super().__init__(src, "DM8")
|
||||
|
||||
def translate_type(self, type: str, size: Optional[Union[int, Tuple[int]]]):
|
||||
"""类型转换"""
|
||||
type = type.lower()
|
||||
|
||||
if type == "varchar":
|
||||
return f"varchar({size})"
|
||||
if type == "int":
|
||||
return "int"
|
||||
if type == "bigint" or type == "bigint unsigned":
|
||||
return "bigint"
|
||||
if type == "datetime":
|
||||
return "datetime"
|
||||
if type == "bit":
|
||||
return "bit"
|
||||
if type in ("tinyint", "smallint"):
|
||||
return "smallint"
|
||||
if type == "text":
|
||||
return "text"
|
||||
if type == "blob":
|
||||
return "blob"
|
||||
if type == "mediumblob":
|
||||
return "varchar(10240)"
|
||||
if type == "decimal":
|
||||
return (
|
||||
f"decimal({','.join(str(s) for s in size)})" if len(size) else "decimal"
|
||||
)
|
||||
|
||||
def gen_create(self, ddl) -> str:
|
||||
"""生成 CREATE 语句"""
|
||||
|
||||
def generate_column(col):
|
||||
name = col["name"].lower()
|
||||
if name == "id":
|
||||
return "id bigint NOT NULL PRIMARY KEY IDENTITY"
|
||||
|
||||
type = col["type"].lower()
|
||||
full_type = self.translate_type(type, col["size"])
|
||||
nullable = "NULL" if col["nullable"] else "NOT NULL"
|
||||
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
|
||||
return f"{name} {full_type} {default} {nullable}"
|
||||
|
||||
table_name = ddl["table_name"].lower()
|
||||
columns = [f"{generate_column(col).strip()}" for col in ddl["columns"]]
|
||||
field_def_list = ",\n ".join(columns)
|
||||
script = f"""-- ----------------------------
|
||||
-- Table structure for {table_name}
|
||||
-- ----------------------------
|
||||
CREATE TABLE {table_name} (
|
||||
{field_def_list}
|
||||
);"""
|
||||
|
||||
# oracle INSERT '' 不能通过 NOT NULL 校验
|
||||
script = script.replace("DEFAULT '' NOT NULL", "DEFAULT '' NULL")
|
||||
|
||||
return script
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
return "\n".join(f"{script};" for script in self.index(ddl))
|
||||
|
||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||
script = ""
|
||||
for field, comment_string in self.filed_comments(table_sql):
|
||||
script += (
|
||||
f"COMMENT ON COLUMN {table_name}.{field} IS '{comment_string}';" + "\n"
|
||||
)
|
||||
|
||||
table_comment = self.table_comment(table_sql)
|
||||
if table_comment:
|
||||
script += f"COMMENT ON TABLE {table_name} IS '{table_comment}';\n"
|
||||
|
||||
return script
|
||||
|
||||
def gen_pk(self, table_name: str) -> str:
|
||||
"""生成主键定义"""
|
||||
return ""
|
||||
|
||||
def gen_index(self, ddl: Dict) -> str:
|
||||
return "\n".join(f"{script};" for script in self.index(ddl))
|
||||
|
||||
def gen_insert(self, table_name: str) -> str:
|
||||
"""拷贝 INSERT 语句"""
|
||||
inserts = list(Convertor.inserts(table_name, self.content))
|
||||
|
||||
## 生成 insert 脚本
|
||||
script = ""
|
||||
if inserts:
|
||||
inserts_lines = "\n".join(inserts)
|
||||
script += f"""\n\n-- ----------------------------
|
||||
-- Records of {table_name.lower()}
|
||||
-- ----------------------------
|
||||
-- @formatter:off
|
||||
SET IDENTITY_INSERT {table_name.lower()} ON;
|
||||
{inserts_lines}
|
||||
COMMIT;
|
||||
SET IDENTITY_INSERT {table_name.lower()} OFF;
|
||||
-- @formatter:on"""
|
||||
|
||||
return script
|
||||
|
||||
|
||||
class KingbaseConvertor(PostgreSQLConvertor):
|
||||
def __init__(self, src):
|
||||
super().__init__(src)
|
||||
self.db_type = "Kingbase"
|
||||
|
||||
def gen_create(self, ddl: Dict) -> str:
|
||||
"""生成 create"""
|
||||
|
||||
def _generate_column(col):
|
||||
name = col["name"].lower()
|
||||
if name == "deleted":
|
||||
return "deleted int2 NOT NULL DEFAULT 0"
|
||||
|
||||
type = col["type"].lower()
|
||||
full_type = self.translate_type(type, col["size"])
|
||||
nullable = "NULL" if col["nullable"] else "NOT NULL"
|
||||
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
|
||||
return f"{name} {full_type} {nullable} {default}"
|
||||
|
||||
table_name = ddl["table_name"].lower()
|
||||
columns = [f"{_generate_column(col).strip()}" for col in ddl["columns"]]
|
||||
filed_def_list = ",\n ".join(columns)
|
||||
script = f"""-- ----------------------------
|
||||
-- Table structure for {table_name}
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS {table_name};
|
||||
CREATE TABLE {table_name} (
|
||||
{filed_def_list}
|
||||
);"""
|
||||
|
||||
# Kingbase INSERT '' 不能通过 NOT NULL 校验
|
||||
script = script.replace("NOT NULL DEFAULT ''", "NULL DEFAULT ''")
|
||||
|
||||
return script
|
||||
|
||||
|
||||
class OpengaussConvertor(KingbaseConvertor):
|
||||
def __init__(self, src):
|
||||
super().__init__(src)
|
||||
self.db_type = "OpenGauss"
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="芋道系统数据库转换工具")
|
||||
parser.add_argument(
|
||||
"type",
|
||||
type=str,
|
||||
help="目标数据库类型",
|
||||
choices=["postgres", "oracle", "sqlserver", "dm8", "kingbase", "opengauss"],
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
sql_file = pathlib.Path("../mysql/ruoyi-vue-pro.sql").resolve().as_posix()
|
||||
convertor = None
|
||||
if args.type == "postgres":
|
||||
convertor = PostgreSQLConvertor(sql_file)
|
||||
elif args.type == "oracle":
|
||||
convertor = OracleConvertor(sql_file)
|
||||
elif args.type == "sqlserver":
|
||||
convertor = SQLServerConvertor(sql_file)
|
||||
elif args.type == "dm8":
|
||||
convertor = DM8Convertor(sql_file)
|
||||
elif args.type == "kingbase":
|
||||
convertor = KingbaseConvertor(sql_file)
|
||||
elif args.type == "opengauss":
|
||||
convertor = OpengaussConvertor(sql_file)
|
||||
else:
|
||||
raise NotImplementedError(f"不支持目标数据库类型: {args.type}")
|
||||
|
||||
convertor.print()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,134 +0,0 @@
|
||||
name: ruoyi-vue-pro
|
||||
|
||||
volumes:
|
||||
mysql: { }
|
||||
postgres: { }
|
||||
sqlserver: { }
|
||||
dm8: { }
|
||||
kingbase: { }
|
||||
opengauss: { }
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0.33
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
MYSQL_DATABASE: ruoyi-vue-pro
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql/
|
||||
# 注入初始化脚本
|
||||
- ./mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
command:
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
--explicit_defaults_for_timestamp=true
|
||||
--lower_case_table_names=1
|
||||
|
||||
postgres:
|
||||
image: postgres:14.2
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: 123456
|
||||
POSTGRES_DB: ruoyi-vue-pro
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
# 注入初始化脚本
|
||||
- ../postgresql/quartz.sql:/docker-entrypoint-initdb.d/quartz.sql:ro
|
||||
- ../postgresql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro
|
||||
|
||||
oracle:
|
||||
image: gvenzl/oracle-xe:18-slim-faststart
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
## 登录信息 SID: XE user: system password: oracle
|
||||
ORACLE_PASSWORD: oracle
|
||||
ports:
|
||||
- "1521:1521"
|
||||
volumes:
|
||||
- ../oracle/ruoyi-vue-pro.sql:/tmp/schema.sql:ro
|
||||
# 创建app用户: ROOT/123456@//localhost/XEPDB1
|
||||
- ./oracle/1_create_user.sql:/docker-entrypoint-initdb.d/1_create_user.sql:ro
|
||||
- ./oracle/2_create_schema.sh:/docker-entrypoint-initdb.d/2_create_schema.sh:ro
|
||||
|
||||
oracle_m1:
|
||||
image: einslib/oracle-19c:19.3.0-ee-slim-faststart
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
## 登录信息 SID: FREE user: system password: oracle
|
||||
ORACLE_PASSWORD: oracle
|
||||
ports:
|
||||
- "1521:1521"
|
||||
volumes:
|
||||
- ../oracle/ruoyi-vue-pro.sql:/tmp/schema.sql:ro
|
||||
# 创建app用户: ROOT/123456@//localhost/XEPDB1
|
||||
- ./oracle/1_create_user.sql:/docker-entrypoint-initdb.d/1_create_user.sql:ro
|
||||
- ./oracle/2_create_schema.sh:/docker-entrypoint-initdb.d/2_create_schema.sh:ro
|
||||
|
||||
sqlserver:
|
||||
image: mcr.microsoft.com/mssql/server:2017-latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
ACCEPT_EULA: "Y"
|
||||
SA_PASSWORD: "Yudao@2024"
|
||||
ports:
|
||||
- "1433:1433"
|
||||
volumes:
|
||||
- sqlserver:/var/opt/mssql
|
||||
- ../sqlserver/ruoyi-vue-pro.sql:/tmp/schema.sql:ro
|
||||
# docker compose exec sqlserver bash /tmp/create_schema.sh
|
||||
- ./sqlserver/create_schema.sh:/tmp/create_schema.sh:ro
|
||||
|
||||
dm8:
|
||||
# docker load -i dm8_20240715_x86_rh6_rq_single.tar
|
||||
image: dm8_single:dm8_20240715_rev232765_x86_rh6_64
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PAGE_SIZE: 16
|
||||
LD_LIBRARY_PATH: /opt/dmdbms/bin
|
||||
EXTENT_SIZE: 32
|
||||
BLANK_PAD_MODE: 1
|
||||
LOG_SIZE: 1024
|
||||
UNICODE_FLAG: 1
|
||||
LENGTH_IN_CHAR: 1
|
||||
INSTANCE_NAME: dm8_test
|
||||
ports:
|
||||
- "5236:5236"
|
||||
volumes:
|
||||
- dm8:/opt/dmdbms/data
|
||||
- ../dm/ruoyi-vue-pro-dm8.sql:/tmp/schema.sql:ro
|
||||
|
||||
kingbase:
|
||||
image: kingbase_v009r001c001b0025_single_x86:v1
|
||||
# image: kingbase_v009r001c001b0025_single_arm:v1
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DB_USER: root
|
||||
DB_PASSWORD: 123456
|
||||
ports:
|
||||
- "54321:54321"
|
||||
volumes:
|
||||
- kingbase:/home/kingbase/userdata
|
||||
- ../kingbase/ruoyi-vue-pro.sql:/tmp/schema.sql:ro
|
||||
|
||||
opengauss:
|
||||
image: opengauss/opengauss:5.0.0
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
GS_USERNAME: root
|
||||
GS_PASSWORD: Yudao@2024
|
||||
LD_LIBRARY_PATH: /usr/local/opengauss/lib:/usr/lib
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- opengauss:/var/lib/opengauss
|
||||
- ../opengauss/ruoyi-vue-pro.sql:/tmp/schema.sql:ro
|
||||
# docker compose exec opengauss bash -c '/usr/local/opengauss/bin/gsql -U $GS_USERNAME -W $GS_PASSWORD -d postgres -f /tmp/schema.sql'
|
||||
@@ -1,3 +0,0 @@
|
||||
ALTER SESSION SET CONTAINER=XEPDB1;
|
||||
CREATE USER ROOT IDENTIFIED BY 123456 QUOTA UNLIMITED ON USERS;
|
||||
GRANT CONNECT, RESOURCE TO ROOT;
|
||||
@@ -1 +0,0 @@
|
||||
sqlplus -s ROOT/123456@//localhost/XEPDB1 @/tmp/schema.sql
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -Q "CREATE DATABASE [ruoyi-vue-pro];
|
||||
GO"
|
||||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -d 'ruoyi-vue-pro' -i /tmp/schema.sql
|
||||
@@ -34,6 +34,8 @@
|
||||
<rocketmq-spring.version>2.3.1</rocketmq-spring.version>
|
||||
<!-- RPC 相关 -->
|
||||
<!-- Config 配置中心相关 -->
|
||||
<springdoc.version>2.7.0</springdoc.version>
|
||||
<knife4j.version>4.6.0</knife4j.version>
|
||||
<!-- Job 定时任务相关 -->
|
||||
<xxl-job.version>2.4.0</xxl-job.version>
|
||||
<!-- 服务保障相关 -->
|
||||
@@ -150,6 +152,11 @@
|
||||
<artifactId>tashow-data-permission</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-sdk-file</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring 核心 -->
|
||||
<dependency>
|
||||
@@ -397,6 +404,22 @@
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xingfudeshi</groupId> <!-- TODO 芋艿:https://github.com/xiaoymin/knife4j/issues/874 -->
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId> <!-- 接口文档 UI:knife4j【网关专属】 -->
|
||||
<artifactId>knife4j-gateway-spring-boot-starter</artifactId>
|
||||
<version>4.5.0</version> <!-- TODO 芋艿:等 4.5.0 => 4.6.0 -->
|
||||
</dependency>
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<modules>
|
||||
<module>tashow-infra-api</module>
|
||||
<module>tashow-system-api</module>
|
||||
<module>tashow-product-api</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -9,8 +9,10 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* RPC 服务 - 文件
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
/** RPC 服务 - 文件 */
|
||||
public interface FileApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/file";
|
||||
@@ -52,7 +54,9 @@ public interface FileApi {
|
||||
.getCheckedData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存文件,并返回文件的访问路径
|
||||
*/
|
||||
@PostMapping(PREFIX + "/create")
|
||||
/** 保存文件,并返回文件的访问路径 */
|
||||
CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO);
|
||||
}
|
||||
|
||||
90
tashow-feign/tashow-product-api/pom.xml
Normal file
90
tashow-feign/tashow-product-api/pom.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-feign</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>tashow-product-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
infra 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.13</version> <!-- 推荐使用最新稳定版本 -->
|
||||
</dependency>
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<!-- Swagger Core -->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-core</artifactId>
|
||||
<version>2.2.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger Models -->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>2.2.20</version>
|
||||
</dependency>
|
||||
<!-- EasyExcel 核心库 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-annotation</artifactId>
|
||||
<version>3.5.9</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-data-mybatis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* infra API 包,定义暴露给其它模块的 API
|
||||
*/
|
||||
package com.tashow.cloud.productapi.api;
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tashow.cloud.productapi.api.product;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import com.tashow.cloud.productapi.enums.ApiConstants;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
/** RPC 服务 - 参数配置 */
|
||||
public interface CategoryApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/category";
|
||||
|
||||
/** 根据参数键查询参数值 */
|
||||
@GetMapping(PREFIX + "/categoryList")
|
||||
List<CategoryDO> categoryList(@RequestParam(value = "grade", required = false) Integer grade,
|
||||
@RequestParam(value = "categoryId", required = false) Long categoryId,
|
||||
@RequestParam(value = "categoryName", required = false) String categoryName,
|
||||
@RequestParam(value = "status", required = false) Integer status);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品类目 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_category")
|
||||
@KeySequence("tz_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CategoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 类目ID
|
||||
*/
|
||||
@TableId
|
||||
private Long categoryId;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 父节点
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 父节名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 产品类目名称
|
||||
*/
|
||||
private String categoryName;
|
||||
/**
|
||||
* 类目图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 类目的显示图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 类目描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> tag;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 默认是1,表示正常状态,0为下线状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 分类层级 1、2、3级
|
||||
*/
|
||||
private Integer grade;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品类目 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class CategoryDto {
|
||||
|
||||
/**
|
||||
* 类目ID
|
||||
*/
|
||||
private Long categoryId;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 父节点
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 父节名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 产品类目名称
|
||||
*/
|
||||
private String categoryName;
|
||||
/**
|
||||
* 类目图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 类目的显示图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 类目描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> tag;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 默认是1,表示正常状态,0为下线状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 分类层级 1、2、3级
|
||||
*/
|
||||
private Integer grade;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特殊日期附加费用规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_additional_fee_dates")
|
||||
@KeySequence("tz_prod_additional_fee_dates_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdAdditionalFeeDatesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 特殊日期规则的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'
|
||||
*/
|
||||
private Integer dateType;
|
||||
|
||||
/**
|
||||
* 类型:1:特殊日期 2:可预约时段黑名单日期 3:紧急相应服务黑名单日期
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> customTimeSlots;
|
||||
/* *//**
|
||||
* 指定日期
|
||||
*//*
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> specificDates;*/
|
||||
/**
|
||||
* 收费方式0:''固定金额'':1:''基准价上浮
|
||||
*/
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 是否启用该规则是否启用该规则0关1开
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
public boolean isEmpty() {
|
||||
return id == null ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 特殊时段附加费用规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_additional_fee_periods")
|
||||
@KeySequence("tz_prod_additional_fee_periods_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdAdditionalFeePeriodsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 特殊时段规则的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 特殊时段设置
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> specialTimeSlots;
|
||||
/**
|
||||
* 收费方式0:'固定金额',1:'基准价上浮'
|
||||
*/
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 浮动百分比
|
||||
*/
|
||||
private BigDecimal floatingPercentage;
|
||||
public boolean isEmpty() {
|
||||
return id == null ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod")
|
||||
@KeySequence("tz_prod_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
@TableId
|
||||
private Long prodId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 商品简称
|
||||
*/
|
||||
private String abbreviation;
|
||||
/**
|
||||
* seo标题
|
||||
*/
|
||||
private String seoShortName;
|
||||
/**
|
||||
* seo搜索
|
||||
*/
|
||||
private String seoSearch;
|
||||
/**
|
||||
* 关键词
|
||||
*/
|
||||
private String keyword;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 简要描述,卖点等
|
||||
*/
|
||||
private String brief;
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
|
||||
/**
|
||||
* 是否置灰0否1是
|
||||
*/
|
||||
private Integer isProhibit;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String processNotes;
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private String prodNumber;
|
||||
/**
|
||||
* 商品主图
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 商品轮播图片,以,分割
|
||||
*/
|
||||
private String imgs;
|
||||
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
private String video;
|
||||
|
||||
/**
|
||||
* 商品轮播图片,以,分割
|
||||
*/
|
||||
private String whiteImg;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> tag;
|
||||
|
||||
/**
|
||||
* 默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
private Integer soldNum;
|
||||
/**
|
||||
* 分享图
|
||||
*/
|
||||
private String shareImage;
|
||||
/**
|
||||
* 分享话术
|
||||
*/
|
||||
private String shareContent;
|
||||
/**
|
||||
* 是否开启区域0关1开
|
||||
*/
|
||||
private Integer regionSwitch;
|
||||
/**
|
||||
* 是否特殊时段0关1开
|
||||
*/
|
||||
private Integer additionalSwitch;
|
||||
/**
|
||||
* 是否特殊日期(节假日周末什么的)0关1开
|
||||
*/
|
||||
private Integer additionalFeeSwitch;
|
||||
/**
|
||||
* 是否紧急响应服务0关1开
|
||||
*/
|
||||
private Integer emergencySwitch;
|
||||
/**
|
||||
* 是否预约0关1开
|
||||
*/
|
||||
private Integer reservationSwitch;
|
||||
/**
|
||||
* 是否接单上线0关1开
|
||||
*/
|
||||
private Integer orderLimitSwitch;
|
||||
/**
|
||||
* 是否开启体重配置0关1开
|
||||
*/
|
||||
private Integer weightSwitch;
|
||||
/**
|
||||
* 版本 乐观锁
|
||||
*/
|
||||
private Integer version;
|
||||
/**
|
||||
* 展示的权重
|
||||
*/
|
||||
private Integer top;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deleteTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品紧急响应服务设置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_emergency_response")
|
||||
@KeySequence("tz_prod_emergency_response_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdEmergencyResponseDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 紧急响应服务配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 可响应时间段
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> responseTimeSlots;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 紧急响应时间区间设置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_emergency_response_intervals")
|
||||
@KeySequence("tz_prod_emergency_response_intervals_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdEmergencyResponseIntervalsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 响应时间区间的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的紧急响应服务配置ID
|
||||
*/
|
||||
private Long configId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
|
||||
/**
|
||||
* 响应模式名称modeName
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 响应时间(小时)
|
||||
*/
|
||||
private BigDecimal responseHours;
|
||||
/**
|
||||
* 收费模式0:固定收费 1:浮动收费
|
||||
*/
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 浮动百分比
|
||||
*/
|
||||
private BigDecimal floatingPercentage;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
public boolean isEmpty() {
|
||||
return id == null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 属性规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_extend")
|
||||
@KeySequence("tz_prod_extend_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdExtendDO {
|
||||
|
||||
/**
|
||||
* 属性值ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 是否显示失效规格值 0否1是
|
||||
*/
|
||||
private Integer isExpire;
|
||||
|
||||
/**
|
||||
* 是否显示禁用规格值 0否1是
|
||||
*/
|
||||
private Integer isDisable;
|
||||
|
||||
/**
|
||||
* 体重是否收费0否1是
|
||||
*/
|
||||
private Integer isWeightCharge;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商品属性 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_prop")
|
||||
@KeySequence("tz_prod_prop_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdPropDO{
|
||||
|
||||
|
||||
/**
|
||||
* 属性id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private Long propId;
|
||||
/**
|
||||
* 属性名称
|
||||
*/
|
||||
private String propName;
|
||||
/**
|
||||
* ProdPropRule 1:销售属性(规格); 2:参数属性;
|
||||
*/
|
||||
private Integer rule;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long prodId;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Integer deleted;
|
||||
/**
|
||||
* isExist 是否新增 0否1是
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private Integer isExist;
|
||||
|
||||
|
||||
/**
|
||||
* 状态0禁用1启用
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private List<ProdPropValueDO> prodPropValues;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 属性规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_prop_value")
|
||||
@KeySequence("tz_prod_prop_value_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdPropValueDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private Long valueId;
|
||||
/**
|
||||
* 属性值名称
|
||||
*/
|
||||
private String propValue;
|
||||
/**
|
||||
* 属性ID
|
||||
*/
|
||||
private Long propId;
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 状态0禁用1启用
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 是否失效0否1是
|
||||
*/
|
||||
private Integer isExpire;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* isExist 是否新增 0否1是
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private Integer isExist;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deleteTime;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.TimeBookVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品预约配置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_reservation_config")
|
||||
@KeySequence("tz_prod_reservation_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdReservationConfigDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 预约配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 预约时段设置
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> reservationTimeSlots;
|
||||
/**
|
||||
* 需提前多少小时预约
|
||||
*/
|
||||
private Integer advanceHours;
|
||||
/**
|
||||
* 预约日期范围 7天 10天 15天 30天
|
||||
*/
|
||||
private Integer reservationDateRange;
|
||||
/**
|
||||
* 是否允许更改预约时间 1可以 0不可以
|
||||
*/
|
||||
private Integer allowChange;
|
||||
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private Integer timeSlot;
|
||||
|
||||
/**
|
||||
* 更改预约时间的时间规则(如服务开始前1小时可更改)
|
||||
*/
|
||||
private Integer changeTimeRule;
|
||||
/**
|
||||
* 允许更改预约时间的最大次数
|
||||
*/
|
||||
private Integer maxChangeTimes;
|
||||
/**
|
||||
* 预约时间区间设置
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private TimeBookVO timeBook;
|
||||
|
||||
public TimeBookVO getTimeBook() {
|
||||
if (this.timeBook == null) {
|
||||
this.timeBook = new TimeBookVO();
|
||||
this.timeBook.setTimeSlot(this.timeSlot);
|
||||
this.timeBook.setReservationTimeSlots(this.reservationTimeSlots);
|
||||
}
|
||||
return this.timeBook;
|
||||
}
|
||||
|
||||
public void setTimeBook(TimeBookVO timeBook) {
|
||||
this.timeBook = timeBook;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商品与服务区域关联 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_service_area_relevance")
|
||||
@KeySequence("tz_prod_service_area_relevance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdServiceAreaRelevanceDO{
|
||||
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 关联的服务区域ID
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 服务区域 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_service_areas")
|
||||
@KeySequence("tz_prod_service_areas_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdServiceAreasDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 服务区域的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 服务区域名称(如台江区、鼓楼区)
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 超区规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_service_over_area_rules")
|
||||
@KeySequence("tz_prod_service_over_area_rules_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdServiceOverAreaRulesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 超区规则的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)
|
||||
*/
|
||||
private Integer ruleType;
|
||||
/**
|
||||
* 超区费用(仅在rule_type为accept_with_fee时有效)
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商品和标签管理 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_tags")
|
||||
@KeySequence("tz_prod_tags_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdTagsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 标签id
|
||||
*/
|
||||
private Long tagId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 体重区间价格 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_weight_range_prices")
|
||||
@KeySequence("tz_prod_weight_range_prices_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdWeightRangePricesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 体重区间价格的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的体重配置ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 体重区间
|
||||
*/
|
||||
private String weightRange;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 是否收费0否1是
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商品接单上限设置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_product_order_limit")
|
||||
@KeySequence("tz_product_order_limit_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProductOrderLimitDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 接单上限配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 限制单位'0:按自然天',1:'按自然周',2:'按自然月'
|
||||
*/
|
||||
private Integer limitUnit;
|
||||
/**
|
||||
* 上限阈值
|
||||
*/
|
||||
private Integer maxOrders;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 店铺信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_shop_detail")
|
||||
@KeySequence("tz_shop_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ShopDetailDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@TableId
|
||||
private Long shopId;
|
||||
/**
|
||||
* 店铺名称(数字、中文,英文(可混合,不可有特殊字符),可修改)、不唯一
|
||||
*/
|
||||
private String shopName;
|
||||
/**
|
||||
* 店长用户id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 店铺类型
|
||||
*/
|
||||
private Integer shopType;
|
||||
/**
|
||||
* 店铺简介(可修改)
|
||||
*/
|
||||
private String intro;
|
||||
/**
|
||||
* 店铺公告(可修改)
|
||||
*/
|
||||
private String shopNotice;
|
||||
/**
|
||||
* 店铺行业(餐饮、生鲜果蔬、鲜花等)
|
||||
*/
|
||||
private Integer shopIndustry;
|
||||
/**
|
||||
* 店长
|
||||
*/
|
||||
private String shopOwner;
|
||||
/**
|
||||
* 店铺绑定的手机(登录账号:唯一)
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 店铺联系电话
|
||||
*/
|
||||
private String tel;
|
||||
/**
|
||||
* 店铺所在纬度(可修改)
|
||||
*/
|
||||
private String shopLat;
|
||||
/**
|
||||
* 店铺所在经度(可修改)
|
||||
*/
|
||||
private String shopLng;
|
||||
/**
|
||||
* 店铺详细地址
|
||||
*/
|
||||
private String shopAddress;
|
||||
/**
|
||||
* 店铺所在省份(描述)
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 店铺所在城市(描述)
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 店铺所在区域(描述)
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 店铺省市区代码,用于回显
|
||||
*/
|
||||
private String pcaCode;
|
||||
/**
|
||||
* 店铺logo(可修改)
|
||||
*/
|
||||
private String shopLogo;
|
||||
/**
|
||||
* 店铺相册
|
||||
*/
|
||||
private String shopPhotos;
|
||||
/**
|
||||
* 每天营业时间段(可修改)
|
||||
*/
|
||||
private String openTime;
|
||||
/**
|
||||
* 店铺状态(-1:未开通 0: 停业中 1:营业中),可修改
|
||||
*/
|
||||
private Integer shopStatus;
|
||||
/**
|
||||
* 0:商家承担运费; 1:买家承担运费
|
||||
*/
|
||||
private Integer transportType;
|
||||
/**
|
||||
* 固定运费
|
||||
*/
|
||||
private BigDecimal fixedFreight;
|
||||
/**
|
||||
* 满X包邮
|
||||
*/
|
||||
private BigDecimal fullFreeShipping;
|
||||
/**
|
||||
* 分销开关(0:开启 1:关闭)
|
||||
*/
|
||||
private Integer isDistribution;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 单品SKU DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku")
|
||||
@KeySequence("tz_sku_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 单品ID
|
||||
*/
|
||||
@TableId
|
||||
private Long skuId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 销售属性组合字符串 格式是p1:v1;p2:v2
|
||||
*/
|
||||
private String properties;
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
private String alias;
|
||||
/**
|
||||
* 当前价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 基准价
|
||||
*/
|
||||
private BigDecimal basePrice;
|
||||
/**
|
||||
* 最低价格
|
||||
*/
|
||||
private BigDecimal minPrice;
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
private BigDecimal maxPrice;
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
/**
|
||||
* 市场价
|
||||
*/
|
||||
private BigDecimal marketPrice;
|
||||
|
||||
/**
|
||||
* 服务内容
|
||||
*/
|
||||
private String serviceContent;
|
||||
/**
|
||||
* 规格id 多个用逗号分隔(1,2,3)
|
||||
*/
|
||||
private String propIds;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 0:主服务1:待定
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 概述
|
||||
*/
|
||||
private String overview;
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer stocks;
|
||||
|
||||
|
||||
/**
|
||||
* 总库存是0 无线库存是1
|
||||
*/
|
||||
private Integer stocksFlg;
|
||||
|
||||
/**
|
||||
* 锁定库存数
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private Integer stocksLockNum;
|
||||
/**
|
||||
* 预警库存
|
||||
*/
|
||||
private Integer warnStocks;
|
||||
/**
|
||||
* 库存扣款时机0:付款扣1:下单扣
|
||||
*/
|
||||
private Integer stocksType;
|
||||
/**
|
||||
* sku编码
|
||||
*/
|
||||
private String skuCode;
|
||||
/**
|
||||
* 商品条形码
|
||||
*/
|
||||
private String modelId;
|
||||
/**
|
||||
* sku图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* sku名称
|
||||
*/
|
||||
private String skuName;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private Integer version;
|
||||
/**
|
||||
* 商品重量
|
||||
*/
|
||||
private Double weight;
|
||||
/**
|
||||
* 商品体积
|
||||
*/
|
||||
private Double volume;
|
||||
/**
|
||||
* 0 禁用 1 启用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 最小购买数量
|
||||
*/
|
||||
private Integer moq;
|
||||
/**
|
||||
* 是否上下架0下架1上架
|
||||
*/
|
||||
private Integer isShelf;
|
||||
|
||||
/**
|
||||
* 是否默认规则0否1是
|
||||
*/
|
||||
private Integer isSpecs;
|
||||
|
||||
/**
|
||||
* 扩展服务表单id
|
||||
*/
|
||||
private Long formId;
|
||||
|
||||
|
||||
/**
|
||||
* isExist 是否新增 0否1是
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private Integer isExist;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deleteTime;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 服务交付方式 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku_service_deliver")
|
||||
@KeySequence("tz_sku_service_deliver_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuServiceDeliverDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 服务遗体运输唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的扩展服务ID
|
||||
*/
|
||||
private Long serviceId;
|
||||
/**
|
||||
* 交互方式0:快递物流 1:到店自提 2:商家自送
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 是否收费0:免费1收费
|
||||
*/
|
||||
private Integer isCharge;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String tel;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 服务详情 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku_service_details")
|
||||
@KeySequence("tz_sku_service_details_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuServiceDetailsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 服务详情的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的扩展服务ID
|
||||
*/
|
||||
private Long serviceId;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 是否收费0:免费1收费
|
||||
*/
|
||||
private Integer isCharge;
|
||||
/**
|
||||
* 是否默认值0否1是
|
||||
*/
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 类型:0:配置信息1:交付方式
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
private String adress;
|
||||
|
||||
/**
|
||||
* 触发节点名称
|
||||
*/
|
||||
private String triggerName;
|
||||
|
||||
/**
|
||||
* 触发节点id(或关联节点)
|
||||
*/
|
||||
private Long triggerId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否并行0串行1并行
|
||||
*/
|
||||
private Integer isParallel;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describeContent;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 服务物料详情 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku_service_material")
|
||||
@KeySequence("tz_sku_service_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuServiceMaterialDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 服务物料的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的扩展服务ID
|
||||
*/
|
||||
private Long serviceId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describeContent;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 服务遗体运输 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku_service_transport")
|
||||
@KeySequence("tz_sku_service_transport_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuServiceTransportDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 服务遗体运输唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的扩展服务ID
|
||||
*/
|
||||
private Long serviceId;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contacts;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String tel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.tashow.cloud.productapi.api.product.dto;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 商品SKU扩展服务表单 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_sku_services_form")
|
||||
@KeySequence("tz_sku_services_form_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuServicesFormDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 扩展服务的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 表单ID
|
||||
*/
|
||||
private Integer formId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
private String serviceName;
|
||||
/**
|
||||
* 是否启用该服务
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 产品类目分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CategoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "店铺ID", example = "22369")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "父节点", example = "16509")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "产品类目名称", example = "王五")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类目图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "类目的显示图片")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "类目描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private List<String> tag;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "默认是1,表示正常状态,0为下线状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "分类层级")
|
||||
private Integer grade;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 产品类目 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CategoryRespVO {
|
||||
|
||||
@Schema(description = "类目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15856")
|
||||
@ExcelProperty("类目ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22369")
|
||||
@ExcelProperty("店铺ID")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "父节点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16509")
|
||||
@ExcelProperty("父节点")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "产品类目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("产品类目名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类目图标")
|
||||
@ExcelProperty("类目图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "类目的显示图片")
|
||||
@ExcelProperty("类目的显示图片")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "类目描述")
|
||||
@ExcelProperty("类目描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "标签")
|
||||
@ExcelProperty("标签")
|
||||
private List<String> tag;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "默认是1,表示正常状态,0为下线状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("默认是1,表示正常状态,0为下线状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "分类层级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("分类层级")
|
||||
private Integer grade;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 产品类目新增/修改 Request VO")
|
||||
@Data
|
||||
public class CategorySaveReqVO {
|
||||
|
||||
@Schema(description = "类目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15856")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22369")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "父节点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16509")
|
||||
//@NotNull(message = "父节点不能为空")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 父节名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
@Schema(description = "产品类目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
//@NotEmpty(message = "产品类目名称不能为空")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类目图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "类目的显示图片")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "类目描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private List<String> tag;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "默认是1,表示正常状态,0为下线状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "分类层级 1级 2级 3级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
//@NotNull(message = "分类层级不能为空")
|
||||
private Integer grade;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@Data
|
||||
public class ProdListVO {
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
@TableId
|
||||
private Long prodId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否置灰0否1是
|
||||
*/
|
||||
private Integer isProhibit;
|
||||
/**
|
||||
* 服务区域地址名称集合
|
||||
*/
|
||||
private List<String> areaNameList;
|
||||
|
||||
/**
|
||||
* 紧急服务最快响应时间(小时)
|
||||
*/
|
||||
private BigDecimal responseHours;
|
||||
/**
|
||||
* 服务时段
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> reservationTimeSlots;
|
||||
|
||||
/**
|
||||
* 还剩多少天
|
||||
*/
|
||||
private Long remainingDays;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String processNotes;
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 商品分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "商品名称", example = "赵六")
|
||||
private String prodName;
|
||||
|
||||
@Schema(description = "店铺id", example = "10843")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "商品分类", example = "14895")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "商品回收站分页查询")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdRecycleBinVO extends PageParam {
|
||||
|
||||
@Schema(description = "商品名称", example = "18784")
|
||||
private String prodName;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] deleteTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdRespVO {
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
|
||||
@ExcelProperty("产品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("商品名称")
|
||||
private String prodName;
|
||||
|
||||
@Schema(description = "商品简称")
|
||||
@ExcelProperty("商品简称")
|
||||
private String abbreviation;
|
||||
|
||||
@Schema(description = "seo标题", example = "李四")
|
||||
@ExcelProperty("seo标题")
|
||||
private String seoShortName;
|
||||
|
||||
|
||||
@Schema(description = "seo搜索")
|
||||
@ExcelProperty("seo搜索")
|
||||
private String seoSearch;
|
||||
|
||||
@Schema(description = "关键词")
|
||||
@ExcelProperty("关键词")
|
||||
private String keyword;
|
||||
|
||||
@Schema(description = "店铺id", example = "10843")
|
||||
@ExcelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "简要描述,卖点等")
|
||||
@ExcelProperty("简要描述,卖点等")
|
||||
private String brief;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "详细描述")
|
||||
@ExcelProperty("详细描述")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "商品编号")
|
||||
@ExcelProperty("商品编号")
|
||||
private String prodNumber;
|
||||
|
||||
@Schema(description = "商品主图")
|
||||
@ExcelProperty("商品主图")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "商品轮播图片,以,分割")
|
||||
@ExcelProperty("商品轮播图片,以,分割")
|
||||
private String imgs;
|
||||
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
private String video;
|
||||
|
||||
/**
|
||||
* 商品轮播图片,以,分割
|
||||
*/
|
||||
private String whiteImg;
|
||||
|
||||
@Schema(description = "默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核", example = "2")
|
||||
@ExcelProperty("默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "商品分类", example = "14895")
|
||||
@ExcelProperty("商品分类")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "销量")
|
||||
@ExcelProperty("销量")
|
||||
private Integer soldNum;
|
||||
|
||||
@Schema(description = "分享图")
|
||||
@ExcelProperty("分享图")
|
||||
private String shareImage;
|
||||
|
||||
@Schema(description = "'是否置灰0否1是'")
|
||||
private Integer isProhibit;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String processNotes;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
public List<String> tag;
|
||||
|
||||
@Schema(description = "分享话术")
|
||||
@ExcelProperty("分享话术")
|
||||
private String shareContent;
|
||||
|
||||
@Schema(description = "是否开启区域0关1开")
|
||||
@ExcelProperty("是否开启区域0关1开")
|
||||
private Integer regionSwitch;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
@ExcelProperty("是否特殊时段0关1开")
|
||||
private Integer additionalSwitch;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
@ExcelProperty("是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Integer additionalFeeSwitch;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
@ExcelProperty("是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
@ExcelProperty("是否预约0关1开")
|
||||
private Integer reservationSwitch;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
@ExcelProperty("是否接单上线0关1开")
|
||||
private Integer orderLimitSwitch;
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
@ExcelProperty("是否开启体重配置0关1开")
|
||||
private Integer weightSwitch;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
@ExcelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
@ExcelProperty("修改人")
|
||||
private String updateBy;
|
||||
|
||||
@Schema(description = "版本 乐观锁")
|
||||
@ExcelProperty("版本 乐观锁")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "展示的权重")
|
||||
@ExcelProperty("展示的权重")
|
||||
private Integer top;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@Data
|
||||
public class ProdRestoreListVO {
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
@TableId
|
||||
private Long prodId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 服务区域地址名称集合
|
||||
*/
|
||||
private List<String> areaNameList;
|
||||
|
||||
/**
|
||||
* 紧急服务最快响应时间(小时)
|
||||
*/
|
||||
private BigDecimal responseHours;
|
||||
/**
|
||||
* 服务时段
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> reservationTimeSlots;
|
||||
|
||||
/**
|
||||
* 还剩多少天
|
||||
*/
|
||||
private Long remainingDays;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdSaveReqVO {
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
|
||||
private Long prodId;
|
||||
|
||||
//@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
//@NotEmpty(message = "商品名称不能为空")
|
||||
private String prodName;
|
||||
|
||||
@Schema(description = "商品简称")
|
||||
private String abbreviation;
|
||||
|
||||
@Schema(description = "seo标题", example = "李四")
|
||||
private String seoShortName;
|
||||
|
||||
@Schema(description = "seo搜索")
|
||||
private String seoSearch;
|
||||
|
||||
@Schema(description = "关键词")
|
||||
private String keyword;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "店铺id", example = "10843")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "简要描述,卖点等")
|
||||
private String brief;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "详细描述")
|
||||
private String content;
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
private String video;
|
||||
|
||||
/**
|
||||
* 白底图
|
||||
*/
|
||||
private String whiteImg;
|
||||
|
||||
@Schema(description = "商品编号")
|
||||
private String prodNumber;
|
||||
|
||||
@Schema(description = "商品主图")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "商品轮播图片,以,分割")
|
||||
private String imgs;
|
||||
|
||||
@Schema(description = "默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "'是否置灰0否1是'")
|
||||
private Integer isProhibit;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String processNotes;
|
||||
|
||||
|
||||
@Schema(description = "商品分类", example = "14895")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "销量")
|
||||
private Integer soldNum;
|
||||
|
||||
@Schema(description = "分享图")
|
||||
private String shareImage;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
public List<String> tag;
|
||||
|
||||
@Schema(description = "分享话术")
|
||||
private String shareContent;
|
||||
|
||||
@Schema(description = "是否开启区域0关1开")
|
||||
private Integer regionSwitch;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
private Integer additionalSwitch;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Integer additionalFeeSwitch;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
private Integer reservationSwitch;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
private Integer orderLimitSwitch;
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
private Integer weightSwitch;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
@Schema(description = "版本 乐观锁")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "展示的权重")
|
||||
private Integer top;
|
||||
|
||||
@Schema(description = "sku列表")
|
||||
private List<SkuDO> skuList;
|
||||
|
||||
@Schema(description = "规格")
|
||||
private List<ProdPropSaveReqVO> prodPropSaveReqVO;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProductOrderLimitDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@Data
|
||||
public class ProdServiceInfoVO {
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "新建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "是否开启服务区域配置0关1开")
|
||||
private Integer regionSwitch;
|
||||
@Schema(description = "服务区域配置")
|
||||
public ProdServiceAreasInfoVO prodServiceAreasInfo;
|
||||
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
private Integer reservationSwitch;
|
||||
@Schema(description = "预约配置")
|
||||
public ProdReservationInfoReqVO prodReservationConfig;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
@Schema(description = "急响应服务配置")
|
||||
public ProdEmergencyInfoReqVO prodEmergencyInfoVO;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
private Integer orderLimitSwitch;
|
||||
@Schema(description = "接单上线配置")
|
||||
public ProductOrderLimitDO productOrderLimitVO;
|
||||
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开 ")
|
||||
private Integer additionalSwitch;
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
private Integer additionalFeeSwitch;
|
||||
@Schema(description = "特殊时段规则配置 ")
|
||||
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
|
||||
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
private Integer weightSwitch;
|
||||
@Schema(description = "体重配置")
|
||||
public ProdWeightRangePricesSaveInfoVO prodWeightConfig;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@Data
|
||||
public class ProdServiceVO {
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "新建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "是否开启服务区域配置0关1开")
|
||||
private Integer regionSwitch;
|
||||
@Schema(description = "服务区域配置")
|
||||
public ProdServiceAreasInfoVO prodServiceAreasInfo;
|
||||
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
private Integer reservationSwitch;
|
||||
@Schema(description = "预约配置")
|
||||
public ProdReservationInfoVO prodReservationConfig;
|
||||
|
||||
/* public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
|
||||
if (prodReservationBlackList == null || prodReservationBlackList.isEmpty()) {
|
||||
return prodReservationBlackList;
|
||||
}
|
||||
return prodReservationBlackList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void setProdReservationBlackList(List<ProdAdditionalFeeBlackVO> prodReservationBlackList) {
|
||||
this.prodReservationBlackList = prodReservationBlackList;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
@Schema(description = "急响应服务配置")
|
||||
public ProdEmergencyInfoVO prodEmergencyInfoVO;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
private Integer orderLimitSwitch;
|
||||
@Schema(description = "接单上线配置")
|
||||
public ProductOrderLimitDO productOrderLimitVO;
|
||||
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Integer additionalSwitch;
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开 ")
|
||||
private Integer additionalFeeSwitch;
|
||||
@Schema(description = "特殊时段规则配置 ")
|
||||
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
|
||||
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
private Integer weightSwitch;
|
||||
@Schema(description = "体重配置")
|
||||
public ProdWeightRangePricesSaveInfoVO prodWeightConfig;
|
||||
|
||||
|
||||
public ProdReservationInfoVO getProdReservationConfig() {
|
||||
|
||||
if (this.prodReservationConfig == null) {
|
||||
return null;
|
||||
}
|
||||
// 判断是否“逻辑上为空”
|
||||
if (isProdReservationInfoEmpty(this.prodReservationConfig)) {
|
||||
return null;
|
||||
}
|
||||
return this.prodReservationConfig;
|
||||
}
|
||||
|
||||
public void setProdReservationConfig(ProdReservationInfoVO prodReservationConfig) {
|
||||
this.prodReservationConfig = prodReservationConfig;
|
||||
}
|
||||
|
||||
private boolean isProdReservationInfoEmpty(ProdReservationInfoVO config) {
|
||||
if (config == null) return true;
|
||||
// 判断所有字段是否都为 null 或空
|
||||
return config.getId() == null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊日期附加费用规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdAdditionalFeeBlackVO {
|
||||
|
||||
@Schema(description = "特殊日期规则的唯一标识符")
|
||||
@ExcelProperty("特殊日期规则的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'")
|
||||
@ExcelProperty("日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'")
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "黑名单日期设置")
|
||||
@ExcelProperty("黑名单日期设置")
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> customTimeSlots;
|
||||
|
||||
|
||||
@Schema(description = "类型:1:特殊日期 2:可预约时段黑名单日期 3:紧急相应服务黑名单日期")
|
||||
@ExcelProperty("类型:1:特殊日期 2:可预约时段黑名单日期 3:紧急相应服务黑名单日期")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用该规则是否启用该规则0关1开")
|
||||
private Integer isEnabled;
|
||||
public boolean isEmpty() {
|
||||
return id == null ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊日期附加费用规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdAdditionalFeeDatesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "商品id", example = "24324")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", example = "2")
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
private String customTimeSlots;
|
||||
|
||||
@Schema(description = "指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开")
|
||||
private Integer isEnabled;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊日期附加费用规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdAdditionalFeeDatesRespVO {
|
||||
|
||||
@Schema(description = "特殊日期规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1445")
|
||||
@ExcelProperty("特殊日期规则的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24324")
|
||||
@ExcelProperty("商品id")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'")
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
@ExcelProperty("自定义日期时间段(JSON格式存储)")
|
||||
private String customTimeSlots;
|
||||
|
||||
@Schema(description = "指定日期(JSON格式存储)")
|
||||
@ExcelProperty("指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用该规则是否启用该规则0关1开")
|
||||
private Integer isEnabled;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊日期附加费用规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdAdditionalFeeDatesSaveReqVO {
|
||||
|
||||
@Schema(description = "特殊日期规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1445")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24324")
|
||||
@NotNull(message = "商品id不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'不能为空")
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
private String customTimeSlots;
|
||||
|
||||
@Schema(description = "指定日期(JSON格式存储)")
|
||||
private String specificDates;
|
||||
|
||||
@Schema(description = "收费方式0:''固定金额'':1:''基准价上浮", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收费方式不能为空")
|
||||
private Integer chargeMode;
|
||||
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17305")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用该规则不能为空")
|
||||
private Integer isEnabled;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdAdditionalFeePeriodsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "商品ID", example = "11100")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)")
|
||||
private String specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdAdditionalFeePeriodsRespVO {
|
||||
|
||||
@Schema(description = "特殊时段规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "24746")
|
||||
@ExcelProperty("特殊时段规则的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11100")
|
||||
@ExcelProperty("商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("特殊时段设置(JSON格式存储)")
|
||||
private List<String> specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费方式0:'固定金额',1:'基准价上浮'")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
@ExcelProperty("浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdAdditionalFeePeriodsSaveReqVO {
|
||||
|
||||
@Schema(description = "特殊时段规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "24746")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11100")
|
||||
@NotNull(message = "商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "特殊时段设置(JSON格式存储)不能为空")
|
||||
private List<String> specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收费方式0:'固定金额',1:'基准价上浮'不能为空")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyInfoReqVO {
|
||||
|
||||
|
||||
/**
|
||||
* 紧急响应服务配置的唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 可响应时间段
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> responseTimeSlots;
|
||||
|
||||
@Schema(description = "紧急响应时间区间设置")
|
||||
public List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||
|
||||
@Schema(description = "紧急响应黑名单日期设置")
|
||||
public List<ProdAdditionalFeeBlackVO> prodEmergencyResponseBlackList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyInfoVO {
|
||||
|
||||
|
||||
/**
|
||||
* 紧急响应服务配置的唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 可响应时间段
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> responseTimeSlots;
|
||||
|
||||
@Schema(description = "紧急响应时间区间设置")
|
||||
public List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||
|
||||
@Schema(description = "紧急响应黑名单日期设置")
|
||||
public List<ProdAdditionalFeeBlackVO> prodEmergencyResponseBlackList;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdEmergencyResponsePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的商品ID", example = "29152")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段")
|
||||
private List<String> responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期")
|
||||
private List<String> blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期")
|
||||
private List<String> blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyResponseRespVO {
|
||||
|
||||
@Schema(description = "紧急响应服务配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "7448")
|
||||
@ExcelProperty("紧急响应服务配置的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29152")
|
||||
@ExcelProperty("关联的商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段(JSON格式存储)")
|
||||
@ExcelProperty("可响应时间段(JSON格式存储)")
|
||||
private String responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期(JSON格式存储)")
|
||||
@ExcelProperty("黑名自定义日期(JSON格式存储)")
|
||||
private String blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期(JSON格式存储)")
|
||||
@ExcelProperty("黑名单指定日期(JSON格式存储)")
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
@ExcelProperty("法定节假日是否开启0:关闭1开启")
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
@ExcelProperty("固定休息日周末是否开启0关闭1开启")
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdEmergencyResponseSaveReqVO {
|
||||
|
||||
@Schema(description = "紧急响应服务配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "7448")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29152")
|
||||
@NotNull(message = "关联的商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段")
|
||||
private List<String> responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期")
|
||||
private List<String>blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期")
|
||||
private List<String> blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdEmergencyResponseIntervalsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", example = "5737")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)")
|
||||
private BigDecimal responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyResponseIntervalsRespVO {
|
||||
|
||||
@Schema(description = "响应时间区间的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "29650")
|
||||
@ExcelProperty("响应时间区间的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5737")
|
||||
@ExcelProperty("关联的紧急响应服务配置ID")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("响应模式名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("响应时间(小时)")
|
||||
private BigDecimal responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费模式0:固定收费 1:浮动收费")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
@ExcelProperty("浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
@ExcelProperty("最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdEmergencyResponseIntervalsSaveReqVO {
|
||||
|
||||
@Schema(description = "响应时间区间的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "29650")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5737")
|
||||
@NotNull(message = "关联的紧急响应服务配置ID不能为空")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "响应模式名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "响应时间(小时)不能为空")
|
||||
private BigDecimal responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收费模式0:固定收费 1:浮动收费不能为空")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodprop;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 商品属性分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdPropPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "属性名称", example = "李四")
|
||||
private String propName;
|
||||
|
||||
@Schema(description = "ProdPropRule 1:销售属性(规格); 2:参数属性;")
|
||||
private Integer rule;
|
||||
|
||||
@Schema(description = "店铺id", example = "2806")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "商品id", example = "21671")
|
||||
private Integer prodId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodprop;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 商品属性 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdPropRespVO {
|
||||
|
||||
@Schema(description = "属性id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14271")
|
||||
@ExcelProperty("属性id")
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "属性名称", example = "李四")
|
||||
@ExcelProperty("属性名称")
|
||||
private String propName;
|
||||
|
||||
@Schema(description = "ProdPropRule 1:销售属性(规格); 2:参数属性;")
|
||||
@ExcelProperty("ProdPropRule 1:销售属性(规格); 2:参数属性;")
|
||||
private Integer rule;
|
||||
|
||||
@Schema(description = "店铺id", example = "2806")
|
||||
@ExcelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "商品id", example = "21671")
|
||||
@ExcelProperty("商品id")
|
||||
private Integer prodId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
@ExcelProperty("是否删除0否1是")
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodprop;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品属性新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdPropSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "属性id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14271")
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "属性名称", example = "李四")
|
||||
private String propName;
|
||||
|
||||
@Schema(description = "ProdPropRule 1:销售属性(规格); 2:参数属性;")
|
||||
private Integer rule;
|
||||
|
||||
@Schema(description = "店铺id", example = "2806")
|
||||
private Long shopId;
|
||||
|
||||
@Schema(description = "商品id(添加的时候不传)", example = "21671")
|
||||
private Integer prodId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* isExist 是否新增 0否1是
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private Integer isExist;
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
@NotEmpty(message="规格属性值不能为空")
|
||||
private List<ProdPropValueDO> prodPropValues;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProPageReqVO extends PageParam {
|
||||
|
||||
/**
|
||||
* 属性规格名称
|
||||
*/
|
||||
private String propValue;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long prodId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ProPropRecycleBinVO {
|
||||
@Schema(description = "规格值id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 属性规格名称
|
||||
*/
|
||||
private String propValue;
|
||||
/**
|
||||
* 关联规格属性id
|
||||
*/
|
||||
private Long propId;
|
||||
|
||||
/**
|
||||
* 还剩多少天
|
||||
*/
|
||||
private Long remainingDays;
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 属性规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdPropValuePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "属性值名称")
|
||||
private String propValue;
|
||||
|
||||
@Schema(description = "属性ID", example = "28282")
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 属性规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdPropValueRespVO {
|
||||
|
||||
@Schema(description = "属性值ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13799")
|
||||
@ExcelProperty("属性值ID")
|
||||
private Long valueId;
|
||||
|
||||
@Schema(description = "属性值名称")
|
||||
@ExcelProperty("属性值名称")
|
||||
private String propValue;
|
||||
|
||||
@Schema(description = "属性ID", example = "28282")
|
||||
@ExcelProperty("属性ID")
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
@ExcelProperty("是否删除0否1是")
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 属性规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdPropValueSaveReqVO {
|
||||
|
||||
@Schema(description = "属性值ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13799")
|
||||
private Long valueId;
|
||||
|
||||
@Schema(description = "属性值名称")
|
||||
private String propValue;
|
||||
|
||||
@Schema(description = "属性ID", example = "28282")
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品预约配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdReservationConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的商品ID", example = "19369")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "预约时段设置")
|
||||
private List<String> reservationTimeSlots;
|
||||
|
||||
@Schema(description = "需提前多少小时预约")
|
||||
private Integer advanceHours;
|
||||
|
||||
@Schema(description = "预约日期范围 7天 10天 15天 30天")
|
||||
private Integer reservationDateRange;
|
||||
|
||||
@Schema(description = "是否允许更改预约时间 1可以 0不可以")
|
||||
private Boolean allowChange;
|
||||
|
||||
@Schema(description = "更改预约时间的时间规则(如服务开始前1小时可更改)")
|
||||
private Integer changeTimeRule;
|
||||
|
||||
@Schema(description = "允许更改预约时间的最大次数")
|
||||
private Integer maxChangeTimes;
|
||||
|
||||
@Schema(description = "黑名自定义日期")
|
||||
private List<String> blacklistedDates;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单自定义0关1开'
|
||||
*/
|
||||
private Integer isBlacklisted;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单指定日期0关1开'
|
||||
*/
|
||||
private Integer isBlackAppoint;
|
||||
|
||||
@Schema(description = "黑名单指定日期")
|
||||
private List<String> blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "配置创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "配置最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品预约配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdReservationConfigRespVO {
|
||||
|
||||
@Schema(description = "预约配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "20606")
|
||||
@ExcelProperty("预约配置的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19369")
|
||||
@ExcelProperty("关联的商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "预约时段设置", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("预约时段设置")
|
||||
private List<String> reservationTimeSlots;
|
||||
|
||||
@Schema(description = "需提前多少小时预约", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("需提前多少小时预约")
|
||||
private Integer advanceHours;
|
||||
|
||||
@Schema(description = "预约日期范围 7天 10天 15天 30天", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("预约日期范围 7天 10天 15天 30天")
|
||||
private Integer reservationDateRange;
|
||||
|
||||
@Schema(description = "是否允许更改预约时间 1可以 0不可以", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否允许更改预约时间 1可以 0不可以")
|
||||
private Boolean allowChange;
|
||||
|
||||
@Schema(description = "更改预约时间的时间规则(如服务开始前1小时可更改)")
|
||||
@ExcelProperty("更改预约时间的时间规则(如服务开始前1小时可更改)")
|
||||
private Integer changeTimeRule;
|
||||
|
||||
@Schema(description = "允许更改预约时间的最大次数")
|
||||
@ExcelProperty("允许更改预约时间的最大次数")
|
||||
private Integer maxChangeTimes;
|
||||
|
||||
@Schema(description = "黑名自定义日期")
|
||||
@ExcelProperty("黑名自定义日期")
|
||||
private List<String> blacklistedDates;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单自定义0关1开'
|
||||
*/
|
||||
private Integer isBlacklisted;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单指定日期0关1开'
|
||||
*/
|
||||
private Integer isBlackAppoint;
|
||||
|
||||
@Schema(description = "黑名单指定日期")
|
||||
@ExcelProperty("黑名单指定日期")
|
||||
private List<String> blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
@ExcelProperty("法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
@ExcelProperty("固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "配置创建时间")
|
||||
@ExcelProperty("配置创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "配置最后更新时间")
|
||||
@ExcelProperty("配置最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品预约配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdReservationConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "预约配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "20606")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19369")
|
||||
@NotNull(message = "关联的商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "预约时段设置", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "预约时段设置不能为空")
|
||||
private List<String> reservationTimeSlots;
|
||||
|
||||
@Schema(description = "需提前多少小时预约", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "需提前多少小时预约不能为空")
|
||||
private Integer advanceHours;
|
||||
|
||||
@Schema(description = "预约日期范围 7天 10天 15天 30天", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "预约日期范围 7天 10天 15天 30天不能为空")
|
||||
private Integer reservationDateRange;
|
||||
|
||||
@Schema(description = "是否允许更改预约时间 1可以 0不可以", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否允许更改预约时间 1可以 0不可以不能为空")
|
||||
private Boolean allowChange;
|
||||
|
||||
@Schema(description = "更改预约时间的时间规则(如服务开始前1小时可更改)")
|
||||
private Integer changeTimeRule;
|
||||
|
||||
@Schema(description = "允许更改预约时间的最大次数")
|
||||
private Integer maxChangeTimes;
|
||||
|
||||
@Schema(description = "黑名自定义日期")
|
||||
private List<String> blacklistedDates;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单自定义0关1开'
|
||||
*/
|
||||
private Integer isBlacklisted;
|
||||
|
||||
/**
|
||||
* '是否开启黑名单指定日期0关1开'
|
||||
*/
|
||||
private Integer isBlackAppoint;
|
||||
|
||||
@Schema(description = "黑名单指定日期")
|
||||
private List<String> blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "配置创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "配置最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdReservationInfoReqVO {
|
||||
|
||||
/**
|
||||
* 预约配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 预约时段设置
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> reservationTimeSlots;
|
||||
/**
|
||||
* 需提前多少小时预约
|
||||
*/
|
||||
private Integer advanceHours;
|
||||
/**
|
||||
* 预约日期范围 7天 10天 15天 30天
|
||||
*/
|
||||
private Integer reservationDateRange;
|
||||
/**
|
||||
* 是否允许更改预约时间 1可以 0不可以
|
||||
*/
|
||||
private Integer allowChange;
|
||||
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private Integer timeSlot;
|
||||
|
||||
/**
|
||||
* 更改预约时间的时间规则(如服务开始前1小时可更改)
|
||||
*/
|
||||
private Integer changeTimeRule;
|
||||
/**
|
||||
* 允许更改预约时间的最大次数
|
||||
*/
|
||||
private Integer maxChangeTimes;
|
||||
|
||||
/**
|
||||
* 预约时间区间设置
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private TimeBookVO timeBook;
|
||||
|
||||
public TimeBookVO getTimeBook() {
|
||||
if (this.timeBook == null) {
|
||||
this.timeBook = new TimeBookVO();
|
||||
this.timeBook.setTimeSlot(this.timeSlot);
|
||||
this.timeBook.setReservationTimeSlots(this.reservationTimeSlots);
|
||||
}
|
||||
return this.timeBook;
|
||||
}
|
||||
|
||||
public void setTimeBook(TimeBookVO timeBook) {
|
||||
this.timeBook = timeBook;
|
||||
}
|
||||
|
||||
@Schema(description = "预约黑名单日期设置")
|
||||
public List<ProdAdditionalFeeBlackVO> prodReservationBlackList = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdReservationInfoVO {
|
||||
|
||||
/**
|
||||
* 预约配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 预约时段设置
|
||||
*/
|
||||
@TableField(typeHandler = StringListTypeHandler.class)
|
||||
private List<String> reservationTimeSlots;
|
||||
/**
|
||||
* 需提前多少小时预约
|
||||
*/
|
||||
private Integer advanceHours;
|
||||
/**
|
||||
* 预约日期范围 7天 10天 15天 30天
|
||||
*/
|
||||
private Integer reservationDateRange;
|
||||
/**
|
||||
* 是否允许更改预约时间 1可以 0不可以
|
||||
*/
|
||||
private Integer allowChange;
|
||||
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private Integer timeSlot;
|
||||
|
||||
/**
|
||||
* 更改预约时间的时间规则(如服务开始前1小时可更改)
|
||||
*/
|
||||
private Integer changeTimeRule;
|
||||
/**
|
||||
* 允许更改预约时间的最大次数
|
||||
*/
|
||||
private Integer maxChangeTimes;
|
||||
|
||||
/**
|
||||
* 预约时间区间设置
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private TimeBookVO timeBook;
|
||||
|
||||
public TimeBookVO getTimeBook() {
|
||||
if (this.timeBook == null) {
|
||||
this.timeBook = new TimeBookVO();
|
||||
this.timeBook.setTimeSlot(this.timeSlot);
|
||||
this.timeBook.setReservationTimeSlots(this.reservationTimeSlots);
|
||||
}
|
||||
return this.timeBook;
|
||||
}
|
||||
|
||||
public void setTimeBook(TimeBookVO timeBook) {
|
||||
this.timeBook = timeBook;
|
||||
}
|
||||
|
||||
@Schema(description = "预约黑名单日期设置")
|
||||
public List<ProdAdditionalFeeBlackVO> prodReservationBlackList;
|
||||
|
||||
|
||||
/* public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
|
||||
if (prodReservationBlackList == null || prodReservationBlackList.isEmpty()) {
|
||||
return prodReservationBlackList;
|
||||
}
|
||||
return prodReservationBlackList.stream()
|
||||
.filter(black -> black != null && !black.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void setProdReservationBlackList(List<ProdAdditionalFeeBlackVO> prodReservationBlackList) {
|
||||
this.prodReservationBlackList = prodReservationBlackList;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品预约配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TimeBookVO {
|
||||
|
||||
/**
|
||||
* 预约时段设置
|
||||
*/
|
||||
private List<String> reservationTimeSlots;
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private Integer timeSlot;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 商品与服务区域关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdServiceAreaRelevancePageReqVO extends PageParam {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 商品与服务区域关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceAreaRelevanceRespVO {
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23588")
|
||||
@ExcelProperty("关联的商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "关联的服务区域ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28293")
|
||||
@ExcelProperty("关联的服务区域ID")
|
||||
private Long areaId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 商品与服务区域关联新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdServiceAreaRelevanceSaveReqVO {
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23588")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "关联的服务区域ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28293")
|
||||
private Long areaId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceareas;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 服务区域 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceAreasInfoVO {
|
||||
|
||||
/**
|
||||
* 超区规则的唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)
|
||||
*/
|
||||
private Integer ruleType;
|
||||
/**
|
||||
* 超区费用(仅在rule_type为accept_with_fee时有效)
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
|
||||
@Schema(description = "服务区域地址名称")
|
||||
private List<String> areaNameList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceareas;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 服务区域分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdServiceAreasPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "服务区域名称(如台江区、鼓楼区)", example = "芋艿")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "区域创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceareas;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 服务区域 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceAreasRespVO {
|
||||
|
||||
@Schema(description = "服务区域的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "26474")
|
||||
@ExcelProperty("服务区域的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "服务区域名称(如台江区、鼓楼区)", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("服务区域名称(如台江区、鼓楼区)")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "区域创建时间")
|
||||
@ExcelProperty("区域创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceareas;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 服务区域新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdServiceAreasSaveReqVO {
|
||||
|
||||
@Schema(description = "服务区域的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "26474")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "服务区域名称(如台江区、鼓楼区)", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "服务区域名称(如台江区、鼓楼区)不能为空")
|
||||
private String areaName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 超区规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdServiceOverAreaRulesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的商品ID", example = "20133")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)", example = "1")
|
||||
private Boolean ruleType;
|
||||
|
||||
@Schema(description = "超区费用(仅在rule_type为accept_with_fee时有效)")
|
||||
private BigDecimal fee;
|
||||
|
||||
@Schema(description = "规则创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "规则最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 超区规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceOverAreaRulesRespVO {
|
||||
|
||||
@Schema(description = "超区规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "32421")
|
||||
@ExcelProperty("超区规则的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20133")
|
||||
@ExcelProperty("关联的商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)")
|
||||
private Boolean ruleType;
|
||||
|
||||
@Schema(description = "超区费用(仅在rule_type为accept_with_fee时有效)")
|
||||
@ExcelProperty("超区费用(仅在rule_type为accept_with_fee时有效)")
|
||||
private BigDecimal fee;
|
||||
|
||||
@Schema(description = "规则创建时间")
|
||||
@ExcelProperty("规则创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "规则最后更新时间")
|
||||
@ExcelProperty("规则最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 超区规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdServiceOverAreaRulesSaveReqVO {
|
||||
|
||||
@Schema(description = "超区规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "32421")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20133")
|
||||
@NotNull(message = "关联的商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)不能为空")
|
||||
private Boolean ruleType;
|
||||
|
||||
@Schema(description = "超区费用(仅在rule_type为accept_with_fee时有效)")
|
||||
private BigDecimal fee;
|
||||
|
||||
@Schema(description = "规则创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "规则最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prodtags;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 商品和标签管理分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdTagsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user