Compare commits
102 Commits
a389a7c5cd
...
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 | ||
| a8693e77cc | |||
| 0b6e90acb7 | |||
| c3bbf9073a | |||
|
|
64ad185fc4 | ||
| 28f13a5db3 | |||
| a6782b4fa1 | |||
|
|
5344c76cac | ||
| b92b1eaf2c | |||
|
|
7f941fab86 | ||
| bb7ddf9779 | |||
| 64f73ae06b | |||
| 213da81bc8 | |||
|
|
3cf4edd7a9 | ||
|
|
e4c72ce901 | ||
| 7bbb0c1026 | |||
| 5145ba52cb | |||
| 3c7331ffa0 | |||
| 5bc82c1f5c | |||
| 094b8774e3 | |||
| cd4d535d74 | |||
| add23214ac | |||
| 3e4256ada0 | |||
|
|
b31ed69e15 | ||
|
|
85a1032c55 | ||
|
|
3bf191ed3f | ||
| 6ad8d9730e | |||
| f03c5a9cf8 | |||
| 86ee8461b5 | |||
| 40b8931ee2 | |||
| 63fed8b70b | |||
| bd6dcedc0f | |||
|
|
08ca5c48f0 | ||
| 2b6da03ab6 | |||
|
|
9d9054a75d | ||
| e8b8ce0e9a | |||
| 04437369c1 | |||
| 3c2f46b008 | |||
|
|
f392e43ae7 | ||
| deefdeba9d | |||
| 87c7c8b0d2 | |||
|
|
93935285cf | ||
|
|
3ead9b1806 | ||
|
|
d25f9e29aa | ||
|
|
68546551e0 | ||
|
|
6d6654fa93 | ||
|
|
afe7b1fa6b | ||
|
|
d5d108db26 | ||
| d29ca3f02a | |||
| 233ca2115b | |||
| cc812cf1d3 | |||
| 4d18d698df | |||
| ddf504fa25 | |||
| efce3f5efb | |||
| d3211af9ae | |||
| c4bd46747a | |||
| 801ddb0a20 | |||
|
|
b444ecdbe0 | ||
|
|
c822959a24 |
@@ -1,22 +1,21 @@
|
||||
CREATE TABLE mall_product
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
main_img VARCHAR(255) DEFAULT '' NOT NULL, --缩略图
|
||||
detail_img text[] NULL, --详情图
|
||||
top_img text[] NULL, -- 详情页顶图
|
||||
attribute text[] DEFAULT '' NOT NULL,
|
||||
serial_number VARCHAR(100) DEFAULT '' NOT NULL,
|
||||
product_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
main_image_urls text[] DEFAULT '{}' NOT NULL,
|
||||
detail_image_urls text[] DEFAULT '{}' NULL,
|
||||
thumb_image_url text NULL,
|
||||
specs JSONB DEFAULT '[]',
|
||||
unit VARCHAR(12),
|
||||
category_id int8 DEFAULT '' NOT NULL,
|
||||
category_ids VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
category_id int8 DEFAULT 0 NOT NULL,
|
||||
category_path int8[] DEFAULT '{}' NOT NULL,
|
||||
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
profit DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
freight DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
sales int4 DEFAULT 0 NOT NULL,
|
||||
spu_qty int4 DEFAULT 0 NOT NULL,
|
||||
tags text DEFAULT '' NOT NULL,
|
||||
stock int4 DEFAULT 0 NOT NULL,
|
||||
tags JSONB DEFAULT '[]' NOT NULL,
|
||||
status int4 DEFAULT 0 NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
@@ -26,67 +25,76 @@ CREATE TABLE mall_product
|
||||
is_deleted int4 DEFAULT 0 NULL
|
||||
);
|
||||
|
||||
-- 缺规格 运费
|
||||
COMMENT ON TABLE mall_product IS '商城商品';
|
||||
COMMENT ON COLUMN mall_product.id IS '主键';
|
||||
COMMENT ON COLUMN mall_product.spu_sn IS '商品编码';
|
||||
COMMENT ON COLUMN mall_product.spu_name IS '商品名称';
|
||||
COMMENT ON COLUMN mall_product.main_img IS '主图';
|
||||
COMMENT ON COLUMN mall_product.detail_img IS '详情图(多图,逗号分割)';
|
||||
COMMENT ON COLUMN mall_product.top_img IS '顶图(多图,逗号分割)';
|
||||
COMMENT ON COLUMN mall_product.attribute IS '规格详情';
|
||||
COMMENT ON COLUMN mall_product.serial_number IS '商品编码';
|
||||
COMMENT ON COLUMN mall_product.product_name IS '商品名称';
|
||||
COMMENT ON COLUMN mall_product.main_image_urls IS '主图';
|
||||
COMMENT ON COLUMN mall_product.detail_image_urls IS '详情图';
|
||||
COMMENT ON COLUMN mall_product.thumb_image_url IS '缩略图';
|
||||
COMMENT ON COLUMN mall_product.specs IS '规格详情,JSONB数组 [{"attr":"颜色","value":"红"}]';
|
||||
COMMENT ON COLUMN mall_product.unit IS '单位';
|
||||
COMMENT ON COLUMN mall_product.category_id IS 'cate_id分类';
|
||||
COMMENT ON COLUMN mall_product.category_ids IS 'cate_id分类';
|
||||
COMMENT ON COLUMN mall_product.cost_price IS '成本价';
|
||||
COMMENT ON COLUMN mall_product.category_id IS '分类';
|
||||
COMMENT ON COLUMN mall_product.category_path IS '分类路径ID数组,如 [1,5,23]';
|
||||
COMMENT ON COLUMN mall_product.original_price IS '原价';
|
||||
COMMENT ON COLUMN mall_product.retail_price IS '销售价';
|
||||
COMMENT ON COLUMN mall_product.profit IS '利润';
|
||||
COMMENT ON COLUMN mall_product.freight IS '运费';
|
||||
COMMENT ON COLUMN mall_product.sales IS '销量';
|
||||
COMMENT ON COLUMN mall_product.spu_qty IS '库存';
|
||||
COMMENT ON COLUMN mall_product.tags IS '标签(多标签,逗号分割 )';
|
||||
COMMENT ON COLUMN mall_product.status IS '状态(0=下架,1=上架,3=删除)';
|
||||
COMMENT ON COLUMN mall_product.stock IS '库存';
|
||||
COMMENT ON COLUMN mall_product.tags IS '标签列表,JSONB数组格式,如 ["热销","包邮"]';
|
||||
COMMENT ON COLUMN mall_product.status IS '状态(0=下架,1=上架)';
|
||||
COMMENT ON COLUMN mall_product.create_user IS '创建人';
|
||||
COMMENT ON COLUMN mall_product.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN mall_product.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN mall_product.update_user IS '修改人';
|
||||
COMMENT ON COLUMN mall_product.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN mall_product.is_deleted IS '是否已删除';
|
||||
|
||||
CREATE INDEX idx_product_category ON mall_product (category_id);
|
||||
CREATE INDEX idx_product_status ON mall_product (status) WHERE is_deleted = 0;
|
||||
CREATE INDEX idx_product_tags ON mall_product USING GIN (tags);
|
||||
|
||||
alter table mall_product
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
-- 缺图片
|
||||
CREATE TABLE mall_category
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
cname VARCHAR(100) DEFAULT '' NOT NULL,
|
||||
img VARCHAR(200) DEFAULT '' NOT NULL,
|
||||
pid int8 DEFAULT 0 NOT NULL,
|
||||
category_name VARCHAR(100) DEFAULT '' NOT NULL,
|
||||
image_url VARCHAR(200) NULL,
|
||||
pid int8 NULL,
|
||||
level int4 DEFAULT 0 NOT NULL,
|
||||
sort INT4 DEFAULT 0 NOT NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL,
|
||||
create_time TIMESTAMP(6) NULL,
|
||||
create_user int8 NULL,
|
||||
update_time TIMESTAMP(6) NULL,
|
||||
update_user int8 NULL,
|
||||
status int4 NULL,
|
||||
status int4 DEFAULT 1 NOT NULL,
|
||||
create_dept int8 NULL
|
||||
);
|
||||
|
||||
|
||||
COMMENT ON TABLE mall_category IS '商品分类';
|
||||
COMMENT ON TABLE mall_category IS '商品分类(支持三级树形结构)';
|
||||
COMMENT ON COLUMN mall_category.id IS '主键';
|
||||
COMMENT ON COLUMN mall_category.cname IS '分类名称';
|
||||
COMMENT ON COLUMN mall_category.img IS '图片';
|
||||
COMMENT ON COLUMN mall_category.pid IS 'pid';
|
||||
COMMENT ON COLUMN mall_category.level IS 'level';
|
||||
COMMENT ON COLUMN mall_category.category_name IS '分类名称';
|
||||
COMMENT ON COLUMN mall_category.image_url IS '图片';
|
||||
COMMENT ON COLUMN mall_category.pid IS '父分类ID,NULL 表示顶级分类';
|
||||
COMMENT ON COLUMN mall_category.level IS '层级:1-一级分类,2-二级分类,3-三级分类';
|
||||
COMMENT ON COLUMN mall_category.sort IS '排序值,越小越靠前';
|
||||
COMMENT ON COLUMN mall_category.is_deleted IS '是否已删除';
|
||||
COMMENT ON COLUMN mall_category.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN mall_category.create_user IS '创建人';
|
||||
COMMENT ON COLUMN mall_category.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN mall_category.update_user IS '修改人';
|
||||
COMMENT ON COLUMN mall_category.status IS '状态';
|
||||
COMMENT ON COLUMN mall_category.status IS '状态:1-启用,2-禁用';
|
||||
COMMENT ON COLUMN mall_category.create_dept IS '创建部门';
|
||||
|
||||
CREATE INDEX idx_category_pid ON mall_category (pid);
|
||||
CREATE INDEX idx_category_sort ON mall_category(sort);
|
||||
|
||||
|
||||
alter table mall_category
|
||||
owner to yicha1lu;
|
||||
|
||||
@@ -137,15 +145,15 @@ alter table user_cart
|
||||
CREATE TABLE common_user_address
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
user_id int8 NULL,
|
||||
regions_info_id int8 NULL,
|
||||
user_id int8 NOT NULL,
|
||||
regions_id int8 NOT NULL,
|
||||
province VARCHAR(200) NULL,
|
||||
city VARCHAR(200) NULL,
|
||||
district VARCHAR(200) NULL,
|
||||
street VARCHAR(200) NULL,
|
||||
detail VARCHAR(200) NULL,
|
||||
consignee VARCHAR(200) NULL,
|
||||
phone VARCHAR(200) NULL,
|
||||
detail VARCHAR(500) NULL,
|
||||
consignee VARCHAR(200) NOT NULL,
|
||||
phone VARCHAR(20) NOT NULL,
|
||||
is_default int4 NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
@@ -156,11 +164,10 @@ CREATE TABLE common_user_address
|
||||
is_deleted int4 DEFAULT 0 NULL
|
||||
);
|
||||
|
||||
|
||||
COMMENT ON TABLE common_user_address IS '用户地址表';
|
||||
COMMENT ON COLUMN common_user_address.id IS '主键';
|
||||
COMMENT ON COLUMN common_user_address.user_id IS '用户id';
|
||||
COMMENT ON COLUMN common_user_address.regions_info_id IS '地区信息id';
|
||||
COMMENT ON COLUMN common_user_address.regions_id IS '地区信息id';
|
||||
COMMENT ON COLUMN common_user_address.province IS '省份';
|
||||
COMMENT ON COLUMN common_user_address.city IS '城市';
|
||||
COMMENT ON COLUMN common_user_address.district IS '区县';
|
||||
@@ -179,3 +186,8 @@ COMMENT ON COLUMN common_user_address.is_deleted IS '是否已删除';
|
||||
|
||||
alter table common_user_address
|
||||
owner to yicha1lu;
|
||||
|
||||
CREATE INDEX idx_user_address_user_id ON common_user_address (user_id);
|
||||
CREATE INDEX idx_user_address_regions_id ON common_user_address (regions_id);
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
CREATE TABLE user_order
|
||||
(
|
||||
id int8 DEFAULT 0 NOT NULL PRIMARY KEY,
|
||||
user_id int8 DEFAULT 0 NOT NULL,
|
||||
user_phone int8,
|
||||
user_name varchar(128),
|
||||
order_type int4 DEFAULT 0 NOT NULL,
|
||||
order_id int8 DEFAULT 0 NOT NULL,
|
||||
title VARCHAR(256) DEFAULT '' NOT NULL,
|
||||
images VARCHAR(512) NULL,
|
||||
quantity int4 NULL,
|
||||
description VARCHAR(200) DEFAULT '' NOT NULL,
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
user_id int8 NOT NULL,
|
||||
consignee_phone varchar(128) NOT NULL,
|
||||
consignee varchar(128) NOT NULL,
|
||||
order_type varchar(128) NOT NULL,
|
||||
item_code varchar(128) NOT NULL,
|
||||
item_name varchar(128) NOT NULL,
|
||||
image_url VARCHAR(512) NULL,
|
||||
quantity int4 DEFAULT 1 NOT NULL,
|
||||
delivery_address text NULL,
|
||||
express_company VARCHAR(100) NULL,
|
||||
express_no VARCHAR(100) NULL,
|
||||
order_status int4 DEFAULT 0 NOT NULL,
|
||||
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
payment_type int4 DEFAULT 0 NOT NULL,
|
||||
payment_time TIMESTAMP NULL,
|
||||
payment_status int4 DEFAULT 0 NOT NULL,
|
||||
payment_track VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
payment_status int4 DEFAULT 1 NOT NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
create_time TIMESTAMP(6) NULL,
|
||||
@@ -29,21 +31,23 @@ CREATE TABLE user_order
|
||||
COMMENT ON TABLE user_order IS '用户订单';
|
||||
COMMENT ON COLUMN user_order.id IS '主键';
|
||||
COMMENT ON COLUMN user_order.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_order.user_phone IS '用户手机号';
|
||||
COMMENT ON COLUMN user_order.user_name IS '用户名称';
|
||||
COMMENT ON COLUMN user_order.consignee_phone IS '收件人手机号';
|
||||
COMMENT ON COLUMN user_order.consignee IS '收件人';
|
||||
COMMENT ON COLUMN user_order.order_type IS '订单类型';
|
||||
COMMENT ON COLUMN user_order.order_id IS '订单id';
|
||||
COMMENT ON COLUMN user_order.title IS '订单名称';
|
||||
COMMENT ON COLUMN user_order.images IS '图片';
|
||||
COMMENT ON COLUMN user_order.item_code IS '商品编号';
|
||||
COMMENT ON COLUMN user_order.item_name IS '商品名称';
|
||||
COMMENT ON COLUMN user_order.image_url IS '图片';
|
||||
COMMENT ON COLUMN user_order.quantity IS '数量';
|
||||
COMMENT ON COLUMN user_order.description IS '订单描述';
|
||||
COMMENT ON COLUMN user_order.order_status IS '订单状态';
|
||||
COMMENT ON COLUMN user_order.delivery_address IS '收货地址(实物商品必填,虚拟商品可为空)';
|
||||
COMMENT ON COLUMN user_order.order_status IS '订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款';
|
||||
COMMENT ON COLUMN user_order.total_amount IS '订单金额';
|
||||
COMMENT ON COLUMN user_order.actual_amount IS '实际支付金额';
|
||||
COMMENT ON COLUMN user_order.payment_type IS '支付方式';
|
||||
COMMENT ON COLUMN user_order.payment_time IS '支付时间';
|
||||
COMMENT ON COLUMN user_order.payment_track IS '支付凭证编号';
|
||||
COMMENT ON COLUMN user_order.payment_status IS '支付状态';
|
||||
COMMENT ON COLUMN user_order.payment_status IS '支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)';
|
||||
COMMENT ON COLUMN user_order.express_company IS '快递公司名称';
|
||||
COMMENT ON COLUMN user_order.express_no IS '快递单号(物流单号)';
|
||||
COMMENT ON COLUMN user_order.create_user IS '创建人';
|
||||
COMMENT ON COLUMN user_order.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN user_order.create_time IS '创建时间';
|
||||
@@ -51,7 +55,9 @@ COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN user_order.status IS '状态';
|
||||
|
||||
CREATE INDEX user_order_index ON user_order (user_id, order_type);
|
||||
CREATE INDEX idx_user_order_user_status_time ON user_order (user_id, order_status, create_time DESC);
|
||||
CREATE INDEX idx_user_order_status_time ON user_order (order_status, create_time DESC);
|
||||
|
||||
alter table user_order
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
626
doc/sql/executed/20260205_increase.sql
Normal file
626
doc/sql/executed/20260205_increase.sql
Normal file
@@ -0,0 +1,626 @@
|
||||
------------------user_market_info common_user_address common_regions_info mall_product mall_category-------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
DROP TABLE IF EXISTS user_market_info;
|
||||
create table user_market_info
|
||||
(
|
||||
id int8 not null primary key, --user_id
|
||||
pid int8,
|
||||
has_synchronized int4 default 0, --是否同步
|
||||
vendor int4 default 0, -- 是否成为服务商 0-否 1-是
|
||||
e_signed int4 default 0, -- 是否已经签署电子合同 0-否 1-是
|
||||
e_signed_url text, -- 电子合同地址
|
||||
verified int4 default 0, -- 是否实名用户 0-否 1-是
|
||||
verified_date timestamp(6), -- 实名时间
|
||||
real_name varchar(128), -- 实名姓名
|
||||
id_card varchar(128), -- 实名身份证
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1, -- 1: active -- 2: revoked (注销) -- 3: frozen (冻结)
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
CREATE INDEX idx_user_market_pid ON user_market_info (pid) WHERE status = 1;
|
||||
|
||||
|
||||
comment on table user_market_info is '用户拓展信息表';
|
||||
comment on column user_market_info.id is '主键';
|
||||
comment on column user_market_info.pid is '邀请人';
|
||||
comment on column user_market_info.has_synchronized is '是否同步族谱 0-否 1-是';
|
||||
comment on column user_market_info.vendor is '是否成为服务商 0-否 1-是';
|
||||
comment on column user_market_info.e_signed is '是否签署法大大协议 0-否 1-是';
|
||||
comment on column user_market_info.e_signed_url is '电子合同地址';
|
||||
comment on column user_market_info.verified is '是否实名用户 0-否 1-是';
|
||||
comment on column user_market_info.verified_date is '实名时间';
|
||||
comment on column user_market_info.real_name is '实名姓名';
|
||||
comment on column user_market_info.id_card is '实名身份证';
|
||||
comment on column user_market_info.create_user is '创建人';
|
||||
comment on column user_market_info.create_dept is '创建部门';
|
||||
comment on column user_market_info.create_time is '创建时间';
|
||||
comment on column user_market_info.update_user is '修改人';
|
||||
comment on column user_market_info.update_time is '修改时间';
|
||||
comment on column user_market_info.status is '状态';
|
||||
comment on column user_market_info.is_deleted is '是否已删除';
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2019319816467976193', '1123598815738675201', 'marketInfo', '用户拓展信息表', 'menu', '/market/marketInfo',
|
||||
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 ('2019319816467976194', '2019319816467976193', 'marketInfo_add', '新增', 'add', '/market/marketInfo/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 ('2019319816467976195', '2019319816467976193', 'marketInfo_edit', '修改', 'edit', '/market/marketInfo/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 ('2019319816467976196', '2019319816467976193', 'marketInfo_delete', '删除', 'delete',
|
||||
'/api/blade-marketinfo/marketInfo/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 ('2019319816467976197', '2019319816467976193', 'marketInfo_view', '查看', 'view', '/market/marketInfo/view',
|
||||
'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
DROP TABLE IF EXISTS common_user_address;
|
||||
CREATE TABLE common_user_address
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
user_id int8 NOT NULL,
|
||||
regions_id int8 NOT NULL,
|
||||
province VARCHAR(200) NULL,
|
||||
city VARCHAR(200) NULL,
|
||||
district VARCHAR(200) NULL,
|
||||
street VARCHAR(200) NULL,
|
||||
detail VARCHAR(500) NULL,
|
||||
consignee VARCHAR(200) NOT NULL,
|
||||
phone VARCHAR(20) NOT NULL,
|
||||
is_default int4 NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
create_time TIMESTAMP NULL,
|
||||
update_user int8 NULL,
|
||||
update_time TIMESTAMP NULL,
|
||||
status int4 NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE common_user_address IS '用户地址表';
|
||||
COMMENT ON COLUMN common_user_address.id IS '主键';
|
||||
COMMENT ON COLUMN common_user_address.user_id IS '用户id';
|
||||
COMMENT ON COLUMN common_user_address.regions_id IS '地区信息id';
|
||||
COMMENT ON COLUMN common_user_address.province IS '省份';
|
||||
COMMENT ON COLUMN common_user_address.city IS '城市';
|
||||
COMMENT ON COLUMN common_user_address.district IS '区县';
|
||||
COMMENT ON COLUMN common_user_address.street IS '街道';
|
||||
COMMENT ON COLUMN common_user_address.detail IS '详细地址';
|
||||
COMMENT ON COLUMN common_user_address.consignee IS '收货人';
|
||||
COMMENT ON COLUMN common_user_address.phone IS '联系电话';
|
||||
COMMENT ON COLUMN common_user_address.is_default IS '是否默认地址(0=否,1=是)';
|
||||
COMMENT ON COLUMN common_user_address.create_user IS '创建人';
|
||||
COMMENT ON COLUMN common_user_address.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN common_user_address.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN common_user_address.update_user IS '修改人';
|
||||
COMMENT ON COLUMN common_user_address.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN common_user_address.status IS '状态';
|
||||
COMMENT ON COLUMN common_user_address.is_deleted IS '是否已删除';
|
||||
|
||||
CREATE INDEX idx_user_address_user_id ON common_user_address (user_id);
|
||||
CREATE INDEX idx_user_address_regions_id ON common_user_address (regions_id);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
DROP TABLE IF EXISTS common_regions_info;
|
||||
CREATE TABLE common_regions_info
|
||||
(
|
||||
id int4 PRIMARY KEY,
|
||||
name VARCHAR(50) NULL,
|
||||
level int4 NULL,
|
||||
pid int4 DEFAULT 0 NULL,
|
||||
coordinates point,
|
||||
region_code VARCHAR(128) NULL,
|
||||
full_name VARCHAR(500) NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL,
|
||||
create_time TIMESTAMP(6) NULL,
|
||||
create_user int8 NULL,
|
||||
update_time TIMESTAMP(6) NULL,
|
||||
update_user int8 NULL,
|
||||
status int4 NULL,
|
||||
create_dept int8 NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE common_regions_info IS '地区详情表';
|
||||
COMMENT ON COLUMN common_regions_info.id IS '主键';
|
||||
COMMENT ON COLUMN common_regions_info.name IS '名称';
|
||||
COMMENT ON COLUMN common_regions_info.level IS '层级';
|
||||
COMMENT ON COLUMN common_regions_info.pid IS '父主键';
|
||||
COMMENT ON COLUMN common_regions_info.coordinates IS '坐标';
|
||||
COMMENT ON COLUMN common_regions_info.region_code IS '地区编码';
|
||||
COMMENT ON COLUMN common_regions_info.full_name IS '全称';
|
||||
COMMENT ON COLUMN common_regions_info.is_deleted IS '是否删除';
|
||||
COMMENT ON COLUMN common_regions_info.create_user IS '创建人';
|
||||
COMMENT ON COLUMN common_regions_info.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN common_regions_info.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN common_regions_info.update_user IS '修改人';
|
||||
COMMENT ON COLUMN common_regions_info.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN common_regions_info.status IS '状态';
|
||||
|
||||
CREATE INDEX idx_regions_pid ON common_regions_info (pid);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
DROP TABLE IF EXISTS mall_product;
|
||||
CREATE TABLE mall_product
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
serial_number VARCHAR(100) DEFAULT '' NOT NULL,
|
||||
product_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
main_image_urls text[] DEFAULT '{}' NOT NULL,
|
||||
detail_image_urls text[] DEFAULT '{}' NULL,
|
||||
thumb_image_url text NULL,
|
||||
specs JSONB DEFAULT '[]',
|
||||
unit VARCHAR(12),
|
||||
category_id int8 DEFAULT 0 NOT NULL,
|
||||
category_path int8[] DEFAULT '{}' NOT NULL,
|
||||
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
freight DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
sales int4 DEFAULT 0 NOT NULL,
|
||||
stock int4 DEFAULT 0 NOT NULL,
|
||||
tags JSONB DEFAULT '[]' NOT NULL,
|
||||
status int4 DEFAULT 0 NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
create_time TIMESTAMP NULL,
|
||||
update_user int8 NULL,
|
||||
update_time TIMESTAMP NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE mall_product IS '商城商品';
|
||||
COMMENT ON COLUMN mall_product.id IS '主键';
|
||||
COMMENT ON COLUMN mall_product.serial_number IS '商品编码';
|
||||
COMMENT ON COLUMN mall_product.product_name IS '商品名称';
|
||||
COMMENT ON COLUMN mall_product.main_image_urls IS '主图';
|
||||
COMMENT ON COLUMN mall_product.detail_image_urls IS '详情图';
|
||||
COMMENT ON COLUMN mall_product.thumb_image_url IS '缩略图';
|
||||
COMMENT ON COLUMN mall_product.specs IS '规格详情,JSONB数组 [{"attr":"颜色","value":"红"}]';
|
||||
COMMENT ON COLUMN mall_product.unit IS '单位';
|
||||
COMMENT ON COLUMN mall_product.category_id IS '分类';
|
||||
COMMENT ON COLUMN mall_product.category_path IS '分类路径ID数组,如 [1,5,23]';
|
||||
COMMENT ON COLUMN mall_product.original_price IS '原价';
|
||||
COMMENT ON COLUMN mall_product.retail_price IS '销售价';
|
||||
COMMENT ON COLUMN mall_product.freight IS '运费';
|
||||
COMMENT ON COLUMN mall_product.sales IS '销量';
|
||||
COMMENT ON COLUMN mall_product.stock IS '库存';
|
||||
COMMENT ON COLUMN mall_product.tags IS '标签列表,JSONB数组格式,如 ["热销","包邮"]';
|
||||
COMMENT ON COLUMN mall_product.status IS '状态(0=下架,1=上架)';
|
||||
COMMENT ON COLUMN mall_product.create_user IS '创建人';
|
||||
COMMENT ON COLUMN mall_product.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN mall_product.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN mall_product.update_user IS '修改人';
|
||||
COMMENT ON COLUMN mall_product.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN mall_product.is_deleted IS '是否已删除';
|
||||
|
||||
CREATE INDEX idx_product_category ON mall_product (category_id);
|
||||
CREATE INDEX idx_product_status ON mall_product (status) WHERE is_deleted = 0;
|
||||
CREATE INDEX idx_product_tags ON mall_product USING GIN (tags);
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2019341061775732737', '2016445919294554113', 'mallProduct', '商城商品', 'menu', '/mall/mallProduct', 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 ('2019341061775732738', '2019341061775732737', 'mallProduct_add', '新增', 'add', '/mall/mallProduct/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 ('2019341061775732739', '2019341061775732737', 'mallProduct_edit', '修改', 'edit', '/mall/mallProduct/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 ('2019341061775732740', '2019341061775732737', 'mallProduct_delete', '删除', 'delete',
|
||||
'/api/blade-mallproduct/mallProduct/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 ('2019341061775732741', '2019341061775732737', 'mallProduct_view', '查看', 'view', '/mall/mallProduct/view',
|
||||
'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS mall_category;
|
||||
CREATE TABLE mall_category
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
category_name VARCHAR(100) DEFAULT '' NOT NULL,
|
||||
image_url VARCHAR(200) NULL,
|
||||
pid int8 NULL,
|
||||
level int4 DEFAULT 0 NOT NULL,
|
||||
sort INT4 DEFAULT 0 NOT NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL,
|
||||
create_time TIMESTAMP(6) NULL,
|
||||
create_user int8 NULL,
|
||||
update_time TIMESTAMP(6) NULL,
|
||||
update_user int8 NULL,
|
||||
status int4 DEFAULT 1 NOT NULL,
|
||||
create_dept int8 NULL
|
||||
);
|
||||
|
||||
|
||||
COMMENT ON TABLE mall_category IS '商品分类(支持三级树形结构)';
|
||||
COMMENT ON COLUMN mall_category.id IS '主键';
|
||||
COMMENT ON COLUMN mall_category.category_name IS '分类名称';
|
||||
COMMENT ON COLUMN mall_category.image_url IS '图片';
|
||||
COMMENT ON COLUMN mall_category.pid IS '父分类ID,NULL 表示顶级分类';
|
||||
COMMENT ON COLUMN mall_category.level IS '层级:1-一级分类,2-二级分类,3-三级分类';
|
||||
COMMENT ON COLUMN mall_category.sort IS '排序值,越小越靠前';
|
||||
COMMENT ON COLUMN mall_category.is_deleted IS '是否已删除';
|
||||
COMMENT ON COLUMN mall_category.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN mall_category.create_user IS '创建人';
|
||||
COMMENT ON COLUMN mall_category.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN mall_category.update_user IS '修改人';
|
||||
COMMENT ON COLUMN mall_category.status IS '状态:1-启用,2-禁用';
|
||||
COMMENT ON COLUMN mall_category.create_dept IS '创建部门';
|
||||
|
||||
CREATE INDEX idx_category_pid ON mall_category (pid);
|
||||
CREATE INDEX idx_category_sort ON mall_category (sort);
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2019341061003980801', '2016445919294554113', 'mallCategory', '商品分类', 'menu', '/mall/mallCategory', 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 ('2019341061003980802', '2019341061003980801', 'mallCategory_add', '新增', 'add', '/mall/mallCategory/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 ('2019341061003980803', '2019341061003980801', 'mallCategory_edit', '修改', 'edit', '/mall/mallCategory/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 ('2019341061003980804', '2019341061003980801', 'mallCategory_delete', '删除', 'delete',
|
||||
'/api/blade-mallcategory/mallCategory/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 ('2019341061003980805', '2019341061003980801', 'mallCategory_view', '查看', 'view', '/mall/mallCategory/view',
|
||||
'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS user_order;
|
||||
CREATE TABLE user_order
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
user_id int8 NOT NULL,
|
||||
consignee_phone varchar(128) NOT NULL,
|
||||
consignee varchar(128) NOT NULL,
|
||||
order_type varchar(128) NOT NULL,
|
||||
item_code varchar(128) NOT NULL,
|
||||
item_name varchar(128) NOT NULL,
|
||||
image_url VARCHAR(512) NULL,
|
||||
quantity int4 DEFAULT 1 NOT NULL,
|
||||
delivery_address text NULL,
|
||||
express_company VARCHAR(100) NULL,
|
||||
express_no VARCHAR(100) NULL,
|
||||
order_status int4 DEFAULT 0 NOT NULL,
|
||||
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
payment_type int4 DEFAULT 0 NOT NULL,
|
||||
payment_time TIMESTAMP NULL,
|
||||
payment_status int4 DEFAULT 0 NOT NULL,
|
||||
payment_track VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
create_user int8 NULL,
|
||||
create_dept int8 NULL,
|
||||
create_time TIMESTAMP(6) NULL,
|
||||
update_user int8 NULL,
|
||||
update_time TIMESTAMP(6) NULL,
|
||||
status int4 NULL,
|
||||
is_deleted int4 DEFAULT 0 NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE user_order IS '用户订单';
|
||||
COMMENT ON COLUMN user_order.id IS '主键';
|
||||
COMMENT ON COLUMN user_order.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_order.consignee_phone IS '收件人手机号';
|
||||
COMMENT ON COLUMN user_order.consignee IS '收件人';
|
||||
COMMENT ON COLUMN user_order.order_type IS '订单类型';
|
||||
COMMENT ON COLUMN user_order.item_code IS '商品编号';
|
||||
COMMENT ON COLUMN user_order.item_name IS '商品名称';
|
||||
COMMENT ON COLUMN user_order.image_url IS '图片';
|
||||
COMMENT ON COLUMN user_order.quantity IS '数量';
|
||||
COMMENT ON COLUMN user_order.delivery_address IS '收货地址(实物商品必填,虚拟商品可为空)';
|
||||
COMMENT ON COLUMN user_order.order_status IS '订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款';
|
||||
COMMENT ON COLUMN user_order.total_amount IS '订单金额';
|
||||
COMMENT ON COLUMN user_order.actual_amount IS '实际支付金额';
|
||||
COMMENT ON COLUMN user_order.payment_type IS '支付方式';
|
||||
COMMENT ON COLUMN user_order.payment_time IS '支付时间';
|
||||
COMMENT ON COLUMN user_order.payment_track IS '支付凭证编号';
|
||||
COMMENT ON COLUMN user_order.payment_status IS '支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)';
|
||||
COMMENT ON COLUMN user_order.express_company IS '快递公司名称';
|
||||
COMMENT ON COLUMN user_order.express_no IS '快递单号(物流单号)';
|
||||
COMMENT ON COLUMN user_order.create_user IS '创建人';
|
||||
COMMENT ON COLUMN user_order.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN user_order.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN user_order.status IS '状态';
|
||||
|
||||
CREATE INDEX idx_user_order_user_status_time ON user_order (user_id, order_status, create_time DESC);
|
||||
CREATE INDEX idx_user_order_status_time ON user_order (order_status, create_time DESC);
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2019446499472781314', '1123598815738675201', 'order', '用户订单', 'menu', '/common/order', 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 ('2019446499472781315', '2019446499472781314', 'order_add', '新增', 'add', '/common/order/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 ('2019446499472781316', '2019446499472781314', 'order_edit', '修改', 'edit', '/common/order/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 ('2019446499472781317', '2019446499472781314', 'order_delete', '删除', 'delete', '/api/user-order/order/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 ('2019446499472781318', '2019446499472781314', 'order_view', '查看', 'view', '/common/order/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_market_benefit_package_template;
|
||||
CREATE TABLE user_market_benefit_package_template --积分包信息模板表
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
package_name VARCHAR(128) NULL,
|
||||
user_limit int4 default 0, -- 最大购买数量
|
||||
max_limit int4 default 0, -- 全网最大兑换数量
|
||||
day_limit int4 default 0, -- 产出总天数
|
||||
benefit_point_amount decimal(14, 2) default 0, -- 总产出福利积分
|
||||
benefit_value_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||
benefit_point_price decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||
cash_coupon_price decimal(14, 2) default 0, --兑换包需要的现金券
|
||||
exchanged_quantity int4 default 0, -- 已兑换数量
|
||||
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_market_benefit_package_template IS '积分包信息表';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.id IS '主键';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.package_name IS '积分包名称';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.user_limit IS '最大购买数量';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.day_limit IS '产出总天数';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.benefit_point_amount IS '总产出福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.benefit_value_amount IS '购买赠与福利值';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.benefit_point_price IS '兑换包需要的福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.cash_coupon_price IS '兑换包需要的现金券';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.max_limit IS '全网最大兑换数量';
|
||||
COMMENT ON COLUMN user_market_benefit_package_template.exchanged_quantity IS '已兑换数量';
|
||||
comment on column user_market_benefit_package_template.create_user is '创建人';
|
||||
comment on column user_market_benefit_package_template.create_dept is '创建部门';
|
||||
comment on column user_market_benefit_package_template.create_time is '创建时间';
|
||||
comment on column user_market_benefit_package_template.update_user is '修改人';
|
||||
comment on column user_market_benefit_package_template.update_time is '修改时间';
|
||||
comment on column user_market_benefit_package_template.status is '状态';
|
||||
comment on column user_market_benefit_package_template.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_market_benefit_package_template
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
INSERT INTO user_market_benefit_package_template (id, package_name, user_limit, max_limit, day_limit, benefit_point_amount, benefit_value_amount, benefit_point_price, cash_coupon_price, exchanged_quantity, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2019440113307066370, '100福利包', 10, 2000000, 360, 300.00, 100.00, 100.00, 20.00, 0, 1123598821738675201, 1123598813738675201, '2026-02-05 23:56:57.000000', 1123598821738675201, '2026-02-05 23:57:40.162000', 1, 0);
|
||||
INSERT INTO user_market_benefit_package_template (id, package_name, user_limit, max_limit, day_limit, benefit_point_amount, benefit_value_amount, benefit_point_price, cash_coupon_price, exchanged_quantity, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2019440172115402754, '1000福利包', 4, 1000000, 360, 3000.00, 1000.00, 1000.00, 300.00, 0, 1123598821738675201, 1123598813738675201, '2026-02-05 23:57:11.072000', 1123598821738675201, '2026-02-05 23:57:11.072000', 1, 0);
|
||||
INSERT INTO user_market_benefit_package_template (id, package_name, user_limit, max_limit, day_limit, benefit_point_amount, benefit_value_amount, benefit_point_price, cash_coupon_price, exchanged_quantity, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2019440222086340610, '5000福利包', 2, 50000, 360, 15000.00, 5000.00, 5000.00, 1500.00, 0, 1123598821738675201, 1123598813738675201, '2026-02-05 23:57:23.001000', 1123598821738675201, '2026-02-05 23:57:23.001000', 1, 0);
|
||||
INSERT INTO user_market_benefit_package_template (id, package_name, user_limit, max_limit, day_limit, benefit_point_amount, benefit_value_amount, benefit_point_price, cash_coupon_price, exchanged_quantity, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2019440263022747650, '10000福利包', 1, 20000, 360, 40000.00, 10000.00, 10000.00, 4000.00, 0, 1123598821738675201, 1123598813738675201, '2026-02-05 23:57:32.752000', 1123598821738675201, '2026-02-05 23:57:32.752000', 1, 0);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_market_benefit_package;
|
||||
create table user_market_benefit_package --用户福利积分包表
|
||||
(
|
||||
id int8 not null primary key,
|
||||
statistical_date timestamp(6),
|
||||
user_id int8,
|
||||
phone int8,
|
||||
user_name varchar(128),
|
||||
package_id int8,
|
||||
package_name varchar(128),
|
||||
type int4 default 1, -- 1-积分兑换 2-后台划拨
|
||||
user_benefit decimal(14, 2) default 0, --兑换包需要的福利积分
|
||||
user_cash decimal(14, 2) default 0, --兑换包需要的现金券
|
||||
give_amount decimal(14, 2) default 0, -- 购买赠与福利值
|
||||
day_total int4 default 0, -- 产出总天数
|
||||
amount_total decimal(14, 2) default 0, -- 总产出福利积分
|
||||
amount_day decimal(14, 2) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
||||
amount_out decimal(16, 4) default 0, -- 已产出福利积分
|
||||
out_day int4 default 0, -- 已产出天数
|
||||
active_time timestamp(6), -- 激活时间
|
||||
expired_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, -- 1-未激活 2-已激活 3-已完成 4-已过期,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
create index upi_status_index
|
||||
on user_market_benefit_package (is_deleted, status);
|
||||
|
||||
COMMENT ON TABLE user_market_benefit_package IS '用户积分包信息表';
|
||||
COMMENT ON COLUMN user_market_benefit_package.id IS '主键';
|
||||
COMMENT ON COLUMN user_market_benefit_package.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_market_benefit_package.phone IS '用户手机号';
|
||||
COMMENT ON COLUMN user_market_benefit_package.user_name IS '用户名';
|
||||
COMMENT ON COLUMN user_market_benefit_package.package_id IS '积分包id';
|
||||
COMMENT ON COLUMN user_market_benefit_package.package_name IS '积分包名称';
|
||||
COMMENT ON COLUMN user_market_benefit_package.type IS '1-积分兑换 2-后台划拨';
|
||||
COMMENT ON COLUMN user_market_benefit_package.user_benefit IS '兑换包需要的福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package.user_cash IS '兑换包需要的现金券';
|
||||
COMMENT ON COLUMN user_market_benefit_package.give_amount IS '购买赠与福利值';
|
||||
COMMENT ON COLUMN user_market_benefit_package.day_total IS '产出总天数';
|
||||
COMMENT ON COLUMN user_market_benefit_package.amount_total IS '总产出福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package.amount_day IS '每日产出福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package.amount_out IS '已产出福利积分';
|
||||
COMMENT ON COLUMN user_market_benefit_package.out_day IS '已产出天数';
|
||||
COMMENT ON COLUMN user_market_benefit_package.expired_date IS '过期时间';
|
||||
COMMENT ON COLUMN user_market_benefit_package.active_time IS '激活时间';
|
||||
COMMENT ON COLUMN user_market_benefit_package.remark IS '备注';
|
||||
comment on column user_market_benefit_package.create_user is '创建人';
|
||||
comment on column user_market_benefit_package.create_dept is '创建部门';
|
||||
comment on column user_market_benefit_package.create_time is '创建时间';
|
||||
comment on column user_market_benefit_package.update_user is '修改人';
|
||||
comment on column user_market_benefit_package.update_time is '修改时间';
|
||||
comment on column user_market_benefit_package.status is '状态 1-未激活 2-已激活 3-已完成 4-已过期';
|
||||
comment on column user_market_benefit_package.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_market_benefit_package
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_market_benefit_package_log;
|
||||
create table user_market_benefit_package_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
statistical_date timestamp(6),
|
||||
user_id int8,
|
||||
phone int8,
|
||||
user_name varchar(128),
|
||||
type int4 default 1, -- 1-积分兑换 2-后台划拨
|
||||
user_package_id int8,
|
||||
package_name varchar(128),
|
||||
package_detail text,
|
||||
give_number int4 default 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 gpl_date_index
|
||||
on user_market_benefit_package_log (is_deleted, statistical_date, user_id);
|
||||
|
||||
COMMENT ON TABLE user_market_benefit_package_log IS '兑换福利包记录';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.id IS '主键';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.statistical_date IS '统计日期';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.phone IS '用户手机号';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.user_name IS '用户名';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.type IS '1-积分兑换 2-后台划拨';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.user_package_id IS '积分包id';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.package_name IS '积分包名称';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.package_detail IS '积分包信息快照';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.give_number IS '赠送数量';
|
||||
COMMENT ON COLUMN user_market_benefit_package_log.remark IS '备注';
|
||||
comment on column user_market_benefit_package_log.create_user is '创建人';
|
||||
comment on column user_market_benefit_package_log.create_dept is '创建部门';
|
||||
comment on column user_market_benefit_package_log.create_time is '创建时间';
|
||||
comment on column user_market_benefit_package_log.update_user is '修改人';
|
||||
comment on column user_market_benefit_package_log.update_time is '修改时间';
|
||||
comment on column user_market_benefit_package_log.status is '状态';
|
||||
comment on column user_market_benefit_package_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_market_benefit_package_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2016446332399943682, 0, 'userPackInfo', '福利包管理', 'menu', '/userPackInfo', 'iconfont iconicon_principal', 13, 1, -1, 1, '', '', 0);
|
||||
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2019438517579878402', '2016446332399943682', 'userMarketBenefitPackage', '用户福利包信息', 'menu', '/userPackage/userMarketBenefitPackage', NULL, 2, 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 ('2019438517579878403', '2019438517579878402', 'userMarketBenefitPackage_add', '新增', 'add', '/userPackage/userMarketBenefitPackage/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 ('2019438517579878404', '2019438517579878402', 'userMarketBenefitPackage_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackage/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 ('2019438517579878405', '2019438517579878402', 'userMarketBenefitPackage_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackage/userMarketBenefitPackage/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 ('2019438517579878406', '2019438517579878402', 'userMarketBenefitPackage_view', '查看', 'view', '/userPackage/userMarketBenefitPackage/view', 'file-text', 4, 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 ('2019438517974142978', '2016446332399943682', 'userMarketBenefitPackageLog', '划拨福利包记录', 'menu', '/userPackage/userMarketBenefitPackageLog', NULL, 3, 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 ('2019438517974142979', '2019438517974142978', 'userMarketBenefitPackageLog_add', '新增', 'add', '/userPackage/userMarketBenefitPackageLog/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 ('2019438517974142980', '2019438517974142978', 'userMarketBenefitPackageLog_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackageLog/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 ('2019438517974142981', '2019438517974142978', 'userMarketBenefitPackageLog_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackagelog/userMarketBenefitPackageLog/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 ('2019438517974142982', '2019438517974142978', 'userMarketBenefitPackageLog_view', '查看', 'view', '/userPackage/userMarketBenefitPackageLog/view', 'file-text', 4, 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 ('2019438517080756225', '2016446332399943682', 'userMarketBenefitPackageTemplate', '福利包信息', 'menu', '/userPackage/userMarketBenefitPackageTemplate', 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 ('2019438517080756226', '2019438517080756225', 'userMarketBenefitPackageTemplate_add', '新增', 'add', '/userPackage/userMarketBenefitPackageTemplate/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 ('2019438517080756227', '2019438517080756225', 'userMarketBenefitPackageTemplate_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackageTemplate/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 ('2019438517080756228', '2019438517080756225', 'userMarketBenefitPackageTemplate_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackagetemplate/userMarketBenefitPackageTemplate/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 ('2019438517080756229', '2019438517080756225', 'userMarketBenefitPackageTemplate_view', '查看', 'view', '/userPackage/userMarketBenefitPackageTemplate/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256532300197889, 0, 'app_order_status', '-1', 'app订单状态', 17, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256701003493378, 2017256532300197889, 'app_order_status', '3', '待收货', 3, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256735887519745, 2017256532300197889, 'app_order_status', '4', '已完成', 4, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256766271057921, 2017256532300197889, 'app_order_status', '5', '已取消', 5, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256798575587330, 2017256532300197889, 'app_order_status', '6', '售后中', 6, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256831240826882, 2017256532300197889, 'app_order_status', '7', '已完结', 7, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017277351755730945, 0, 'app_yes_no', '-1', 'app是否状态', 18, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017277404973060097, 2017277351755730945, 'app_yes_no', '0', '否', 0, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017277445628448770, 2017277351755730945, 'app_yes_no', '1', '是', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279052097212417, 0, 'app_pay_status', '-1', 'app支付状态', 19, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279219479302146, 2017279052097212417, 'app_pay_status', '1', '待支付', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279260155662338, 2017279052097212417, 'app_pay_status', '2', '已支付', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279292049149953, 2017279052097212417, 'app_pay_status', '3', '已关闭', 3, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256666383708162, 2017256532300197889, 'app_order_status', '2', '已支付', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256633735245825, 2017256532300197889, 'app_order_status', '1', '待支付', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279326488580097, 2017279052097212417, 'app_pay_status', '4', '退款中', 4, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017279356754677762, 2017279052097212417, 'app_pay_status', '5', '已退款', 5, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017280506669256705, 0, 'app_order_model', '-1', 'app订单类型', 20, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017280559299383297, 2017280506669256705, 'app_order_model', '1', '商城订单', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017448732011200513, 0, 'app_pay_type', '-1', 'app支付类型', 21, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017448799661129730, 2017448732011200513, 'app_pay_type', '1', '支付宝', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017448849464295426, 2017448732011200513, 'app_pay_type', '2', '微信', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017448927499321345, 2017448732011200513, 'app_pay_type', '3', '线下支付', 3, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017256598469537794, 2017256532300197889, 'app_order_status', '0', '待支付', 0, '', 0, 1, 1);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017478580159041538, 0, 'app_point_spending_type', '-1', 'app积分消费类型', 22, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017478672572141569, 2017478580159041538, 'app_point_spending_type', '1', '收入', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017478708412469249, 2017478580159041538, 'app_point_spending_type', '2', '支出', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017517140190855170, 0, 'app_package_type', '-1', 'app福利包类型', 23, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017517209350733826, 2017517140190855170, 'app_package_type', '1', '积分兑换', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2017517264824598530, 2017517140190855170, 'app_package_type', '2', '后台划拨', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2018600540205121537, 0, 'app_banner_type', '-1', 'app轮播图类型', 24, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2018600645536677890, 2018600540205121537, 'app_banner_type', '1', '主banner', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2018600683209916417, 2018600540205121537, 'app_banner_type', '2', '商城banner', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2018607816655708161, 0, 'app_user_notice', '-1', 'app用户通知类型', 25, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2018607875027836929, 2018607816655708161, 'app_user_notice', '0', '系统通知', 0, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019414847658545153, 0, 'app_product_status', '-1', 'app上下架商品状态', 26, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019414970329354241, 2019414847658545153, 'app_product_status', '0', '下架', 0, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019415024934998018, 2019414847658545153, 'app_product_status', '1', '上架', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019491173300129793, 0, 'app_package_status', '-1', '福利包状态', 27, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019491225556963329, 2019491173300129793, 'app_package_status', '1', '未激活', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019491256389292033, 2019491173300129793, 'app_package_status', '2', '已激活', 2, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019491292992983042, 2019491173300129793, 'app_package_status', '3', '已完成', 3, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2019491330833993730, 2019491173300129793, 'app_package_status', '4', '已过期', 4, '', 0, 1, 0);
|
||||
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);
|
||||
38
doc/sql/executed/market_packageInfo_menu.sql
Normal file
38
doc/sql/executed/market_packageInfo_menu.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2016446332399943682, 0, 'userPackInfo', '福利包管理', 'menu', '/userPackInfo', 'iconfont iconicon_principal', 13, 1, -1, 1, '', '', 0);
|
||||
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2019438517579878402', '2016446332399943682', 'userMarketBenefitPackage', '用户福利包信息', 'menu', '/userPackage/userMarketBenefitPackage', NULL, 2, 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 ('2019438517579878403', '2019438517579878402', 'userMarketBenefitPackage_add', '新增', 'add', '/userPackage/userMarketBenefitPackage/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 ('2019438517579878404', '2019438517579878402', 'userMarketBenefitPackage_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackage/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 ('2019438517579878405', '2019438517579878402', 'userMarketBenefitPackage_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackage/userMarketBenefitPackage/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 ('2019438517579878406', '2019438517579878402', 'userMarketBenefitPackage_view', '查看', 'view', '/userPackage/userMarketBenefitPackage/view', 'file-text', 4, 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 ('2019438517974142978', '2016446332399943682', 'userMarketBenefitPackageLog', '划拨福利包记录', 'menu', '/userPackage/userMarketBenefitPackageLog', NULL, 3, 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 ('2019438517974142979', '2019438517974142978', 'userMarketBenefitPackageLog_add', '新增', 'add', '/userPackage/userMarketBenefitPackageLog/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 ('2019438517974142980', '2019438517974142978', 'userMarketBenefitPackageLog_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackageLog/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 ('2019438517974142981', '2019438517974142978', 'userMarketBenefitPackageLog_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackagelog/userMarketBenefitPackageLog/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 ('2019438517974142982', '2019438517974142978', 'userMarketBenefitPackageLog_view', '查看', 'view', '/userPackage/userMarketBenefitPackageLog/view', 'file-text', 4, 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 ('2019438517080756225', '2016446332399943682', 'userMarketBenefitPackageTemplate', '福利包信息', 'menu', '/userPackage/userMarketBenefitPackageTemplate', 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 ('2019438517080756226', '2019438517080756225', 'userMarketBenefitPackageTemplate_add', '新增', 'add', '/userPackage/userMarketBenefitPackageTemplate/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 ('2019438517080756227', '2019438517080756225', 'userMarketBenefitPackageTemplate_edit', '修改', 'edit', '/userPackage/userMarketBenefitPackageTemplate/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 ('2019438517080756228', '2019438517080756225', 'userMarketBenefitPackageTemplate_delete', '删除', 'delete', '/api/blade-usermarketbenefitpackagetemplate/userMarketBenefitPackageTemplate/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 ('2019438517080756229', '2019438517080756225', 'userMarketBenefitPackageTemplate_view', '查看', 'view', '/userPackage/userMarketBenefitPackageTemplate/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
10
doc/sql/executed/order.menu.sql
Normal file
10
doc/sql/executed/order.menu.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2019446499472781314', '1123598815738675201', 'order', '用户订单', 'menu', '/common/order', 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 ('2019446499472781315', '2019446499472781314', 'order_add', '新增', 'add', '/common/order/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 ('2019446499472781316', '2019446499472781314', 'order_edit', '修改', 'edit', '/common/order/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 ('2019446499472781317', '2019446499472781314', 'order_delete', '删除', 'delete', '/api/user-order/order/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 ('2019446499472781318', '2019446499472781314', 'order_view', '查看', 'view', '/common/order/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
1025
doc/sql/pending/20260209_increase.sql
Normal file
1025
doc/sql/pending/20260209_increase.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,66 +0,0 @@
|
||||
create table user_market_info
|
||||
(
|
||||
id int8 not null primary key, --user_id
|
||||
pid int8,
|
||||
has_synchronized int4 default 0, --是否同步
|
||||
vendor int4 default 0, -- 是否成为服务商 0-否 1-是
|
||||
e_signed int4 default 0, -- 是否已经签署电子合同 0-否 1-是
|
||||
e_signed_url text, -- 电子合同地址
|
||||
verified int4 default 0, -- 是否实名用户 0-否 1-是
|
||||
verified_date timestamp(6), -- 实名时间
|
||||
real_name varchar(128), -- 实名姓名
|
||||
id_card varchar(128), -- 实名身份证
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1, -- 1: active -- 2: revoked (注销) -- 3: frozen (冻结)
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
CREATE INDEX idx_user_market_pid ON user_market_info (pid) WHERE status = 1;
|
||||
|
||||
|
||||
comment on table user_market_info is '用户拓展信息表';
|
||||
comment on column user_market_info.id is '主键';
|
||||
comment on column user_market_info.pid is '邀请人';
|
||||
comment on column user_market_info.synchronized is '是否同步族谱 0-否 1-是';
|
||||
comment on column user_market_info.vendor is '是否成为服务商 0-否 1-是';
|
||||
comment on column user_market_info.e_signed is '是否签署法大大协议 0-否 1-是';
|
||||
comment on column user_market_info.e_signed_url is '电子合同地址';
|
||||
comment on column user_market_info.verified is '是否实名用户 0-否 1-是';
|
||||
comment on column user_market_info.verified_date is '实名时间';
|
||||
comment on column user_market_info.real_name is '实名姓名';
|
||||
comment on column user_market_info.id_card is '实名身份证';
|
||||
comment on column user_market_info.create_user is '创建人';
|
||||
comment on column user_market_info.create_dept is '创建部门';
|
||||
comment on column user_market_info.create_time is '创建时间';
|
||||
comment on column user_market_info.update_user is '修改人';
|
||||
comment on column user_market_info.update_time is '修改时间';
|
||||
comment on column user_market_info.status is '状态';
|
||||
comment on column user_market_info.is_deleted is '是否已删除';
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2019319816467976193', '1123598815738675201', 'marketInfo', '用户拓展信息表', 'menu', '/market/marketInfo',
|
||||
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 ('2019319816467976194', '2019319816467976193', 'marketInfo_add', '新增', 'add', '/market/marketInfo/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 ('2019319816467976195', '2019319816467976193', 'marketInfo_edit', '修改', 'edit', '/market/marketInfo/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 ('2019319816467976196', '2019319816467976193', 'marketInfo_delete', '删除', 'delete',
|
||||
'/api/blade-marketinfo/marketInfo/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 ('2019319816467976197', '2019319816467976193', 'marketInfo_view', '查看', 'view', '/market/marketInfo/view',
|
||||
'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
12
pom.xml
12
pom.xml
@@ -264,6 +264,18 @@
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -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,28 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncConfiguration {
|
||||
|
||||
|
||||
// 通知类:短信、邮件、站内信
|
||||
@Bean("notificationExecutor")
|
||||
public ThreadPoolTaskExecutor notificationExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(6);
|
||||
executor.setMaxPoolSize(12);
|
||||
executor.setQueueCapacity(200);
|
||||
executor.setThreadNamePrefix("notify-");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,67 @@
|
||||
package org.springblade.common.handler;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||
import org.apache.ibatis.type.MappedTypes;
|
||||
import org.postgresql.util.PGobject;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用于 PostgreSQL JSONB 与 Java 对象(如 List<Map>、Map 等)的双向转换
|
||||
*/
|
||||
@MappedJdbcTypes(JdbcType.OTHER)
|
||||
@MappedTypes({List.class, Map.class})
|
||||
public class PgJsonbTypeHandler extends BaseTypeHandler<Object> {
|
||||
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {
|
||||
PGobject jsonObject = new PGobject();
|
||||
jsonObject.setType("jsonb");
|
||||
try {
|
||||
jsonObject.setValue(objectMapper.writeValueAsString(parameter));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new SQLException("Error converting object to JSON", e);
|
||||
}
|
||||
ps.setObject(i, jsonObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
return parseJson(rs.getString(columnName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
return parseJson(rs.getString(columnIndex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
return parseJson(cs.getString(columnIndex));
|
||||
}
|
||||
|
||||
private Object parseJson(String json) throws SQLException {
|
||||
if (json == null || json.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
// 根据实际泛型类型反序列化(此处简化为返回 Object)
|
||||
// 更精确的做法是使用 ParameterizedType,但 MyBatis 不支持泛型擦除后的还原
|
||||
// 所以通常在 Service 层做二次转换,或使用 JsonNode
|
||||
return objectMapper.readValue(json, Object.class);
|
||||
} catch (Exception e) {
|
||||
throw new SQLException("Error parsing JSON", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.springblade.common.handler;
|
||||
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||
import org.apache.ibatis.type.MappedTypes;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@MappedJdbcTypes(JdbcType.ARRAY)
|
||||
@MappedTypes(List.class)
|
||||
public class PgLongArrayToListTypeHandler extends BaseTypeHandler<List<Long>> {
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, List<Long> parameter, JdbcType jdbcType) throws SQLException {
|
||||
// 将 List<Long> 转换为 PostgreSQL 的 bigint[]
|
||||
Array array = ps.getConnection().createArrayOf("bigint", parameter.toArray());
|
||||
ps.setArray(i, array);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
// 从 ResultSet 中读取数组并转换为 List<Long>
|
||||
Array array = rs.getArray(columnName);
|
||||
if (array == null) {
|
||||
return null;
|
||||
}
|
||||
return Arrays.asList((Long[]) array.getArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
// 从 ResultSet 中按列索引读取数组并转换为 List<Long>
|
||||
Array array = rs.getArray(columnIndex);
|
||||
if (array == null) {
|
||||
return null;
|
||||
}
|
||||
return Arrays.asList((Long[]) array.getArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
// 从 CallableStatement 中读取数组并转换为 List<Long>
|
||||
Array array = cs.getArray(columnIndex);
|
||||
if (array == null) {
|
||||
return null;
|
||||
}
|
||||
return Arrays.asList((Long[]) array.getArray());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.apache.ibatis.type.MappedTypes;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -16,17 +17,15 @@ public class PgStringArrayToListTypeHandler extends BaseTypeHandler<List<String>
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException {
|
||||
if (parameter == null || parameter.isEmpty()) {
|
||||
ps.setNull(i, Types.ARRAY);
|
||||
} else {
|
||||
Array array = ps.getConnection().createArrayOf("TEXT", parameter.toArray());
|
||||
Array array = ps.getConnection().createArrayOf("text", parameter.toArray());
|
||||
ps.setArray(i, array);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
return parseArray(rs.getArray(columnName));
|
||||
Array array = rs.getArray(columnName);
|
||||
if (array == null) return Collections.emptyList(); // 返回空列表而非 null
|
||||
return Arrays.asList((String[]) array.getArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
437
src/main/java/org/springblade/common/utils/date/DateUtil.java
Normal file
437
src/main/java/org/springblade/common/utils/date/DateUtil.java
Normal file
@@ -0,0 +1,437 @@
|
||||
package org.springblade.common.utils.date;
|
||||
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class DateUtil {
|
||||
|
||||
private static final ThreadLocal<SimpleDateFormat> SIMPLE_DAY = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd"));
|
||||
private static final ThreadLocal<SimpleDateFormat> SIMPLE_DATE_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||
public static final ThreadLocal<DateTimeFormatter> THREAD_LOCAL_FORMAT = ThreadLocal.withInitial(() -> DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.CHINA));
|
||||
|
||||
|
||||
/**
|
||||
* 计算天数
|
||||
*
|
||||
* @param beginDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
*/
|
||||
public static Integer getDaySub(Date beginDate, Date endDate) {
|
||||
try {
|
||||
SimpleDateFormat sdf = SIMPLE_DAY.get();
|
||||
Date start = sdf.parse(sdf.format(beginDate));
|
||||
Date end = sdf.parse(sdf.format(endDate));
|
||||
return Math.toIntExact((end.getTime() - start.getTime()) / (24 * 60 * 60 * 1000));
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Date geFirstDayOfThisMonth() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取本月最后一天
|
||||
*/
|
||||
public static Date geLastDayOfThisMonth() {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
cal.roll(Calendar.DAY_OF_MONTH, -1);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
public static Date getThirtyMinuteLate() {
|
||||
Calendar now = Calendar.getInstance();
|
||||
now.add(Calendar.MINUTE, 30);
|
||||
return now.getTime();
|
||||
}
|
||||
|
||||
public static Date getSecondsLate(Date date, int seconds) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.add(Calendar.SECOND, seconds);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static Date getMinutesLate(Date date, int minutes) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.add(Calendar.MINUTE, minutes);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static Date getHoursLate(Date date, int hours) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.add(Calendar.HOUR, hours);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static Date getDaysLate(Date date, int days) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.add(Calendar.DAY_OF_MONTH, days);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static Date getMonthsLate(Date date, int months) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.add(Calendar.MONTH, months);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static Date getZeroTime(Date date) {
|
||||
Calendar result = Calendar.getInstance();
|
||||
result.setTime(date);
|
||||
result.set(Calendar.HOUR_OF_DAY, 0);
|
||||
result.set(Calendar.MINUTE, 0);
|
||||
result.set(Calendar.SECOND, 0);
|
||||
result.set(Calendar.MILLISECOND, 0);
|
||||
return result.getTime();
|
||||
}
|
||||
|
||||
public static boolean isExpireDays(Date date, int i) {
|
||||
Calendar createDate = Calendar.getInstance();
|
||||
createDate.setTime(date);
|
||||
createDate.add(Calendar.DATE, i);
|
||||
return createDate.before(new Date());
|
||||
}
|
||||
|
||||
|
||||
public static Integer getPersonAgeFromIdCard(String pensonnelIdCard) {
|
||||
|
||||
//截取身份证中出行人出生日期中的年、月、日
|
||||
Integer personYear = Integer.parseInt(pensonnelIdCard.substring(6, 10));
|
||||
Integer personMonth = Integer.parseInt(pensonnelIdCard.substring(10, 12));
|
||||
Integer personDay = Integer.parseInt(pensonnelIdCard.substring(12, 14));
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
// 得到当前时间的年、月、日
|
||||
Integer yearNow = cal.get(Calendar.YEAR);
|
||||
Integer monthNow = cal.get(Calendar.MONTH) + 1;
|
||||
Integer dayNow = cal.get(Calendar.DATE);
|
||||
|
||||
// 用当前年月日减去生日年月日
|
||||
Integer yearMinus = yearNow - personYear;
|
||||
Integer monthMinus = monthNow - personMonth;
|
||||
Integer dayMinus = dayNow - personDay;
|
||||
|
||||
Integer age = yearMinus; //先大致赋值
|
||||
|
||||
if (yearMinus == 0) { //出生年份为当前年份
|
||||
age = 0;
|
||||
} else { //出生年份大于当前年份
|
||||
if (monthMinus < 0) {//出生月份小于当前月份时,还没满周岁
|
||||
age = age - 1;
|
||||
}
|
||||
if (monthMinus == 0) {//当前月份为出生月份时,判断日期
|
||||
if (dayMinus < 0) {//出生日期小于当前月份时,没满周岁
|
||||
age = age - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return age;
|
||||
}
|
||||
|
||||
public static Date getToday() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Integer getYear() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
return calendar.get(Calendar.YEAR);
|
||||
}
|
||||
|
||||
public static Integer getMonth() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
return calendar.get(Calendar.MONTH) + 1;
|
||||
}
|
||||
|
||||
public static Integer getDay() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
return calendar.get(Calendar.DATE);
|
||||
}
|
||||
|
||||
public static Date getYesterday() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -1);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getBeForeYesterday() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -2);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date setDayToNum(int day) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, day);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getLastWeek() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -7);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getSixDaysAgo() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -6);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getTomorrow() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
|
||||
public static Integer getTimeHour() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
return calendar.get(Calendar.HOUR_OF_DAY);
|
||||
}
|
||||
|
||||
public static Date getTodayHour(String end) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(end));
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Integer getTimeStampSec() {
|
||||
return Integer.valueOf(String.valueOf(Instant.now().getEpochSecond()));
|
||||
}
|
||||
|
||||
public static Date getDayOfMonth(Integer month) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.DAY_OF_MONTH, month);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* "starttime": "11:00",
|
||||
* "endtime": "20:00",
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public static int verificationPeriod(String startTime, String endTime) {
|
||||
int status = 0;
|
||||
SimpleDateFormat sdf = SIMPLE_DAY.get();
|
||||
SimpleDateFormat sdtf = SIMPLE_DATE_FORMAT.get();
|
||||
if (StringUtils.hasLength(startTime) && StringUtils.hasLength(endTime) && startTime.length() == 5 && endTime.length() == 5) {
|
||||
String currentDay = sdf.format(new Date());
|
||||
Long current = System.currentTimeMillis();
|
||||
//日期补全
|
||||
String startStr = new StringBuilder(currentDay).append(" ").append(startTime).append(":00").toString();
|
||||
String endStr = new StringBuilder(currentDay).append(" ").append(endTime).append(":00").toString();
|
||||
synchronized (DateUtil.class) {
|
||||
try {
|
||||
Long start = sdtf.parse(startStr).getTime();
|
||||
Long end = sdtf.parse(endStr).getTime();
|
||||
//判断是否跨天
|
||||
if (start > end) {
|
||||
status = current - end >= 0 && current - start <= 0 ? 1 : 0;
|
||||
} else {
|
||||
status = start.equals(end) ? 0 : current - start >= 0 && current - end <= 0 ? 0 : 1;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("错误的日期格式 开始时间 {} 结束时间{}", startTime, endTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
public static Date convertFromString(String dateString, String format) {
|
||||
SimpleDateFormat ft = new SimpleDateFormat(format);
|
||||
try {
|
||||
return ft.parse(dateString);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static String convertFromDate(Date date, String format) {
|
||||
SimpleDateFormat ft = new SimpleDateFormat(format);
|
||||
return ft.format(date);
|
||||
}
|
||||
|
||||
public static Date convertLocalDateTimeToDate(LocalDateTime localDateTime) {
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
ZonedDateTime zdt = localDateTime.atZone(zoneId);
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
public static Integer getDays(Integer number, Integer type) {
|
||||
int days = 0;
|
||||
//计算包对应时长
|
||||
switch (type) {
|
||||
case 1: // 天
|
||||
days = number;
|
||||
break;
|
||||
case 2: // 月
|
||||
days = number * 30;
|
||||
break;
|
||||
case 3: //年
|
||||
days = number * 365;
|
||||
break;
|
||||
default:
|
||||
Assert.isTrue(false, "时间类型错误");
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定日期后x天的日期
|
||||
*
|
||||
* @param start 日期
|
||||
* @param day 天数
|
||||
* @return
|
||||
*/
|
||||
public static Date getSpecifyDay(Date start, int day) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(start);
|
||||
calendar.add(Calendar.DATE, day);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getBegin(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getEnd(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.SECOND, 59);
|
||||
calendar.set(Calendar.MINUTE, 59);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||
calendar.set(Calendar.MILLISECOND, 999);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getMonthBegin(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MONTH, 0);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Date getMonthEnd(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
calendar.set(Calendar.SECOND, 59);
|
||||
calendar.set(Calendar.MINUTE, 59);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||
calendar.set(Calendar.MILLISECOND, 999);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Long getExpireSecondWithTimestamp(int seconds) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.SECOND, seconds);
|
||||
return calendar.getTime().getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期是否为周六/周日
|
||||
*
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static Boolean dayOfWeek(String day) {
|
||||
DateTimeFormatter formatter = THREAD_LOCAL_FORMAT.get();
|
||||
LocalDate date = LocalDate.parse(day, formatter);
|
||||
switch (date.getDayOfWeek()) {
|
||||
case SATURDAY:
|
||||
case SUNDAY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,11 +4,17 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@@ -17,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class APPCommonController {
|
||||
|
||||
private final IUserService userService;
|
||||
private final ICommonRegionsInfoService commonRegionsInfoService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,4 +36,17 @@ public class APPCommonController {
|
||||
return R.data(userService.hasChangedPassword());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取省市区列表
|
||||
*/
|
||||
@GetMapping("/region-list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "获取省市区列表")
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
package org.springblade.modules.api.app;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.vo.MallCategoryApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||
import org.springblade.modules.mall.convert.AppMallConvert;
|
||||
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
|
||||
import org.springblade.modules.mall.service.IMallCategoryService;
|
||||
import org.springblade.modules.mall.service.IMallProductService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@@ -12,6 +25,41 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Tag(name = "APP用户接口", description = "APP用户接口")
|
||||
public class APPMallController {
|
||||
|
||||
private final IMallProductService productService;
|
||||
|
||||
private final IMallCategoryService categoryService;
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@GetMapping("/categories")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "列表")
|
||||
public R<List<MallCategoryApiVO>> categories() {
|
||||
List<MallCategoryEntity> list = categoryService.list();
|
||||
return R.data(AppMallConvert.INSTANCE.convertMallCategoryApiListVO(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "列表")
|
||||
public R<List<MallProductApiVO>> list(@RequestParam(required = false) Long categoryId) {
|
||||
return R.data(productService.apiVoList(categoryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "详情", description = "传入vo")
|
||||
public R<MallProductDetailApiVO> detail(@Valid MallProductDetailApiVO vo) {
|
||||
return R.data(productService.apiDetailVO(vo.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
package org.springblade.modules.api.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
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.*;
|
||||
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
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
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@@ -18,6 +30,18 @@ public class APPUserController {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
private final ICommonUserOrderService orderService;
|
||||
|
||||
private final ICommonUserNoticeService userNoticeService;
|
||||
|
||||
private final ICommonUserAddressService addressService;
|
||||
|
||||
private final ICommonUserPointService pointService;
|
||||
|
||||
private final ICommonLotteryRecordService lotteryRecordService;
|
||||
|
||||
private final ICommonLotteryPrizeService lotteryPrizeService;
|
||||
|
||||
|
||||
/**
|
||||
* 是否修改过密码
|
||||
@@ -35,7 +59,7 @@ public class APPUserController {
|
||||
@PostMapping("/change-password")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "修改登录密码", description = "传入String")
|
||||
public R submit(@RequestBody String password) {
|
||||
public R changePassword(@RequestBody String password) {
|
||||
return R.status(userService.changePassword(password));
|
||||
}
|
||||
|
||||
@@ -49,4 +73,145 @@ public class APPUserController {
|
||||
return R.data(userService.inviteCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 下单
|
||||
*/
|
||||
@PostMapping("/create-order")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "下单", description = "传入CreateOrderRequest")
|
||||
public R<CreateOrderResponse> createOrder(@Valid @RequestBody CreateOrderRequest request) {
|
||||
return R.data(orderService.createOrder(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付
|
||||
*/
|
||||
@PostMapping("/pay")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "支付", description = "传入PaymentRequest")
|
||||
public R<PaymentResponse> pay(@Valid @RequestBody PaymentRequest request) {
|
||||
return R.data(orderService.pay(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单列表
|
||||
*/
|
||||
@GetMapping("/order-page")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户订单分页列表", description = "传入userAddress")
|
||||
public R<IPage<CommonUserOrderApiVO>> orderList(CommonUserOrderApiVO userOrder, Query query) {
|
||||
IPage<CommonUserOrderApiVO> pages = orderService.selectOrderApiPage(Condition.getPage(query), userOrder);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单列表
|
||||
*/
|
||||
@GetMapping("/order-detail")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户订单分页列表")
|
||||
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
||||
return R.data(orderService.orderDetail(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/system-notice")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "APP系统消息列表")
|
||||
public R<List<CommonUserNoticeApiVO>> systemNotice() {
|
||||
return R.data(userNoticeService.appSystemNoticeList());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user-notice")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "用户消息列表", description = "传入userNoticeVO")
|
||||
public R<IPage<CommonUserNoticeApiVO>> noticePage(Query query) {
|
||||
IPage<CommonUserNoticeApiVO> pages = userNoticeService.selectAppUserNoticeApiPage(Condition.getPage(query), new CommonUserNoticeApiVO());
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/notice-detail")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "用户读取消息")
|
||||
public R<CommonUserNoticeDetailApiVO> noticeDetail(Long id) {
|
||||
return R.data(userNoticeService.userNoticeDetail(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/unread")
|
||||
@ApiOperationSupport(order = 10)
|
||||
@Operation(summary = "用户未读消息数量")
|
||||
public R<Long> unreadNum() {
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package org.springblade.modules.api.market;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
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.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.market.manager.MarketUserPointManager;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/market-user")
|
||||
@Tag(name = "APP福利包接口", description = "APP福利包接口")
|
||||
public class MarketUserController {
|
||||
|
||||
private final IMarketBenefitPackageService userMarketBenefitPackageService;
|
||||
|
||||
private final MarketUserManager marketUserManager;
|
||||
|
||||
private final ICommonUserNoticeService userNoticeService;
|
||||
|
||||
private final MarketUserPointManager marketUserPointManager;
|
||||
|
||||
|
||||
@GetMapping("/package-list")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "分页", description = "传入userMarketBenefitPackage")
|
||||
public R<IPage<MarketBenefitPackageVO>> findUserPackList(MarketBenefitPackageVO userMarketBenefitPackage, Query query) {
|
||||
IPage<MarketBenefitPackageVO> pages = userMarketBenefitPackageService.findUserPackList(Condition.getPage(query),userMarketBenefitPackage , AuthUtil.getUserId());
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/my-team")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "查直推")
|
||||
public R<List<MarketDirectInfoApiVO>> myTeam() {
|
||||
return R.data(marketUserManager.findUserPackList());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/my-invitor")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "查推荐人信息")
|
||||
public R<MarketDirectInfoApiVO> myInvitor() {
|
||||
return R.data(marketUserManager.findMarketParent());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/system-notice")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "Market系统消息列表")
|
||||
public R<List<CommonUserNoticeApiVO>> systemNotice() {
|
||||
return R.data(userNoticeService.marketSystemNoticeList());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user-notice")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "Market用户消息列表", description = "传入userNoticeVO")
|
||||
public R<IPage<CommonUserNoticeApiVO>> noticePage(Query query) {
|
||||
IPage<CommonUserNoticeApiVO> pages = userNoticeService.selectMarketUserNoticeApiPage(Condition.getPage(query), new CommonUserNoticeApiVO());
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/notice-detail")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户消息详情", description = "传入request")
|
||||
public R<CommonUserNoticeDetailApiVO> noticeDetail(Long id) {
|
||||
return R.data(userNoticeService.userNoticeDetail(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/unread")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "Market用户未读消息数量")
|
||||
public R<Long> unreadNum() {
|
||||
return R.data(userNoticeService.marketUnreadNoticeNum());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@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,37 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CreateOrderRequest implements Serializable {
|
||||
|
||||
@NotEmpty(message = "请填写联系人")
|
||||
private String consignee;
|
||||
|
||||
@NotEmpty(message = "请填写联系电话")
|
||||
private String consigneePhone;
|
||||
|
||||
@NotEmpty(message = "订单类型为空")
|
||||
private String orderType;
|
||||
|
||||
@NotEmpty(message = "商品编号为空")
|
||||
private String itemCode;
|
||||
|
||||
@NotNull(message = "商品数量不能为空")
|
||||
@Min(value = 1, message = "无效商品数量")
|
||||
private Integer quantity;
|
||||
|
||||
@NotEmpty(message = "请填写收货地址")
|
||||
private String address;
|
||||
|
||||
@NotNull(message = "无效支付方式")
|
||||
private Integer paymentType;
|
||||
|
||||
@NotNull(message = "无效标识")
|
||||
private Boolean isOfflinePayment;
|
||||
}
|
||||
@@ -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,14 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PaymentRequest implements Serializable {
|
||||
|
||||
private String orderId;
|
||||
|
||||
private Integer paymentType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.springblade.modules.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class CreateOrderResponse implements Serializable {
|
||||
|
||||
private String orderId;
|
||||
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private BigDecimal discount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.springblade.modules.api.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PaymentResponse implements Serializable {
|
||||
|
||||
private Integer paymentType;
|
||||
|
||||
private String payChannel;
|
||||
|
||||
private String params;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class CommonUserNoticeApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String moduleType;
|
||||
/**
|
||||
* 是否已读 0-否 1-是
|
||||
*/
|
||||
private Integer hasRead;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class CommonUserNoticeDetailApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String moduleType;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CommonUserOrderApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String orderType;
|
||||
|
||||
private String itemName;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
private Integer orderStatus;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CommonUserOrderDetailApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String consigneePhone;
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String orderType;
|
||||
|
||||
private String itemCode;
|
||||
|
||||
private String itemName;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
private String deliveryAddress;
|
||||
|
||||
private String expressCompany;
|
||||
|
||||
private String expressNo;
|
||||
|
||||
private Integer orderStatus;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
private Integer paymentType;
|
||||
|
||||
private Date paymentTime;
|
||||
|
||||
private Integer paymentStatus;
|
||||
|
||||
}
|
||||
@@ -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,15 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MallCategoryApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
private String imageUrl;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MallProductApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String thumbImageUrl;
|
||||
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
private Integer sales;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class MallProductDetailApiVO implements Serializable {
|
||||
|
||||
@NotNull(message = "无效商品")
|
||||
private Long id;
|
||||
|
||||
private String serialNumber;
|
||||
|
||||
private String productName;
|
||||
|
||||
private List<String> mainImageUrls;
|
||||
|
||||
private List<String> detailImageUrls;
|
||||
|
||||
private String thumbImageUrl;
|
||||
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
private Integer sales;
|
||||
|
||||
private Integer stock;
|
||||
|
||||
private List<MallProductEntity.Spec> specs;
|
||||
|
||||
private List<String> tags;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* 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;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户积分包信息表 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
public class MarketBenefitPackageVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long packageId;
|
||||
|
||||
private String packageName;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private BigDecimal userBenefit;
|
||||
|
||||
private BigDecimal userCash;
|
||||
|
||||
private BigDecimal giveAmount;
|
||||
|
||||
private Integer dayTotal;
|
||||
|
||||
private BigDecimal amountTotal;
|
||||
|
||||
private BigDecimal amountDay;
|
||||
|
||||
private BigDecimal amountOut;
|
||||
|
||||
private Integer outDay;
|
||||
|
||||
|
||||
private Date expiredDate;
|
||||
|
||||
private Date activeTime;
|
||||
|
||||
/**
|
||||
* 状态 1-未激活 2-已激活 3-已完成 4-已过期
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private String remark;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* 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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户拓展信息表 视图实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MarketDirectInfoApiVO implements Serializable {
|
||||
|
||||
private String phone;
|
||||
|
||||
private String name;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date registerTime;
|
||||
|
||||
}
|
||||
@@ -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>)
|
||||
|
||||
}
|
||||
@@ -105,6 +105,7 @@ public class AppRegisterTokenGranter extends PasswordTokenGranter {
|
||||
user.setUserType(UserType.of(request.getUserType()).getCategory());
|
||||
user.setTenantId(request.getTenantId());
|
||||
user.setAccount(request.getPhone());
|
||||
user.setPhone(request.getPhone());
|
||||
user.setName(StringUtil.random(10));
|
||||
user.setPassword(DigestUtil.encrypt(ParamCache.getValue(INIT_PASSWD_VALUE)));
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,27 +32,17 @@ 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.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.excel.CommonRegionsInfoExcel;
|
||||
import org.springblade.modules.common.wrapper.CommonRegionsInfoWrapper;
|
||||
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 地区详情表 控制器
|
||||
@@ -62,7 +52,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-regionsinfo/regionsInfo")
|
||||
@RequestMapping("/common/region")
|
||||
@Tag(name = "地区详情表", description = "地区详情表接口")
|
||||
public class CommonRegionsInfoController extends BladeController {
|
||||
|
||||
@@ -139,23 +129,4 @@ public class CommonRegionsInfoController extends BladeController {
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(regionsInfoService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-regionsInfo")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入regionsInfo")
|
||||
public void exportRegionsInfo(@Parameter(hidden = true) @RequestParam Map<String, Object> regionsInfo, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<CommonRegionsInfoEntity> queryWrapper = Condition.getQueryWrapper(regionsInfo, CommonRegionsInfoEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(RegionsInfo::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(RegionsInfoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CommonRegionsInfoExcel> list = regionsInfoService.exportRegionsInfo(queryWrapper);
|
||||
ExcelUtil.export(response, "地区详情表数据" + DateUtil.time(), "地区详情表数据表", list, CommonRegionsInfoExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,27 +32,18 @@ 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.CommonUserAddressEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserAddressVO;
|
||||
import org.springblade.modules.common.excel.CommonUserAddressExcel;
|
||||
import org.springblade.modules.common.wrapper.CommonUserAddressWrapper;
|
||||
import org.springblade.modules.common.service.ICommonUserAddressService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 用户地址表 控制器
|
||||
@@ -62,7 +53,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-useraddress/userAddress")
|
||||
@RequestMapping("/common/address")
|
||||
@Tag(name = "用户地址表", description = "用户地址表接口")
|
||||
public class CommonUserAddressController extends BladeController {
|
||||
|
||||
@@ -140,22 +131,4 @@ public class CommonUserAddressController extends BladeController {
|
||||
return R.status(userAddressService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-userAddress")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入userAddress")
|
||||
public void exportUserAddress(@Parameter(hidden = true) @RequestParam Map<String, Object> userAddress, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<CommonUserAddressEntity> queryWrapper = Condition.getQueryWrapper(userAddress, CommonUserAddressEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserAddress::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserAddressEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CommonUserAddressExcel> list = userAddressService.exportUserAddress(queryWrapper);
|
||||
ExcelUtil.export(response, "用户地址表数据" + DateUtil.time(), "用户地址表数据表", list, CommonUserAddressExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.CommonUserNoticeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserNoticeVO;
|
||||
import org.springblade.modules.common.wrapper.CommonUserNoticeWrapper;
|
||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
|
||||
/**
|
||||
* 用户通知 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/common/notice")
|
||||
@Tag(name = "用户通知", description = "用户通知接口")
|
||||
public class CommonUserNoticeController extends BladeController {
|
||||
|
||||
private final ICommonUserNoticeService userNoticeService;
|
||||
|
||||
/**
|
||||
* 用户通知 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入userNotice")
|
||||
public R<CommonUserNoticeVO> detail(CommonUserNoticeEntity userNotice) {
|
||||
CommonUserNoticeEntity detail = userNoticeService.getOne(Condition.getQueryWrapper(userNotice));
|
||||
return R.data(CommonUserNoticeWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户通知 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入userNotice")
|
||||
public R<IPage<CommonUserNoticeVO>> list(CommonUserNoticeEntity userNotice, Query query) {
|
||||
IPage<CommonUserNoticeEntity> pages = userNoticeService.page(Condition.getPage(query), Condition.getQueryWrapper(userNotice).orderByDesc("id"));
|
||||
return R.data(CommonUserNoticeWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入userNotice")
|
||||
public R<IPage<CommonUserNoticeVO>> page(CommonUserNoticeVO userNotice, Query query) {
|
||||
IPage<CommonUserNoticeVO> pages = userNoticeService.selectUserNoticePage(Condition.getPage(query), userNotice);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入userNotice")
|
||||
public R save(@Valid @RequestBody CommonUserNoticeVO userNotice) {
|
||||
return R.status(userNoticeService.saveUserNotice(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入userNotice")
|
||||
public R update(@Valid @RequestBody CommonUserNoticeEntity userNotice) {
|
||||
return R.status(userNoticeService.updateById(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入userNotice")
|
||||
public R submit(@Valid @RequestBody CommonUserNoticeEntity userNotice) {
|
||||
return R.status(userNoticeService.saveOrUpdate(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(userNoticeService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
/**
|
||||
* 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.redis.debounce.RedisDebounce;
|
||||
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.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
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-06
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/common/order")
|
||||
@Tag(name = "用户订单", description = "用户订单接口")
|
||||
public class CommonUserOrderController extends BladeController {
|
||||
|
||||
private final ICommonUserOrderService orderService;
|
||||
|
||||
/**
|
||||
* 用户订单 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入order")
|
||||
public R<CommonUserOrderEntity> detail(CommonUserOrderEntity order) {
|
||||
CommonUserOrderEntity detail = orderService.getOne(Condition.getQueryWrapper(order));
|
||||
return R.data(detail);
|
||||
}
|
||||
/**
|
||||
* 用户订单 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入order")
|
||||
public R<IPage<CommonUserOrderEntity>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> order, Query query) {
|
||||
IPage<CommonUserOrderEntity> pages = orderService.page(Condition.getPage(query), Condition.getQueryWrapper(order, CommonUserOrderEntity.class));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入order")
|
||||
public R<IPage<CommonUserOrderVO>> page(CommonUserOrderVO order, Query query) {
|
||||
IPage<CommonUserOrderVO> pages = orderService.selectOrderPage(Condition.getPage(query), order);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入order")
|
||||
public R save(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||
return R.status(orderService.save(order));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入order")
|
||||
public R update(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||
return R.status(orderService.updateById(order));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入order")
|
||||
public R submit(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||
return R.status(orderService.saveOrUpdate(order));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(orderService.removeByIds(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-order")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入order")
|
||||
public void exportOrder(@Parameter(hidden = true) @RequestParam Map<String, Object> order, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<CommonUserOrderEntity> queryWrapper = Condition.getQueryWrapper(order, CommonUserOrderEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(Order::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(OrderEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CommonUserOrderExcel> list = orderService.exportOrder(queryWrapper);
|
||||
ExcelUtil.export(response, "用户订单数据" + DateUtil.time(), "用户订单数据表", list, CommonUserOrderExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户订单 确认收款
|
||||
*/
|
||||
@PostMapping("/confirm-payment")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "确认收款", description = "传入order")
|
||||
public R confirmPayment(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||
return R.status(orderService.confirmPayment(order.getId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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.*;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AppCommonConvert {
|
||||
|
||||
AppCommonConvert INSTANCE = Mappers.getMapper(AppCommonConvert.class);
|
||||
|
||||
|
||||
AppCommonRegionsInfoVO convertRegionsInfoVO(CommonRegionsInfoEntity entity);
|
||||
|
||||
List<AppCommonRegionsInfoVO> convertRegionsInfoListVO(List<CommonRegionsInfoEntity> list);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createTime", ignore = true)
|
||||
@Mapping(target = "createUser", ignore = true)
|
||||
@Mapping(target = "createDept", ignore = true)
|
||||
@Mapping(target = "updateTime", ignore = true)
|
||||
@Mapping(target = "updateUser", ignore = true)
|
||||
@Mapping(target = "status", ignore = true)
|
||||
@Mapping(target = "isDeleted", ignore = true)
|
||||
@Mapping(target = "consigneePhone", source = "request.consigneePhone")
|
||||
@Mapping(target = "consignee", source = "request.consignee")
|
||||
@Mapping(target = "itemCode", source = "request.itemCode")
|
||||
@Mapping(target = "quantity", source = "request.quantity")
|
||||
@Mapping(target = "deliveryAddress", source = "request.address")
|
||||
@Mapping(target = "itemName", source = "product.productName")
|
||||
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
||||
CommonUserOrderEntity convertMallProductToOrder(CreateOrderRequest request, MallProductEntity product);
|
||||
|
||||
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
||||
|
||||
List<CommonUserOrderApiVO> convertUserOrderEntityListTOApiList(List<CommonUserOrderEntity> entityList);
|
||||
|
||||
CommonUserOrderDetailApiVO convertOrderDetailApiVO(CommonUserOrderEntity entity);
|
||||
|
||||
CommonUserOrderApiVO convertOrderApiVO(CommonUserOrderVO vo);
|
||||
|
||||
List<CommonUserOrderApiVO> convertOrderApiListVO(List<CommonUserOrderVO> voList);
|
||||
|
||||
CommonUserNoticeApiVO convertNoticeEntityToVO(CommonUserNoticeEntity commonUserNoticeEntity);
|
||||
|
||||
List<CommonUserNoticeApiVO> convertNoticeVOList(List<CommonUserNoticeEntity> list);
|
||||
|
||||
CommonUserNoticeDetailApiVO convertNoticeDetailVO(CommonUserNoticeEntity entity);
|
||||
|
||||
CommonUserAddressApiVO convertAddressToVoList(CommonUserAddressEntity entity);
|
||||
|
||||
List<CommonUserAddressApiVO> convertAddressListToVoList(List<CommonUserAddressEntity> list);
|
||||
|
||||
CommonUserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum BusinessModule {
|
||||
|
||||
SELF_OPERATED_MALL("自营商城", "self_mall"),
|
||||
ECOSYSTEM_PRODUCT("生态商品", "eco_product"),
|
||||
TRAVEL_GROUP("旅游团", "travel_group"),
|
||||
LOTTERY("幸运抽奖", "lottery");
|
||||
|
||||
@Getter
|
||||
private final String displayName;
|
||||
|
||||
@Getter
|
||||
private final String code;
|
||||
|
||||
|
||||
// ========================
|
||||
// 根据 code 查找(忽略大小写)
|
||||
// ========================
|
||||
public static BusinessModule fromCodeIgnoreCase(String code) {
|
||||
BusinessModule module = fromCodeIgnoreCaseOrNull(code);
|
||||
if (module == null) {
|
||||
throw new IllegalArgumentException("未知的业务模块 code: " + code);
|
||||
}
|
||||
return module;
|
||||
}
|
||||
|
||||
public static BusinessModule fromCodeIgnoreCaseOrNull(String code) {
|
||||
if (code == null || code.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
String normalized = code.trim().toLowerCase();
|
||||
for (BusinessModule module : values()) {
|
||||
if (module.code.equals(normalized)) {
|
||||
return module;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@Getter
|
||||
public enum NoticeType {
|
||||
|
||||
/**
|
||||
* 全局通知
|
||||
*/
|
||||
GLOBAL(0),
|
||||
|
||||
/**
|
||||
* APP系统通知
|
||||
*/
|
||||
APP_SYSTEM(1),
|
||||
|
||||
/**
|
||||
* Market系统通知
|
||||
*/
|
||||
MARKET_SYSTEM(2),
|
||||
|
||||
/**
|
||||
* APP用户通知
|
||||
*/
|
||||
APP_USER(3),
|
||||
|
||||
/**
|
||||
* Market用户通知
|
||||
*/
|
||||
MARKET_USER(4);
|
||||
|
||||
private final int code;
|
||||
|
||||
NoticeType(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 code 值获取对应的枚举项
|
||||
*
|
||||
* @param code 通知类型代码
|
||||
* @return 对应的 NotificationType 枚举
|
||||
* @throws IllegalArgumentException 如果 code 无效
|
||||
*/
|
||||
public static NoticeType fromCode(int code) {
|
||||
for (NoticeType type : NoticeType.values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid notification type code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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 OrderStatus {
|
||||
|
||||
PENDING_PAYMENT(0, "📌 订单 <id>%s</id> 尚未支付!请尽快完成付款,以免订单自动取消。"),
|
||||
PAID(1, "✅ 订单 <id>%s</id> 已支付成功!商家正在准备发货(或待您使用),请耐心等待。"),
|
||||
CANCELLED(2, "🗑️ 订单 <id>%s</id> 已取消。如有疑问,可联系客服了解详情。"),
|
||||
SHIPPED(3, "🚚 订单 <id>%s</id> 已发货!(或🎫 电子票已出票)请留意物流信息(或按时使用服务)。"),
|
||||
COMPLETED(4, "🎉 订单 <id>%s</id> 已完成!感谢您的信任,期待再次为您服务~"),
|
||||
CLOSED_TIMEOUT(5, "⏰ 订单 <id>%s</id> 因超时未支付已自动关闭。如需购买,请重新下单。"),
|
||||
REFUNDING(6, "🔄 订单 <id>%s</id> 的退款申请已受理,款项将在1-7个工作日内原路退回,请耐心等待。"),
|
||||
REFUNDED(7, "💸 订单 <id>%s</id> 的退款已成功!金额已退至您的原支付账户,请注意查收。");
|
||||
|
||||
private final int code;
|
||||
private final String userMessageTemplate;
|
||||
|
||||
OrderStatus(int code, String userMessageTemplate) {
|
||||
this.code = code;
|
||||
this.userMessageTemplate = userMessageTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号生成面向用户的消息
|
||||
*/
|
||||
public String formatUserMessage(String orderId) {
|
||||
return userMessageTemplate.formatted(orderId);
|
||||
}
|
||||
|
||||
// ========== 静态工具方法 ==========
|
||||
|
||||
private static final Map<Integer, OrderStatus> BY_CODE = Stream.of(values())
|
||||
.collect(Collectors.toUnmodifiableMap(OrderStatus::getCode, Function.identity()));
|
||||
|
||||
/**
|
||||
* 根据状态码(int)获取对应的 OrderStatus 枚举
|
||||
*
|
||||
* @throws IllegalArgumentException 如果状态码无效
|
||||
*/
|
||||
public static OrderStatus fromCode(int code) {
|
||||
OrderStatus status = BY_CODE.get(code);
|
||||
if (status == null) {
|
||||
throw new IllegalArgumentException("无效的订单状态码: " + code);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全版本:根据状态码获取枚举,若无效则返回 null(适用于非严格场景)
|
||||
*/
|
||||
public static OrderStatus fromCodeOrNull(int code) {
|
||||
return BY_CODE.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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 PaymentStatus {
|
||||
UNPAID(0, "未支付"),
|
||||
PAID(1, "已支付"),
|
||||
FAILED(2, "支付失败"),
|
||||
PROCESSING(3, "支付中(如跳转网银)");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
PaymentStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// ========== 静态映射:code -> enum ==========
|
||||
|
||||
private static final Map<Integer, PaymentStatus> BY_CODE = Stream.of(values())
|
||||
.collect(Collectors.toUnmodifiableMap(PaymentStatus::getCode, Function.identity()));
|
||||
|
||||
/**
|
||||
* 根据整型状态码获取对应的枚举(严格模式)
|
||||
*
|
||||
* @throws IllegalArgumentException 如果状态码无效
|
||||
*/
|
||||
public static PaymentStatus fromCode(int code) {
|
||||
PaymentStatus status = BY_CODE.get(code);
|
||||
if (status == null) {
|
||||
throw new IllegalArgumentException("无效的支付状态码: " + code);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全版本:无效状态码返回 null
|
||||
*/
|
||||
public static PaymentStatus fromCodeOrNull(int code) {
|
||||
return BY_CODE.get(code);
|
||||
}
|
||||
}
|
||||
@@ -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,17 @@
|
||||
package org.springblade.modules.common.event;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class PaymentSuccessEvent {
|
||||
|
||||
private final Long orderId;
|
||||
|
||||
private final Long userId;
|
||||
|
||||
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.mall.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 MallCategoryExcel implements Serializable {
|
||||
public class CommonLotteryRecordExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -59,29 +60,29 @@ public class MallCategoryExcel implements Serializable {
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 分类名称
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("分类名称")
|
||||
private String cname;
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 图片
|
||||
* 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("图片")
|
||||
private String img;
|
||||
@ExcelProperty("中奖奖品ID(null 表示未中奖/谢谢参与)")
|
||||
private Long prizeId;
|
||||
/**
|
||||
* pid
|
||||
* 消耗积分
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("pid")
|
||||
private Long pid;
|
||||
@ExcelProperty("消耗积分")
|
||||
private BigDecimal pointsUsed;
|
||||
/**
|
||||
* level
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("level")
|
||||
private Integer level;
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@@ -1,127 +0,0 @@
|
||||
/**
|
||||
* 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.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 用户地址表 Excel实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class CommonUserAddressExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 地区信息id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("地区信息id")
|
||||
private Long regionsInfoId;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("省份")
|
||||
private String province;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("城市")
|
||||
private String city;
|
||||
/**
|
||||
* 区县
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("区县")
|
||||
private String district;
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("街道")
|
||||
private String street;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("详细地址")
|
||||
private String detail;
|
||||
/**
|
||||
* 收货人
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("收货人")
|
||||
private String consignee;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("联系电话")
|
||||
private String phone;
|
||||
/**
|
||||
* 是否默认地址(0=否,1=是)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否默认地址(0=否,1=是)")
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
/**
|
||||
* 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.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 用户订单 Excel实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-06
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class CommonUserOrderExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 收件人手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("收件人手机号")
|
||||
private String consigneePhone;
|
||||
/**
|
||||
* 收件人
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("收件人")
|
||||
private String consignee;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单类型")
|
||||
private String orderType;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("商品编号")
|
||||
private String itemCode;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("商品名称")
|
||||
private String itemName;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("图片")
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("数量")
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 收货地址(实物商品必填,虚拟商品可为空)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("收货地址(实物商品必填,虚拟商品可为空)")
|
||||
private String deliveryAddress;
|
||||
/**
|
||||
* 快递公司名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("快递公司名称")
|
||||
private String expressCompany;
|
||||
/**
|
||||
* 快递单号(物流单号)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("快递单号(物流单号)")
|
||||
private String expressNo;
|
||||
/**
|
||||
* 订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款")
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单金额")
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("实际支付金额")
|
||||
private BigDecimal actualAmount;
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("支付方式")
|
||||
private Integer paymentType;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("支付时间")
|
||||
private Date paymentTime;
|
||||
/**
|
||||
* 支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)")
|
||||
private Integer paymentStatus;
|
||||
/**
|
||||
* 支付凭证编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("支付凭证编号")
|
||||
private String paymentTrack;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.springblade.modules.common.listener;
|
||||
|
||||
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;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.event.TransactionPhase;
|
||||
import org.springframework.transaction.event.TransactionalEventListener;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class NoticeListener {
|
||||
|
||||
private final ICommonUserNoticeService noticeService;
|
||||
|
||||
@Async
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||
public void onPaymentSuccess(PaymentSuccessEvent 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(OrderStatus.PAID.formatUserMessage(String.valueOf(event.getOrderId())));
|
||||
noticeService.save(notice);
|
||||
}
|
||||
|
||||
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||
public void onPaymentFailure(PaymentSuccessEvent event) {
|
||||
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>
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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.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;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 Mapper 接口
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface CommonLotteryRecordMapper extends BaseMapper<CommonLotteryRecordEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param vo 查询参数
|
||||
* @return List<LotteryRecordVO>
|
||||
*/
|
||||
List<CommonLotteryRecordVO> selectLotteryRecordPage(IPage page, CommonLotteryRecordVO vo);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<LotteryRecordExcel>
|
||||
*/
|
||||
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>
|
||||
@@ -27,11 +27,8 @@ package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonRegionsInfoVO;
|
||||
import org.springblade.modules.common.excel.CommonRegionsInfoExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,13 +48,4 @@ public interface CommonRegionsInfoMapper extends BaseMapper<CommonRegionsInfoEnt
|
||||
*/
|
||||
List<CommonRegionsInfoVO> selectRegionsInfoPage(IPage page, CommonRegionsInfoVO regionsInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<RegionsInfoExcel>
|
||||
*/
|
||||
List<CommonRegionsInfoExcel> exportRegionsInfo(@Param("ew") Wrapper<CommonRegionsInfoEntity> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,9 +25,4 @@
|
||||
select * from regions_info where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportRegionsInfo" resultType="org.springblade.modules.common.excel.CommonRegionsInfoExcel">
|
||||
SELECT * FROM regions_info ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -27,11 +27,8 @@ package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserAddressEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserAddressVO;
|
||||
import org.springblade.modules.common.excel.CommonUserAddressExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,13 +48,4 @@ public interface CommonUserAddressMapper extends BaseMapper<CommonUserAddressEnt
|
||||
*/
|
||||
List<CommonUserAddressVO> selectUserAddressPage(IPage page, CommonUserAddressVO userAddress);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserAddressExcel>
|
||||
*/
|
||||
List<CommonUserAddressExcel> exportUserAddress(@Param("ew") Wrapper<CommonUserAddressEntity> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@@ -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,13 +25,17 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserAddressPage" resultMap="userAddressResultMap">
|
||||
select * from user_address where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportUserAddress" resultType="org.springblade.modules.common.excel.CommonUserAddressExcel">
|
||||
SELECT * FROM user_address ${ew.customSqlSegment}
|
||||
<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>
|
||||
|
||||
@@ -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.mapper;
|
||||
|
||||
import org.springblade.modules.api.vo.CommonUserNoticeApiVO;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserNoticeVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户通知 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
public interface CommonUserNoticeMapper extends BaseMapper<CommonUserNoticeEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userNotice 查询参数
|
||||
* @return List<UserNoticeVO>
|
||||
*/
|
||||
List<CommonUserNoticeVO> selectUserNoticePage(IPage page, CommonUserNoticeVO userNotice);
|
||||
|
||||
List<CommonUserNoticeApiVO> selectAppSystemNoticeVOList();
|
||||
|
||||
List<CommonUserNoticeApiVO> selectAppUserNoticeApiPage(IPage page, CommonUserNoticeApiVO vo, Long userId);
|
||||
|
||||
List<CommonUserNoticeApiVO> selectMarketSystemNoticeVOList();
|
||||
|
||||
List<CommonUserNoticeApiVO> selectMarketUserNoticeApiPage(IPage page, CommonUserNoticeApiVO vo, Long userId);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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.CommonUserNoticeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="userNoticeResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="notice_type" property="noticeType"/>
|
||||
<result column="has_read" property="hasRead"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<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="selectUserNoticePage" resultMap="userNoticeResultMap">
|
||||
select *
|
||||
from user_notice
|
||||
where is_deleted = 0
|
||||
and notice_type in (0, 1, 2)
|
||||
</select>
|
||||
|
||||
<select id="selectAppSystemNoticeVOList" resultType="org.springblade.modules.api.vo.CommonUserNoticeApiVO">
|
||||
select id, module_type, has_read, title, content, create_time
|
||||
from user_notice
|
||||
where notice_type in (0, 1)
|
||||
and is_deleted = 0
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppUserNoticeApiPage" resultType="org.springblade.modules.api.vo.CommonUserNoticeApiVO">
|
||||
select id, module_type, has_read, title, content, create_time
|
||||
from user_notice
|
||||
where user_id = #{userId}
|
||||
and notice_type = 3
|
||||
and is_deleted = 0
|
||||
order by has_read asc, create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectMarketSystemNoticeVOList" resultType="org.springblade.modules.api.vo.CommonUserNoticeApiVO">
|
||||
select id, module_type, has_read, title, content, create_time
|
||||
from user_notice
|
||||
where notice_type in (0, 2)
|
||||
and is_deleted = 0
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectMarketUserNoticeApiPage" resultType="org.springblade.modules.api.vo.CommonUserNoticeApiVO">
|
||||
select id, module_type, has_read, title, content, create_time
|
||||
from user_notice
|
||||
where user_id = #{userId}
|
||||
and notice_type = 4
|
||||
and is_deleted = 0
|
||||
order by has_read asc, create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户订单 Mapper 接口
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-06
|
||||
*/
|
||||
public interface CommonUserOrderMapper extends BaseMapper<CommonUserOrderEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param order 查询参数
|
||||
* @return List<OrderVO>
|
||||
*/
|
||||
List<CommonUserOrderVO> selectOrderPage(IPage page, CommonUserOrderVO order);
|
||||
|
||||
List<CommonUserOrderEntity> selectOrderEntityPage(IPage page, CommonUserOrderEntity order);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<OrderExcel>
|
||||
*/
|
||||
List<CommonUserOrderExcel> exportOrder(@Param("ew") Wrapper<CommonUserOrderEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.CommonUserOrderMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="orderResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserOrderEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="consignee_phone" property="consigneePhone"/>
|
||||
<result column="consignee" property="consignee"/>
|
||||
<result column="order_type" property="orderType"/>
|
||||
<result column="item_code" property="itemCode"/>
|
||||
<result column="item_name" property="itemName"/>
|
||||
<result column="image_url" property="imageUrl"/>
|
||||
<result column="quantity" property="quantity"/>
|
||||
<result column="delivery_address" property="deliveryAddress"/>
|
||||
<result column="express_company" property="expressCompany"/>
|
||||
<result column="express_no" property="expressNo"/>
|
||||
<result column="order_status" property="orderStatus"/>
|
||||
<result column="total_amount" property="totalAmount"/>
|
||||
<result column="actual_amount" property="actualAmount"/>
|
||||
<result column="payment_type" property="paymentType"/>
|
||||
<result column="payment_time" property="paymentTime"/>
|
||||
<result column="payment_status" property="paymentStatus"/>
|
||||
<result column="payment_track" property="paymentTrack"/>
|
||||
<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="selectOrderPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserOrderVO">
|
||||
select uo.*, bu.account as account
|
||||
from user_order uo
|
||||
left join blade_user bu on uo.user_id = bu.id
|
||||
where uo.is_deleted = 0
|
||||
<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>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrderEntityPage" resultType="org.springblade.modules.common.pojo.entity.CommonUserOrderEntity">
|
||||
select * from user_order where is_deleted = 0 and user_id = #{order.userId}
|
||||
<if test="order.orderStatus !=null and order.orderStatus > 0 ">
|
||||
and order_status = #{order.orderStatus}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportOrder" resultType="org.springblade.modules.common.excel.CommonUserOrderExcel">
|
||||
SELECT *
|
||||
FROM user_order ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -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.CommonUserNoticeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户通知 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserNoticeDTO extends CommonUserNoticeEntity {
|
||||
@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.CommonUserOrderEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户订单 数据传输对象实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserOrderDTO extends CommonUserOrderEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user