Compare commits
44 Commits
a8693e77cc
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
| 37d92b9dea | |||
| 6d85686270 | |||
| 0656cabe4a | |||
| d3e09b1cb9 | |||
|
|
72a8a318cf | ||
|
|
943aa3842a | ||
|
|
25da381c4e | ||
|
|
0e06403528 | ||
| 88a0a5616b | |||
| 9a086b86cd | |||
| f5746394fa | |||
|
|
d4e2bed039 | ||
| 16a9bcfbd8 | |||
| 9674374fad | |||
|
|
8be8964eff | ||
|
|
2af46a38b1 | ||
|
|
e2e9b18503 | ||
| e1105dae89 | |||
|
|
f5a9d171e0 | ||
| a3752fe7b9 | |||
|
|
5ef97c4da7 | ||
|
|
d82d91aec5 | ||
|
|
a123ea05e8 | ||
|
|
7a429deb99 | ||
|
|
8530f424c9 | ||
|
|
667dc58dc1 | ||
|
|
884075d3f2 | ||
|
|
5857fe4171 | ||
|
|
9436ea8942 | ||
|
|
bd58fd716a | ||
|
|
0a2d1a1f32 | ||
| 7fc365ce4c | |||
| 54a61ec5d5 | |||
| c3e3139100 | |||
| 2536dc9528 | |||
| 81db304e16 | |||
|
|
4582db201a | ||
|
|
90928754d9 | ||
|
|
8ba9609276 | ||
| 2bccdd7177 | |||
| eddfc26a45 | |||
|
|
b2839ed1d5 | ||
|
|
a1ebf5b065 | ||
|
|
df88450bab |
5
doc/sql/executed/blade_menu_userNotice.sql
Normal file
5
doc/sql/executed/blade_menu_userNotice.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2019338015981219841, 'userNotice', '用户通知', 'menu', '/common/commonUserNotice', 'iconfont iconicon_voipphone', 1, 1, 0, 1, '', '', 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/common/commonUserNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/common/commonUserNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/common/notice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/common/commonUserNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -3,7 +3,7 @@ CREATE TABLE user_notice
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY, -- 主键
|
||||
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
|
||||
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-系统通知 1-app通知 2-market通知
|
||||
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-全局通知 1-APP系统通知 2-Market系统通知 3-APP用户通知 4-Market用户通知
|
||||
module_type varchar(256) NULL, -- 业务模块
|
||||
has_read int4 DEFAULT 0 NOT NULL, -- 是否已读 0-否 1-是
|
||||
title VARCHAR(100) NULL, -- 标题
|
||||
@@ -21,7 +21,7 @@ CREATE TABLE user_notice
|
||||
COMMENT ON TABLE user_notice IS '用户通知';
|
||||
COMMENT ON COLUMN user_notice.id IS '主键';
|
||||
COMMENT ON COLUMN user_notice.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-系统通知 1-app通知 2-market通知';
|
||||
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-全局通知 1-APP系统通知 2-Market系统通知 3-APP用户通知 4-Market用户通知';
|
||||
COMMENT ON COLUMN user_notice.module_type IS '业务模块类型';
|
||||
COMMENT ON COLUMN user_notice.has_read IS '是否已读 0-否 1-是';
|
||||
COMMENT ON COLUMN user_notice.title IS '标题';
|
||||
@@ -77,3 +77,949 @@ VALUES (2020766604569534467, 2020766458167353346, 'notice_type', '3', 'APP用户
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted)
|
||||
VALUES (2020766604569534468, 2020766458167353346, 'notice_type', '3', 'Market用户通知', 2, '', 0, 1, 0);
|
||||
|
||||
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
comment on table benefit_point is '用户福利值表';
|
||||
comment on column benefit_point.id is '主键(用户id)';
|
||||
comment on column benefit_point.amount is '金额';
|
||||
comment on column benefit_point.version is '版本号';
|
||||
comment on column benefit_point.create_user is '创建人';
|
||||
comment on column benefit_point.create_dept is '创建部门';
|
||||
comment on column benefit_point.create_time is '创建时间';
|
||||
comment on column benefit_point.update_user is '修改人';
|
||||
comment on column benefit_point.update_time is '修改时间';
|
||||
comment on column benefit_point.status is '状态';
|
||||
comment on column benefit_point.is_deleted is '是否已删除';
|
||||
|
||||
DROP TABLE IF EXISTS benefit_point_log;
|
||||
create table benefit_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
fee decimal(14, 2) default 0,
|
||||
source_type varchar(256), -- 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_umbl_uid
|
||||
on benefit_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table benefit_point_log is '用户福利值流水表';
|
||||
comment on column benefit_point_log.id is '主键';
|
||||
comment on column benefit_point_log.user_id is '用户id';
|
||||
comment on column benefit_point_log.amount is '金额';
|
||||
comment on column benefit_point_log.last_amount is '上一笔金额';
|
||||
comment on column benefit_point_log.fee is '手续费';
|
||||
comment on column benefit_point_log.source_type is '来源类型';
|
||||
comment on column benefit_point_log.source_id is '来源id';
|
||||
comment on column benefit_point_log.source_detail is '来源详情';
|
||||
comment on column benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column benefit_point_log.statistical_date is '统计时间';
|
||||
comment on column benefit_point_log.remark is '备注';
|
||||
comment on column benefit_point_log.create_user is '创建人';
|
||||
comment on column benefit_point_log.create_dept is '创建部门';
|
||||
comment on column benefit_point_log.create_time is '创建时间';
|
||||
comment on column benefit_point_log.update_user is '修改人';
|
||||
comment on column benefit_point_log.update_time is '修改时间';
|
||||
comment on column benefit_point_log.status is '状态';
|
||||
comment on column benefit_point_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
--- 现金券 cash_coupon
|
||||
DROP TABLE IF EXISTS cash_coupon;
|
||||
create table cash_coupon
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table cash_coupon is '用户现金券表';
|
||||
comment on column cash_coupon.id is '主键(用户id)';
|
||||
comment on column cash_coupon.amount is '面额';
|
||||
comment on column cash_coupon.version is '版本号';
|
||||
comment on column cash_coupon.create_user is '创建人';
|
||||
comment on column cash_coupon.create_dept is '创建部门';
|
||||
comment on column cash_coupon.create_time is '创建时间';
|
||||
comment on column cash_coupon.update_user is '修改人';
|
||||
comment on column cash_coupon.update_time is '修改时间';
|
||||
comment on column cash_coupon.status is '状态';
|
||||
comment on column cash_coupon.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS cash_coupon_log;
|
||||
create table cash_coupon_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_umcl_uid
|
||||
on cash_coupon_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table cash_coupon_log is '用户现金券流水表';
|
||||
comment on column cash_coupon_log.id is '主键';
|
||||
comment on column cash_coupon_log.user_id is '用户id';
|
||||
comment on column cash_coupon_log.amount is '金额';
|
||||
comment on column cash_coupon_log.last_amount is '上一笔金额';
|
||||
comment on column cash_coupon_log.source_type is '来源类型';
|
||||
comment on column cash_coupon_log.source_id is '来源id';
|
||||
comment on column cash_coupon_log.source_detail is '来源详情';
|
||||
comment on column cash_coupon_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column cash_coupon_log.statistical_date is '统计时间';
|
||||
comment on column cash_coupon_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column cash_coupon_log.remark is '备注';
|
||||
comment on column cash_coupon_log.create_user is '创建人';
|
||||
comment on column cash_coupon_log.create_dept is '创建部门';
|
||||
comment on column cash_coupon_log.create_time is '创建时间';
|
||||
comment on column cash_coupon_log.update_user is '修改人';
|
||||
comment on column cash_coupon_log.update_time is '修改时间';
|
||||
comment on column cash_coupon_log.status is '状态';
|
||||
comment on column cash_coupon_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
--- 用户积分 user_point
|
||||
DROP TABLE IF EXISTS user_point;
|
||||
create table user_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table user_point is '用户商城积分表';
|
||||
comment on column user_point.id is '主键(用户id)';
|
||||
comment on column user_point.amount is '面额';
|
||||
comment on column user_point.version is '版本号';
|
||||
comment on column user_point.create_user is '创建人';
|
||||
comment on column user_point.create_dept is '创建部门';
|
||||
comment on column user_point.create_time is '创建时间';
|
||||
comment on column user_point.update_user is '修改人';
|
||||
comment on column user_point.update_time is '修改时间';
|
||||
comment on column user_point.is_deleted is '是否已删除';
|
||||
|
||||
DROP TABLE IF EXISTS user_point_log;
|
||||
create table user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_uapl_uid
|
||||
on user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table user_point_log is '用户商城积分流水表';
|
||||
comment on column user_point_log.id is '主键';
|
||||
comment on column user_point_log.user_id is '用户id';
|
||||
comment on column user_point_log.amount is '金额';
|
||||
comment on column user_point_log.last_amount is '上一笔金额';
|
||||
comment on column user_point_log.source_type is '来源类型';
|
||||
comment on column user_point_log.source_id is '来源id';
|
||||
comment on column user_point_log.source_detail is '来源详情';
|
||||
comment on column user_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_point_log.statistical_date is '统计时间';
|
||||
comment on column user_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_point_log.remark is '备注';
|
||||
comment on column user_point_log.create_user is '创建人';
|
||||
comment on column user_point_log.create_dept is '创建部门';
|
||||
comment on column user_point_log.create_time is '创建时间';
|
||||
comment on column user_point_log.update_user is '修改人';
|
||||
comment on column user_point_log.update_time is '修改时间';
|
||||
comment on column user_point_log.status is '状态';
|
||||
comment on column user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_commission;
|
||||
create table user_commission
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table user_commission is '用户佣金表';
|
||||
comment on column user_commission.id is '主键';
|
||||
comment on column user_commission.amount is '佣金金额';
|
||||
comment on column user_commission.version is '版本号';
|
||||
comment on column user_commission.create_user is '创建人';
|
||||
comment on column user_commission.create_dept is '创建部门';
|
||||
comment on column user_commission.create_time is '创建时间';
|
||||
comment on column user_commission.update_user is '修改人';
|
||||
comment on column user_commission.update_time is '修改时间';
|
||||
comment on column user_commission.status is '状态';
|
||||
comment on column user_commission.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_commission_log;
|
||||
create table user_commission_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
comment on table user_commission_log is '用户佣金流水表';
|
||||
comment on column user_commission_log.id is '主键';
|
||||
comment on column user_commission_log.user_id is '用户id';
|
||||
comment on column user_commission_log.amount is '金额';
|
||||
comment on column user_commission_log.last_amount is '上一笔金额';
|
||||
comment on column user_commission_log.source_type is '来源类型';
|
||||
comment on column user_commission_log.source_id is '来源id';
|
||||
comment on column user_commission_log.source_detail is '来源详情';
|
||||
comment on column user_commission_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_commission_log.statistical_date is '统计时间';
|
||||
comment on column user_commission_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_commission_log.remark is '备注';
|
||||
comment on column user_commission_log.create_user is '创建人';
|
||||
comment on column user_commission_log.create_dept is '创建部门';
|
||||
comment on column user_commission_log.create_time is '创建时间';
|
||||
comment on column user_commission_log.update_user is '修改人';
|
||||
comment on column user_commission_log.update_time is '修改时间';
|
||||
comment on column user_commission_log.status is '状态';
|
||||
comment on column user_commission_log.is_deleted is '是否已删除';
|
||||
|
||||
create index idx_ucl_uid
|
||||
on user_commission_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
|
||||
-- 佣金账户表
|
||||
DROP TABLE IF EXISTS market_commission_account;
|
||||
create table market_commission_account
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_name varchar(128), -- 账户名称
|
||||
account_code varchar(64), -- 账户代码
|
||||
account_type int4, -- 账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金
|
||||
amount decimal(14, 2) default 0, -- 账户总余额
|
||||
version int4 default 1,
|
||||
remark varchar(200),
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mca_code
|
||||
on market_commission_account (account_code);
|
||||
create index idx_mca_type
|
||||
on market_commission_account (account_type);
|
||||
|
||||
comment on table market_commission_account is '用户佣金账户表';
|
||||
comment on column market_commission_account.id is '主键';
|
||||
comment on column market_commission_account.account_name is '账户名称';
|
||||
comment on column market_commission_account.account_code is '账户代码';
|
||||
comment on column market_commission_account.account_type is '账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金';
|
||||
comment on column market_commission_account.amount is '账户总余额';
|
||||
comment on column market_commission_account.version is '版本号';
|
||||
comment on column market_commission_account.remark is '备注';
|
||||
comment on column market_commission_account.create_user is '创建人';
|
||||
comment on column market_commission_account.create_dept is '创建部门';
|
||||
comment on column market_commission_account.create_time is '创建时间';
|
||||
comment on column market_commission_account.update_user is '修改人';
|
||||
comment on column market_commission_account.update_time is '修改时间';
|
||||
comment on column market_commission_account.status is '状态';
|
||||
comment on column market_commission_account.is_deleted is '是否已删除';
|
||||
|
||||
---------------------------------------insert start
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0', '0.0000', 1, '商品成本账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04',
|
||||
1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201,
|
||||
'2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1, '分发直推人佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201,
|
||||
'2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3', '0.0000', 1, '运营账户', 1123598821738675201,
|
||||
1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4', '0.0000', 1, '分发广告补贴账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201,
|
||||
'2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER', '5', '0.0000', 1,
|
||||
'分发服务商佣金账户', 1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201,
|
||||
'2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6', '0.0000', 1, '分发极差代理佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201,
|
||||
'2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7', '0.0000', 1, '联创佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201,
|
||||
'2026-01-31 14:34:38.479', 1, 0);
|
||||
|
||||
---------------------------------------insert end
|
||||
|
||||
-- 25%商品成本佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_goods_cost_log;
|
||||
create table market_commission_goods_cost_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index inx_mcgcl_uid
|
||||
on market_commission_goods_cost_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index inx_mcgcl_aid
|
||||
on market_commission_goods_cost_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_goods_cost_log is '25%商品成本佣金流水表';
|
||||
comment on column market_commission_goods_cost_log.id is '主键';
|
||||
comment on column market_commission_goods_cost_log.account_id is '账户id';
|
||||
comment on column market_commission_goods_cost_log.user_id is '用户id';
|
||||
comment on column market_commission_goods_cost_log.amount is '金额';
|
||||
comment on column market_commission_goods_cost_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_goods_cost_log.source_type is '来源类型';
|
||||
comment on column market_commission_goods_cost_log.source_id is '来源id';
|
||||
comment on column market_commission_goods_cost_log.source_detail is '来源详情';
|
||||
comment on column market_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_goods_cost_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_goods_cost_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_goods_cost_log.remark is '备注';
|
||||
comment on column market_commission_goods_cost_log.create_user is '创建人';
|
||||
comment on column market_commission_goods_cost_log.create_dept is '创建部门';
|
||||
comment on column market_commission_goods_cost_log.create_time is '创建时间';
|
||||
comment on column market_commission_goods_cost_log.update_user is '修改人';
|
||||
comment on column market_commission_goods_cost_log.update_time is '修改时间';
|
||||
comment on column market_commission_goods_cost_log.status is '状态';
|
||||
comment on column market_commission_goods_cost_log.is_deleted is '是否已删除';
|
||||
|
||||
-- 30%购买人获取用户积分佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_user_point_log;
|
||||
create table market_commission_user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcupl_uid
|
||||
on market_commission_user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcupl_aid
|
||||
on market_commission_user_point_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_user_point_log is '30%购买人获取用户积分佣金流水表';
|
||||
comment on column market_commission_user_point_log.id is '主键';
|
||||
comment on column market_commission_user_point_log.account_id is '账户id';
|
||||
comment on column market_commission_user_point_log.user_id is '用户id';
|
||||
comment on column market_commission_user_point_log.amount is '变动金额';
|
||||
comment on column market_commission_user_point_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_user_point_log.source_type is '来源类型';
|
||||
comment on column market_commission_user_point_log.source_id is '来源id';
|
||||
comment on column market_commission_user_point_log.source_detail is '来源详情';
|
||||
comment on column market_commission_user_point_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_user_point_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_user_point_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_user_point_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_user_point_log.remark is '备注';
|
||||
comment on column market_commission_user_point_log.create_user is '创建人';
|
||||
comment on column market_commission_user_point_log.create_dept is '创建部门';
|
||||
comment on column market_commission_user_point_log.create_time is '创建时间';
|
||||
comment on column market_commission_user_point_log.update_user is '修改人';
|
||||
comment on column market_commission_user_point_log.update_time is '修改时间';
|
||||
comment on column market_commission_user_point_log.status is '状态';
|
||||
comment on column market_commission_user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
-- 10%直推人佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_direct_push_log;
|
||||
create table market_commission_direct_push_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcdpl_uid
|
||||
on market_commission_direct_push_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcdpl_aid
|
||||
on market_commission_direct_push_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_direct_push_log is '10%直推人佣金流水表';
|
||||
comment on column market_commission_direct_push_log.id is '主键';
|
||||
comment on column market_commission_direct_push_log.account_id is '账户id';
|
||||
comment on column market_commission_direct_push_log.user_id is '用户id';
|
||||
comment on column market_commission_direct_push_log.amount is '变动金额';
|
||||
comment on column market_commission_direct_push_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_direct_push_log.source_type is '来源类型';
|
||||
comment on column market_commission_direct_push_log.source_id is '来源id';
|
||||
comment on column market_commission_direct_push_log.source_detail is '来源详情';
|
||||
comment on column market_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_direct_push_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_direct_push_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_direct_push_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_direct_push_log.remark is '备注';
|
||||
comment on column market_commission_direct_push_log.create_user is '创建人';
|
||||
comment on column market_commission_direct_push_log.create_dept is '创建部门';
|
||||
comment on column market_commission_direct_push_log.create_time is '创建时间';
|
||||
comment on column market_commission_direct_push_log.update_user is '修改人';
|
||||
comment on column market_commission_direct_push_log.update_time is '修改时间';
|
||||
comment on column market_commission_direct_push_log.status is '状态';
|
||||
comment on column market_commission_direct_push_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
-- 5%运营佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_operation_log;
|
||||
create table market_commission_operation_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
cut_amount decimal(14, 2) default 0, -- 随机立减金额
|
||||
cut_detail text, -- 随机立减说明
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcol_aid
|
||||
on market_commission_operation_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_operation_log is '5%运营佣金流水表';
|
||||
comment on column market_commission_operation_log.id is '主键';
|
||||
comment on column market_commission_operation_log.account_id is '账户id';
|
||||
comment on column market_commission_operation_log.amount is '变动金额';
|
||||
comment on column market_commission_operation_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_operation_log.cut_amount is '随机立减金额';
|
||||
comment on column market_commission_operation_log.cut_detail is '随机立减说明';
|
||||
comment on column market_commission_operation_log.source_type is '来源类型';
|
||||
comment on column market_commission_operation_log.source_id is '来源id';
|
||||
comment on column market_commission_operation_log.source_detail is '来源详情';
|
||||
comment on column market_commission_operation_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_operation_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_operation_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_operation_log.remark is '备注';
|
||||
comment on column market_commission_operation_log.create_user is '创建人';
|
||||
comment on column market_commission_operation_log.create_dept is '创建部门';
|
||||
comment on column market_commission_operation_log.create_time is '创建时间';
|
||||
comment on column market_commission_operation_log.update_user is '修改人';
|
||||
comment on column market_commission_operation_log.update_time is '修改时间';
|
||||
comment on column market_commission_operation_log.status is '状态';
|
||||
comment on column market_commission_operation_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
-- 5%广告补贴佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_advertising_log;
|
||||
create table market_commission_advertising_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcal_aid
|
||||
on market_commission_advertising_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_advertising_log is '5%广告补贴佣金流水表';
|
||||
comment on column market_commission_advertising_log.id is '主键';
|
||||
comment on column market_commission_advertising_log.account_id is '账户id';
|
||||
comment on column market_commission_advertising_log.amount is '变动金额';
|
||||
comment on column market_commission_advertising_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_advertising_log.source_type is '来源类型 0-商城订单 1-发放广告佣金';
|
||||
comment on column market_commission_advertising_log.source_id is '来源id';
|
||||
comment on column market_commission_advertising_log.source_detail is '来源详情';
|
||||
comment on column market_commission_advertising_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_advertising_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_advertising_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_advertising_log.remark is '备注';
|
||||
comment on column market_commission_advertising_log.create_user is '创建人';
|
||||
comment on column market_commission_advertising_log.create_dept is '创建部门';
|
||||
comment on column market_commission_advertising_log.create_time is '创建时间';
|
||||
comment on column market_commission_advertising_log.update_user is '修改人';
|
||||
comment on column market_commission_advertising_log.update_time is '修改时间';
|
||||
comment on column market_commission_advertising_log.status is '状态';
|
||||
comment on column market_commission_advertising_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
-- 5%服务商佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_service_provider_log;
|
||||
create table market_commission_service_provider_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
address_id int8, -- 收货地址id
|
||||
region_id int4, -- 区域id
|
||||
service_provider_id int8, -- 服务商id
|
||||
service_type int4, -- 服务类型
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcspl_uid
|
||||
on market_commission_service_provider_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcspl_aid
|
||||
on market_commission_service_provider_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_service_provider_log is '5%服务商佣金流水表';
|
||||
comment on column market_commission_service_provider_log.id is '主键';
|
||||
comment on column market_commission_service_provider_log.account_id is '账户id';
|
||||
comment on column market_commission_service_provider_log.user_id is '用户id';
|
||||
comment on column market_commission_service_provider_log.amount is '变动金额';
|
||||
comment on column market_commission_service_provider_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_service_provider_log.source_type is '来源类型';
|
||||
comment on column market_commission_service_provider_log.source_id is '来源id';
|
||||
comment on column market_commission_service_provider_log.source_detail is '来源详情';
|
||||
comment on column market_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_service_provider_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_service_provider_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_service_provider_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_service_provider_log.address_id is '收货地址id';
|
||||
comment on column market_commission_service_provider_log.region_id is '省市区id';
|
||||
comment on column market_commission_service_provider_log.service_type is '服务类型';
|
||||
comment on column market_commission_service_provider_log.service_provider_id is '服务商ID';
|
||||
comment on column market_commission_service_provider_log.remark is '备注';
|
||||
comment on column market_commission_service_provider_log.create_user is '创建人';
|
||||
comment on column market_commission_service_provider_log.create_dept is '创建部门';
|
||||
comment on column market_commission_service_provider_log.create_time is '创建时间';
|
||||
comment on column market_commission_service_provider_log.update_user is '修改人';
|
||||
comment on column market_commission_service_provider_log.update_time is '修改时间';
|
||||
comment on column market_commission_service_provider_log.status is '状态';
|
||||
comment on column market_commission_service_provider_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
-- 15%极差代理佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_agency_log;
|
||||
create table market_commission_agency_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mc_agency_uid
|
||||
on market_commission_agency_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mc_agency_aid
|
||||
on market_commission_agency_log (is_complete, account_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_agency_log is '15%极差代理佣金流水表';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.account_id is '账户id';
|
||||
comment on column market_commission_agency_log.user_id is '用户id';
|
||||
comment on column market_commission_agency_log.amount is '变动金额';
|
||||
comment on column market_commission_agency_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_agency_log.source_type is '来源类型';
|
||||
comment on column market_commission_agency_log.source_id is '来源id';
|
||||
comment on column market_commission_agency_log.source_detail is '来源详情';
|
||||
comment on column market_commission_agency_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_agency_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_agency_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_agency_log.remark is '备注';
|
||||
comment on column market_commission_agency_log.create_user is '创建人';
|
||||
comment on column market_commission_agency_log.create_dept is '创建部门';
|
||||
comment on column market_commission_agency_log.create_time is '创建时间';
|
||||
comment on column market_commission_agency_log.update_user is '修改人';
|
||||
comment on column market_commission_agency_log.update_time is '修改时间';
|
||||
comment on column market_commission_agency_log.status is '状态';
|
||||
comment on column market_commission_agency_log.is_deleted is '是否已删除';
|
||||
|
||||
-- 5%联创佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_co_creator_log;
|
||||
create table market_commission_co_creator_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type varchar(256), -- 来源类型
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcccl_aid
|
||||
on market_commission_co_creator_log (is_complete, account_id, statistical_date, type, create_time DESC);
|
||||
|
||||
comment on table market_commission_co_creator_log is '5%联创佣金流水表';
|
||||
comment on column market_commission_co_creator_log.id is '主键';
|
||||
comment on column market_commission_co_creator_log.account_id is '账户id';
|
||||
comment on column market_commission_co_creator_log.amount is '变动金额';
|
||||
comment on column market_commission_co_creator_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_co_creator_log.source_type is '来源类型';
|
||||
comment on column market_commission_co_creator_log.source_id is '来源id';
|
||||
comment on column market_commission_co_creator_log.source_detail is '来源详情';
|
||||
comment on column market_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_co_creator_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_co_creator_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_co_creator_log.remark is '备注';
|
||||
comment on column market_commission_co_creator_log.create_user is '创建人';
|
||||
comment on column market_commission_co_creator_log.create_dept is '创建部门';
|
||||
comment on column market_commission_co_creator_log.create_time is '创建时间';
|
||||
comment on column market_commission_co_creator_log.update_user is '修改人';
|
||||
comment on column market_commission_co_creator_log.update_time is '修改时间';
|
||||
comment on column market_commission_co_creator_log.status is '状态';
|
||||
comment on column market_commission_co_creator_log.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_market_package_daily_settlement;
|
||||
create table user_market_package_daily_settlement --用户福利包每天结算记录
|
||||
(
|
||||
id int8 not null primary key,
|
||||
statistical_date timestamp(6),
|
||||
user_id int8,
|
||||
account int8,
|
||||
user_name varchar(128),
|
||||
package_id bigint[], --用户兑换福利包id(数组), 记录已发的id
|
||||
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index inx_umpds_uid
|
||||
on user_market_package_daily_settlement (statistical_date, is_complete, user_id);
|
||||
|
||||
COMMENT ON TABLE user_market_package_daily_settlement IS '用户福利包每天结算记录';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.id IS '主键';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.account IS '账户';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.user_name IS '用户名';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.package_id IS '用户兑换福利包id(数组), 记录已发的id';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.is_complete IS '是否完成 0-未完成 1-完成';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.remark IS '备注';
|
||||
comment on column user_market_package_daily_settlement.create_user is '创建人';
|
||||
comment on column user_market_package_daily_settlement.create_dept is '创建部门';
|
||||
comment on column user_market_package_daily_settlement.create_time is '创建时间';
|
||||
comment on column user_market_package_daily_settlement.update_user is '修改人';
|
||||
comment on column user_market_package_daily_settlement.update_time is '修改时间';
|
||||
comment on column user_market_package_daily_settlement.status is '状态';
|
||||
comment on column user_market_package_daily_settlement.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS common_lottery_prize;
|
||||
create table common_lottery_prize
|
||||
(
|
||||
id int8 not null primary key,
|
||||
prize_name varchar(100),--奖品名称
|
||||
prize_type int4, -- 类型:1=积分 2=优惠券 3=实物...
|
||||
prize_value VARCHAR(255), -- 奖品内容(如积分数量、券码等)
|
||||
probability DECIMAL(5, 4), -- 中奖概率(如 0.05 = 5%)
|
||||
stock int4, -- 总库存(-1 表示无限)
|
||||
daily_limit int4, -- 每日发放上限
|
||||
sort_order int4, -- 排序(用于前端展示顺序)
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1, -- 状态:0=下架 1=上架,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
COMMENT ON TABLE common_lottery_prize IS '奖品配置表';
|
||||
COMMENT ON COLUMN common_lottery_prize.id IS '主键';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_name IS '奖品名称';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_type IS '奖品类型';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_value IS '奖品内容';
|
||||
COMMENT ON COLUMN common_lottery_prize.probability IS '中奖概率(如 0.05 = 5%)';
|
||||
COMMENT ON COLUMN common_lottery_prize.stock IS '总库存(-1 表示无限)';
|
||||
COMMENT ON COLUMN common_lottery_prize.daily_limit IS '每日发放上限';
|
||||
COMMENT ON COLUMN common_lottery_prize.sort_order IS '排序(用于前端展示顺序)';
|
||||
COMMENT ON COLUMN common_lottery_prize.remark IS '备注';
|
||||
comment on column common_lottery_prize.create_user is '创建人';
|
||||
comment on column common_lottery_prize.create_dept is '创建部门';
|
||||
comment on column common_lottery_prize.create_time is '创建时间';
|
||||
comment on column common_lottery_prize.update_user is '修改人';
|
||||
comment on column common_lottery_prize.update_time is '修改时间';
|
||||
comment on column common_lottery_prize.status is '状态:0=下架 1=上架';
|
||||
comment on column common_lottery_prize.is_deleted is '是否已删除';
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2022583456075808770', '1123598815738675201', 'lotteryPrize', '奖品配置表', 'menu', '/common/lotteryPrize',
|
||||
NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2022583456075808771', '2022583456075808770', 'lotteryPrize_add', '新增', 'add', '/common/lotteryPrize/add',
|
||||
'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2022583456075808772', '2022583456075808770', 'lotteryPrize_edit', '修改', 'edit', '/common/lotteryPrize/edit',
|
||||
'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2022583456075808773', '2022583456075808770', 'lotteryPrize_delete', '删除', 'delete',
|
||||
'/api/blade-lotteryprize/lotteryPrize/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2022583456075808774', '2022583456075808770', 'lotteryPrize_view', '查看', 'view', '/common/lotteryPrize/view',
|
||||
'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS common_lottery_record;
|
||||
create table common_lottery_record
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8, -- 用户id
|
||||
prize_id int8, -- 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
points_used decimal(14, 2) default 0, -- 消耗积分
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 0, --0=未发放 1=已发放 2=发放失败
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
COMMENT ON TABLE common_lottery_record IS '抽奖记录表';
|
||||
COMMENT ON COLUMN common_lottery_record.id IS '主键';
|
||||
COMMENT ON COLUMN common_lottery_record.user_id IS '用户id';
|
||||
COMMENT ON COLUMN common_lottery_record.prize_id IS '中奖奖品ID(null 表示未中奖/谢谢参与)';
|
||||
COMMENT ON COLUMN common_lottery_record.points_used IS '消耗积分';
|
||||
COMMENT ON COLUMN common_lottery_record.remark IS '备注';
|
||||
comment on column common_lottery_record.create_user is '创建人';
|
||||
comment on column common_lottery_record.create_dept is '创建部门';
|
||||
comment on column common_lottery_record.create_time is '创建时间';
|
||||
comment on column common_lottery_record.update_user is '修改人';
|
||||
comment on column common_lottery_record.update_time is '修改时间';
|
||||
comment on column common_lottery_record.status is '0=未发放 1=已发放 2=发放失败';
|
||||
comment on column common_lottery_record.is_deleted is '是否已删除';
|
||||
create index idx_clr_duc on common_lottery_record (is_deleted, user_id, create_time desc);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285314, 2019338015981219841, 'userAddress', '用户收货地址', 'menu', '/common/commonUserAddress', null, 1, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285315, 2019341062694285314, 'userAddress_add', '新增', 'add', '/common/commonUserAddress/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285316, 2019341062694285314, 'userAddress_edit', '修改', 'edit', '/common/commonUserAddress/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285317, 2019341062694285314, 'userAddress_delete', '删除', 'delete', '/common/address/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285318, 2019341062694285314, 'userAddress_view', '查看', 'view', '/common/commonUserAddress/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -1,5 +0,0 @@
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2019338015981219841, 'userNotice', '用户通知', 'menu', '/common/commonUserNotice', 'iconfont iconicon_voipphone', 1, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/common/commonUserNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/common/commonUserNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/common/notice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/common/commonUserNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -1,491 +0,0 @@
|
||||
-- 佣金账户表
|
||||
DROP TABLE IF EXISTS market_commission_account;
|
||||
create table market_commission_account
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_name varchar(128), -- 账户名称
|
||||
account_code varchar(64), -- 账户代码
|
||||
account_type int4, -- 账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金
|
||||
amount decimal(14, 2) default 0, -- 账户总余额
|
||||
version int4 default 1,
|
||||
remark varchar(200),
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mca_code
|
||||
on market_commission_account (account_code);
|
||||
|
||||
comment on table market_commission_account is '用户佣金账户表';
|
||||
comment on column market_commission_account.id is '主键';
|
||||
comment on column market_commission_account.account_name is '账户名称';
|
||||
comment on column market_commission_account.account_code is '账户代码';
|
||||
comment on column market_commission_account.account_type is '账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金';
|
||||
comment on column market_commission_account.amount is '账户总余额';
|
||||
comment on column market_commission_account.version is '版本号';
|
||||
comment on column market_commission_account.remark is '备注';
|
||||
comment on column market_commission_account.create_user is '创建人';
|
||||
comment on column market_commission_account.create_dept is '创建部门';
|
||||
comment on column market_commission_account.create_time is '创建时间';
|
||||
comment on column market_commission_account.update_user is '修改人';
|
||||
comment on column market_commission_account.update_time is '修改时间';
|
||||
comment on column market_commission_account.status is '状态';
|
||||
comment on column market_commission_account.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_account
|
||||
owner to yicha1lu;
|
||||
---------------------------------------insert start
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0','0.0000', 1, '商品成本账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201, '2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1,'分发直推人佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201, '2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3','0.0000', 1, '运营账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4','0.0000', 1, '分发广告补贴账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201, '2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER','5', '0.0000', 1, '分发服务商佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201, '2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6','0.0000', 1, '分发极差代理佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201, '2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7','0.0000', 1, '联创佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201, '2026-01-31 14:34:38.479', 1, 0);
|
||||
|
||||
---------------------------------------insert end
|
||||
|
||||
-- 25%商品成本佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_goods_cost_log;
|
||||
create table market_commission_goods_cost_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index inx_mcgcl_uid
|
||||
on market_commission_goods_cost_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index inx_mcgcl_aid
|
||||
on market_commission_goods_cost_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_goods_cost_log is '25%商品成本佣金流水表';
|
||||
comment on column market_commission_goods_cost_log.id is '主键';
|
||||
comment on column market_commission_goods_cost_log.account_id is '账户id';
|
||||
comment on column market_commission_goods_cost_log.user_id is '用户id';
|
||||
comment on column market_commission_goods_cost_log.amount is '金额';
|
||||
comment on column market_commission_goods_cost_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_goods_cost_log.source_type is '来源模块 0-商城订单';
|
||||
comment on column market_commission_goods_cost_log.source_id is '来源id';
|
||||
comment on column market_commission_goods_cost_log.source_detail is '来源详情';
|
||||
comment on column market_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_goods_cost_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_goods_cost_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_goods_cost_log.remark is '备注';
|
||||
comment on column market_commission_goods_cost_log.create_user is '创建人';
|
||||
comment on column market_commission_goods_cost_log.create_dept is '创建部门';
|
||||
comment on column market_commission_goods_cost_log.create_time is '创建时间';
|
||||
comment on column market_commission_goods_cost_log.update_user is '修改人';
|
||||
comment on column market_commission_goods_cost_log.update_time is '修改时间';
|
||||
comment on column market_commission_goods_cost_log.status is '状态';
|
||||
comment on column market_commission_goods_cost_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_goods_cost_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 30%购买人获取用户积分佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_user_point_log;
|
||||
create table market_commission_user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放积分
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcupl_uid
|
||||
on market_commission_user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcupl_aid
|
||||
on market_commission_user_point_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_user_point_log is '30%购买人获取用户积分佣金流水表';
|
||||
comment on column market_commission_user_point_log.id is '主键';
|
||||
comment on column market_commission_user_point_log.account_id is '账户id';
|
||||
comment on column market_commission_user_point_log.user_id is '用户id';
|
||||
comment on column market_commission_user_point_log.amount is '变动金额';
|
||||
comment on column market_commission_user_point_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_user_point_log.source_type is '来源类型 0-商城订单 1-发放积分';
|
||||
comment on column market_commission_user_point_log.source_id is '来源id';
|
||||
comment on column market_commission_user_point_log.source_detail is '来源详情';
|
||||
comment on column market_commission_user_point_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_user_point_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_user_point_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_user_point_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_user_point_log.remark is '备注';
|
||||
comment on column market_commission_user_point_log.create_user is '创建人';
|
||||
comment on column market_commission_user_point_log.create_dept is '创建部门';
|
||||
comment on column market_commission_user_point_log.create_time is '创建时间';
|
||||
comment on column market_commission_user_point_log.update_user is '修改人';
|
||||
comment on column market_commission_user_point_log.update_time is '修改时间';
|
||||
comment on column market_commission_user_point_log.status is '状态';
|
||||
comment on column market_commission_user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 10%直推人佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_direct_push_log;
|
||||
create table market_commission_direct_push_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放直推佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcdpl_uid
|
||||
on market_commission_direct_push_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcdpl_aid
|
||||
on market_commission_direct_push_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_direct_push_log is '10%直推人佣金流水表';
|
||||
comment on column market_commission_direct_push_log.id is '主键';
|
||||
comment on column market_commission_direct_push_log.account_id is '账户id';
|
||||
comment on column market_commission_direct_push_log.user_id is '用户id';
|
||||
comment on column market_commission_direct_push_log.amount is '变动金额';
|
||||
comment on column market_commission_direct_push_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_direct_push_log.source_type is '来源类型 0-商城订单 1-发放直推佣金';
|
||||
comment on column market_commission_direct_push_log.source_id is '来源id';
|
||||
comment on column market_commission_direct_push_log.source_detail is '来源详情';
|
||||
comment on column market_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_direct_push_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_direct_push_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_direct_push_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_direct_push_log.remark is '备注';
|
||||
comment on column market_commission_direct_push_log.create_user is '创建人';
|
||||
comment on column market_commission_direct_push_log.create_dept is '创建部门';
|
||||
comment on column market_commission_direct_push_log.create_time is '创建时间';
|
||||
comment on column market_commission_direct_push_log.update_user is '修改人';
|
||||
comment on column market_commission_direct_push_log.update_time is '修改时间';
|
||||
comment on column market_commission_direct_push_log.status is '状态';
|
||||
comment on column market_commission_direct_push_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_direct_push_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%运营佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_operation_log;
|
||||
create table market_commission_operation_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
cut_amount decimal(14, 2) default 0, -- 随机立减金额
|
||||
cut_detail text, -- 随机立减说明
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放运营佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcol_aid
|
||||
on market_commission_operation_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_operation_log is '5%运营佣金流水表';
|
||||
comment on column market_commission_operation_log.id is '主键';
|
||||
comment on column market_commission_operation_log.account_id is '账户id';
|
||||
comment on column market_commission_operation_log.amount is '变动金额';
|
||||
comment on column market_commission_operation_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_operation_log.cut_amount is '随机立减金额';
|
||||
comment on column market_commission_operation_log.cut_detail is '随机立减说明';
|
||||
comment on column market_commission_operation_log.source_type is '来源类型 0-商城订单 1-发放运营佣金';
|
||||
comment on column market_commission_operation_log.source_id is '来源id';
|
||||
comment on column market_commission_operation_log.source_detail is '来源详情';
|
||||
comment on column market_commission_operation_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_operation_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_operation_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_operation_log.remark is '备注';
|
||||
comment on column market_commission_operation_log.create_user is '创建人';
|
||||
comment on column market_commission_operation_log.create_dept is '创建部门';
|
||||
comment on column market_commission_operation_log.create_time is '创建时间';
|
||||
comment on column market_commission_operation_log.update_user is '修改人';
|
||||
comment on column market_commission_operation_log.update_time is '修改时间';
|
||||
comment on column market_commission_operation_log.status is '状态';
|
||||
comment on column market_commission_operation_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_operation_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%广告补贴佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_advertising_log;
|
||||
create table market_commission_advertising_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放广告佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcal_aid
|
||||
on market_commission_advertising_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_advertising_log is '5%广告补贴佣金流水表';
|
||||
comment on column market_commission_advertising_log.id is '主键';
|
||||
comment on column market_commission_advertising_log.account_id is '账户id';
|
||||
comment on column market_commission_advertising_log.amount is '变动金额';
|
||||
comment on column market_commission_advertising_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_advertising_log.source_type is '来源类型 0-商城订单 1-发放广告佣金';
|
||||
comment on column market_commission_advertising_log.source_id is '来源id';
|
||||
comment on column market_commission_advertising_log.source_detail is '来源详情';
|
||||
comment on column market_commission_advertising_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_advertising_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_advertising_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_advertising_log.remark is '备注';
|
||||
comment on column market_commission_advertising_log.create_user is '创建人';
|
||||
comment on column market_commission_advertising_log.create_dept is '创建部门';
|
||||
comment on column market_commission_advertising_log.create_time is '创建时间';
|
||||
comment on column market_commission_advertising_log.update_user is '修改人';
|
||||
comment on column market_commission_advertising_log.update_time is '修改时间';
|
||||
comment on column market_commission_advertising_log.status is '状态';
|
||||
comment on column market_commission_advertising_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_advertising_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%服务商佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_service_provider_log;
|
||||
create table market_commission_service_provider_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放服务商佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
address_id int8, -- 收货地址id
|
||||
region_id int4, -- 区域id
|
||||
service_provider_id int8, -- 服务商id
|
||||
service_type int4, -- 服务类型
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcspl_uid
|
||||
on market_commission_service_provider_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcspl_aid
|
||||
on market_commission_service_provider_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_service_provider_log is '5%服务商佣金流水表';
|
||||
comment on column market_commission_service_provider_log.id is '主键';
|
||||
comment on column market_commission_service_provider_log.account_id is '账户id';
|
||||
comment on column market_commission_service_provider_log.user_id is '用户id';
|
||||
comment on column market_commission_service_provider_log.amount is '变动金额';
|
||||
comment on column market_commission_service_provider_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_service_provider_log.source_type is '来源类型 0-商城订单 1-发放服务商佣金';
|
||||
comment on column market_commission_service_provider_log.source_id is '来源id';
|
||||
comment on column market_commission_service_provider_log.source_detail is '来源详情';
|
||||
comment on column market_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_service_provider_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_service_provider_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_service_provider_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_service_provider_log.address_id is '收货地址id';
|
||||
comment on column market_commission_service_provider_log.region_id is '省市区id';
|
||||
comment on column market_commission_service_provider_log.service_type is '服务类型';
|
||||
comment on column market_commission_service_provider_log.service_provider_id is '服务商ID';
|
||||
comment on column market_commission_service_provider_log.remark is '备注';
|
||||
comment on column market_commission_service_provider_log.create_user is '创建人';
|
||||
comment on column market_commission_service_provider_log.create_dept is '创建部门';
|
||||
comment on column market_commission_service_provider_log.create_time is '创建时间';
|
||||
comment on column market_commission_service_provider_log.update_user is '修改人';
|
||||
comment on column market_commission_service_provider_log.update_time is '修改时间';
|
||||
comment on column market_commission_service_provider_log.status is '状态';
|
||||
comment on column market_commission_service_provider_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_service_provider_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 15%极差代理佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_agency_log;
|
||||
create table market_commission_agency_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放极差代理佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mc_agency_uid
|
||||
on market_commission_agency_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mc_agency_aid
|
||||
on market_commission_agency_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_agency_log is '15%极差代理佣金流水表';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.account_id is '账户id';
|
||||
comment on column market_commission_agency_log.user_id is '用户id';
|
||||
comment on column market_commission_agency_log.amount is '变动金额';
|
||||
comment on column market_commission_agency_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_agency_log.source_type is '来源类型 0-商城订单 1-发放极差代理佣金';
|
||||
comment on column market_commission_agency_log.source_id is '来源id';
|
||||
comment on column market_commission_agency_log.source_detail is '来源详情';
|
||||
comment on column market_commission_agency_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_agency_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_agency_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_agency_log.remark is '备注';
|
||||
comment on column market_commission_agency_log.create_user is '创建人';
|
||||
comment on column market_commission_agency_log.create_dept is '创建部门';
|
||||
comment on column market_commission_agency_log.create_time is '创建时间';
|
||||
comment on column market_commission_agency_log.update_user is '修改人';
|
||||
comment on column market_commission_agency_log.update_time is '修改时间';
|
||||
comment on column market_commission_agency_log.status is '状态';
|
||||
comment on column market_commission_agency_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_agency_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%联创佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_co_creator_log;
|
||||
create table market_commission_co_creator_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放联创佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcccl_aid
|
||||
on market_commission_co_creator_log (is_complete, account_id, statistical_date, type , create_time DESC);
|
||||
|
||||
comment on table market_commission_co_creator_log is '5%联创佣金流水表';
|
||||
comment on column market_commission_co_creator_log.id is '主键';
|
||||
comment on column market_commission_co_creator_log.account_id is '账户id';
|
||||
comment on column market_commission_co_creator_log.amount is '变动金额';
|
||||
comment on column market_commission_co_creator_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_co_creator_log.source_type is '来源类型 0-商城订单 1-发放联创佣金';
|
||||
comment on column market_commission_co_creator_log.source_id is '来源id';
|
||||
comment on column market_commission_co_creator_log.source_detail is '来源详情';
|
||||
comment on column market_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_co_creator_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_co_creator_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_co_creator_log.remark is '备注';
|
||||
comment on column market_commission_co_creator_log.create_user is '创建人';
|
||||
comment on column market_commission_co_creator_log.create_dept is '创建部门';
|
||||
comment on column market_commission_co_creator_log.create_time is '创建时间';
|
||||
comment on column market_commission_co_creator_log.update_user is '修改人';
|
||||
comment on column market_commission_co_creator_log.update_time is '修改时间';
|
||||
comment on column market_commission_co_creator_log.status is '状态';
|
||||
comment on column market_commission_co_creator_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_co_creator_log
|
||||
owner to yicha1lu;
|
||||
@@ -1,244 +0,0 @@
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table benefit_point is '用户福利值表';
|
||||
comment on column benefit_point.id is '主键(用户id)';
|
||||
comment on column benefit_point.amount is '金额';
|
||||
comment on column benefit_point.version is '版本号';
|
||||
comment on column benefit_point.create_user is '创建人';
|
||||
comment on column benefit_point.create_dept is '创建部门';
|
||||
comment on column benefit_point.create_time is '创建时间';
|
||||
comment on column benefit_point.update_user is '修改人';
|
||||
comment on column benefit_point.update_time is '修改时间';
|
||||
comment on column benefit_point.status is '状态';
|
||||
comment on column benefit_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table benefit_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS benefit_point_log;
|
||||
create table benefit_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
fee decimal(14, 2) default 0,
|
||||
source_type int4, -- 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_umbl_uid
|
||||
on benefit_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table benefit_point_log is '用户福利值流水表';
|
||||
comment on column benefit_point_log.id is '主键';
|
||||
comment on column benefit_point_log.user_id is '用户id';
|
||||
comment on column benefit_point_log.amount is '金额';
|
||||
comment on column benefit_point_log.last_amount is '上一笔金额';
|
||||
comment on column benefit_point_log.fee is '手续费';
|
||||
comment on column benefit_point_log.source_type is '来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易';
|
||||
comment on column benefit_point_log.source_id is '来源id';
|
||||
comment on column benefit_point_log.source_detail is '来源详情';
|
||||
comment on column benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column benefit_point_log.statistical_date is '统计时间';
|
||||
comment on column benefit_point_log.remark is '备注';
|
||||
comment on column benefit_point_log.create_user is '创建人';
|
||||
comment on column benefit_point_log.create_dept is '创建部门';
|
||||
comment on column benefit_point_log.create_time is '创建时间';
|
||||
comment on column benefit_point_log.update_user is '修改人';
|
||||
comment on column benefit_point_log.update_time is '修改时间';
|
||||
comment on column benefit_point_log.status is '状态';
|
||||
comment on column benefit_point_log.is_deleted is '是否已删除';
|
||||
alter table benefit_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 现金券 cash_coupon
|
||||
DROP TABLE IF EXISTS cash_coupon;
|
||||
create table cash_coupon
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table cash_coupon is '用户现金券表';
|
||||
comment on column cash_coupon.id is '主键(用户id)';
|
||||
comment on column cash_coupon.amount is '面额';
|
||||
comment on column cash_coupon.version is '版本号';
|
||||
comment on column cash_coupon.create_user is '创建人';
|
||||
comment on column cash_coupon.create_dept is '创建部门';
|
||||
comment on column cash_coupon.create_time is '创建时间';
|
||||
comment on column cash_coupon.update_user is '修改人';
|
||||
comment on column cash_coupon.update_time is '修改时间';
|
||||
comment on column cash_coupon.status is '状态';
|
||||
comment on column cash_coupon.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS cash_coupon_log;
|
||||
create table cash_coupon_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城抽奖 1-福利包兑换
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_umcl_uid
|
||||
on cash_coupon_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table cash_coupon_log is '用户现金券流水表';
|
||||
comment on column cash_coupon_log.id is '主键';
|
||||
comment on column cash_coupon_log.user_id is '用户id';
|
||||
comment on column cash_coupon_log.amount is '金额';
|
||||
comment on column cash_coupon_log.last_amount is '上一笔金额';
|
||||
comment on column cash_coupon_log.source_type is '来源类型 0-商城抽奖 1-福利包兑换';
|
||||
comment on column cash_coupon_log.source_id is '来源id';
|
||||
comment on column cash_coupon_log.source_detail is '来源详情';
|
||||
comment on column cash_coupon_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column cash_coupon_log.statistical_date is '统计时间';
|
||||
comment on column cash_coupon_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column cash_coupon_log.remark is '备注';
|
||||
comment on column cash_coupon_log.create_user is '创建人';
|
||||
comment on column cash_coupon_log.create_dept is '创建部门';
|
||||
comment on column cash_coupon_log.create_time is '创建时间';
|
||||
comment on column cash_coupon_log.update_user is '修改人';
|
||||
comment on column cash_coupon_log.update_time is '修改时间';
|
||||
comment on column cash_coupon_log.status is '状态';
|
||||
comment on column cash_coupon_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 用户积分 user_point
|
||||
DROP TABLE IF EXISTS user_point;
|
||||
create table user_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table user_point is '用户商城积分表';
|
||||
comment on column user_point.id is '主键(用户id)';
|
||||
comment on column user_point.amount is '面额';
|
||||
comment on column user_point.version is '版本号';
|
||||
comment on column user_point.create_user is '创建人';
|
||||
comment on column user_point.create_dept is '创建部门';
|
||||
comment on column user_point.create_time is '创建时间';
|
||||
comment on column user_point.update_user is '修改人';
|
||||
comment on column user_point.update_time is '修改时间';
|
||||
comment on column user_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS user_point_log;
|
||||
create table user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-商城抽奖
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_uapl_uid
|
||||
on user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table user_point_log is '用户商城积分流水表';
|
||||
comment on column user_point_log.id is '主键';
|
||||
comment on column user_point_log.user_id is '用户id';
|
||||
comment on column user_point_log.amount is '金额';
|
||||
comment on column user_point_log.last_amount is '上一笔金额';
|
||||
comment on column user_point_log.source_type is '0-商城订单 1-商城抽奖';
|
||||
comment on column user_point_log.source_id is '来源id';
|
||||
comment on column user_point_log.source_detail is '来源详情';
|
||||
comment on column user_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_point_log.statistical_date is '统计时间';
|
||||
comment on column user_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_point_log.remark is '备注';
|
||||
comment on column user_point_log.create_user is '创建人';
|
||||
comment on column user_point_log.create_dept is '创建部门';
|
||||
comment on column user_point_log.create_time is '创建时间';
|
||||
comment on column user_point_log.update_user is '修改人';
|
||||
comment on column user_point_log.update_time is '修改时间';
|
||||
comment on column user_point_log.status is '状态';
|
||||
comment on column user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
@@ -28,6 +28,7 @@ package org.springblade;
|
||||
import org.springblade.common.constant.CommonConstant;
|
||||
import org.springblade.core.launch.BladeApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||
|
||||
@@ -39,6 +40,7 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
|
||||
@EnableScheduling
|
||||
@EnableRedisHttpSession
|
||||
@SpringBootApplication
|
||||
@EnableRetry //重试机制
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
|
||||
PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor();
|
||||
paginationInterceptor.setDbType(DbType.POSTGRE_SQL);
|
||||
// 可选:设置最大单页限制(防止恶意请求)
|
||||
paginationInterceptor.setMaxLimit(1000L);
|
||||
interceptor.addInnerInterceptor(paginationInterceptor);
|
||||
|
||||
// 2. 乐观锁插件
|
||||
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.springblade.common.exception;
|
||||
|
||||
public class OptimisticLockException extends RuntimeException{
|
||||
public OptimisticLockException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package org.springblade.job.processor;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketPackageDailySettlementEntity;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||
import tech.powerjob.worker.log.OmsLogger;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 福利包每日发放福利积分到用户
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
||||
|
||||
private final IMarketBenefitPackageService userBenefitPackageService;
|
||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||
private final IMarketBenefitPointService benefitPointService;
|
||||
private final IMarketBenefitPointLogService benefitPointLogService;
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) {
|
||||
|
||||
OmsLogger omsLogger = context.getOmsLogger();
|
||||
try {
|
||||
omsLogger.info("开始执行定时任务-发放福利积分");
|
||||
benefitPackageSendPoint();
|
||||
omsLogger.info("结束执行定时任务-发放福利积分");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("任务执行异常", e);
|
||||
omsLogger.error("任务执行异常: {}", e.getMessage());
|
||||
return new ProcessResult(false, "系统异常: " + e.getMessage());
|
||||
}
|
||||
|
||||
// 返回结果,该结果会被持久化到数据库,在前端页面直接查看,极为方便
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
|
||||
public void benefitPackageSendPoint() {
|
||||
// 1. 查询待处理的结算任务
|
||||
List<MarketPackageDailySettlementEntity> settlementEntityList = userPackageDailySettlementService.list(
|
||||
Wrappers.lambdaQuery(MarketPackageDailySettlementEntity.class)
|
||||
.eq(MarketPackageDailySettlementEntity::getStatisticalDate, DateUtil.getToday())
|
||||
.eq(MarketPackageDailySettlementEntity::getIsComplete, 0)
|
||||
);
|
||||
|
||||
if (settlementEntityList.isEmpty()) {
|
||||
return; // 提前退出,避免无谓查询
|
||||
}
|
||||
|
||||
// 2. 查询所有状态为“进行中”的福利包
|
||||
List<MarketBenefitPackageEntity> userBenefitPackageList = userBenefitPackageService.list(
|
||||
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||
);
|
||||
|
||||
// 3. 按用户分组(注意:这里创建的是新 List,但后续仍需包装)
|
||||
Map<Long, List<MarketBenefitPackageEntity>> benefitPackageMap = userBenefitPackageList.stream()
|
||||
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||
|
||||
// 4. 处理每个结算任务
|
||||
for (MarketPackageDailySettlementEntity settlementEntity : settlementEntityList) {
|
||||
Long userId = settlementEntity.getUserId();
|
||||
List<MarketBenefitPackageEntity> originalList = benefitPackageMap.get(userId);
|
||||
|
||||
if (originalList.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 关键:创建可变副本,避免不可变列表问题
|
||||
List<MarketBenefitPackageEntity> benefitPackageList = new ArrayList<>(originalList);
|
||||
|
||||
// 获取用户积分账户
|
||||
MarketBenefitPointEntity benefitPoint = benefitPointService.getById(userId);
|
||||
if (benefitPoint == null) {
|
||||
log.warn("用户积分账户不存在,userId: {}", userId);
|
||||
continue;
|
||||
}
|
||||
|
||||
BigDecimal lastAmount = benefitPoint.getAmount();
|
||||
List<MarketBenefitPointLogEntity> pointLogList = new ArrayList<>();
|
||||
|
||||
// 处理每个福利包
|
||||
for (MarketBenefitPackageEntity pkg : benefitPackageList) {
|
||||
BigDecimal amountOut = pkg.getAmountOut();
|
||||
BigDecimal amountTotal = pkg.getAmountTotal();
|
||||
BigDecimal amountDay = pkg.getAmountDay();
|
||||
|
||||
// 修正:防止超额发放
|
||||
BigDecimal newAmountOut = amountOut.add(amountDay);
|
||||
if (newAmountOut.compareTo(amountTotal) > 0) {
|
||||
amountDay = amountTotal.subtract(amountOut); // 只发剩余部分
|
||||
newAmountOut = amountTotal;
|
||||
pkg.setStatus(3); // 完成
|
||||
}
|
||||
|
||||
// 处理天数
|
||||
int outDay = pkg.getOutDay() + 1;
|
||||
if (outDay >= pkg.getDayTotal()) {
|
||||
outDay = pkg.getDayTotal();
|
||||
pkg.setStatus(3); // 完成
|
||||
}
|
||||
|
||||
// 记录日志
|
||||
pointLogList.add(new MarketBenefitPointLogEntity()
|
||||
.setUserId(userId)
|
||||
.setAmount(amountDay)
|
||||
.setLastAmount(lastAmount)
|
||||
.setFee(BigDecimal.ZERO)
|
||||
.setSourceType(MarketBusinessModule.BENEFIT_PACKAGE.getCode())
|
||||
.setSourceId(pkg.getId())
|
||||
.setSourceDetail(JSONObject.toJSONString(pkg))
|
||||
.setIsComplete(0)
|
||||
.setStatisticalDate(new Date())
|
||||
.setRemark(pkg.getPackageName() + "每日福利积分产出")
|
||||
);
|
||||
|
||||
lastAmount = lastAmount.add(amountDay);
|
||||
|
||||
// 更新福利包状态
|
||||
pkg.setAmountOut(newAmountOut);
|
||||
pkg.setOutDay(outDay);
|
||||
}
|
||||
|
||||
// 批量保存日志
|
||||
if (!pointLogList.isEmpty()) {
|
||||
if (!benefitPointLogService.saveBatch(pointLogList)) {
|
||||
log.error("福利积分记录失败-批量保存日志, userId: " + userId);
|
||||
throw new RuntimeException("福利积分记录失败, userId: " + userId);
|
||||
}
|
||||
|
||||
// 标记日志为完成
|
||||
pointLogList.forEach(log -> log.setIsComplete(1));
|
||||
benefitPointLogService.updateBatchById(pointLogList);
|
||||
|
||||
// 累加总发放积分
|
||||
BigDecimal sendPoint = pointLogList.stream()
|
||||
.map(MarketBenefitPointLogEntity::getAmount)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 更新用户积分总额
|
||||
benefitPoint.setAmount(benefitPoint.getAmount().add(sendPoint));
|
||||
if (!benefitPointService.updateById(benefitPoint)) {
|
||||
log.error("更新用户积分失败-更新福利积分, userId: " + userId);
|
||||
throw new RuntimeException("更新用户积分失败, userId: " + userId);
|
||||
}
|
||||
|
||||
// 更新福利包(使用可变列表)
|
||||
if (!userBenefitPackageService.updateBatchById(benefitPackageList)) {
|
||||
log.error("更新福利包失败-更新福利包, userId: " + userId);
|
||||
throw new RuntimeException("更新福利包失败, userId: " + userId);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新结算任务
|
||||
List<Long> packageIds = benefitPackageList.stream()
|
||||
.map(MarketBenefitPackageEntity::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
settlementEntity.setIsComplete(1);
|
||||
settlementEntity.setPackageId(packageIds);
|
||||
userPackageDailySettlementService.updateById(settlementEntity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package org.springblade.job.processor;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketPackageDailySettlementEntity;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||
import tech.powerjob.worker.log.OmsLogger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 福利包每日发放结算记录
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class InitBenefitPackageSettlementProcessor implements BasicProcessor {
|
||||
|
||||
private final IMarketBenefitPackageService userBenefitPackageService;
|
||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) {
|
||||
|
||||
OmsLogger omsLogger = context.getOmsLogger(); // PowerJob 内置日志,控制台可查
|
||||
|
||||
try {
|
||||
omsLogger.info("开始执行定时任务-初始化用户福利包每天结算记录...");
|
||||
initUserPackageDailySettlement();
|
||||
omsLogger.info("结束执行定时任务-初始化用户福利包每天结算记录");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("任务执行异常", e);
|
||||
omsLogger.error("任务执行异常: {}", e.getMessage());
|
||||
return new ProcessResult(false, "系统异常: " + e.getMessage());
|
||||
}
|
||||
|
||||
// 返回结果,该结果会被持久化到数据库,在前端页面直接查看,极为方便
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
public void initUserPackageDailySettlement() {
|
||||
|
||||
//用户福利包列表
|
||||
List<MarketBenefitPackageEntity> benefitPackageList = userBenefitPackageService.list(
|
||||
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||
);
|
||||
|
||||
//用户福利包列表-map
|
||||
Map<Long, List<MarketBenefitPackageEntity>> benefitPackageMap = benefitPackageList.stream().collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||
|
||||
//用户当天发放福利积分记录列表
|
||||
List<MarketPackageDailySettlementEntity> settlementEntityList = userPackageDailySettlementService.list(
|
||||
Wrappers.lambdaQuery(MarketPackageDailySettlementEntity.class)
|
||||
.eq(MarketPackageDailySettlementEntity::getStatisticalDate, DateUtil.getToday())
|
||||
);
|
||||
//用户当天发放福利积分记录列表-map
|
||||
Map<Long, List<MarketPackageDailySettlementEntity>> settlementEntityMap = settlementEntityList.stream().collect(Collectors.groupingBy(MarketPackageDailySettlementEntity::getUserId));
|
||||
|
||||
|
||||
List<MarketPackageDailySettlementEntity> userPackageSettlementList = new ArrayList<>();
|
||||
|
||||
benefitPackageMap.forEach((userId, packageList) -> {
|
||||
|
||||
if (!settlementEntityMap.containsKey(userId)){
|
||||
userPackageSettlementList.add(
|
||||
new MarketPackageDailySettlementEntity()
|
||||
.setUserId(userId)
|
||||
.setUserName(packageList.get(0).getUserName())
|
||||
.setAccount(packageList.get(0).getPhone())
|
||||
.setStatisticalDate(DateUtil.getToday())
|
||||
.setPackageId(List.of())
|
||||
.setIsComplete(0)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
userPackageDailySettlementService.saveBatch(userPackageSettlementList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package org.springblade.job.processor;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionEntity;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
||||
import org.springblade.modules.market.service.IMarketCashCouponService;
|
||||
import org.springblade.modules.market.service.IMarketInfoService;
|
||||
import org.springblade.modules.market.service.IMarketUserCommissionService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class InitUserAssetsProcessor implements BasicProcessor {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
private final IMarketInfoService marketInfoService;
|
||||
|
||||
private final ICommonUserPointService userPointService;
|
||||
|
||||
private final IMarketCashCouponService cashCouponService;
|
||||
|
||||
private final IMarketBenefitPointService benefitPointService;
|
||||
|
||||
private final IMarketUserCommissionService commissionService;
|
||||
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||
List<User> userList = userService.list(Wrappers.<User>lambdaQuery().eq(User::getUserType, 2).eq(User::getIsDeleted, 0));
|
||||
userList.forEach(user -> {
|
||||
MarketInfoEntity marketInfo = marketInfoService.getById(user.getId());
|
||||
if (marketInfo == null) {
|
||||
marketInfo = new MarketInfoEntity();
|
||||
marketInfo.setId(user.getId());
|
||||
marketInfoService.save(marketInfo);
|
||||
}
|
||||
CommonUserPointEntity userPoint = userPointService.getById(user.getId());
|
||||
if (userPoint == null) {
|
||||
userPoint = new CommonUserPointEntity();
|
||||
userPoint.setId(user.getId());
|
||||
userPointService.save(userPoint);
|
||||
}
|
||||
MarketCashCouponEntity cashCoupon = cashCouponService.getById(user.getId());
|
||||
if (cashCoupon == null) {
|
||||
cashCoupon = new MarketCashCouponEntity();
|
||||
cashCoupon.setId(user.getId());
|
||||
cashCouponService.save(cashCoupon);
|
||||
}
|
||||
MarketBenefitPointEntity benefitPoint = benefitPointService.getById(user.getId());
|
||||
if (benefitPoint == null) {
|
||||
benefitPoint = new MarketBenefitPointEntity();
|
||||
benefitPoint.setId(user.getId());
|
||||
benefitPointService.save(benefitPoint);
|
||||
}
|
||||
MarketUserCommissionEntity commission = commissionService.getById(user.getId());
|
||||
if (commission == null) {
|
||||
commission = new MarketUserCommissionEntity();
|
||||
commission.setId(user.getId());
|
||||
commissionService.save(commission);
|
||||
}
|
||||
});
|
||||
return new ProcessResult(true, "result is success");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -43,8 +43,8 @@ public class APPCommonController {
|
||||
@GetMapping("/region-list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "获取省市区列表")
|
||||
public R<List<AppCommonRegionsInfoVO>> findRegionList(@RequestParam @Min(value = 0 , message = "父级id不能小于0") Long pid ,
|
||||
@RequestParam @Min(value = 1 , message = "只能选到省") @Max(value = 4 , message = "只能选到街道") Integer level) {
|
||||
public R<List<AppCommonRegionsInfoVO>> findRegionList(@RequestParam @Min(value = 0 , message = "请选择有效地区") Long pid ,
|
||||
@RequestParam @Min(value = 1 , message = "请选择省、市、区或街道") @Max(value = 4 , message = "请选择省、市、区或街道") Integer level) {
|
||||
return R.data(commonRegionsInfoService.findRegionList(pid , level));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,19 +10,15 @@ import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.request.CreateOrderRequest;
|
||||
import org.springblade.modules.api.request.PaymentRequest;
|
||||
import org.springblade.modules.api.request.*;
|
||||
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeDetailApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||
import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.service.*;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Hidden
|
||||
@@ -38,6 +34,14 @@ public class APPUserController {
|
||||
|
||||
private final ICommonUserNoticeService userNoticeService;
|
||||
|
||||
private final ICommonUserAddressService addressService;
|
||||
|
||||
private final ICommonUserPointService pointService;
|
||||
|
||||
private final ICommonLotteryRecordService lotteryRecordService;
|
||||
|
||||
private final ICommonLotteryPrizeService lotteryPrizeService;
|
||||
|
||||
|
||||
/**
|
||||
* 是否修改过密码
|
||||
@@ -143,4 +147,71 @@ public class APPUserController {
|
||||
return R.data(userNoticeService.appUnreadNoticeNum());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user-address")
|
||||
@ApiOperationSupport(order = 11)
|
||||
@Operation(summary = "用户收货地址", description = "传入userAddressVO")
|
||||
public R<List<CommonUserAddressApiVO>> addressList(Query query) {
|
||||
return R.data(addressService.selectAddressList(Condition.getPage(query), new CommonUserAddressApiVO()));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/submit-address")
|
||||
@ApiOperationSupport(order = 12)
|
||||
@Operation(summary = "提交用户收货地址", description = "传入AddressSubmitRequest")
|
||||
public R<Boolean> submitAddress(@Valid @RequestBody AddressSubmitRequest request) {
|
||||
return R.status(addressService.submitAddress(request));
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/delete-address")
|
||||
@ApiOperationSupport(order = 13)
|
||||
@Operation(summary = "删除用户收货地址", description = "传入id")
|
||||
public R<Boolean> removeAddress(@Valid @RequestBody AddressRemoveRequest request) {
|
||||
return R.status(addressService.removeAddress(request.getIds()));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user-points")
|
||||
@ApiOperationSupport(order = 14)
|
||||
@Operation(summary = "用户积分查询")
|
||||
public R<BigDecimal> userPoints() {
|
||||
return R.data(pointService.queryPoint());
|
||||
}
|
||||
|
||||
@GetMapping("/lottery-prizes")
|
||||
@ApiOperationSupport(order = 15)
|
||||
@Operation(summary = "奖品列表")
|
||||
public R<List<CommonLotteryPrizeApiVO>> lotteryPrizes() {
|
||||
return R.data(lotteryPrizeService.staticList());
|
||||
}
|
||||
|
||||
@GetMapping("/lottery-records")
|
||||
@ApiOperationSupport(order = 16)
|
||||
@Operation(summary = "抽奖记录")
|
||||
public R<IPage<CommonLotteryRecordApiVO>> lotteryRecords(Query query) {
|
||||
return R.data(lotteryRecordService.selectLotteryRecordApiPage(Condition.getPage(query), new CommonLotteryRecordApiVO()));
|
||||
}
|
||||
|
||||
@PostMapping("/lottery-draw")
|
||||
@ApiOperationSupport(order = 17)
|
||||
@Operation(summary = "用户抽奖", description = "传入LotteriesDrawRequest")
|
||||
public R<CommonLotteryPrizeApiVO> draw(@Valid @RequestBody LotteryDrawRequest request) {
|
||||
return R.data(lotteryPrizeService.draw(request));
|
||||
}
|
||||
|
||||
@GetMapping("/lottery-rules")
|
||||
@ApiOperationSupport(order = 18)
|
||||
@Operation(summary = "抽奖规则")
|
||||
public R<String> lotteryRules() {
|
||||
return R.data(lotteryPrizeService.rules());
|
||||
}
|
||||
|
||||
@GetMapping("/lottery-winners")
|
||||
@ApiOperationSupport(order = 19)
|
||||
@Operation(summary = "获奖名单")
|
||||
public R<List<CommonLotteryWinnerApiVO>> lotteryWinners() {
|
||||
return R.data(lotteryRecordService.lotteryWinners());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,13 +11,12 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeDetailApiVO;
|
||||
import org.springblade.modules.api.vo.MarketDirectInfoApiVO;
|
||||
import org.springblade.modules.api.request.AcquireBenefitPackageRequest;
|
||||
import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||
import org.springblade.modules.market.manager.MarketUserManager;
|
||||
import org.springblade.modules.api.vo.MarketBenefitPackageVO;
|
||||
import org.springblade.modules.userPackage.service.IUserMarketBenefitPackageService;
|
||||
import org.springblade.modules.market.manager.MarketUserPointManager;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -29,12 +28,14 @@ import java.util.List;
|
||||
@Tag(name = "APP福利包接口", description = "APP福利包接口")
|
||||
public class MarketUserController {
|
||||
|
||||
private final IUserMarketBenefitPackageService userMarketBenefitPackageService;
|
||||
private final IMarketBenefitPackageService userMarketBenefitPackageService;
|
||||
|
||||
private final MarketUserManager marketUserManager;
|
||||
|
||||
private final ICommonUserNoticeService userNoticeService;
|
||||
|
||||
private final MarketUserPointManager marketUserPointManager;
|
||||
|
||||
|
||||
@GetMapping("/package-list")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@@ -85,8 +86,9 @@ public class MarketUserController {
|
||||
return R.data(userNoticeService.userNoticeDetail(id));
|
||||
}
|
||||
|
||||
@GetMapping("/unread-num")
|
||||
@ApiOperationSupport(order = 6)
|
||||
|
||||
@GetMapping("/unread")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "Market用户未读消息数量")
|
||||
public R<Long> unreadNum() {
|
||||
return R.data(userNoticeService.marketUnreadNoticeNum());
|
||||
@@ -94,5 +96,47 @@ public class MarketUserController {
|
||||
|
||||
|
||||
|
||||
@GetMapping("/benefit-package")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "福利包列表")
|
||||
public R<List<MarketPackageTemplateVO>> benefitPackageList() {
|
||||
return R.data(marketUserManager.benefitPackageList());
|
||||
}
|
||||
|
||||
@PostMapping("/acquire-benefit-package")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "兑换福利包", description = "传入acquireBenefitPackageRequest")
|
||||
public R<Boolean> acquireBenefitPackage(@RequestBody AcquireBenefitPackageRequest request) {
|
||||
return R.status(marketUserManager.acquireBenefitPackage(request));
|
||||
}
|
||||
|
||||
@GetMapping("/user-assets")
|
||||
@ApiOperationSupport(order = 10)
|
||||
@Operation(summary = "用户资产查询")
|
||||
public R<UserAssetsApiVO> userAssets() {
|
||||
return R.data(marketUserManager.userAssets());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/benefit-point-log")
|
||||
@ApiOperationSupport(order = 11)
|
||||
@Operation(summary = "福利积分流水")
|
||||
public R<IPage<MarketUserBenefitPointLogVO>> benefitPointLogList(Query query , MarketUserBenefitPointLogVO benefitPointLogVO) {
|
||||
return R.data(marketUserPointManager.benefitPointLogList(Condition.getPage(query) , benefitPointLogVO));
|
||||
}
|
||||
|
||||
@GetMapping("/cash-coupon-log")
|
||||
@ApiOperationSupport(order = 12)
|
||||
@Operation(summary = "现金券流水")
|
||||
public R<IPage<MarketUserCashCouponLogVO>> cashCouponLogList(Query query , MarketUserCashCouponLogVO cashCouponLogVO) {
|
||||
return R.data(marketUserPointManager.cashCouponLogList(Condition.getPage(query) , cashCouponLogVO));
|
||||
}
|
||||
|
||||
@GetMapping("/user-commission-log")
|
||||
@ApiOperationSupport(order = 13)
|
||||
@Operation(summary = "用户佣金流水")
|
||||
public R<IPage<MarketUserCommissionLogVO>> userCommissionLogList(Query query , MarketUserCommissionLogVO userCommissionLogVO) {
|
||||
return R.data(marketUserPointManager.userCommissionLogList(Condition.getPage(query) , userCommissionLogVO));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AcquireBenefitPackageRequest implements Serializable {
|
||||
|
||||
@NotNull(message = "请选择要兑换的福利包")
|
||||
private Long packId;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AddressRemoveRequest implements Serializable {
|
||||
|
||||
@NotEmpty(message = "至少选择一条地址")
|
||||
private List<Long> ids;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class AddressSubmitRequest implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "请选择地区")
|
||||
private Integer regionsId;
|
||||
|
||||
@NotEmpty(message = "详细地址必填")
|
||||
private String detail;
|
||||
|
||||
@NotEmpty(message = "联系人必填")
|
||||
private String consignee;
|
||||
|
||||
@NotEmpty(message = "手机号必填")
|
||||
private String phone;
|
||||
|
||||
@NotNull(message = "是否默认必选")
|
||||
private Integer isDefault;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class LotteryDrawRequest implements Serializable {
|
||||
|
||||
@NotNull(message = "无效积分")
|
||||
private BigDecimal amount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class CommonLotteryPrizeApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String prizeName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CommonLotteryRecordApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String prizeName;
|
||||
|
||||
private BigDecimal pointsUsed;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CommonLotteryWinnerApiVO implements Serializable {
|
||||
|
||||
private String prizeName;
|
||||
|
||||
private String account;
|
||||
|
||||
private String username;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
public class CommonUserAddressApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long regionsInfoId;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
||||
private String district;
|
||||
|
||||
private String street;
|
||||
|
||||
private String detail;
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String phone;
|
||||
|
||||
private Integer isDefault;
|
||||
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class CommonUserNoticeApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer moduleType;
|
||||
private String moduleType;
|
||||
/**
|
||||
* 是否已读 0-否 1-是
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CommonUserNoticeDetailApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer moduleType;
|
||||
private String moduleType;
|
||||
|
||||
private String title;
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.core.tool.utils.StringPool;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class FullRegionInfoVO implements Serializable {
|
||||
|
||||
private Integer currentLevel = -1;
|
||||
|
||||
private String street = StringPool.EMPTY;
|
||||
|
||||
private String district = StringPool.EMPTY;
|
||||
|
||||
private String city = StringPool.EMPTY;
|
||||
|
||||
private String province = StringPool.EMPTY;
|
||||
|
||||
private Long streetId = -1L;
|
||||
|
||||
private Long districtId = -1L;
|
||||
|
||||
private Long cityId = -1L;
|
||||
|
||||
private Long provinceId = -1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
public class MarketPackageTemplateVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String packageName;
|
||||
/**
|
||||
* 最大购买数量
|
||||
*/
|
||||
private Integer userLimit;
|
||||
/**
|
||||
* 全网最大兑换数量
|
||||
*/
|
||||
private Integer maxLimit;
|
||||
/**
|
||||
* 产出总天数
|
||||
*/
|
||||
private Integer dayLimit;
|
||||
/**
|
||||
* 总产出福利积分
|
||||
*/
|
||||
private BigDecimal benefitPointAmount;
|
||||
/**
|
||||
* 购买赠与福利值
|
||||
*/
|
||||
private BigDecimal benefitValueAmount;
|
||||
/**
|
||||
* 兑换包需要的福利积分
|
||||
*/
|
||||
private BigDecimal benefitPointPrice;
|
||||
/**
|
||||
* 兑换包需要的现金券
|
||||
*/
|
||||
private BigDecimal cashCouponPrice;
|
||||
/**
|
||||
* 已兑换数量
|
||||
*/
|
||||
private Integer exchangedQuantity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MarketUserBenefitPointLogVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 上一笔金额
|
||||
*/
|
||||
private BigDecimal lastAmount;
|
||||
/**
|
||||
* 手续费
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
|
||||
/**
|
||||
* 消费类型 1-收入 2-支出
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MarketUserCashCouponLogVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 上一笔金额
|
||||
*/
|
||||
private BigDecimal lastAmount;
|
||||
/**
|
||||
* 手续费
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
|
||||
/**
|
||||
* 消费类型 1-收入 2-支出
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MarketUserCommissionLogVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 上一笔金额
|
||||
*/
|
||||
private BigDecimal lastAmount;
|
||||
/**
|
||||
* 手续费
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
|
||||
/**
|
||||
* 消费类型 1-收入 2-支出
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class UserAssetsApiVO implements Serializable {
|
||||
|
||||
private BigDecimal withdrawableBalance; // 可提现余额
|
||||
|
||||
private BigDecimal benefitPoints; // 福利积分
|
||||
|
||||
private BigDecimal cashCouponAmount; // 现金券数量(或 List<CashCoupon>)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import org.springblade.modules.common.wrapper.CommonLotteryPrizeWrapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryPrizeService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 奖品配置表 控制器
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-lotteryprize/lotteryPrize")
|
||||
@Tag(name = "奖品配置表", description = "奖品配置表接口")
|
||||
public class CommonLotteryPrizeController extends BladeController {
|
||||
|
||||
private final ICommonLotteryPrizeService lotteryPrizeService;
|
||||
|
||||
/**
|
||||
* 奖品配置表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入lotteryPrize")
|
||||
public R<CommonLotteryPrizeVO> detail(CommonLotteryPrizeEntity lotteryPrize) {
|
||||
CommonLotteryPrizeEntity detail = lotteryPrizeService.getOne(Condition.getQueryWrapper(lotteryPrize));
|
||||
return R.data(CommonLotteryPrizeWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 奖品配置表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入lotteryPrize")
|
||||
public R<IPage<CommonLotteryPrizeVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryPrize, Query query) {
|
||||
IPage<CommonLotteryPrizeEntity> pages = lotteryPrizeService.page(Condition.getPage(query), Condition.getQueryWrapper(lotteryPrize, CommonLotteryPrizeEntity.class));
|
||||
return R.data(CommonLotteryPrizeWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入lotteryPrize")
|
||||
public R<IPage<CommonLotteryPrizeVO>> page(CommonLotteryPrizeVO lotteryPrize, Query query) {
|
||||
IPage<CommonLotteryPrizeVO> pages = lotteryPrizeService.selectLotteryPrizePage(Condition.getPage(query), lotteryPrize);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入lotteryPrize")
|
||||
public R save(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.save(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入lotteryPrize")
|
||||
public R update(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.updateById(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入lotteryPrize")
|
||||
public R submit(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.saveOrUpdate(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(lotteryPrizeService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import org.springblade.modules.common.wrapper.CommonLotteryRecordWrapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryRecordService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 控制器
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-lotteryprize/lotteryRecord")
|
||||
@Tag(name = "抽奖记录表", description = "抽奖记录表接口")
|
||||
public class CommonLotteryRecordController extends BladeController {
|
||||
|
||||
private final ICommonLotteryRecordService lotteryRecordService;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入lotteryRecord")
|
||||
public R<CommonLotteryRecordVO> detail(CommonLotteryRecordEntity lotteryRecord) {
|
||||
CommonLotteryRecordEntity detail = lotteryRecordService.getOne(Condition.getQueryWrapper(lotteryRecord));
|
||||
return R.data(CommonLotteryRecordWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 抽奖记录表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入lotteryRecord")
|
||||
public R<IPage<CommonLotteryRecordVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryRecord, Query query) {
|
||||
IPage<CommonLotteryRecordEntity> pages = lotteryRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(lotteryRecord, CommonLotteryRecordEntity.class));
|
||||
return R.data(CommonLotteryRecordWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入lotteryRecord")
|
||||
public R<IPage<CommonLotteryRecordVO>> page(CommonLotteryRecordVO lotteryRecord, Query query) {
|
||||
IPage<CommonLotteryRecordVO> pages = lotteryRecordService.selectLotteryRecordPage(Condition.getPage(query), lotteryRecord);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入lotteryRecord")
|
||||
public R save(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.save(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入lotteryRecord")
|
||||
public R update(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.updateById(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入lotteryRecord")
|
||||
public R submit(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.saveOrUpdate(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(lotteryRecordService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-lotteryRecord")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入lotteryRecord")
|
||||
public void exportLotteryRecord(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryRecord, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<CommonLotteryRecordEntity> queryWrapper = Condition.getQueryWrapper(lotteryRecord, CommonLotteryRecordEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(LotteryRecord::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(LotteryRecordEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CommonLotteryRecordExcel> list = lotteryRecordService.exportLotteryRecord(queryWrapper);
|
||||
ExcelUtil.export(response, "抽奖记录表数据" + DateUtil.time(), "抽奖记录表数据表", list, CommonLotteryRecordExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
||||
import org.springblade.modules.common.wrapper.CommonUserPointWrapper;
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/common/user-point")
|
||||
@Tag(name = "用户商城积分表", description = "用户商城积分表接口")
|
||||
public class CommonUserPointController extends BladeController {
|
||||
|
||||
private final ICommonUserPointService commonUserPointService;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonUserPoint")
|
||||
public R<CommonUserPointVO> detail(CommonUserPointEntity commonUserPoint) {
|
||||
CommonUserPointEntity detail = commonUserPointService.getOne(Condition.getQueryWrapper(commonUserPoint));
|
||||
return R.data(CommonUserPointWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户商城积分表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonUserPoint")
|
||||
public R<IPage<CommonUserPointVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonUserPoint, Query query) {
|
||||
IPage<CommonUserPointEntity> pages = commonUserPointService.page(Condition.getPage(query), Condition.getQueryWrapper(commonUserPoint, CommonUserPointEntity.class));
|
||||
return R.data(CommonUserPointWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonUserPoint")
|
||||
public R<IPage<CommonUserPointVO>> page(CommonUserPointVO commonUserPoint, Query query) {
|
||||
IPage<CommonUserPointVO> pages = commonUserPointService.selectCommonUserPointPage(Condition.getPage(query), commonUserPoint);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonUserPoint")
|
||||
public R save(@Valid @RequestBody CommonUserPointEntity commonUserPoint) {
|
||||
return R.status(commonUserPointService.save(commonUserPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonUserPoint")
|
||||
public R update(@Valid @RequestBody CommonUserPointEntity commonUserPoint) {
|
||||
return R.status(commonUserPointService.updateById(commonUserPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonUserPoint")
|
||||
public R submit(@Valid @RequestBody CommonUserPointEntity commonUserPoint) {
|
||||
return R.status(commonUserPointService.saveOrUpdate(commonUserPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commonUserPointService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import org.springblade.modules.common.wrapper.CommonUserPointLogWrapper;
|
||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/common/user-point-log")
|
||||
@Tag(name = "用户商城积分流水表", description = "用户商城积分流水表接口")
|
||||
public class CommonUserPointLogController extends BladeController {
|
||||
|
||||
private final ICommonUserPointLogService commonUserPointLogService;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonUserPointLog")
|
||||
public R<CommonUserPointLogVO> detail(CommonUserPointLogEntity commonUserPointLog) {
|
||||
CommonUserPointLogEntity detail = commonUserPointLogService.getOne(Condition.getQueryWrapper(commonUserPointLog));
|
||||
return R.data(CommonUserPointLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户商城积分流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonUserPointLog")
|
||||
public R<IPage<CommonUserPointLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonUserPointLog, Query query) {
|
||||
IPage<CommonUserPointLogEntity> pages = commonUserPointLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commonUserPointLog, CommonUserPointLogEntity.class));
|
||||
return R.data(CommonUserPointLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonUserPointLog")
|
||||
public R<IPage<CommonUserPointLogVO>> page(CommonUserPointLogVO commonUserPointLog, Query query) {
|
||||
IPage<CommonUserPointLogVO> pages = commonUserPointLogService.selectCommonUserPointLogPage(Condition.getPage(query), commonUserPointLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonUserPointLog")
|
||||
public R save(@Valid @RequestBody CommonUserPointLogEntity commonUserPointLog) {
|
||||
return R.status(commonUserPointLogService.save(commonUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonUserPointLog")
|
||||
public R update(@Valid @RequestBody CommonUserPointLogEntity commonUserPointLog) {
|
||||
return R.status(commonUserPointLogService.updateById(commonUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonUserPointLog")
|
||||
public R submit(@Valid @RequestBody CommonUserPointLogEntity commonUserPointLog) {
|
||||
return R.status(commonUserPointLogService.saveOrUpdate(commonUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commonUserPointLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,14 +3,10 @@ package org.springblade.modules.common.convert;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.api.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.api.request.CreateOrderRequest;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeDetailApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.api.vo.*;
|
||||
import org.springblade.modules.common.pojo.entity.*;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
@@ -59,4 +55,11 @@ public interface AppCommonConvert {
|
||||
List<CommonUserNoticeApiVO> convertNoticeVOList(List<CommonUserNoticeEntity> list);
|
||||
|
||||
CommonUserNoticeDetailApiVO convertNoticeDetailVO(CommonUserNoticeEntity entity);
|
||||
|
||||
CommonUserAddressApiVO convertAddressToVoList(CommonUserAddressEntity entity);
|
||||
|
||||
List<CommonUserAddressApiVO> convertAddressListToVoList(List<CommonUserAddressEntity> list);
|
||||
|
||||
CommonUserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ public enum BusinessModule {
|
||||
|
||||
SELF_OPERATED_MALL("自营商城", "self_mall"),
|
||||
ECOSYSTEM_PRODUCT("生态商品", "eco_product"),
|
||||
TRAVEL_GROUP("旅游团", "travel_group");
|
||||
TRAVEL_GROUP("旅游团", "travel_group"),
|
||||
LOTTERY("幸运抽奖", "lottery");
|
||||
|
||||
@Getter
|
||||
private final String displayName;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Getter
|
||||
public enum UserPointFlowType {
|
||||
|
||||
GRANT(1, "🎉 恭喜!您通过【订单 %s】成功获得 %s 积分,已存入您的账户,快去兑换好礼吧!") {
|
||||
@Override
|
||||
public String formatUserMessage(String orderId, String points) {
|
||||
return String.format(this.getUserMessageTemplate(), orderId, points);
|
||||
}
|
||||
},
|
||||
|
||||
SPEND(2, "🎰 您已使用 %s 积分 参与幸运大抽奖,祝您好运连连,大奖抱回家!") {
|
||||
@Override
|
||||
public String formatUserMessage(String orderId, String points) {
|
||||
// 注意:SPEND 不使用 orderId,但为了统一接口保留参数
|
||||
return String.format(this.getUserMessageTemplate(), points);
|
||||
}
|
||||
};
|
||||
|
||||
private final int code;
|
||||
private final String userMessageTemplate;
|
||||
|
||||
private UserPointFlowType(int code, String userMessageTemplate) {
|
||||
this.code = code;
|
||||
this.userMessageTemplate = userMessageTemplate;
|
||||
}
|
||||
|
||||
public abstract String formatUserMessage(String orderId, String points);
|
||||
|
||||
private static final Map<Integer, UserPointFlowType> BY_CODE = Stream.of(values())
|
||||
.collect(Collectors.toUnmodifiableMap(UserPointFlowType::getCode, Function.identity()));
|
||||
|
||||
public static UserPointFlowType fromCode(int code) {
|
||||
UserPointFlowType status = BY_CODE.get(code);
|
||||
if (status == null) {
|
||||
throw new IllegalArgumentException("无效的订单状态码: " + code);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
public static UserPointFlowType fromCodeOrNull(int code) {
|
||||
return BY_CODE.get(code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.springblade.modules.common.event;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class GrantUserPointEvent {
|
||||
|
||||
private final Long orderId;
|
||||
|
||||
private final Long userId;
|
||||
|
||||
private final BigDecimal point;
|
||||
|
||||
private final BusinessModule businessModule;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.springblade.modules.common.event;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SpendUserPointEvent {
|
||||
|
||||
private Long userId;
|
||||
|
||||
private BigDecimal point;
|
||||
|
||||
private BusinessModule businessModule;
|
||||
|
||||
}
|
||||
@@ -23,12 +23,13 @@
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.userPackage.excel;
|
||||
package org.springblade.modules.common.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
@@ -38,16 +39,16 @@ import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 划拨积分记录 Excel实体类
|
||||
* 抽奖记录表 Excel实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserMarketBenefitPackageLogExcel implements Serializable {
|
||||
public class CommonLotteryRecordExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -58,12 +59,6 @@ public class UserMarketBenefitPackageLogExcel implements Serializable {
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 统计日期
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计日期")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@@ -71,47 +66,17 @@ public class UserMarketBenefitPackageLogExcel implements Serializable {
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
* 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long phone;
|
||||
@ExcelProperty("中奖奖品ID(null 表示未中奖/谢谢参与)")
|
||||
private Long prizeId;
|
||||
/**
|
||||
* 用户名
|
||||
* 消耗积分
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名")
|
||||
private String userName;
|
||||
/**
|
||||
* 1-积分兑换 2-后台划拨
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("1-积分兑换 2-后台划拨")
|
||||
private Integer type;
|
||||
/**
|
||||
* 积分包id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("积分包id")
|
||||
private Long userPackageId;
|
||||
/**
|
||||
* 积分包名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("积分包名称")
|
||||
private String packageName;
|
||||
/**
|
||||
* 积分包信息快照
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("积分包信息快照")
|
||||
private String packageDetail;
|
||||
/**
|
||||
* 赠送数量
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("赠送数量")
|
||||
private Integer giveNumber;
|
||||
@ExcelProperty("消耗积分")
|
||||
private BigDecimal pointsUsed;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@@ -4,7 +4,10 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.modules.common.eums.NoticeType;
|
||||
import org.springblade.modules.common.eums.OrderStatus;
|
||||
import org.springblade.modules.common.eums.UserPointFlowType;
|
||||
import org.springblade.modules.common.event.GrantUserPointEvent;
|
||||
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||
import org.springblade.modules.common.event.SpendUserPointEvent;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity;
|
||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -36,4 +39,39 @@ public class NoticeListener {
|
||||
log.warn("支付事务回滚,orderId={}", event.getOrderId());
|
||||
}
|
||||
|
||||
|
||||
@Async
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||
public void onGrantUserPoint(GrantUserPointEvent event) {
|
||||
CommonUserNoticeEntity notice = new CommonUserNoticeEntity();
|
||||
notice.setUserId(event.getUserId());
|
||||
notice.setNoticeType(NoticeType.APP_USER.getCode());
|
||||
notice.setModuleType(event.getBusinessModule().getCode());
|
||||
notice.setTitle(event.getBusinessModule().getDisplayName());
|
||||
notice.setContent(UserPointFlowType.GRANT.formatUserMessage(String.valueOf(event.getOrderId()), String.valueOf(event.getPoint())));
|
||||
noticeService.save(notice);
|
||||
}
|
||||
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||
public void onGrantUserPointFailure(GrantUserPointEvent event) {
|
||||
log.warn("用户获取积分事务回滚,orderId={}", event.getOrderId());
|
||||
}
|
||||
|
||||
@Async
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||
public void onSpendUserPoint(SpendUserPointEvent event) {
|
||||
CommonUserNoticeEntity notice = new CommonUserNoticeEntity();
|
||||
notice.setUserId(event.getUserId());
|
||||
notice.setNoticeType(NoticeType.APP_USER.getCode());
|
||||
notice.setModuleType(event.getBusinessModule().getCode());
|
||||
notice.setTitle(event.getBusinessModule().getDisplayName());
|
||||
notice.setContent(UserPointFlowType.SPEND.formatUserMessage(null, String.valueOf(event.getPoint())));
|
||||
noticeService.save(notice);
|
||||
}
|
||||
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||
public void onSpendUserPointFailure(SpendUserPointEvent event) {
|
||||
log.warn("用户获取积分事务回滚,userId={}", event.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 奖品配置表 Mapper 接口
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface CommonLotteryPrizeMapper extends BaseMapper<CommonLotteryPrizeEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param lotteryPrize 查询参数
|
||||
* @return List<LotteryPrizeVO>
|
||||
*/
|
||||
List<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage page, CommonLotteryPrizeVO lotteryPrize);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonLotteryPrizeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="lotteryPrizeResultMap" type="org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="prize_name" property="prizeName"/>
|
||||
<result column="prize_type" property="prizeType"/>
|
||||
<result column="prize_value" property="prizeValue"/>
|
||||
<result column="probability" property="probability"/>
|
||||
<result column="stock" property="stock"/>
|
||||
<result column="daily_limit" property="dailyLimit"/>
|
||||
<result column="sort_order" property="sortOrder"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectLotteryPrizePage" resultMap="lotteryPrizeResultMap">
|
||||
select * from common_lottery_prize where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -23,11 +23,12 @@
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.userPackage.mapper;
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.userPackage.pojo.entity.UserMarketBenefitPackageEntity;
|
||||
import org.springblade.modules.userPackage.pojo.vo.UserMarketBenefitPackageVO;
|
||||
import org.springblade.modules.userPackage.excel.UserMarketBenefitPackageExcel;
|
||||
import org.springblade.modules.api.vo.CommonLotteryRecordApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -35,29 +36,30 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 Mapper 接口
|
||||
* 抽奖记录表 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface UserMarketBenefitPackageMapper extends BaseMapper<UserMarketBenefitPackageEntity> {
|
||||
public interface CommonLotteryRecordMapper extends BaseMapper<CommonLotteryRecordEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userMarketBenefitPackage 查询参数
|
||||
* @return List<UserMarketBenefitPackageVO>
|
||||
* @param vo 查询参数
|
||||
* @return List<LotteryRecordVO>
|
||||
*/
|
||||
List<UserMarketBenefitPackageVO> selectUserMarketBenefitPackagePage(IPage page, UserMarketBenefitPackageVO userMarketBenefitPackage);
|
||||
List<CommonLotteryRecordVO> selectLotteryRecordPage(IPage page, CommonLotteryRecordVO vo);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserMarketBenefitPackageExcel>
|
||||
* @return List<LotteryRecordExcel>
|
||||
*/
|
||||
List<UserMarketBenefitPackageExcel> exportUserMarketBenefitPackage(@Param("ew") Wrapper<UserMarketBenefitPackageEntity> queryWrapper);
|
||||
List<CommonLotteryRecordExcel> exportLotteryRecord(@Param("ew") Wrapper<CommonLotteryRecordEntity> queryWrapper);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonLotteryRecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="lotteryRecordResultMap" type="org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="prize_id" property="prizeId"/>
|
||||
<result column="points_used" property="pointsUsed"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectLotteryRecordPage" resultType="org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO">
|
||||
select * from common_lottery_record where is_deleted = 0
|
||||
<if test="vo.userId!=null">
|
||||
and user_id = #{vo.userId}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportLotteryRecord" resultType="org.springblade.modules.common.excel.CommonLotteryRecordExcel">
|
||||
SELECT * FROM common_lottery_record ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -6,7 +6,7 @@
|
||||
<resultMap id="userAddressResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserAddressEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="regions_info_id" property="regionsInfoId"/>
|
||||
<result column="regions_id" property="regionsId"/>
|
||||
<result column="province" property="province"/>
|
||||
<result column="city" property="city"/>
|
||||
<result column="district" property="district"/>
|
||||
@@ -25,8 +25,17 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserAddressPage" resultMap="userAddressResultMap">
|
||||
select * from user_address where is_deleted = 0
|
||||
<select id="selectUserAddressPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserAddressVO">
|
||||
select
|
||||
cua.*,
|
||||
bu.account
|
||||
from blade_user bu
|
||||
left join common_user_address cua on cua.user_id = bu.id
|
||||
where bu.is_deleted = 0 and bu.user_type = 2 and cua.is_deleted = 0
|
||||
<if test="userAddress.account != null">
|
||||
and bu.account = #{userAddress.account}
|
||||
</if>
|
||||
order by cua.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="notice_type" property="noticeType"/>
|
||||
<result column="has_read" property="hasRead"/>
|
||||
<result column="release_time" property="releaseTime"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
|
||||
@@ -41,6 +41,15 @@
|
||||
<if test="order.id != null">
|
||||
and uo.id = #{order.id}
|
||||
</if>
|
||||
<if test="order.account != null">
|
||||
and bu.account = #{order.account}
|
||||
</if>
|
||||
<if test="order.paymentStatus !=null">
|
||||
and uo.payment_status = #{order.paymentStatus}
|
||||
</if>
|
||||
<if test="order.paymentType !=null">
|
||||
and uo.payment_type = #{order.paymentType}
|
||||
</if>
|
||||
<if test="order.orderStatus != null">
|
||||
and uo.order_status = #{order.orderStatus}
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public interface CommonUserPointLogMapper extends BaseMapper<CommonUserPointLogEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param pointLog 查询参数
|
||||
* @return List<CommonUserPointLogVO>
|
||||
*/
|
||||
List<CommonUserPointLogVO> selectCommonUserPointLogPage(IPage page, CommonUserPointLogVO pointLog);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonUserPointLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commonUserPointLogResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="amount" property="amount"/>
|
||||
<result column="last_amount" property="lastAmount"/>
|
||||
<result column="source_type" property="sourceType"/>
|
||||
<result column="source_id" property="sourceId"/>
|
||||
<result column="source_detail" property="sourceDetail"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="is_complete" property="isComplete"/>
|
||||
<result column="statistical_date" property="statisticalDate"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectCommonUserPointLogPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserPointLogVO">
|
||||
select
|
||||
upl.*,
|
||||
bu.account
|
||||
from blade_user bu
|
||||
left join user_point_log upl on bu.id = upl.user_id
|
||||
where bu.is_deleted = 0 and upl.is_deleted = 0 and upl.is_complete = 1
|
||||
<if test="pointLog.account != null">
|
||||
and bu.account = #{pointLog.account}
|
||||
</if>
|
||||
order by upl.id desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public interface CommonUserPointMapper extends BaseMapper<CommonUserPointEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userPoint 查询参数
|
||||
* @return List<CommonUserPointVO>
|
||||
*/
|
||||
List<CommonUserPointVO> selectCommonUserPointPage(IPage page, CommonUserPointVO userPoint);
|
||||
|
||||
|
||||
int addUserPoint(Long userId, BigDecimal amount, Integer version);
|
||||
|
||||
int deductUserPoint(Long userId, BigDecimal amount, Integer version);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonUserPointMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commonUserPointResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserPointEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="amount" property="amount"/>
|
||||
<result column="version" property="version"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectCommonUserPointPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserPointVO">
|
||||
select
|
||||
up.*,
|
||||
bu.account
|
||||
from blade_user bu
|
||||
left join user_point up on bu.id = up.id
|
||||
where bu.is_deleted = 0 and bu.user_type = 2 and up.is_deleted = 0
|
||||
<if test="userPoint.account != null">
|
||||
and bu.account = #{userPoint.account}
|
||||
</if>
|
||||
order by up.id desc
|
||||
</select>
|
||||
|
||||
<update id="addUserPoint">
|
||||
update
|
||||
user_point
|
||||
set amount = amount + #{amount} , version = version + 1
|
||||
where id = #{userId} and version = #{version}
|
||||
</update>
|
||||
|
||||
<update id="deductUserPoint">
|
||||
update
|
||||
user_point
|
||||
set amount = amount - #{amount} , version = version + 1
|
||||
where id = #{userId} and version = #{version} and amount >= #{amount}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 数据传输对象实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeDTO extends CommonLotteryPrizeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 数据传输对象实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordDTO extends CommonLotteryRecordEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserPointDTO extends CommonUserPointEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserPointLogDTO extends CommonUserPointLogEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("common_lottery_prize")
|
||||
@Schema(description = "LotteryPrize对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 奖品名称
|
||||
*/
|
||||
@Schema(description = "奖品名称")
|
||||
private String prizeName;
|
||||
/**
|
||||
* 奖品类型
|
||||
*/
|
||||
@Schema(description = "奖品类型")
|
||||
private Integer prizeType;
|
||||
/**
|
||||
* 奖品内容
|
||||
*/
|
||||
@Schema(description = "奖品内容")
|
||||
private String prizeValue;
|
||||
/**
|
||||
* 中奖概率(如 0.05 = 5%)
|
||||
*/
|
||||
@Schema(description = "中奖概率(如 0.05 = 5%)")
|
||||
private BigDecimal probability;
|
||||
/**
|
||||
* 总库存(-1 表示无限)
|
||||
*/
|
||||
@Schema(description = "总库存(-1 表示无限)")
|
||||
private Integer stock;
|
||||
/**
|
||||
* 每日发放上限
|
||||
*/
|
||||
@Schema(description = "每日发放上限")
|
||||
private Integer dailyLimit;
|
||||
/**
|
||||
* 排序(用于前端展示顺序)
|
||||
*/
|
||||
@Schema(description = "排序(用于前端展示顺序)")
|
||||
private Integer sortOrder;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("common_lottery_record")
|
||||
@Schema(description = "LotteryRecord对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
*/
|
||||
@Schema(description = "中奖奖品ID(null 表示未中奖/谢谢参与)")
|
||||
private Long prizeId;
|
||||
/**
|
||||
* 消耗积分
|
||||
*/
|
||||
@Schema(description = "消耗积分")
|
||||
private BigDecimal pointsUsed;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -39,9 +40,10 @@ import java.io.Serial;
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_address")
|
||||
@TableName("common_user_address")
|
||||
@Schema(description = "UserAddress对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class CommonUserAddressEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
@@ -56,7 +58,7 @@ public class CommonUserAddressEntity extends BaseEntity {
|
||||
* 地区信息id
|
||||
*/
|
||||
@Schema(description = "地区信息id")
|
||||
private Long regionsInfoId;
|
||||
private Long regionsId;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -46,18 +49,12 @@ import java.io.Serial;
|
||||
@Data
|
||||
@TableName("user_order")
|
||||
@Schema(description = "Order对象")
|
||||
public class CommonUserOrderEntity implements Serializable {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserOrderEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Schema(description = "主键")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
@@ -149,40 +146,5 @@ public class CommonUserOrderEntity implements Serializable {
|
||||
*/
|
||||
@Schema(description = "支付凭证编号")
|
||||
private String paymentTrack;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private Long createUser;
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@Schema(description = "创建部门")
|
||||
private Long createDept;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
private Long updateUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_point")
|
||||
@Schema(description = "CommonUserPoint对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserPointEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 面额
|
||||
*/
|
||||
@Schema(description = "面额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Version
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_point_log")
|
||||
@Schema(description = "CommonUserPointLog对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class CommonUserPointLogEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 上一笔金额
|
||||
*/
|
||||
@Schema(description = "上一笔金额")
|
||||
private BigDecimal lastAmount;
|
||||
/**
|
||||
*
|
||||
* 来源类型
|
||||
*/
|
||||
@Schema(description = "来源类型")
|
||||
private String sourceType;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@Schema(description = "来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@Schema(description = "来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 消费类型 1-收入 2-支出
|
||||
*/
|
||||
@Schema(description = "消费类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 是否完成 0-未完成 1-已完成
|
||||
*/
|
||||
@Schema(description = "是否完成 0-未完成 1-已完成")
|
||||
private Integer isComplete;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 视图实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeVO extends CommonLotteryPrizeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 视图实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordVO extends CommonLotteryRecordEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -42,4 +42,6 @@ public class CommonUserAddressVO extends CommonUserAddressEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String account;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserPointLogVO extends CommonUserPointLogEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String account;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserPointVO extends CommonUserPointEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String account;
|
||||
|
||||
}
|
||||
@@ -23,39 +23,36 @@
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.userPackage.service;
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import org.springblade.modules.userPackage.pojo.entity.UserMarketBenefitPackageLogEntity;
|
||||
import org.springblade.modules.userPackage.pojo.vo.UserMarketBenefitPackageLogVO;
|
||||
import org.springblade.modules.userPackage.excel.UserMarketBenefitPackageLogExcel;
|
||||
import org.springblade.modules.api.request.LotteryDrawRequest;
|
||||
import org.springblade.modules.api.vo.CommonLotteryPrizeApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 划拨积分记录 服务类
|
||||
* 奖品配置表 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface IUserMarketBenefitPackageLogService extends BaseService<UserMarketBenefitPackageLogEntity> {
|
||||
public interface ICommonLotteryPrizeService extends BaseService<CommonLotteryPrizeEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userMarketBenefitPackageLog 查询参数
|
||||
* @return IPage<UserMarketBenefitPackageLogVO>
|
||||
* @param lotteryPrize 查询参数
|
||||
* @return IPage<LotteryPrizeVO>
|
||||
*/
|
||||
IPage<UserMarketBenefitPackageLogVO> selectUserMarketBenefitPackageLogPage(IPage<UserMarketBenefitPackageLogVO> page, UserMarketBenefitPackageLogVO userMarketBenefitPackageLog);
|
||||
IPage<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage<CommonLotteryPrizeVO> page, CommonLotteryPrizeVO lotteryPrize);
|
||||
|
||||
CommonLotteryPrizeApiVO draw(LotteryDrawRequest request);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserMarketBenefitPackageLogExcel>
|
||||
*/
|
||||
List<UserMarketBenefitPackageLogExcel> exportUserMarketBenefitPackageLog(Wrapper<UserMarketBenefitPackageLogEntity> queryWrapper);
|
||||
List<CommonLotteryPrizeApiVO> staticList();
|
||||
|
||||
String rules();
|
||||
}
|
||||
@@ -23,41 +23,49 @@
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.userPackage.service;
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import org.springblade.modules.api.vo.MarketBenefitPackageVO;
|
||||
import org.springblade.modules.userPackage.pojo.entity.UserMarketBenefitPackageEntity;
|
||||
import org.springblade.modules.userPackage.pojo.vo.UserMarketBenefitPackageVO;
|
||||
import org.springblade.modules.userPackage.excel.UserMarketBenefitPackageExcel;
|
||||
import org.springblade.modules.api.vo.CommonLotteryRecordApiVO;
|
||||
import org.springblade.modules.api.vo.CommonLotteryWinnerApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 服务类
|
||||
* 抽奖记录表 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface IUserMarketBenefitPackageService extends BaseService<UserMarketBenefitPackageEntity> {
|
||||
public interface ICommonLotteryRecordService extends BaseService<CommonLotteryRecordEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userMarketBenefitPackage 查询参数
|
||||
* @return IPage<UserMarketBenefitPackageVO>
|
||||
* @param lotteryRecord 查询参数
|
||||
* @return IPage<LotteryRecordVO>
|
||||
*/
|
||||
IPage<UserMarketBenefitPackageVO> selectUserMarketBenefitPackagePage(IPage<UserMarketBenefitPackageVO> page, UserMarketBenefitPackageVO userMarketBenefitPackage);
|
||||
IPage<CommonLotteryRecordVO> selectLotteryRecordPage(IPage<CommonLotteryRecordVO> page, CommonLotteryRecordVO lotteryRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserMarketBenefitPackageExcel>
|
||||
* @return List<LotteryRecordExcel>
|
||||
*/
|
||||
List<UserMarketBenefitPackageExcel> exportUserMarketBenefitPackage(Wrapper<UserMarketBenefitPackageEntity> queryWrapper);
|
||||
List<CommonLotteryRecordExcel> exportLotteryRecord(Wrapper<CommonLotteryRecordEntity> queryWrapper);
|
||||
|
||||
IPage<CommonLotteryRecordApiVO> selectLotteryRecordApiPage(IPage<CommonLotteryRecordApiVO> page, CommonLotteryRecordApiVO vo);
|
||||
|
||||
Boolean addRecord(Long userId, BigDecimal amount);
|
||||
|
||||
List<CommonLotteryWinnerApiVO> lotteryWinners();
|
||||
|
||||
IPage<MarketBenefitPackageVO> findUserPackList(IPage<UserMarketBenefitPackageEntity> page, MarketBenefitPackageVO userMarketBenefitPackage , Long userId);
|
||||
}
|
||||
@@ -27,6 +27,8 @@ package org.springblade.modules.common.service;
|
||||
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import org.springblade.modules.api.vo.FullRegionInfoVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonRegionsInfoVO;
|
||||
@@ -51,4 +53,6 @@ public interface ICommonRegionsInfoService extends BaseService<CommonRegionsInfo
|
||||
IPage<CommonRegionsInfoVO> selectRegionsInfoPage(IPage<CommonRegionsInfoVO> page, CommonRegionsInfoVO regionsInfo);
|
||||
|
||||
List<AppCommonRegionsInfoVO> findRegionList(@Min(value = 0) Long pid, @Max(value = 4 ) @Min(value = 0) Integer level);
|
||||
|
||||
FullRegionInfoVO queryFullInfo( Long regionId);
|
||||
}
|
||||
|
||||
@@ -25,11 +25,16 @@
|
||||
*/
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springblade.modules.api.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.api.vo.CommonUserAddressApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserAddressEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserAddressVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户地址表 服务类
|
||||
*
|
||||
@@ -46,4 +51,9 @@ public interface ICommonUserAddressService extends BaseService<CommonUserAddress
|
||||
*/
|
||||
IPage<CommonUserAddressVO> selectUserAddressPage(IPage<CommonUserAddressVO> page, CommonUserAddressVO userAddress);
|
||||
|
||||
List<CommonUserAddressApiVO> selectAddressList(IPage<CommonUserAddressApiVO> page, CommonUserAddressApiVO commonUserAddressVO);
|
||||
|
||||
boolean submitAddress(AddressSubmitRequest request);
|
||||
|
||||
boolean removeAddress(List<Long> ids);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public interface ICommonUserPointLogService extends BaseService<CommonUserPointLogEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commonUserPointLog 查询参数
|
||||
* @return IPage<CommonUserPointLogVO>
|
||||
*/
|
||||
IPage<CommonUserPointLogVO> selectCommonUserPointLogPage(IPage<CommonUserPointLogVO> page, CommonUserPointLogVO commonUserPointLog);
|
||||
|
||||
Boolean recordPointChangeLog(CommonUserPointEntity commonUserPoint, BigDecimal lastAmount, String sourceType, BigDecimal amount, Integer type, Long sourceId, String sourceDetail);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public interface ICommonUserPointService extends BaseService<CommonUserPointEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commonUserPoint 查询参数
|
||||
* @return IPage<CommonUserPointVO>
|
||||
*/
|
||||
IPage<CommonUserPointVO> selectCommonUserPointPage(IPage<CommonUserPointVO> page, CommonUserPointVO commonUserPoint);
|
||||
|
||||
BigDecimal queryPoint();
|
||||
|
||||
void grantPointsByUserOrder(CommonUserOrderEntity order);
|
||||
|
||||
void spendPointsForLottery(BigDecimal amount, Long userId);
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.redis.debounce.DebounceClient;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.api.request.LotteryDrawRequest;
|
||||
import org.springblade.modules.api.vo.CommonLotteryPrizeApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import org.springblade.modules.common.mapper.CommonLotteryPrizeMapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryPrizeService;
|
||||
import org.springblade.modules.common.service.ICommonLotteryRecordService;
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||
import org.springblade.modules.market.pojo.dto.MarketCashCouponApiDTO;
|
||||
import org.springblade.modules.market.service.IMarketCashCouponService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 奖品配置表 服务实现类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CommonLotteryPrizeServiceImpl extends BaseServiceImpl<CommonLotteryPrizeMapper, CommonLotteryPrizeEntity> implements ICommonLotteryPrizeService {
|
||||
|
||||
private final DebounceClient debounceClient;
|
||||
|
||||
private final ICommonUserPointService userPointService;
|
||||
|
||||
private final IMarketCashCouponService cashCouponService;
|
||||
|
||||
private final ICommonLotteryRecordService lotteryRecordService;
|
||||
|
||||
private static final List<CommonLotteryPrizeApiVO> STATIC_PRIZE_LIST = List.of(
|
||||
new CommonLotteryPrizeApiVO(0L, "谢谢参与"),
|
||||
new CommonLotteryPrizeApiVO(1L, "100积分"),
|
||||
new CommonLotteryPrizeApiVO(2L, "1000积分"),
|
||||
new CommonLotteryPrizeApiVO(3L, "生态礼包"),
|
||||
new CommonLotteryPrizeApiVO(4L, "黑茶礼盒"),
|
||||
new CommonLotteryPrizeApiVO(5L, "幸运锦鲤")
|
||||
);
|
||||
|
||||
private static final CommonLotteryPrizeApiVO PRIZE = new CommonLotteryPrizeApiVO(0L, "谢谢参与");
|
||||
|
||||
private static final String RULES = """
|
||||
活动名称:幸运大抽奖
|
||||
|
||||
活动时间:即日起至2026年8月31日 23:59(北京时间)
|
||||
|
||||
参与方式:
|
||||
- 消耗 100 积分 即可参与一次抽奖;
|
||||
|
||||
奖品说明:
|
||||
• 谢谢参与:未中奖,感谢支持;
|
||||
• 100积分:中奖后立即到账;
|
||||
• 1000积分:中奖后立即到账;
|
||||
• 生态礼包:内含精选生态商品组合,包邮到家;
|
||||
• 黑茶礼盒:高品质黑茶礼盒一份,典雅包装,适合馈赠;
|
||||
• 幸运锦鲤:超级大奖!包含实物礼包+专属权益,详情请留意中奖通知。
|
||||
|
||||
发放规则:
|
||||
- 积分类奖品:即时到账;
|
||||
- 实物奖品(生态礼包、黑茶礼盒、幸运锦鲤):中奖后3个工作日内联系您,请保持手机畅通并及时填写收货信息,逾期视为放弃。
|
||||
|
||||
温馨提示:
|
||||
1. 抽奖结果由系统随机生成,公平公正;
|
||||
2. 禁止使用外挂、脚本等作弊行为,一经发现将取消资格;
|
||||
3. 本活动最终解释权归平台所有。
|
||||
""";
|
||||
|
||||
@Override
|
||||
public IPage<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage<CommonLotteryPrizeVO> page, CommonLotteryPrizeVO lotteryPrize) {
|
||||
return page.setRecords(baseMapper.selectLotteryPrizePage(page, lotteryPrize));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonLotteryPrizeApiVO draw(LotteryDrawRequest request) {
|
||||
Long userId = AuthUtil.getUserId();
|
||||
String key = "lottery:" + userId;
|
||||
if (debounceClient.tryDebounce(key, 3, TimeUnit.SECONDS)) {
|
||||
Assert.isTrue(request.getAmount().compareTo(BigDecimal.valueOf(100)) == 0 || request.getAmount().compareTo(BigDecimal.valueOf(1000)) == 0, "无效积分");
|
||||
userPointService.spendPointsForLottery(request.getAmount(), userId);
|
||||
Boolean addCashCoupon = cashCouponService.addCashCoupon(new MarketCashCouponApiDTO().setAmount(request.getAmount()).setUserId(userId).setSourceType(MarketBusinessModule.LOTTERY));
|
||||
if (!addCashCoupon) {
|
||||
log.error("新增现金券失败");
|
||||
throw new RuntimeException("操作失败");
|
||||
}
|
||||
Boolean addedRecord = lotteryRecordService.addRecord(userId, request.getAmount());
|
||||
if (!addedRecord) {
|
||||
log.error("新增抽奖记录失败");
|
||||
throw new RuntimeException("操作失败");
|
||||
}
|
||||
} else {
|
||||
long remaining = debounceClient.getRemainingTime(key, TimeUnit.SECONDS);
|
||||
throw new RuntimeException("操作过于频繁,请" + remaining + "秒后重试");
|
||||
}
|
||||
return PRIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonLotteryPrizeApiVO> staticList() {
|
||||
return STATIC_PRIZE_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String rules() {
|
||||
return RULES;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.api.vo.CommonLotteryRecordApiVO;
|
||||
import org.springblade.modules.api.vo.CommonLotteryWinnerApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import org.springblade.modules.common.mapper.CommonLotteryRecordMapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 服务实现类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Service
|
||||
public class CommonLotteryRecordServiceImpl extends BaseServiceImpl<CommonLotteryRecordMapper, CommonLotteryRecordEntity> implements ICommonLotteryRecordService {
|
||||
|
||||
@Override
|
||||
public IPage<CommonLotteryRecordVO> selectLotteryRecordPage(IPage<CommonLotteryRecordVO> page, CommonLotteryRecordVO lotteryRecord) {
|
||||
return page.setRecords(baseMapper.selectLotteryRecordPage(page, lotteryRecord));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CommonLotteryRecordExcel> exportLotteryRecord(Wrapper<CommonLotteryRecordEntity> queryWrapper) {
|
||||
List<CommonLotteryRecordExcel> lotteryRecordList = baseMapper.exportLotteryRecord(queryWrapper);
|
||||
//lotteryRecordList.forEach(lotteryRecord -> {
|
||||
// lotteryRecord.setTypeName(DictCache.getValue(DictEnum.YES_NO, LotteryRecord.getType()));
|
||||
//});
|
||||
return lotteryRecordList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<CommonLotteryRecordApiVO> selectLotteryRecordApiPage(IPage<CommonLotteryRecordApiVO> page, CommonLotteryRecordApiVO vo) {
|
||||
CommonLotteryRecordVO lotteryRecord = new CommonLotteryRecordVO();
|
||||
lotteryRecord.setUserId(AuthUtil.getUserId());
|
||||
List<CommonLotteryRecordVO> voList = baseMapper.selectLotteryRecordPage(page, lotteryRecord);
|
||||
List<CommonLotteryRecordApiVO> list = voList.stream().map(record -> {
|
||||
CommonLotteryRecordApiVO apiVO = new CommonLotteryRecordApiVO();
|
||||
apiVO.setId(record.getId());
|
||||
apiVO.setPrizeName(record.getPrizeId() == null ? "谢谢参与。" : "中奖了!");
|
||||
apiVO.setPointsUsed(record.getPointsUsed());
|
||||
apiVO.setCreateTime(record.getCreateTime());
|
||||
return apiVO;
|
||||
}).toList();
|
||||
return page.setRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addRecord(Long userId, BigDecimal amount) {
|
||||
CommonLotteryRecordEntity lotteryRecord = new CommonLotteryRecordEntity();
|
||||
lotteryRecord.setUserId(userId);
|
||||
lotteryRecord.setPointsUsed(amount);
|
||||
return save(lotteryRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonLotteryWinnerApiVO> lotteryWinners() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springblade.modules.api.vo.FullRegionInfoVO;
|
||||
import org.springblade.modules.common.convert.AppCommonConvert;
|
||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
@@ -35,6 +36,8 @@ import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -64,4 +67,29 @@ public class CommonRegionsInfoServiceImpl extends BaseServiceImpl<CommonRegionsI
|
||||
return AppCommonConvert.INSTANCE.convertRegionsInfoListVO(regionsInfoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FullRegionInfoVO queryFullInfo(Long regionId) {
|
||||
CommonRegionsInfoEntity regionInfo = getById(regionId);
|
||||
Assert.notNull(regionInfo, "无效地区");
|
||||
Assert.isTrue(regionInfo.getLevel() > 0 && regionInfo.getLevel() < 5, "无效地区");
|
||||
FullRegionInfoVO result = new FullRegionInfoVO().setCurrentLevel(regionInfo.getLevel());
|
||||
switch (regionInfo.getLevel()) {
|
||||
case 4:
|
||||
result.setStreet(regionInfo.getName()).setStreetId(regionId);
|
||||
regionInfo = getById(regionInfo.getPid());
|
||||
case 3:
|
||||
result.setDistrict(regionInfo.getName()).setDistrictId(regionId);
|
||||
regionInfo = getById(regionInfo.getPid());
|
||||
case 2:
|
||||
result.setCity(regionInfo.getName()).setCityId(regionId);
|
||||
regionInfo = getById(regionInfo.getPid());
|
||||
case 1:
|
||||
result.setProvince(regionInfo.getName()).setProvinceId(regionId);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("无效地区");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,13 +25,26 @@
|
||||
*/
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.api.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.api.vo.CommonUserAddressApiVO;
|
||||
import org.springblade.modules.api.vo.FullRegionInfoVO;
|
||||
import org.springblade.modules.common.convert.AppCommonConvert;
|
||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserAddressEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserAddressVO;
|
||||
import org.springblade.modules.common.mapper.CommonUserAddressMapper;
|
||||
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
||||
import org.springblade.modules.common.service.ICommonUserAddressService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* 用户地址表 服务实现类
|
||||
@@ -40,11 +53,53 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CommonUserAddressServiceImpl extends BaseServiceImpl<CommonUserAddressMapper, CommonUserAddressEntity> implements ICommonUserAddressService {
|
||||
|
||||
private final ICommonRegionsInfoService regionInfoService;
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserAddressVO> selectUserAddressPage(IPage<CommonUserAddressVO> page, CommonUserAddressVO userAddress) {
|
||||
return page.setRecords(baseMapper.selectUserAddressPage(page, userAddress));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonUserAddressApiVO> selectAddressList(IPage<CommonUserAddressApiVO> page, CommonUserAddressApiVO commonUserAddressVO) {
|
||||
List<CommonUserAddressEntity> addressList = list(Wrappers.lambdaQuery(CommonUserAddressEntity.class)
|
||||
.eq(CommonUserAddressEntity::getUserId, AuthUtil.getUserId())
|
||||
.orderByDesc(CommonUserAddressEntity::getIsDefault , CommonUserAddressEntity::getId));
|
||||
return AppCommonConvert.INSTANCE.convertAddressListToVoList(addressList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean submitAddress(AddressSubmitRequest request) {
|
||||
|
||||
FullRegionInfoVO regionInfo = regionInfoService.queryFullInfo(Long.valueOf(request.getRegionsId()));
|
||||
Assert.isTrue(regionInfo.getCurrentLevel() == 4, "请选择所属街道");
|
||||
Assert.isTrue(isMobile(request.getPhone()), "手机号码格式不正确");
|
||||
Assert.isTrue(request.getConsignee().length() < 100 , "名字不能超过100个字");
|
||||
CommonUserAddressEntity address = AppCommonConvert.INSTANCE.convertRequestToPo(request);
|
||||
address
|
||||
.setProvince(regionInfo.getProvince())
|
||||
.setCity(regionInfo.getCity())
|
||||
.setDistrict(regionInfo.getDistrict())
|
||||
.setUserId(AuthUtil.getUserId())
|
||||
.setStreet(regionInfo.getStreet());
|
||||
if (request.getIsDefault() == 1) {
|
||||
update(Wrappers.lambdaUpdate(CommonUserAddressEntity.class).eq(CommonUserAddressEntity::getUserId, AuthUtil.getUserId()).set(CommonUserAddressEntity::getIsDefault, 0));
|
||||
}
|
||||
return saveOrUpdate(address);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAddress(List<Long> ids) {
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
private Boolean isMobile(String phone){
|
||||
Predicate<String> isPhoneValid = p -> p.matches("^1[3-9]\\d{9}$");
|
||||
return isPhoneValid.test(phone);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import org.springblade.modules.common.mapper.CommonUserOrderMapper;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
import org.springblade.modules.mall.service.IMallProductService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
@@ -77,6 +78,8 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
private final ApplicationEventPublisher eventPublisher;
|
||||
|
||||
private final ICommonUserPointService userPointService;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserOrderVO> selectOrderPage(IPage<CommonUserOrderVO> page, CommonUserOrderVO order) {
|
||||
@@ -113,7 +116,8 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
order.setActualAmount(actualAmount);
|
||||
order.setOrderType(orderType);
|
||||
order.setPaymentType(request.getIsOfflinePayment() ? request.getPaymentType() : null);
|
||||
save(order);
|
||||
order.setCreateTime(new Date());
|
||||
this.save(order);
|
||||
yield new CreateOrderResponse(String.valueOf(order.getId()), actualAmount, totalAmount, discount);
|
||||
}
|
||||
case TRAVEL_GROUP -> {
|
||||
@@ -125,10 +129,10 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
@Override
|
||||
public PaymentResponse pay(PaymentRequest request) {
|
||||
//todo先判断是否为线下支付,如果是线下支付则立即返回
|
||||
CommonUserOrderEntity order = getById(Long.valueOf(request.getOrderId()));
|
||||
Assert.notNull(order, "无效订单");
|
||||
Assert.isTrue(order.getPaymentType() != 99, "线下订单不能重复支付");
|
||||
//todo: 继续支付逻辑
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -152,12 +156,6 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RedisDebounce(key = "order:confirm", param = "#id", interval = 20, includeRemainingTime = true, message = "操作过于频繁")
|
||||
public boolean confirmPayment(Long id) {
|
||||
|
||||
CommonUserOrderEntity order = getById(id);
|
||||
if (order == null || order.getIsDeleted() == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean updated = update(Wrappers.<CommonUserOrderEntity>lambdaUpdate()
|
||||
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.PAID.getCode())
|
||||
.set(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.PAID.getCode())
|
||||
@@ -169,10 +167,18 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
.eq(CommonUserOrderEntity::getIsDeleted, 0)
|
||||
);
|
||||
if (!updated) {
|
||||
return false;
|
||||
// 可能已被处理过,或状态不符 → 幂等返回 true(避免报错)
|
||||
log.warn("订单 {} 无需处理或已处理", id);
|
||||
return true; // ⭐ 幂等:已成功过就不要再失败
|
||||
}
|
||||
//todo:增加用户积分
|
||||
CommonUserOrderEntity order = getById(id);
|
||||
if (order == null) {
|
||||
throw new IllegalStateException("订单更新成功但查询不到,id=" + id);
|
||||
}
|
||||
userPointService.grantPointsByUserOrder(order);
|
||||
|
||||
eventPublisher.publishEvent(new PaymentSuccessEvent(id, order.getUserId(), BusinessModule.SELF_OPERATED_MALL));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import org.springblade.modules.common.mapper.CommonUserPointLogMapper;
|
||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 服务实现类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Service
|
||||
public class CommonUserPointLogServiceImpl extends BaseServiceImpl<CommonUserPointLogMapper, CommonUserPointLogEntity> implements ICommonUserPointLogService {
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserPointLogVO> selectCommonUserPointLogPage(IPage<CommonUserPointLogVO> page, CommonUserPointLogVO commonUserPointLog) {
|
||||
return page.setRecords(baseMapper.selectCommonUserPointLogPage(page, commonUserPointLog));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean recordPointChangeLog(CommonUserPointEntity commonUserPoint, BigDecimal lastAmount, String sourceType, BigDecimal amount, Integer type, Long sourceId, String sourceDetail) {
|
||||
CommonUserPointLogEntity userPointLog = new CommonUserPointLogEntity();
|
||||
userPointLog.setType(type);
|
||||
userPointLog.setUserId(commonUserPoint.getId());
|
||||
userPointLog.setAmount(amount);
|
||||
userPointLog.setSourceType(sourceType);
|
||||
userPointLog.setSourceId(sourceId);
|
||||
userPointLog.setSourceDetail(sourceDetail);
|
||||
userPointLog.setIsComplete(1);
|
||||
userPointLog.setStatisticalDate(DateUtil.getToday());
|
||||
userPointLog.setLastAmount(lastAmount);
|
||||
return save(userPointLog);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
import org.springblade.modules.common.eums.UserPointFlowType;
|
||||
import org.springblade.modules.common.event.GrantUserPointEvent;
|
||||
import org.springblade.modules.common.event.SpendUserPointEvent;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
||||
import org.springblade.modules.common.mapper.CommonUserPointMapper;
|
||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static org.springblade.modules.common.eums.BusinessModule.LOTTERY;
|
||||
import static org.springblade.modules.common.eums.BusinessModule.SELF_OPERATED_MALL;
|
||||
|
||||
/**
|
||||
* 用户积分表 服务实现类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointMapper, CommonUserPointEntity> implements ICommonUserPointService {
|
||||
|
||||
private final ICommonUserPointLogService userPointLogService;
|
||||
|
||||
private final ApplicationEventPublisher eventPublisher;
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserPointVO> selectCommonUserPointPage(IPage<CommonUserPointVO> page, CommonUserPointVO commonUserPoint) {
|
||||
return page.setRecords(baseMapper.selectCommonUserPointPage(page, commonUserPoint));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal queryPoint() {
|
||||
CommonUserPointEntity userPoint = getById(AuthUtil.getUserId());
|
||||
return userPoint.getAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void grantPointsByUserOrder(CommonUserOrderEntity order) {
|
||||
Assert.notNull(order, "无效订单");
|
||||
Assert.isTrue(order.getId() != null && order.getUserId() != null && order.getActualAmount() != null && order.getActualAmount().compareTo(BigDecimal.ZERO) > 0, "无效订单");
|
||||
BigDecimal pointsAmount;
|
||||
String sourceType;
|
||||
switch (BusinessModule.fromCodeIgnoreCaseOrNull(order.getOrderType())) {
|
||||
case SELF_OPERATED_MALL -> {
|
||||
pointsAmount = order.getActualAmount().multiply(BigDecimal.valueOf(0.3));
|
||||
sourceType = SELF_OPERATED_MALL.getCode();
|
||||
}
|
||||
default -> throw new RuntimeException("无效订单类型");
|
||||
}
|
||||
CommonUserPointEntity userPoint = getById(order.getUserId());
|
||||
BigDecimal lastAmount = userPoint.getAmount();
|
||||
int i = baseMapper.addUserPoint(order.getUserId(), pointsAmount, userPoint.getVersion());
|
||||
if (i > 0) {
|
||||
if (userPointLogService.recordPointChangeLog(userPoint, lastAmount, sourceType.toUpperCase(), pointsAmount, UserPointFlowType.GRANT.getCode(), order.getId(), JSON.toJSONString(order))) {
|
||||
eventPublisher.publishEvent(new GrantUserPointEvent(order.getId(), order.getUserId(), pointsAmount, BusinessModule.fromCodeIgnoreCaseOrNull(sourceType)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("奖励用户积分失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void spendPointsForLottery(BigDecimal amount, Long userId) {
|
||||
Assert.isTrue(amount.compareTo(BigDecimal.valueOf(100)) == 0 || amount.compareTo(BigDecimal.valueOf(1000)) == 0, "无效积分");
|
||||
Assert.notNull(userId, "无效用户");
|
||||
CommonUserPointEntity userPoint = getById(userId);
|
||||
Assert.isTrue(userPoint.getAmount().compareTo(amount) >= 0, "积分不足");
|
||||
BigDecimal lastAmount = userPoint.getAmount();
|
||||
int i = baseMapper.deductUserPoint(userId, amount, userPoint.getVersion());
|
||||
if (i > 0) {
|
||||
if (userPointLogService.recordPointChangeLog(userPoint, lastAmount, LOTTERY.getCode().toUpperCase(), amount.negate(), UserPointFlowType.SPEND.getCode(), null, null)) {
|
||||
eventPublisher.publishEvent(new SpendUserPointEvent(userId, amount, LOTTERY));
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("消费用户积分失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 奖品配置表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public class CommonLotteryPrizeWrapper extends BaseEntityWrapper<CommonLotteryPrizeEntity, CommonLotteryPrizeVO> {
|
||||
|
||||
public static CommonLotteryPrizeWrapper build() {
|
||||
return new CommonLotteryPrizeWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonLotteryPrizeVO entityVO(CommonLotteryPrizeEntity lotteryPrize) {
|
||||
CommonLotteryPrizeVO lotteryPrizeVO = Objects.requireNonNull(BeanUtil.copyProperties(lotteryPrize, CommonLotteryPrizeVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(lotteryPrize.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(lotteryPrize.getUpdateUser());
|
||||
//lotteryPrizeVO.setCreateUserName(createUser.getName());
|
||||
//lotteryPrizeVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return lotteryPrizeVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public class CommonLotteryRecordWrapper extends BaseEntityWrapper<CommonLotteryRecordEntity, CommonLotteryRecordVO> {
|
||||
|
||||
public static CommonLotteryRecordWrapper build() {
|
||||
return new CommonLotteryRecordWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonLotteryRecordVO entityVO(CommonLotteryRecordEntity lotteryRecord) {
|
||||
CommonLotteryRecordVO lotteryRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(lotteryRecord, CommonLotteryRecordVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(lotteryRecord.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(lotteryRecord.getUpdateUser());
|
||||
//lotteryRecordVO.setCreateUserName(createUser.getName());
|
||||
//lotteryRecordVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return lotteryRecordVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public class CommonUserPointLogWrapper extends BaseEntityWrapper<CommonUserPointLogEntity, CommonUserPointLogVO> {
|
||||
|
||||
public static CommonUserPointLogWrapper build() {
|
||||
return new CommonUserPointLogWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonUserPointLogVO entityVO(CommonUserPointLogEntity commonUserPointLog) {
|
||||
CommonUserPointLogVO commonUserPointLogVO = Objects.requireNonNull(BeanUtil.copyProperties(commonUserPointLog, CommonUserPointLogVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(commonUserPointLog.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(commonUserPointLog.getUpdateUser());
|
||||
//commonUserPointLogVO.setCreateUserName(createUser.getName());
|
||||
//commonUserPointLogVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return commonUserPointLogVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户商城积分表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
public class CommonUserPointWrapper extends BaseEntityWrapper<CommonUserPointEntity, CommonUserPointVO> {
|
||||
|
||||
public static CommonUserPointWrapper build() {
|
||||
return new CommonUserPointWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonUserPointVO entityVO(CommonUserPointEntity commonUserPoint) {
|
||||
CommonUserPointVO commonUserPointVO = Objects.requireNonNull(BeanUtil.copyProperties(commonUserPoint, CommonUserPointVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(commonUserPoint.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(commonUserPoint.getUpdateUser());
|
||||
//commonUserPointVO.setCreateUserName(createUser.getName());
|
||||
//commonUserPointVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return commonUserPointVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPackageVO;
|
||||
import org.springblade.modules.market.wrapper.MarketBenefitPackageWrapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/benefit-package/")
|
||||
@Tag(name = "用户积分包信息表", description = "用户积分包信息表接口")
|
||||
public class MarketBenefitPackageController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPackageService userMarketBenefitPackageService;
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入userMarketBenefitPackage")
|
||||
public R<MarketBenefitPackageVO> detail(MarketBenefitPackageEntity userMarketBenefitPackage) {
|
||||
MarketBenefitPackageEntity detail = userMarketBenefitPackageService.getOne(Condition.getQueryWrapper(userMarketBenefitPackage));
|
||||
return R.data(MarketBenefitPackageWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户积分包信息表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackage")
|
||||
public R<IPage<MarketBenefitPackageVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userMarketBenefitPackage, Query query) {
|
||||
IPage<MarketBenefitPackageEntity> pages = userMarketBenefitPackageService.page(Condition.getPage(query), Condition.getQueryWrapper(userMarketBenefitPackage, MarketBenefitPackageEntity.class).orderByDesc("id"));
|
||||
return R.data(MarketBenefitPackageWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackage")
|
||||
public R<IPage<MarketBenefitPackageVO>> page(MarketBenefitPackageVO userMarketBenefitPackage, Query query) {
|
||||
IPage<MarketBenefitPackageVO> pages = userMarketBenefitPackageService.selectUserMarketBenefitPackagePage(Condition.getPage(query), userMarketBenefitPackage);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入userMarketBenefitPackage")
|
||||
public R save(@Valid @RequestBody MarketBenefitPackageEntity userMarketBenefitPackage) {
|
||||
return R.status(userMarketBenefitPackageService.save(userMarketBenefitPackage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入userMarketBenefitPackage")
|
||||
public R update(@Valid @RequestBody MarketBenefitPackageEntity userMarketBenefitPackage) {
|
||||
return R.status(userMarketBenefitPackageService.updateById(userMarketBenefitPackage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入userMarketBenefitPackage")
|
||||
public R submit(@Valid @RequestBody MarketBenefitPackageEntity userMarketBenefitPackage) {
|
||||
return R.status(userMarketBenefitPackageService.saveOrUpdate(userMarketBenefitPackage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(userMarketBenefitPackageService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPackageLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketBenefitPackageLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 划拨积分记录 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/benefit-package-log")
|
||||
@Tag(name = "划拨积分记录", description = "划拨积分记录接口")
|
||||
public class MarketBenefitPackageLogController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPackageLogService userMarketBenefitPackageLogService;
|
||||
|
||||
/**
|
||||
* 划拨积分记录 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入userMarketBenefitPackageLog")
|
||||
public R<MarketBenefitPackageLogVO> detail(MarketBenefitPackageLogEntity userMarketBenefitPackageLog) {
|
||||
MarketBenefitPackageLogEntity detail = userMarketBenefitPackageLogService.getOne(Condition.getQueryWrapper(userMarketBenefitPackageLog));
|
||||
return R.data(MarketBenefitPackageLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 划拨积分记录 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackageLog")
|
||||
public R<IPage<MarketBenefitPackageLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userMarketBenefitPackageLog, Query query) {
|
||||
IPage<MarketBenefitPackageLogEntity> pages = userMarketBenefitPackageLogService.page(Condition.getPage(query), Condition.getQueryWrapper(userMarketBenefitPackageLog, MarketBenefitPackageLogEntity.class).orderByDesc("id"));
|
||||
return R.data(MarketBenefitPackageLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 划拨积分记录 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackageLog")
|
||||
public R<IPage<MarketBenefitPackageLogVO>> page(MarketBenefitPackageLogVO userMarketBenefitPackageLog, Query query) {
|
||||
IPage<MarketBenefitPackageLogVO> pages = userMarketBenefitPackageLogService.selectUserMarketBenefitPackageLogPage(Condition.getPage(query), userMarketBenefitPackageLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 划拨积分记录 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入userMarketBenefitPackageLog")
|
||||
public R save(@Valid @RequestBody MarketBenefitPackageLogEntity userMarketBenefitPackageLog) {
|
||||
return R.status(userMarketBenefitPackageLogService.save(userMarketBenefitPackageLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 划拨积分记录 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入userMarketBenefitPackageLog")
|
||||
public R update(@Valid @RequestBody MarketBenefitPackageLogEntity userMarketBenefitPackageLog) {
|
||||
return R.status(userMarketBenefitPackageLogService.updateById(userMarketBenefitPackageLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 划拨积分记录 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入userMarketBenefitPackageLog")
|
||||
public R submit(@Valid @RequestBody MarketBenefitPackageLogEntity userMarketBenefitPackageLog) {
|
||||
return R.status(userMarketBenefitPackageLogService.saveOrUpdate(userMarketBenefitPackageLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 划拨积分记录 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(userMarketBenefitPackageLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.pojo.vo.MarketImportBenefitPackageError;
|
||||
import org.springblade.modules.market.request.AllocatePackRequest;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageTemplateEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPackageTemplateVO;
|
||||
import org.springblade.modules.market.wrapper.MarketBenefitPackageTemplateWrapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageTemplateService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 积分包信息表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/benefit-package-template")
|
||||
@Tag(name = "积分包信息表", description = "积分包信息表接口")
|
||||
public class MarketBenefitPackageTemplateController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPackageTemplateService userMarketBenefitPackageTemplateService;
|
||||
|
||||
/**
|
||||
* 积分包信息表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R<MarketBenefitPackageTemplateVO> detail(MarketBenefitPackageTemplateEntity userMarketBenefitPackageTemplate) {
|
||||
MarketBenefitPackageTemplateEntity detail = userMarketBenefitPackageTemplateService.getOne(Condition.getQueryWrapper(userMarketBenefitPackageTemplate));
|
||||
return R.data(MarketBenefitPackageTemplateWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 积分包信息表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R<IPage<MarketBenefitPackageTemplateVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userMarketBenefitPackageTemplate, Query query) {
|
||||
IPage<MarketBenefitPackageTemplateEntity> pages = userMarketBenefitPackageTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(userMarketBenefitPackageTemplate, MarketBenefitPackageTemplateEntity.class).orderByDesc("id"));
|
||||
return R.data(MarketBenefitPackageTemplateWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分包信息表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R<IPage<MarketBenefitPackageTemplateVO>> page(MarketBenefitPackageTemplateVO userMarketBenefitPackageTemplate, Query query) {
|
||||
IPage<MarketBenefitPackageTemplateVO> pages = userMarketBenefitPackageTemplateService.selectUserMarketBenefitPackageTemplatePage(Condition.getPage(query), userMarketBenefitPackageTemplate);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分包信息表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R save(@Valid @RequestBody MarketBenefitPackageTemplateEntity userMarketBenefitPackageTemplate) {
|
||||
return R.status(userMarketBenefitPackageTemplateService.save(userMarketBenefitPackageTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分包信息表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R update(@Valid @RequestBody MarketBenefitPackageTemplateEntity userMarketBenefitPackageTemplate) {
|
||||
return R.status(userMarketBenefitPackageTemplateService.updateById(userMarketBenefitPackageTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分包信息表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入userMarketBenefitPackageTemplate")
|
||||
public R submit(@Valid @RequestBody MarketBenefitPackageTemplateEntity userMarketBenefitPackageTemplate) {
|
||||
return R.status(userMarketBenefitPackageTemplateService.saveOrUpdate(userMarketBenefitPackageTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分包信息表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(userMarketBenefitPackageTemplateService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/allocate-benefit-package")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "划拨福利包")
|
||||
public R allocatePackToUser(@Valid @RequestBody AllocatePackRequest request) {
|
||||
return R.status(userMarketBenefitPackageTemplateService.allocatePackToUser(request));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("import-benefit-package")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "导入福利包", description = "传入excel")
|
||||
public R<List<MarketImportBenefitPackageError>> importBenefitPackage(MultipartFile file) {
|
||||
return R.data(userMarketBenefitPackageTemplateService.importBenefitPackage(file));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.manager.MarketUserPointManager;
|
||||
import org.springblade.modules.market.request.BenefitPointTransferRequest;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointVO;
|
||||
import org.springblade.modules.market.wrapper.MarketBenefitPointWrapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户福利值表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/benefit-point")
|
||||
@Tag(name = "用户福利值表", description = "用户福利值表接口")
|
||||
public class MarketBenefitPointController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPointService marketBenefitPointService;
|
||||
private final MarketUserPointManager marketUserPointManager;
|
||||
|
||||
/**
|
||||
* 用户福利值表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonBenefitPoint")
|
||||
public R<MarketBenefitPointVO> detail(MarketBenefitPointEntity commonBenefitPoint) {
|
||||
MarketBenefitPointEntity detail = marketBenefitPointService.getOne(Condition.getQueryWrapper(commonBenefitPoint));
|
||||
return R.data(MarketBenefitPointWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户福利值表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonBenefitPoint")
|
||||
public R<IPage<MarketBenefitPointVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonBenefitPoint, Query query) {
|
||||
IPage<MarketBenefitPointEntity> pages = marketBenefitPointService.page(Condition.getPage(query), Condition.getQueryWrapper(commonBenefitPoint, MarketBenefitPointEntity.class));
|
||||
return R.data(MarketBenefitPointWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonBenefitPoint")
|
||||
public R<IPage<MarketBenefitPointVO>> page(MarketBenefitPointVO commonBenefitPoint, Query query) {
|
||||
IPage<MarketBenefitPointVO> pages = marketBenefitPointService.selectCommonBenefitPointPage(Condition.getPage(query), commonBenefitPoint);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonBenefitPoint")
|
||||
public R save(@Valid @RequestBody MarketBenefitPointEntity commonBenefitPoint) {
|
||||
return R.status(marketBenefitPointService.save(commonBenefitPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonBenefitPoint")
|
||||
public R update(@Valid @RequestBody MarketBenefitPointEntity commonBenefitPoint) {
|
||||
return R.status(marketBenefitPointService.updateById(commonBenefitPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonBenefitPoint")
|
||||
public R submit(@Valid @RequestBody MarketBenefitPointEntity commonBenefitPoint) {
|
||||
return R.status(marketBenefitPointService.saveOrUpdate(commonBenefitPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketBenefitPointService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/transfer")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "划拨福利积分", description = "传入request")
|
||||
public R transfer(@RequestBody BenefitPointTransferRequest request) {
|
||||
return R.status(marketUserPointManager.transfer(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketBenefitPointLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/benefit-point-log")
|
||||
@Tag(name = "用户福利值流水表", description = "用户福利值流水表接口")
|
||||
public class MarketBenefitPointLogController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPointLogService marketBenefitPointLogService;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonBenefitPointLog")
|
||||
public R<MarketBenefitPointLogVO> detail(MarketBenefitPointLogEntity commonBenefitPointLog) {
|
||||
MarketBenefitPointLogEntity detail = marketBenefitPointLogService.getOne(Condition.getQueryWrapper(commonBenefitPointLog));
|
||||
return R.data(MarketBenefitPointLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户福利值流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonBenefitPointLog")
|
||||
public R<IPage<MarketBenefitPointLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonBenefitPointLog, Query query) {
|
||||
IPage<MarketBenefitPointLogEntity> pages = marketBenefitPointLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commonBenefitPointLog, MarketBenefitPointLogEntity.class));
|
||||
return R.data(MarketBenefitPointLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonBenefitPointLog")
|
||||
public R<IPage<MarketBenefitPointLogVO>> page(MarketBenefitPointLogVO commonBenefitPointLog, Query query) {
|
||||
IPage<MarketBenefitPointLogVO> pages = marketBenefitPointLogService.selectCommonBenefitPointLogPage(Condition.getPage(query), commonBenefitPointLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonBenefitPointLog")
|
||||
public R save(@Valid @RequestBody MarketBenefitPointLogEntity commonBenefitPointLog) {
|
||||
return R.status(marketBenefitPointLogService.save(commonBenefitPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonBenefitPointLog")
|
||||
public R update(@Valid @RequestBody MarketBenefitPointLogEntity commonBenefitPointLog) {
|
||||
return R.status(marketBenefitPointLogService.updateById(commonBenefitPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonBenefitPointLog")
|
||||
public R submit(@Valid @RequestBody MarketBenefitPointLogEntity commonBenefitPointLog) {
|
||||
return R.status(marketBenefitPointLogService.saveOrUpdate(commonBenefitPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketBenefitPointLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCashCouponVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCashCouponWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCashCouponService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户现金券表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/cash-coupon")
|
||||
@Tag(name = "用户现金券表", description = "用户现金券表接口")
|
||||
public class MarketCashCouponController extends BladeController {
|
||||
|
||||
private final IMarketCashCouponService marketCashCouponService;
|
||||
|
||||
/**
|
||||
* 用户现金券表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonCashCoupon")
|
||||
public R<MarketCashCouponVO> detail(MarketCashCouponEntity commonCashCoupon) {
|
||||
MarketCashCouponEntity detail = marketCashCouponService.getOne(Condition.getQueryWrapper(commonCashCoupon));
|
||||
return R.data(MarketCashCouponWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户现金券表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonCashCoupon")
|
||||
public R<IPage<MarketCashCouponVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonCashCoupon, Query query) {
|
||||
IPage<MarketCashCouponEntity> pages = marketCashCouponService.page(Condition.getPage(query), Condition.getQueryWrapper(commonCashCoupon, MarketCashCouponEntity.class));
|
||||
return R.data(MarketCashCouponWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonCashCoupon")
|
||||
public R<IPage<MarketCashCouponVO>> page(MarketCashCouponVO commonCashCoupon, Query query) {
|
||||
IPage<MarketCashCouponVO> pages = marketCashCouponService.selectCommonCashCouponPage(Condition.getPage(query), commonCashCoupon);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonCashCoupon")
|
||||
public R save(@Valid @RequestBody MarketCashCouponEntity commonCashCoupon) {
|
||||
return R.status(marketCashCouponService.save(commonCashCoupon));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonCashCoupon")
|
||||
public R update(@Valid @RequestBody MarketCashCouponEntity commonCashCoupon) {
|
||||
return R.status(marketCashCouponService.updateById(commonCashCoupon));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonCashCoupon")
|
||||
public R submit(@Valid @RequestBody MarketCashCouponEntity commonCashCoupon) {
|
||||
return R.status(marketCashCouponService.saveOrUpdate(commonCashCoupon));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCashCouponService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCashCouponLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCashCouponLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCashCouponLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market/cash-coupon-log")
|
||||
@Tag(name = "用户现金券流水表", description = "用户现金券流水表接口")
|
||||
public class MarketCashCouponLogController extends BladeController {
|
||||
|
||||
private final IMarketCashCouponLogService marketCashCouponLogService;
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commonCashCouponLog")
|
||||
public R<MarketCashCouponLogVO> detail(MarketCashCouponLogEntity commonCashCouponLog) {
|
||||
MarketCashCouponLogEntity detail = marketCashCouponLogService.getOne(Condition.getQueryWrapper(commonCashCouponLog));
|
||||
return R.data(MarketCashCouponLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户现金券流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commonCashCouponLog")
|
||||
public R<IPage<MarketCashCouponLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonCashCouponLog, Query query) {
|
||||
IPage<MarketCashCouponLogEntity> pages = marketCashCouponLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commonCashCouponLog, MarketCashCouponLogEntity.class));
|
||||
return R.data(MarketCashCouponLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commonCashCouponLog")
|
||||
public R<IPage<MarketCashCouponLogVO>> page(MarketCashCouponLogVO commonCashCouponLog, Query query) {
|
||||
IPage<MarketCashCouponLogVO> pages = marketCashCouponLogService.selectCommonCashCouponLogPage(Condition.getPage(query), commonCashCouponLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commonCashCouponLog")
|
||||
public R save(@Valid @RequestBody MarketCashCouponLogEntity commonCashCouponLog) {
|
||||
return R.status(marketCashCouponLogService.save(commonCashCouponLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commonCashCouponLog")
|
||||
public R update(@Valid @RequestBody MarketCashCouponLogEntity commonCashCouponLog) {
|
||||
return R.status(marketCashCouponLogService.updateById(commonCashCouponLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commonCashCouponLog")
|
||||
public R submit(@Valid @RequestBody MarketCashCouponLogEntity commonCashCouponLog) {
|
||||
return R.status(marketCashCouponLogService.saveOrUpdate(commonCashCouponLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCashCouponLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionAccountEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionAccountVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionAccountWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionAccountService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/account")
|
||||
@Tag(name = "用户佣金账户表", description = "用户佣金账户表接口")
|
||||
public class MarketCommissionAccountController extends BladeController {
|
||||
|
||||
private final IMarketCommissionAccountService marketCommissionAccountService;
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionAccount")
|
||||
public R<MarketCommissionAccountVO> detail(MarketCommissionAccountEntity marketCommissionAccount) {
|
||||
MarketCommissionAccountEntity detail = marketCommissionAccountService.getOne(Condition.getQueryWrapper(marketCommissionAccount));
|
||||
return R.data(MarketCommissionAccountWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户佣金账户表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAccount")
|
||||
public R<IPage<MarketCommissionAccountVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionAccount, Query query) {
|
||||
IPage<MarketCommissionAccountEntity> pages = marketCommissionAccountService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionAccount, MarketCommissionAccountEntity.class));
|
||||
return R.data(MarketCommissionAccountWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAccount")
|
||||
public R<IPage<MarketCommissionAccountVO>> page(MarketCommissionAccountVO marketCommissionAccount, Query query) {
|
||||
IPage<MarketCommissionAccountVO> pages = marketCommissionAccountService.selectMarketCommissionAccountPage(Condition.getPage(query), marketCommissionAccount);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionAccount")
|
||||
public R save(@Valid @RequestBody MarketCommissionAccountEntity marketCommissionAccount) {
|
||||
return R.status(marketCommissionAccountService.save(marketCommissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionAccount")
|
||||
public R update(@Valid @RequestBody MarketCommissionAccountEntity marketCommissionAccount) {
|
||||
return R.status(marketCommissionAccountService.updateById(marketCommissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionAccount")
|
||||
public R submit(@Valid @RequestBody MarketCommissionAccountEntity marketCommissionAccount) {
|
||||
return R.status(marketCommissionAccountService.saveOrUpdate(marketCommissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionAccountService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionAdvertisingLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionAdvertisingLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionAdvertisingLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionAdvertisingLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/advertising-log")
|
||||
@Tag(name = "5%广告补贴佣金流水表", description = "5%广告补贴佣金流水表接口")
|
||||
public class MarketCommissionAdvertisingLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionAdvertisingLogService marketCommissionAdvertisingLogService;
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionAdvertisingLog")
|
||||
public R<MarketCommissionAdvertisingLogVO> detail(MarketCommissionAdvertisingLogEntity marketCommissionAdvertisingLog) {
|
||||
MarketCommissionAdvertisingLogEntity detail = marketCommissionAdvertisingLogService.getOne(Condition.getQueryWrapper(marketCommissionAdvertisingLog));
|
||||
return R.data(MarketCommissionAdvertisingLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAdvertisingLog")
|
||||
public R<IPage<MarketCommissionAdvertisingLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionAdvertisingLog, Query query) {
|
||||
IPage<MarketCommissionAdvertisingLogEntity> pages = marketCommissionAdvertisingLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionAdvertisingLog, MarketCommissionAdvertisingLogEntity.class));
|
||||
return R.data(MarketCommissionAdvertisingLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAdvertisingLog")
|
||||
public R<IPage<MarketCommissionAdvertisingLogVO>> page(MarketCommissionAdvertisingLogVO marketCommissionAdvertisingLog, Query query) {
|
||||
IPage<MarketCommissionAdvertisingLogVO> pages = marketCommissionAdvertisingLogService.selectMarketCommissionAdvertisingLogPage(Condition.getPage(query), marketCommissionAdvertisingLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionAdvertisingLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionAdvertisingLogEntity marketCommissionAdvertisingLog) {
|
||||
return R.status(marketCommissionAdvertisingLogService.save(marketCommissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionAdvertisingLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionAdvertisingLogEntity marketCommissionAdvertisingLog) {
|
||||
return R.status(marketCommissionAdvertisingLogService.updateById(marketCommissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionAdvertisingLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionAdvertisingLogEntity marketCommissionAdvertisingLog) {
|
||||
return R.status(marketCommissionAdvertisingLogService.saveOrUpdate(marketCommissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionAdvertisingLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionAgencyLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionAgencyLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionAgencyLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionAgencyLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/agency-log")
|
||||
@Tag(name = "15%极差代理佣金流水表", description = "15%极差代理佣金流水表接口")
|
||||
public class MarketCommissionAgencyLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionAgencyLogService marketCommissionAgencyLogService;
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionAgencyLog")
|
||||
public R<MarketCommissionAgencyLogVO> detail(MarketCommissionAgencyLogEntity marketCommissionAgencyLog) {
|
||||
MarketCommissionAgencyLogEntity detail = marketCommissionAgencyLogService.getOne(Condition.getQueryWrapper(marketCommissionAgencyLog));
|
||||
return R.data(MarketCommissionAgencyLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 15%极差代理佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAgencyLog")
|
||||
public R<IPage<MarketCommissionAgencyLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionAgencyLog, Query query) {
|
||||
IPage<MarketCommissionAgencyLogEntity> pages = marketCommissionAgencyLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionAgencyLog, MarketCommissionAgencyLogEntity.class));
|
||||
return R.data(MarketCommissionAgencyLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionAgencyLog")
|
||||
public R<IPage<MarketCommissionAgencyLogVO>> page(MarketCommissionAgencyLogVO marketCommissionAgencyLog, Query query) {
|
||||
IPage<MarketCommissionAgencyLogVO> pages = marketCommissionAgencyLogService.selectMarketCommissionAgencyLogPage(Condition.getPage(query), marketCommissionAgencyLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionAgencyLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionAgencyLogEntity marketCommissionAgencyLog) {
|
||||
return R.status(marketCommissionAgencyLogService.save(marketCommissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionAgencyLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionAgencyLogEntity marketCommissionAgencyLog) {
|
||||
return R.status(marketCommissionAgencyLogService.updateById(marketCommissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionAgencyLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionAgencyLogEntity marketCommissionAgencyLog) {
|
||||
return R.status(marketCommissionAgencyLogService.saveOrUpdate(marketCommissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionAgencyLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionCoCreatorLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionCoCreatorLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionCoCreatorLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionCoCreatorLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/cocreator-log")
|
||||
@Tag(name = "5%联创佣金流水表", description = "5%联创佣金流水表接口")
|
||||
public class MarketCommissionCoCreatorLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionCoCreatorLogService marketCommissionCoCreatorLogService;
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionCoCreatorLog")
|
||||
public R<MarketCommissionCoCreatorLogVO> detail(MarketCommissionCoCreatorLogEntity marketCommissionCoCreatorLog) {
|
||||
MarketCommissionCoCreatorLogEntity detail = marketCommissionCoCreatorLogService.getOne(Condition.getQueryWrapper(marketCommissionCoCreatorLog));
|
||||
return R.data(MarketCommissionCoCreatorLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%联创佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionCoCreatorLog")
|
||||
public R<IPage<MarketCommissionCoCreatorLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionCoCreatorLog, Query query) {
|
||||
IPage<MarketCommissionCoCreatorLogEntity> pages = marketCommissionCoCreatorLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionCoCreatorLog, MarketCommissionCoCreatorLogEntity.class));
|
||||
return R.data(MarketCommissionCoCreatorLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionCoCreatorLog")
|
||||
public R<IPage<MarketCommissionCoCreatorLogVO>> page(MarketCommissionCoCreatorLogVO marketCommissionCoCreatorLog, Query query) {
|
||||
IPage<MarketCommissionCoCreatorLogVO> pages = marketCommissionCoCreatorLogService.selectMarketCommissionCoCreatorLogPage(Condition.getPage(query), marketCommissionCoCreatorLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionCoCreatorLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionCoCreatorLogEntity marketCommissionCoCreatorLog) {
|
||||
return R.status(marketCommissionCoCreatorLogService.save(marketCommissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionCoCreatorLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionCoCreatorLogEntity marketCommissionCoCreatorLog) {
|
||||
return R.status(marketCommissionCoCreatorLogService.updateById(marketCommissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionCoCreatorLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionCoCreatorLogEntity marketCommissionCoCreatorLog) {
|
||||
return R.status(marketCommissionCoCreatorLogService.saveOrUpdate(marketCommissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionCoCreatorLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionDirectPushLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionDirectPushLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionDirectPushLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionDirectPushLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/direct-push-log")
|
||||
@Tag(name = "10%直推人佣金流水表", description = "10%直推人佣金流水表接口")
|
||||
public class MarketCommissionDirectPushLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionDirectPushLogService marketCommissionDirectPushLogService;
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionDirectPushLog")
|
||||
public R<MarketCommissionDirectPushLogVO> detail(MarketCommissionDirectPushLogEntity marketCommissionDirectPushLog) {
|
||||
MarketCommissionDirectPushLogEntity detail = marketCommissionDirectPushLogService.getOne(Condition.getQueryWrapper(marketCommissionDirectPushLog));
|
||||
return R.data(MarketCommissionDirectPushLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 10%直推人佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionDirectPushLog")
|
||||
public R<IPage<MarketCommissionDirectPushLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionDirectPushLog, Query query) {
|
||||
IPage<MarketCommissionDirectPushLogEntity> pages = marketCommissionDirectPushLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionDirectPushLog, MarketCommissionDirectPushLogEntity.class));
|
||||
return R.data(MarketCommissionDirectPushLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionDirectPushLog")
|
||||
public R<IPage<MarketCommissionDirectPushLogVO>> page(MarketCommissionDirectPushLogVO marketCommissionDirectPushLog, Query query) {
|
||||
IPage<MarketCommissionDirectPushLogVO> pages = marketCommissionDirectPushLogService.selectMarketCommissionDirectPushLogPage(Condition.getPage(query), marketCommissionDirectPushLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionDirectPushLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionDirectPushLogEntity marketCommissionDirectPushLog) {
|
||||
return R.status(marketCommissionDirectPushLogService.save(marketCommissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionDirectPushLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionDirectPushLogEntity marketCommissionDirectPushLog) {
|
||||
return R.status(marketCommissionDirectPushLogService.updateById(marketCommissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionDirectPushLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionDirectPushLogEntity marketCommissionDirectPushLog) {
|
||||
return R.status(marketCommissionDirectPushLogService.saveOrUpdate(marketCommissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionDirectPushLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionGoodsCostLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionGoodsCostLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionGoodsCostLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionGoodsCostLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/goods-cost-log")
|
||||
@Tag(name = "25%商品成本佣金流水表", description = "25%商品成本佣金流水表接口")
|
||||
public class MarketCommissionGoodsCostLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionGoodsCostLogService marketCommissionGoodsCostLogService;
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionGoodsCostLog")
|
||||
public R<MarketCommissionGoodsCostLogVO> detail(MarketCommissionGoodsCostLogEntity marketCommissionGoodsCostLog) {
|
||||
MarketCommissionGoodsCostLogEntity detail = marketCommissionGoodsCostLogService.getOne(Condition.getQueryWrapper(marketCommissionGoodsCostLog));
|
||||
return R.data(MarketCommissionGoodsCostLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 25%商品成本佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionGoodsCostLog")
|
||||
public R<IPage<MarketCommissionGoodsCostLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionGoodsCostLog, Query query) {
|
||||
IPage<MarketCommissionGoodsCostLogEntity> pages = marketCommissionGoodsCostLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionGoodsCostLog, MarketCommissionGoodsCostLogEntity.class));
|
||||
return R.data(MarketCommissionGoodsCostLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionGoodsCostLog")
|
||||
public R<IPage<MarketCommissionGoodsCostLogVO>> page(MarketCommissionGoodsCostLogVO marketCommissionGoodsCostLog, Query query) {
|
||||
IPage<MarketCommissionGoodsCostLogVO> pages = marketCommissionGoodsCostLogService.selectMarketCommissionGoodsCostLogPage(Condition.getPage(query), marketCommissionGoodsCostLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionGoodsCostLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionGoodsCostLogEntity marketCommissionGoodsCostLog) {
|
||||
return R.status(marketCommissionGoodsCostLogService.save(marketCommissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionGoodsCostLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionGoodsCostLogEntity marketCommissionGoodsCostLog) {
|
||||
return R.status(marketCommissionGoodsCostLogService.updateById(marketCommissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionGoodsCostLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionGoodsCostLogEntity marketCommissionGoodsCostLog) {
|
||||
return R.status(marketCommissionGoodsCostLogService.saveOrUpdate(marketCommissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionGoodsCostLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionOperationLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionOperationLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionOperationLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionOperationLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/operation-log")
|
||||
@Tag(name = "5%运营佣金流水表", description = "5%运营佣金流水表接口")
|
||||
public class MarketCommissionOperationLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionOperationLogService marketCommissionOperationLogService;
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionOperationLog")
|
||||
public R<MarketCommissionOperationLogVO> detail(MarketCommissionOperationLogEntity marketCommissionOperationLog) {
|
||||
MarketCommissionOperationLogEntity detail = marketCommissionOperationLogService.getOne(Condition.getQueryWrapper(marketCommissionOperationLog));
|
||||
return R.data(MarketCommissionOperationLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%运营佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionOperationLog")
|
||||
public R<IPage<MarketCommissionOperationLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionOperationLog, Query query) {
|
||||
IPage<MarketCommissionOperationLogEntity> pages = marketCommissionOperationLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionOperationLog, MarketCommissionOperationLogEntity.class));
|
||||
return R.data(MarketCommissionOperationLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionOperationLog")
|
||||
public R<IPage<MarketCommissionOperationLogVO>> page(MarketCommissionOperationLogVO marketCommissionOperationLog, Query query) {
|
||||
IPage<MarketCommissionOperationLogVO> pages = marketCommissionOperationLogService.selectMarketCommissionOperationLogPage(Condition.getPage(query), marketCommissionOperationLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionOperationLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionOperationLogEntity marketCommissionOperationLog) {
|
||||
return R.status(marketCommissionOperationLogService.save(marketCommissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionOperationLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionOperationLogEntity marketCommissionOperationLog) {
|
||||
return R.status(marketCommissionOperationLogService.updateById(marketCommissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionOperationLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionOperationLogEntity marketCommissionOperationLog) {
|
||||
return R.status(marketCommissionOperationLogService.saveOrUpdate(marketCommissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionOperationLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.springblade.modules.market.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCommissionServiceProviderLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCommissionServiceProviderLogVO;
|
||||
import org.springblade.modules.market.wrapper.MarketCommissionServiceProviderLogWrapper;
|
||||
import org.springblade.modules.market.service.IMarketCommissionServiceProviderLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-commission/service-provider-log")
|
||||
@Tag(name = "5%服务商佣金流水表", description = "5%服务商佣金流水表接口")
|
||||
public class MarketCommissionServiceProviderLogController extends BladeController {
|
||||
|
||||
private final IMarketCommissionServiceProviderLogService marketCommissionServiceProviderLogService;
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入marketCommissionServiceProviderLog")
|
||||
public R<MarketCommissionServiceProviderLogVO> detail(MarketCommissionServiceProviderLogEntity marketCommissionServiceProviderLog) {
|
||||
MarketCommissionServiceProviderLogEntity detail = marketCommissionServiceProviderLogService.getOne(Condition.getQueryWrapper(marketCommissionServiceProviderLog));
|
||||
return R.data(MarketCommissionServiceProviderLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%服务商佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionServiceProviderLog")
|
||||
public R<IPage<MarketCommissionServiceProviderLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCommissionServiceProviderLog, Query query) {
|
||||
IPage<MarketCommissionServiceProviderLogEntity> pages = marketCommissionServiceProviderLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCommissionServiceProviderLog, MarketCommissionServiceProviderLogEntity.class));
|
||||
return R.data(MarketCommissionServiceProviderLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入marketCommissionServiceProviderLog")
|
||||
public R<IPage<MarketCommissionServiceProviderLogVO>> page(MarketCommissionServiceProviderLogVO marketCommissionServiceProviderLog, Query query) {
|
||||
IPage<MarketCommissionServiceProviderLogVO> pages = marketCommissionServiceProviderLogService.selectMarketCommissionServiceProviderLogPage(Condition.getPage(query), marketCommissionServiceProviderLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入marketCommissionServiceProviderLog")
|
||||
public R save(@Valid @RequestBody MarketCommissionServiceProviderLogEntity marketCommissionServiceProviderLog) {
|
||||
return R.status(marketCommissionServiceProviderLogService.save(marketCommissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入marketCommissionServiceProviderLog")
|
||||
public R update(@Valid @RequestBody MarketCommissionServiceProviderLogEntity marketCommissionServiceProviderLog) {
|
||||
return R.status(marketCommissionServiceProviderLogService.updateById(marketCommissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入marketCommissionServiceProviderLog")
|
||||
public R submit(@Valid @RequestBody MarketCommissionServiceProviderLogEntity marketCommissionServiceProviderLog) {
|
||||
return R.status(marketCommissionServiceProviderLogService.saveOrUpdate(marketCommissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(marketCommissionServiceProviderLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user