trade:微调交易配置的注释

plp
YunaiV 3 years ago
parent 9e3564bd6a
commit eeb8873b1d

@ -1,241 +0,0 @@
--
CREATE TABLE trade_config
(
id BIGINT AUTO_INCREMENT COMMENT '' PRIMARY KEY,
brokerage_enabled BIT DEFAULT 1 NOT NULL COMMENT '',
brokerage_enabled_condition TINYINT DEFAULT 1 NOT NULL COMMENT '1- 2-',
brokerage_bind_mode TINYINT DEFAULT 1 NOT NULL COMMENT ': 1-广2-, 3-',
brokerage_poster_urls VARCHAR(2000) DEFAULT '' NULL COMMENT '',
brokerage_first_percent INT DEFAULT 0 NOT NULL COMMENT '',
brokerage_second_percent INT DEFAULT 0 NOT NULL COMMENT '',
brokerage_withdraw_min_price INT DEFAULT 0 NOT NULL COMMENT '',
brokerage_withdraw_fee_percent INT DEFAULT 0 NOT NULL COMMENT '',
brokerage_bank_names VARCHAR(200) DEFAULT '' NOT NULL COMMENT '=brokerage_bank_name',
brokerage_frozen_days INT DEFAULT 7 NOT NULL COMMENT '()',
brokerage_withdraw_types VARCHAR(32) DEFAULT '1,2,3,4' NOT NULL COMMENT '1-2-3-4-',
creator VARCHAR(64) DEFAULT '' NULL COMMENT '',
create_time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '',
updater VARCHAR(64) DEFAULT '' NULL COMMENT '',
update_time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '',
deleted BIT DEFAULT b'0' NOT NULL COMMENT '',
tenant_id BIGINT DEFAULT 0 NOT NULL COMMENT ''
) COMMENT '';
# alter table trade_config
# add brokerage_withdraw_fee_percent int default 0 not null comment '' after brokerage_withdraw_min_price;
# alter table trade_brokerage_user
# add level int not null default 1 comment '' after frozen_price;
# alter table trade_brokerage_user
# add path varchar(2000) null comment '' after level;
--
create table trade_brokerage_user
(
id bigint auto_increment comment '' primary key,
bind_user_id bigint null comment '广',
bind_user_time datetime null comment '广',
brokerage_enabled bit default 1 not null comment '广',
brokerage_time datetime null comment '',
price int default 0 not null comment '',
frozen_price int default 0 not null comment '',
creator varchar(64) default '' null comment '',
create_time datetime default CURRENT_TIMESTAMP not null comment '',
updater varchar(64) default '' null comment '',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '',
deleted bit default b'0' not null comment '',
tenant_id bigint default 0 not null comment ''
)
comment '';
create index idx_invite_user_id on trade_brokerage_user (bind_user_id) comment '广';
create index idx_agent on trade_brokerage_user (brokerage_enabled) comment '广';
create table trade_brokerage_record
(
id int auto_increment comment ''
primary key,
user_id bigint not null comment '',
biz_id varchar(64) default '' not null comment '',
biz_type tinyint default 0 not null comment '1-2-',
title varchar(64) default '' not null comment '',
price int default 0 not null comment '',
total_price int default 0 not null comment '',
description varchar(500) default '' not null comment '',
status tinyint default 0 not null comment '0-1-2-',
frozen_days int default 0 not null comment '',
unfreeze_time datetime null comment '',
source_user_level int not null comment '',
source_user_id bigint not null comment '',
creator varchar(64) default '' null comment '',
create_time datetime default CURRENT_TIMESTAMP not null comment '',
updater varchar(64) default '' null comment '',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '',
deleted bit default b'0' not null comment '',
tenant_id bigint default 0 not null comment ''
)
comment '';
create index idx_user_id on trade_brokerage_record (user_id) comment '';
create index idx_biz on trade_brokerage_record (biz_type, biz_id) comment '';
create index idx_status on trade_brokerage_record (status) comment '';
create table trade_brokerage_withdraw
(
id bigint auto_increment comment ''
primary key,
user_id bigint not null comment '',
price int default 0 not null comment '',
fee_price int default 0 not null comment '',
total_price int default 0 not null comment '',
type tinyint default 0 not null comment '1-2-3-4-',
name varchar(64) null comment '',
account_no varchar(64) null comment '',
bank_name varchar(100) null comment '',
bank_address varchar(200) null comment '',
account_qr_code_url varchar(512) null comment '',
status tinyint(2) default 0 not null comment '0-10- 20-11 - 21-',
audit_reason varchar(128) null comment '',
audit_time datetime null comment '',
remark varchar(500) null comment '',
creator varchar(64) default '' null comment '',
create_time datetime default CURRENT_TIMESTAMP not null comment '',
updater varchar(64) default '' null comment '',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '',
deleted bit default b'0' not null comment '',
tenant_id bigint default 0 not null comment ''
)
comment '';
create index idx_user_id on trade_brokerage_withdraw (user_id) comment '';
create index idx_audit_status on trade_brokerage_withdraw (status) comment '';
--
insert into system_dict_type(type, name)
values ('brokerage_enabled_condition', '');
insert into system_dict_data(dict_type, label, value, sort, remark)
values ('brokerage_enabled_condition', '', 1, 1, ''),
('brokerage_enabled_condition', '', 2, 2, '广');
insert into system_dict_type(type, name)
values ('brokerage_bind_mode', '');
insert into system_dict_data(dict_type, label, value, sort, remark)
values ('brokerage_bind_mode', '广', 1, 1, '广广'),
('brokerage_bind_mode', '', 2, 2, '广'),
('brokerage_bind_mode', '', 3, 3, '广广');
insert into system_dict_type(type, name)
values ('brokerage_withdraw_type', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_withdraw_type', '', 1, 1),
('brokerage_withdraw_type', '', 2, 2),
('brokerage_withdraw_type', '', 3, 3),
('brokerage_withdraw_type', '', 4, 4);
insert into system_dict_type(type, name)
values ('brokerage_record_biz_type', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_record_biz_type', '', 1, 1),
('brokerage_record_biz_type', '', 2, 2),
('brokerage_record_biz_type', '', 3, 3);
insert into system_dict_type(type, name)
values ('brokerage_record_status', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_record_status', '', 0, 0),
('brokerage_record_status', '', 1, 1),
('brokerage_record_status', '', 2, 2);
insert into system_dict_type(type, name)
values ('brokerage_withdraw_status', '');
insert into system_dict_data(dict_type, label, value, sort, color_type)
values ('brokerage_withdraw_status', '', 0, 0, ''),
('brokerage_withdraw_status', '', 10, 10, 'success'),
('brokerage_withdraw_status', '', 11, 11, 'success'),
('brokerage_withdraw_status', '', 20, 20, 'danger'),
('brokerage_withdraw_status', '', 21, 21, 'danger');
insert into system_dict_type(type, name)
values ('brokerage_bank_name', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_bank_name', '', 0, 0),
('brokerage_bank_name', '', 1, 1),
('brokerage_bank_name', '', 2, 2),
('brokerage_bank_name', '', 3, 3),
('brokerage_bank_name', '', 4, 4),
('brokerage_bank_name', '', 5, 5);
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 0, 2072, 'config', 'ep:setting', 'trade/config/index', 0, 'TradeConfig');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:config:query', 3, 1, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:config:save', 3, 2, @parentId, '', '', '', 0);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 1, 5, 2072, 'brokerage', 'fa-solid:project-diagram', '', 0, '');
-- ID
SELECT @brokerageMenuId := LAST_INSERT_ID();
--
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 0, @brokerageMenuId, 'brokerage-user', 'fa-solid:user-tie', 'trade/brokerage/user/index', 0,
'TradeBrokerageUser');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:brokerage-user:query', 3, 1, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('广', 'trade:brokerage-user:user-query', 3, 2, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('广', 'trade:brokerage-user:order-query', 3, 3, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('广', 'trade:brokerage-user:update-brokerage-enable', 3, 4, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('广', 'trade:brokerage-user:update-bind-user', 3, 5, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('广', 'trade:brokerage-user:clear-bind-user', 3, 6, @parentId, '', '', '', 0);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 1, @brokerageMenuId, 'brokerage-record', 'fa:money', 'trade/brokerage/record/index', 0,
'TradeBrokerageRecord');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:brokerage-record:query', 3, 1, @parentId, '', '', '', 0);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 2, @brokerageMenuId, 'brokerage-withdraw', 'fa:credit-card',
'trade/brokerage/withdraw/index', 0, 'TradeBrokerageWithdraw');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:brokerage-withdraw:query', 3, 1, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'trade:brokerage-withdraw:audit', 3, 2, @parentId, '', '', '', 0);
--
INSERT INTO `ruoyi-vue-pro`.system_notify_template (name, code, nickname, content, type, params, status)
VALUES
('', 'brokerage_withdraw_audit_approve', 'system', '{createTime}{price}', 2, '["createTime","price"]', 0),
('', 'brokerage_withdraw_audit_reject', 'system', '{createTime}{price}{reason}', 2, '["createTime","price","reason"]', 0);

@ -1,3 +0,0 @@
ALTER TABLE `ruoyi-vue-pro`.`trade_after_sale_log`
ADD COLUMN `before_status` int NOT NULL COMMENT '' AFTER `id`,
ADD COLUMN `after_status` int NOT NULL COMMENT '' AFTER `before_status`;

@ -1,6 +0,0 @@
ALTER TABLE trade_order ADD COLUMN use_point int NOT NULL DEFAULT 0 COMMENT '使' AFTER point_price;
ALTER TABLE trade_order ADD COLUMN refund_point int NOT NULL DEFAULT 0 COMMENT '退使' AFTER use_point;
ALTER TABLE trade_order ADD COLUMN give_point int NOT NULL DEFAULT 0 COMMENT '' AFTER refund_point;
ALTER TABLE trade_order_item ADD COLUMN use_point int NOT NULL DEFAULT 0 COMMENT '使' AFTER point_price;
ALTER TABLE trade_order_item ADD COLUMN give_point int NOT NULL DEFAULT 0 COMMENT '' AFTER use_point;

@ -18,15 +18,15 @@ public enum BrokerageBindModeEnum implements IntArrayValuable {
/**
* 广
*/
ANYTIME(1, "没有推广人"),
ANYTIME(1, "首次绑定"),
/**
* 广
*/
REGISTER(2, "新用户"),
REGISTER(2, "注册绑定"),
/**
*
*/
OVERRIDE(3, "扫码覆盖"),
OVERRIDE(3, "覆盖绑定"),
;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BrokerageBindModeEnum::getMode).toArray();

@ -80,7 +80,7 @@ public class TradeConfigBaseVO {
private Integer brokerageFrozenDays;
@Schema(description = "提现方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "[0, 1]")
@NotNull(message = "提现方式不能为空")
@NotEmpty(message = "提现方式不能为空")
@InEnum(value = BrokerageWithdrawTypeEnum.class, message = "提现方式必须是 {value}")
private List<Integer> brokerageWithdrawTypes;

Loading…
Cancel
Save