Compare commits
41 Commits
e04672fbeb
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b052f0c10 | |||
|
|
4f02e78db1 | ||
|
|
16fcb1c714 | ||
| a929e49db7 | |||
| 40e1a3070f | |||
|
|
bc6f3d47d8 | ||
|
|
b15c8e82d0 | ||
|
|
f3e626050b | ||
|
|
fbad45da65 | ||
|
|
ad0beed1c5 | ||
| c07e7ec5fd | |||
| 53ab15a5ca | |||
|
|
afca9b2998 | ||
| 66f6967b09 | |||
| ea4d7a450c | |||
| dbccf57ce9 | |||
| cf517c2b39 | |||
| 924ee879ce | |||
| 967da9e95e | |||
|
|
c27371c640 | ||
| 35354ae4b4 | |||
|
|
b2665809b9 | ||
|
|
774b4eb2d8 | ||
| 37cf579539 | |||
| 1c18d8b082 | |||
|
|
de77da7779 | ||
|
|
34cf179254 | ||
|
|
b355f0364c | ||
| 1c593d1dfb | |||
| 65dfe51f96 | |||
| a57e208e7a | |||
| 6a8a8fc519 | |||
| 0ad70b63e9 | |||
| 2795deedcb | |||
|
|
1a8e0d07bb | ||
|
|
8bb7fa49d5 | ||
|
|
e2496d4bfd | ||
| 539e28762c | |||
| 7e1a58eb66 | |||
|
|
2cf3aa552a | ||
|
|
e8573b90db |
388
doc/sql/executed/202603123_increase.sql
Normal file
388
doc/sql/executed/202603123_increase.sql
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
-- =============================================
|
||||||
|
-- 微信商户配置表 (blade_pay_wxpay_account_config)
|
||||||
|
-- =============================================
|
||||||
|
DROP TABLE IF EXISTS blade_pay_wxpay_account_config;
|
||||||
|
CREATE TABLE blade_pay_wxpay_account_config
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- ID
|
||||||
|
tenant_id varchar(12), -- 租户id
|
||||||
|
mch_id varchar(255) NOT NULL, -- 商户号
|
||||||
|
pay_key varchar(500) NOT NULL, -- 支付密钥
|
||||||
|
pay_name varchar(255), -- 收款名称
|
||||||
|
v3_key varchar(500), -- V3密钥
|
||||||
|
api_type int4, -- API类型【0:普通】
|
||||||
|
notify_url varchar(1000), -- 统一支付回调地址
|
||||||
|
refund_notify_url varchar(1000), -- 统一退款回调
|
||||||
|
cashier_url varchar(1000), -- 聚合收银台URL
|
||||||
|
cert_pem text, -- 微信证书pem文件
|
||||||
|
cert_pkcs text, -- 微信正式p12文件
|
||||||
|
cert_pub_key text, -- 微信证书公钥
|
||||||
|
cert_private_key text, -- 微信证书私钥
|
||||||
|
cert_serial_no varchar(500), -- 商户 API 证书序列号
|
||||||
|
cert_plat_serial_no varchar(500), -- 平台序列号
|
||||||
|
wx_pub_key text, -- 微信支付公钥
|
||||||
|
wx_pub_key_id varchar(255), -- 微信支付公钥ID
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 状态【0:关闭、1:启用】
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE blade_pay_wxpay_account_config IS '微信商户配置表';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.id IS 'ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.tenant_id IS '租户id';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.mch_id IS '商户号';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.pay_key IS '支付密钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.pay_name IS '收款名称';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.v3_key IS 'V3密钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.api_type IS 'API类型【0:普通】';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.notify_url IS '统一支付回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.refund_notify_url IS '统一退款回调';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cashier_url IS '聚合收银台URL';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_pem IS '微信证书pem文件';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_pkcs IS '微信正式p12文件';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_pub_key IS '微信证书公钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_private_key IS '微信证书私钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_serial_no IS '商户 API 证书序列号';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.cert_plat_serial_no IS '平台序列号';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.wx_pub_key IS '微信支付公钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.wx_pub_key_id IS '微信支付公钥ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.status IS '状态【0:关闭、1:启用】';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN blade_pay_wxpay_account_config.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- 支付订单表 (blade_pay_order)
|
||||||
|
-- =============================================
|
||||||
|
DROP TABLE IF EXISTS blade_pay_order;
|
||||||
|
CREATE TABLE blade_pay_order
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- ID
|
||||||
|
tenant_id varchar(12), -- 租户id
|
||||||
|
order_no varchar(255) NOT NULL, -- 系统单号
|
||||||
|
body varchar(255) NOT NULL, -- 商品名称
|
||||||
|
money varchar(255) NOT NULL, -- 支付金额
|
||||||
|
app_id varchar(255) NOT NULL, -- 应用ID
|
||||||
|
mch_id varchar(255) NOT NULL, -- 商户号
|
||||||
|
pay_name varchar(255) NOT NULL, -- 收款名称
|
||||||
|
pay_type varchar(255) NOT NULL, -- 支付方式【code、native、jsapi、wxapp、h5、app】
|
||||||
|
channel varchar(255) NOT NULL, -- 支付渠道【wxpay、alipay】
|
||||||
|
buyer_id varchar(255), -- 买家ID
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 0:未支付、1:已支付
|
||||||
|
pay_no varchar(255), -- 第三方支付单号
|
||||||
|
pay_time varchar(255), -- 支付时间
|
||||||
|
is_refund int4 NOT NULL DEFAULT 0, -- 是否退款【0:否、1:是】
|
||||||
|
refund_money varchar(255), -- 已退款金额
|
||||||
|
notify_url varchar(255), -- 异步回调地址
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE blade_pay_order IS '支付订单表';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.id IS 'ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.tenant_id IS '租户id';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.order_no IS '系统单号';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.body IS '商品名称';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.money IS '支付金额';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.app_id IS '应用ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.mch_id IS '商户号';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.pay_name IS '收款名称';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.pay_type IS '支付方式【code、native、jsapi、wxapp、h5、app】';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.channel IS '支付渠道【wxpay、alipay】';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.buyer_id IS '买家ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.status IS '0:未支付、1:已支付';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.pay_no IS '第三方支付单号';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.pay_time IS '支付时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.is_refund IS '是否退款【0:否、1:是】';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.refund_money IS '已退款金额';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.notify_url IS '异步回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN blade_pay_order.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- 订单退款表 (blade_pay_order_refund)
|
||||||
|
-- =============================================
|
||||||
|
DROP TABLE IF EXISTS blade_pay_order_refund;
|
||||||
|
CREATE TABLE blade_pay_order_refund
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- ID
|
||||||
|
tenant_id varchar(12), -- 租户id
|
||||||
|
refund_no varchar(255) NOT NULL, -- 退款单号
|
||||||
|
order_no varchar(255) NOT NULL, -- 业务订单
|
||||||
|
pay_no varchar(255) NOT NULL, -- 支付单号
|
||||||
|
refund_mch_id varchar(255) NOT NULL, -- 退款商户
|
||||||
|
refund_money varchar(255) NOT NULL, -- 退款金额
|
||||||
|
refund_desc varchar(255), -- 退款原因
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 退款状态 -1:退款失败 0:已发起 1:退款成功
|
||||||
|
notify_url varchar(1000), -- 退款回调地址
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE blade_pay_order_refund IS '订单退款表';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.id IS 'ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.tenant_id IS '租户id';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.refund_no IS '退款单号';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.order_no IS '业务订单';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.pay_no IS '支付单号';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.refund_mch_id IS '退款商户';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.refund_money IS '退款金额';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.refund_desc IS '退款原因';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.status IS '退款状态 -1:退款失败 0:已发起 1:退款成功';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.notify_url IS '退款回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN blade_pay_order_refund.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- 支付宝商户配置表 (blade_pay_alipay_account_config)
|
||||||
|
-- =============================================
|
||||||
|
DROP TABLE IF EXISTS blade_pay_alipay_account_config;
|
||||||
|
CREATE TABLE blade_pay_alipay_account_config
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- ID
|
||||||
|
tenant_id varchar(12), -- 租户id
|
||||||
|
mch_id varchar(255) NOT NULL, -- 商户号
|
||||||
|
app_id varchar(255) NOT NULL, -- 支付宝应用ID
|
||||||
|
account varchar(255) NOT NULL, -- 支付宝账户
|
||||||
|
pay_key text, -- 支付密钥
|
||||||
|
pub_key text, -- 支付宝公钥(开发者工具生成的txt文件)证书模式下通过程序提取该值
|
||||||
|
private_key text, -- 支付宝私钥(开发者工具生成的txt文件,证书模式下CSR文件夹下的私钥)
|
||||||
|
app_cert text, -- 应用证书,开发者网站下载
|
||||||
|
alipay_pub_cert text, -- 支付宝公钥证书,开发者网站下载
|
||||||
|
root_cert text, -- 支付宝根证书,开发者网站下载
|
||||||
|
app_auth_token varchar(500), -- 三方模式授权token
|
||||||
|
service_url varchar(500), -- 支付宝网关地址
|
||||||
|
sign_type varchar(255) NOT NULL, -- 加密算法类型
|
||||||
|
pay_name varchar(255), -- 收款名称
|
||||||
|
company_name varchar(500), -- 公司名称
|
||||||
|
api_type int4 NOT NULL DEFAULT 0, -- API类型【0:普通】
|
||||||
|
notify_url varchar(1000), -- 统一支付回调地址
|
||||||
|
refund_notify_url varchar(1000), -- 退款回调地址
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 状态【0:关闭、1:启用】
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE blade_pay_alipay_account_config IS '支付宝商户配置表';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.id IS 'ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.tenant_id IS '租户id';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.mch_id IS '商户号';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.app_id IS '支付宝应用ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.account IS '支付宝账户';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.pay_key IS '支付密钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.pub_key IS '支付宝公钥(开发者工具生成的txt文件)证书模式下通过程序提取该值';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.private_key IS '支付宝私钥(开发者工具生成的txt文件,证书模式下CSR文件夹下的私钥)';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.app_cert IS '应用证书,开发者网站下载';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.alipay_pub_cert IS '支付宝公钥证书,开发者网站下载';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.root_cert IS '支付宝根证书,开发者网站下载';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.app_auth_token IS '三方模式授权token';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.service_url IS '支付宝网关地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.sign_type IS '加密算法类型';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.pay_name IS '收款名称';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.company_name IS '公司名称';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.api_type IS 'API类型【0:普通】';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.notify_url IS '统一支付回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.refund_notify_url IS '退款回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.status IS '状态【0:关闭、1:启用】';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN blade_pay_alipay_account_config.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- 聚合支付配置表 (blade_pay_merge_pay_config)
|
||||||
|
-- =============================================
|
||||||
|
DROP TABLE IF EXISTS blade_pay_merge_pay_config;
|
||||||
|
CREATE TABLE blade_pay_merge_pay_config
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- ID
|
||||||
|
tenant_id varchar(12), -- 租户id
|
||||||
|
mch_id varchar(255) NOT NULL, -- 商户号
|
||||||
|
pay_key varchar(255) NOT NULL, -- 支付密钥
|
||||||
|
notify_url varchar(1000), -- 统一支付回调地址
|
||||||
|
refund_notify_url varchar(1000), -- 退款回调地址
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 状态【0:关闭、1:启用】
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMENT ON TABLE blade_pay_merge_pay_config IS '聚合支付配置表';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.id IS 'ID';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.tenant_id IS '租户id';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.mch_id IS '商户号';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.pay_key IS '支付密钥';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.notify_url IS '统一支付回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.refund_notify_url IS '退款回调地址';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.status IS '状态【0:关闭、1:启用】';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN blade_pay_merge_pay_config.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS common_order_confirm_log;
|
||||||
|
|
||||||
|
CREATE TABLE common_order_confirm_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8, -- 用户ID
|
||||||
|
order_id int8, -- 订单ID
|
||||||
|
item_name varchar(32), -- 商品名称
|
||||||
|
delivery_address varchar(255), -- 收货地址ID
|
||||||
|
actual_amount numeric(10, 2) default 0.00 not null, -- 实际支付金额
|
||||||
|
order_type varchar(32), -- 订单类型
|
||||||
|
payment_type int4, -- 支付类型
|
||||||
|
is_agency_distributed int4 NOT NULL DEFAULT 0, -- 是否分发极差代理 (0:未分发, 1:已分发)
|
||||||
|
agency_distribute_time timestamp(6), -- 极差代理发放时间
|
||||||
|
is_service_distributed int4 NOT NULL DEFAULT 0, -- 是否发放服务商佣金 (0:未发放, 1:已发放)
|
||||||
|
service_distribute_time timestamp(6), -- 服务商佣金发放时间
|
||||||
|
status int4 NOT NULL DEFAULT 0, -- 状态
|
||||||
|
create_user int8, -- 创建人
|
||||||
|
create_dept int8, -- 创建部门
|
||||||
|
create_time timestamp(6), -- 创建时间
|
||||||
|
update_user int8, -- 修改人
|
||||||
|
update_time timestamp(6), -- 修改时间
|
||||||
|
is_deleted int4, -- 是否已删除 (0:未删除, 1:已删除)
|
||||||
|
remark varchar(500) DEFAULT '' -- 备注
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX idx_cocl_aop ON common_order_confirm_log (is_agency_distributed, order_type, payment_type);
|
||||||
|
CREATE INDEX idx_cocl_sop ON common_order_confirm_log (is_service_distributed, order_type, payment_type);
|
||||||
|
CREATE INDEX idx_cocl_poc ON common_order_confirm_log (payment_type, order_type, create_time DESC);
|
||||||
|
|
||||||
|
COMMENT ON TABLE common_order_confirm_log IS '订单确认收货记录表';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.id IS 'id';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.order_id IS '订单id';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.item_name IS '商品名称';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.delivery_address IS '收货地址';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.actual_amount IS '实际支付金额';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.order_type IS '订单类型';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.payment_type IS '支付类型';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.is_agency_distributed IS '是否分发极差代理 (0:未分发, 1:已分发)';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.agency_distribute_time IS '极差代理发放时间';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.is_service_distributed IS '是否发放服务商佣金 (0:未发放, 1:已发放)';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.service_distribute_time IS '服务商佣金发放时间';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN common_order_confirm_log.remark IS '备注';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- 菜单数据初始化 (blade_menu)
|
||||||
|
-- =============================================
|
||||||
|
|
||||||
|
-- 1. 支付管理 (根节点)
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, is_open, remark, is_deleted) VALUES (1477199103906373633, 0, '14', '支付管理', 'pay', '/pay', 'iconfont icon-weixin1', 100, 1, 1, '', 0);
|
||||||
|
|
||||||
|
-- 2. 微信支付配置模块
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted) VALUES (1476839243041804294, 1477199103906373633, 'wxconfig', '微信支付配置', 'menu', '/plugin/pay/wxconfig', 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 (1476839243041804295, 1476839243041804294, 'wxconfig_add', '新增', 'add', '/plugin/pay/wxconfig/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 (1476839243041804296, 1476839243041804294, 'wxconfig_edit', '修改', 'edit', '/plugin/pay/wxconfig/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 (1476839243041804297, 1476839243041804294, 'wxconfig_delete', '删除', 'delete', '/api/blade-pay/wxconfig/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 (1476839243041804298, 1476839243041804294, 'wxconfig_view', '查看', 'view', '/plugin/pay/wxconfig/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||||
|
|
||||||
|
-- 3. 订单管理模块
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1476767495650865158, 1477199103906373633, 'order', '订单管理', 'menu', '/plugin/pay/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 (1476767495650865159, 1476767495650865158, 'order_add', '新增', 'add', '/plugin/pay/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 (1476767495650865160, 1476767495650865158, 'order_edit', '修改', 'edit', '/plugin/pay/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 (1476767495650865161, 1476767495650865158, 'order_delete', '删除', 'delete', '/api/blade-pay/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 (1476767495650865162, 1476767495650865158, 'order_view', '查看', 'view', '/plugin/pay/order/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||||
|
|
||||||
|
-- 4. 支付体验 (根节点下的子菜单)
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, is_open, remark, is_deleted)VALUES (1477222211518210049, 1477199103906373633, '12', '支付体验', 'pay-demo', '/plugin/pay/demo', 'iconfont iconicon_wechat', 3, 1, 1, '', 0);
|
||||||
|
|
||||||
|
-- 5. 退款管理模块
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1478012327564226566, 1477199103906373633, 'refund', '退款管理', 'menu', '/plugin/pay/refund', NULL, 1, 1, 0, 1, NULL, 0);
|
||||||
|
|
||||||
|
-- 注意:原SQL中退款管理缺少“新增”按钮,此处保持原样。如果有需要可自行添加。
|
||||||
|
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1478012327564226568, 1478012327564226566, 'refund_edit', '修改', 'edit', '/plugin/pay/refund/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 (1478012327564226569, 1478012327564226566, 'refund_delete', '删除', 'delete', '/api/blade-pay/refund/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 (1478012327564226570, 1478012327564226566, 'refund_view', '查看', 'view', '/plugin/pay/refund/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||||
|
|
||||||
|
-- 6. 支付宝配置模块
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1519502474608390145, 1477199103906373633, 'aliconfig', '支付宝配置', 'menu', '/plugin/pay/aliconfig', NULL, 1, 1, 0, 1, NULL, 0);
|
||||||
|
|
||||||
|
-- 修正了原SQL中字段顺序不一致的问题,统一为 action 列
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1519502474608391478, 1477199103906373633, 'aliconfig_view', '查看', 'view', '/plugin/pay/aliconfig/view', 'file-text', 4, 2, 2, 1, '', 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1519502474608398520, 1477199103906373633, 'aliconfig_delete', '删除', 'delete', '/api/blade-pay/aliconfig/remove', 'delete', 3, 2, 3, 1, '', 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1519502474608399630, 1477199103906373633, 'aliconfig_edit', '修改', 'edit', '/plugin/pay/aliconfig/edit', 'form', 2, 2, 2, 1, '', 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1519502474608397841, 1477199103906373633, 'aliconfig_add', '新增', 'add', '/plugin/pay/aliconfig/add', 'plus', 1, 2, 1, 1, '', 0);
|
||||||
|
|
||||||
|
-- 7. 聚合支付配置模块
|
||||||
|
-- 注意:原SQL使用 VALUES 位置匹配,这里显式指定字段以确保安全
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES (1541359525647163398, 1477199103906373633, 'mergepayconfig', '聚合支付', 'menu', '/plugin/pay/merge/config', 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 (1541359525647163399, 1541359525647163398, 'mergepayconfig_add', '新增', 'add', '/plugin/pay/merge/config/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 (1541359525647163400, 1541359525647163398, 'mergepayconfig_edit', '修改', 'edit', '/plugin/pay/merge/config/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 (1541359525647163401, 1541359525647163398, 'mergepayconfig_delete', '删除', 'delete', '/api/blade-pay/merge/config/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 (1541359525647163402, 1541359525647163398, 'mergepayconfig_view', '查看', 'view', '/plugin/pay/merge/config/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
438
doc/sql/executed/20260316_increase.sql
Normal file
438
doc/sql/executed/20260316_increase.sql
Normal file
@@ -0,0 +1,438 @@
|
|||||||
|
DROP TABLE IF EXISTS merchant_flagship_store CASCADE;
|
||||||
|
|
||||||
|
CREATE TABLE merchant_flagship_store
|
||||||
|
(
|
||||||
|
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- [主键]
|
||||||
|
store_name VARCHAR(255) NOT NULL, -- 商家全称
|
||||||
|
contact_phone VARCHAR(20), -- 商家联系电话
|
||||||
|
province_id int8 NOT NULL,
|
||||||
|
city_id int8 NOT NULL,
|
||||||
|
regions_id int8 NOT NULL,
|
||||||
|
region_name text NOT NULL, -- 地区名
|
||||||
|
full_address text NOT NULL, -- 详细地址
|
||||||
|
location geometry(Point, 4326) NOT NULL, -- 门店经纬度坐标(用于地图打点和距离计算)
|
||||||
|
thumbnail_url text, -- 缩略图
|
||||||
|
main_image_url text[] default '{}'::text[], -- 商家主图
|
||||||
|
detail_images text[] default '{}'::text[], -- 详情展示多图
|
||||||
|
business_hours VARCHAR(100), -- 营业时间描述
|
||||||
|
store_description text, -- 商家详细介绍
|
||||||
|
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 merchant_flagship_store IS '商家旗舰店信息表';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.id IS '主键 ID';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.store_name IS '店铺名字';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.contact_phone IS '商家联系电话';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.province_id IS '省份id';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.city_id IS '城市id';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.regions_id IS '地址id';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.region_name IS '地区名';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.full_address IS '完整详细地址';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.location IS '地理坐标 POINT(经度,纬度),用于地图定位和距离计算';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.main_image_url IS '商家主图';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.thumbnail_url IS '缩略图';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.detail_images IS '详情图';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.business_hours IS '营业时间,如:10:00--23:00';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.store_description IS '商家详细介绍';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.status IS '状态';
|
||||||
|
COMMENT ON COLUMN merchant_flagship_store.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
-- 4.3 地理位置索引 (GiST):核心!用于“附近店铺”查询和距离排序
|
||||||
|
CREATE INDEX idx_mfs_location ON merchant_flagship_store USING gist(location);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS cultural_tourism_spot CASCADE;
|
||||||
|
CREATE TABLE cultural_tourism_spot
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
||||||
|
is_recommended int4 DEFAULT 0, -- 是否推荐
|
||||||
|
spot_name VARCHAR(255) NOT NULL, -- 景点名称
|
||||||
|
summary varchar(255), -- 简短摘要(列表页显示,如:“中国最美的地方”)
|
||||||
|
rating NUMERIC(3, 2) DEFAULT 0.00, -- 用户评分
|
||||||
|
visit_count int4 DEFAULT 0, -- 出行人数
|
||||||
|
thumbnail_url text, -- 缩略图
|
||||||
|
main_image_url text[] default '{}'::text[], -- 主图
|
||||||
|
detail_images text[] default '{}'::text[], -- 详情多图集合
|
||||||
|
video_url text, -- 宣传视频链接
|
||||||
|
description text, -- 详细介绍
|
||||||
|
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 cultural_tourism_spot IS '文旅景点信息表';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.is_recommended IS '是否推荐';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.spot_name IS '景点全称';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.rating IS '用户评分,范围0.00~5.00';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.visit_count IS '出行人数';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.thumbnail_url IS '缩略图';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.main_image_url IS '主图';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.detail_images IS '详情图';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.video_url IS '宣传视频链接';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.summary IS '简短摘要';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.description IS '详细介绍';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.status IS '状态';
|
||||||
|
COMMENT ON COLUMN cultural_tourism_spot.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS news_category CASCADE;
|
||||||
|
|
||||||
|
CREATE TABLE news_category
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
||||||
|
category_name VARCHAR(50) NOT NULL, -- 分类名称
|
||||||
|
sort_order int4 DEFAULT 0, -- 排序
|
||||||
|
is_top int4 DEFAULT 0, -- 是否置顶
|
||||||
|
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 news_category IS '资讯分类表,用于管理顶部导航标签';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN news_category.id IS '主键';
|
||||||
|
COMMENT ON COLUMN news_category.category_name IS '分类名称';
|
||||||
|
COMMENT ON COLUMN news_category.sort_order IS '排序';
|
||||||
|
COMMENT ON COLUMN news_category.is_top IS '是否置顶';
|
||||||
|
COMMENT ON COLUMN news_category.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN news_category.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN news_category.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN news_category.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN news_category.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN news_category.status IS '状态';
|
||||||
|
COMMENT ON COLUMN news_category.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
CREATE INDEX idx_nc_pinned_sort ON news_category(is_top DESC, sort_order DESC, create_time DESC);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS news_content CASCADE;
|
||||||
|
|
||||||
|
-- =================================================================
|
||||||
|
-- 2. 创建资讯内容表
|
||||||
|
-- =================================================================
|
||||||
|
CREATE TABLE news_content
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
||||||
|
category_id int8 NOT NULL, -- 所属分类ID
|
||||||
|
title VARCHAR(255) NOT NULL, -- 标题
|
||||||
|
summary varchar(255), -- 简短摘要
|
||||||
|
content_type int4 DEFAULT 0, -- 内容类型:0-图文 1-视频
|
||||||
|
video_url text, -- 视频链接
|
||||||
|
play_count int8 DEFAULT 0, -- 播放次数
|
||||||
|
thumbnail_url text, -- 缩略图
|
||||||
|
main_image_url text[] default '{}'::text[], -- 主图(
|
||||||
|
detail_images text[] default '{}'::text[], -- 详情多图集合
|
||||||
|
article_content text, -- 正文内容
|
||||||
|
comment_count int8 DEFAULT 0, -- 评论数量
|
||||||
|
is_featured int4 DEFAULT 0, -- 是否置顶
|
||||||
|
sort_order int4 DEFAULT 0, -- 排序
|
||||||
|
view_count int8 DEFAULT 0, -- 浏览次数
|
||||||
|
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 DEFAULT 1, -- 状态 ,0=下架,1=上架
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
-- =================================================================
|
||||||
|
-- 3. 添加字段备注
|
||||||
|
-- =================================================================
|
||||||
|
COMMENT ON TABLE news_content IS '资讯内容表';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN news_content.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN news_content.category_id IS '所属分类ID';
|
||||||
|
COMMENT ON COLUMN news_content.title IS '资讯标题';
|
||||||
|
COMMENT ON COLUMN news_content.summary IS '简短摘要';
|
||||||
|
COMMENT ON COLUMN news_content.content_type IS '内容类型 0-图文 1-视频';
|
||||||
|
COMMENT ON COLUMN news_content.video_url IS '视频链接';
|
||||||
|
COMMENT ON COLUMN news_content.play_count IS '视频播放次数';
|
||||||
|
COMMENT ON COLUMN news_content.thumbnail_url IS '缩略图';
|
||||||
|
COMMENT ON COLUMN news_content.main_image_url IS '主图';
|
||||||
|
COMMENT ON COLUMN news_content.detail_images IS '详情多图';
|
||||||
|
COMMENT ON COLUMN news_content.article_content IS '正文内容';
|
||||||
|
COMMENT ON COLUMN news_content.comment_count IS '评论数量';
|
||||||
|
COMMENT ON COLUMN news_content.is_featured IS '是否置顶';
|
||||||
|
COMMENT ON COLUMN news_content.sort_order IS '排序';
|
||||||
|
COMMENT ON COLUMN news_content.view_count IS '浏览次数';
|
||||||
|
COMMENT ON COLUMN news_content.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN news_content.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN news_content.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN news_content.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN news_content.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN news_content.status IS '状态 0=下架,1=上架';
|
||||||
|
COMMENT ON COLUMN news_content.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
CREATE INDEX idx_ncc_featured_sort ON news_content(is_featured DESC, sort_order DESC, create_time DESC);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tour_product;
|
||||||
|
CREATE TABLE tour_product
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
product_name varchar(100) NOT NULL, -- 产品名称 (如:恩施硒茶文化之旅)
|
||||||
|
sub_title varchar(255) DEFAULT NULL, -- 副标题/亮点 (如:4天3晚 | 研学之旅)
|
||||||
|
thumbnail_url text DEFAULT NULL, -- 缩略图
|
||||||
|
main_image_url text[] DEFAULT '{}'::text[], -- 商家主图 (数组)
|
||||||
|
detail_images text[] DEFAULT '{}'::text[], -- 详情展示多图 (数组)
|
||||||
|
city_name varchar(50) DEFAULT NULL, -- 目的地城市名称
|
||||||
|
duration_days int4 DEFAULT NULL, -- 行程天数
|
||||||
|
duration_nights int4 DEFAULT NULL, -- 住宿晚数
|
||||||
|
base_price decimal(10, 2) NOT NULL, -- 基础起售价
|
||||||
|
adult_price decimal(10, 2) DEFAULT NULL, -- 成人单价
|
||||||
|
child_price decimal(10, 2) DEFAULT NULL, -- 儿童单价
|
||||||
|
elderly_price decimal(10, 2) DEFAULT NULL, -- 老年人单价
|
||||||
|
min_people int4 DEFAULT 1, -- 最小成团人数
|
||||||
|
max_people int4 DEFAULT 9999, -- 最大接待人数
|
||||||
|
is_recommended int4 DEFAULT 0, -- 是否推荐
|
||||||
|
require_id_card int4 DEFAULT 0, -- 是否强制身份证
|
||||||
|
require_passport int4 DEFAULT 0, -- 是否强制护照
|
||||||
|
require_hk_macau_pass int4 DEFAULT 0, -- 是否强制港澳通行证
|
||||||
|
description text DEFAULT NULL, -- 产品详情描述
|
||||||
|
visit_count int4 DEFAULT 0, -- 已成团次数/销量
|
||||||
|
rating decimal(3, 2) DEFAULT 0.00, -- 用户评分
|
||||||
|
province_id int8 NOT NULL,
|
||||||
|
city_id int8 NOT NULL,
|
||||||
|
create_user int8 NULL, -- 创建人ID
|
||||||
|
create_dept int8 NULL, -- 创建部门ID
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人ID
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL DEFAULT 1, -- 状态:0=下架,1=上架
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 添加表注释
|
||||||
|
COMMENT ON TABLE tour_product IS '旅游产品表';
|
||||||
|
|
||||||
|
-- 添加列注释
|
||||||
|
COMMENT ON COLUMN tour_product.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN tour_product.product_name IS '产品名称 (如:恩施硒茶文化之旅)';
|
||||||
|
COMMENT ON COLUMN tour_product.sub_title IS '副标题/亮点 (如:4天3晚 | 研学之旅)';
|
||||||
|
COMMENT ON COLUMN tour_product.thumbnail_url IS '缩略图';
|
||||||
|
COMMENT ON COLUMN tour_product.main_image_url IS '商家主图 (数组)';
|
||||||
|
COMMENT ON COLUMN tour_product.detail_images IS '详情展示多图 (数组)';
|
||||||
|
COMMENT ON COLUMN tour_product.city_name IS '目的地城市名称';
|
||||||
|
COMMENT ON COLUMN tour_product.duration_days IS '行程天数';
|
||||||
|
COMMENT ON COLUMN tour_product.duration_nights IS '住宿晚数';
|
||||||
|
COMMENT ON COLUMN tour_product.base_price IS '基础起售价';
|
||||||
|
COMMENT ON COLUMN tour_product.adult_price IS '成人单价';
|
||||||
|
COMMENT ON COLUMN tour_product.child_price IS '儿童单价';
|
||||||
|
COMMENT ON COLUMN tour_product.elderly_price IS '老年人单价';
|
||||||
|
COMMENT ON COLUMN tour_product.min_people IS '最小成团人数';
|
||||||
|
COMMENT ON COLUMN tour_product.max_people IS '最大接待人数';
|
||||||
|
COMMENT ON COLUMN tour_product.is_recommended IS '是否推荐:0=否,1=是';
|
||||||
|
COMMENT ON COLUMN tour_product.require_id_card IS '是否强制身份证:0=否,1=是';
|
||||||
|
COMMENT ON COLUMN tour_product.require_passport IS '是否强制护照:0=否,1=是';
|
||||||
|
COMMENT ON COLUMN tour_product.require_hk_macau_pass IS '是否强制港澳通行证:0=否,1=是';
|
||||||
|
COMMENT ON COLUMN tour_product.description IS '产品详情描述';
|
||||||
|
COMMENT ON COLUMN tour_product.visit_count IS '已成团次数/销量';
|
||||||
|
COMMENT ON COLUMN tour_product.rating IS '用户评分';
|
||||||
|
COMMENT ON COLUMN tour_product.province_id IS '省份id';
|
||||||
|
COMMENT ON COLUMN tour_product.city_id IS '城市id';
|
||||||
|
COMMENT ON COLUMN tour_product.create_user IS '创建人ID';
|
||||||
|
COMMENT ON COLUMN tour_product.create_dept IS '创建部门ID';
|
||||||
|
COMMENT ON COLUMN tour_product.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN tour_product.update_user IS '修改人ID';
|
||||||
|
COMMENT ON COLUMN tour_product.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN tour_product.status IS '状态:0=下架,1=上架';
|
||||||
|
COMMENT ON COLUMN tour_product.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tour_order_detail;
|
||||||
|
|
||||||
|
CREATE TABLE tour_order_detail
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
order_id int8 NOT NULL, -- 关联订单ID (主表 tour_order 的ID)
|
||||||
|
user_id int8 NOT NULL, -- 下单用户ID
|
||||||
|
traveler_detail jsonb DEFAULT NULL, -- 出行人信息快照 (数组格式,冗余存储,防止档案修改影响历史订单)
|
||||||
|
product_snapshot jsonb DEFAULT NULL, -- 产品信息快照 (数组格式,包含线路名称、单价、数量、规格等,防止产品下架/改价影响历史订单)
|
||||||
|
contract_url varchar(500) DEFAULT NULL, -- 电子合同地址/编号 (存储生成的合同PDF路径或第三方合同号)
|
||||||
|
contract_status int4 DEFAULT 0, -- 合同状态:0=未签署,1=已签署,2=已过期 (扩展字段,建议加上)
|
||||||
|
guide_name varchar(50) DEFAULT NULL, -- 导游姓名
|
||||||
|
guide_phone varchar(20) DEFAULT NULL, -- 导游联系电话
|
||||||
|
start_date timestamp(6) DEFAULT NULL, -- 出行日期 (具体出发时间)
|
||||||
|
end_date timestamp(6) DEFAULT NULL, -- 预计返回日期
|
||||||
|
remark varchar(255) DEFAULT NULL, -- 订单备注 (用户留言或内部备注)
|
||||||
|
create_user int8 NULL, -- 创建人ID
|
||||||
|
create_dept int8 NULL, -- 创建部门ID
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人ID
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL DEFAULT 1, -- 状态:0=下架,1=上架
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 表注释
|
||||||
|
COMMENT ON TABLE tour_order_detail IS '订单详情扩展表';
|
||||||
|
|
||||||
|
-- 字段注释
|
||||||
|
COMMENT ON COLUMN tour_order_detail.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.order_id IS '关联订单ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.user_id IS '下单用户ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.traveler_detail IS '出行人信息快照 (JSONB数组)';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.product_snapshot IS '产品信息快照 (JSONB数组)';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.contract_url IS '电子合同地址或编号';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.contract_status IS '合同签署状态:0=未签署,1=已签署,2=已过期';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.guide_name IS '导游姓名';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.guide_phone IS '导游联系电话';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.start_date IS '出行日期';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.end_date IS '预计返回日期';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.remark IS '备注信息';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.create_user IS '创建人ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.create_dept IS '创建部门ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.update_user IS '修改人ID';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.status IS '数据状态:0=无效,1=有效';
|
||||||
|
COMMENT ON COLUMN tour_order_detail.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
||||||
|
|
||||||
|
-- 索引优化
|
||||||
|
-- 1. 关联订单查询 (最常用)
|
||||||
|
CREATE INDEX idx_tod_order_id ON tour_order_detail (order_id);
|
||||||
|
|
||||||
|
-- 2. 用户查询我的订单详情
|
||||||
|
CREATE INDEX idx_tod_user_id ON tour_order_detail (user_id);
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS common_tour_info;
|
||||||
|
CREATE TABLE common_tour_info
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8 NOT NULL, -- 关联系统用户ID
|
||||||
|
id_card_no varchar(20) DEFAULT NULL, -- 身份证号
|
||||||
|
passport_no varchar(30) DEFAULT NULL, -- 护照号码
|
||||||
|
hk_macau_pass_no varchar(20) DEFAULT NULL, -- 港澳通行证号码
|
||||||
|
user_name varchar(50) NOT NULL, -- 姓名
|
||||||
|
gender int4 DEFAULT NULL,
|
||||||
|
contact_phone varchar(20) DEFAULT NULL, -- 本人手机号
|
||||||
|
traveler_type int4 DEFAULT 1, -- 默认人员类型:1=成人,2=儿童,3=老人 (系统可根据生日自动算,但允许用户手动修正)
|
||||||
|
remark varchar(255) DEFAULT NULL, -- 备注 (如:晕车、素食、靠窗座位等偏好)
|
||||||
|
create_user int8 NULL, -- 创建人ID (通常同 user_id)
|
||||||
|
create_dept int8 NULL, -- 创建部门ID (若为B2B2C模式可能需要)
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人ID
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL DEFAULT 1,
|
||||||
|
is_deleted int4 NOT NULL DEFAULT 0 -- 逻辑删除:0=未删除,1=已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 表注释
|
||||||
|
COMMENT ON TABLE common_tour_info IS '基础出行人档案表';
|
||||||
|
COMMENT ON COLUMN common_tour_info.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN common_tour_info.user_id IS '关联系统用户ID (所属人)';
|
||||||
|
COMMENT ON COLUMN common_tour_info.id_card_no IS '身份证号';
|
||||||
|
COMMENT ON COLUMN common_tour_info.passport_no IS '护照号码';
|
||||||
|
COMMENT ON COLUMN common_tour_info.hk_macau_pass_no IS '港澳通行证号码';
|
||||||
|
COMMENT ON COLUMN common_tour_info.user_name IS '姓名';
|
||||||
|
COMMENT ON COLUMN common_tour_info.gender IS '性别:1=男,2=女';
|
||||||
|
COMMENT ON COLUMN common_tour_info.contact_phone IS '本人手机号';
|
||||||
|
COMMENT ON COLUMN common_tour_info.traveler_type IS '默认人员类型:1=成人,2=儿童,3=老人';
|
||||||
|
COMMENT ON COLUMN common_tour_info.remark IS '备注偏好';
|
||||||
|
COMMENT ON COLUMN common_tour_info.create_user IS '创建人ID';
|
||||||
|
COMMENT ON COLUMN common_tour_info.create_dept IS '创建部门ID';
|
||||||
|
COMMENT ON COLUMN common_tour_info.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN common_tour_info.update_user IS '修改人ID';
|
||||||
|
COMMENT ON COLUMN common_tour_info.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN common_tour_info.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
||||||
|
|
||||||
|
|
||||||
|
CREATE INDEX idx_tup_uid ON common_tour_info (user_id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------- 商品分类 (自营商品 , 生态产品) ---------------------------------------------
|
||||||
|
INSERT INTO mall_category (id, category_name, image_url, pid, level, sort, is_deleted, create_time, create_user, update_time, update_user, status, create_dept) VALUES (2033413707249164290, '自营商品', '', null, 1, 0, 0, '2026-03-16 13:23:01.460000', 1123598821738675201, '2026-03-16 13:23:01.460000', 1123598821738675201, 1, 1123598813738675201);
|
||||||
|
INSERT INTO mall_category (id, category_name, image_url, pid, level, sort, is_deleted, create_time, create_user, update_time, update_user, status, create_dept) VALUES (2033413760969809921, '生态产品', '', null, 1, 0, 0, '2026-03-16 13:23:14.280000', 1123598821738675201, '2026-03-16 13:23:14.280000', 1123598821738675201, 1, 1123598813738675201);
|
||||||
|
|
||||||
|
--------------------------------------------- 系统参数 -app支付宝aesKey ---------------------------------------------
|
||||||
|
INSERT INTO blade_param (id, param_name, param_key, param_value, remark, create_user, create_dept, create_time, update_user, update_time, status, is_deleted) VALUES (2037772595062923266, 'app支付宝aesKey', 'yichuyilu.app.ali.aes.key', 'VS14+f0md0HjJ1D0Wp3Lgw==', 'app支付宝aesKey', null, null, '2026-03-28 14:03:41.282000', null, '2026-03-28 14:03:41.282000', 1, 0);
|
||||||
|
|
||||||
|
--------------------------------------------- 后台菜单 ---------------------------------------------
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033415593821937665, 1123598815738675201, 'ecosystemProduct', '生态产品', 'menu', '/mall/ecosystemProduct', 'iconfont iconicon_addressbook', 11, 1, -1, 1, '', '', 0);
|
||||||
|
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2033749606692487170, 1123598815738675201, 'merchantFlagshipStore', '商家旗舰店信息', 'menu', '/common/merchantFlagshipStore', 'iconfont iconicon_message', 13, 1, 0, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179162013698', '2033749606692487170', 'merchantFlagshipStore_add', '新增', 'add', '/common/merchantFlagshipStore/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 ('2038120179162013699', '2033749606692487170', 'merchantFlagshipStore_edit', '修改', 'edit', '/common/merchantFlagshipStore/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 ('2038120179162013700', '2033749606692487170', 'merchantFlagshipStore_delete', '删除', 'delete', '/api/common/merchant-store/merchantFlagshipStore/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 ('2038120179162013701', '2033749606692487170', 'merchantFlagshipStore_view', '查看', 'view', '/common/merchantFlagshipStore/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, component, remark, is_deleted) VALUES (2033749607145472001, 1123598815738675201, 'culturalTourismSpot', '文旅景点信息', 'menu', '/common/culturalTourismSpot', 'iconfont iconicon_message', 14, 1, 0, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120179677913091', '2033749607145472001', 'culturalTourismSpot_add', '新增', 'add', '/common/culturalTourismSpot/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 ('2038120179677913092', '2033749607145472001', 'culturalTourismSpot_edit', '修改', 'edit', '/common/culturalTourismSpot/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 ('2038120179677913093', '2033749607145472001', 'culturalTourismSpot_delete', '删除', 'delete', '/api/common/tourism-spot/culturalTourismSpot/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 ('2038120179677913094', '2033749607145472001', 'culturalTourismSpot_view', '查看', 'view', '/common/culturalTourismSpot/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, component, remark, is_deleted) VALUES (2033749607535542273, 1123598815738675201, 'newsCategory', '资讯分类', 'menu', '/common/newsCategory', 'iconfont iconicon_message', 15, 1, 0, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180067983362', '2033749607535542273', 'newsCategory_add', '新增', 'add', '/common/newsCategory/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 ('2038120180067983363', '2033749607535542273', 'newsCategory_edit', '修改', 'edit', '/common/newsCategory/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 ('2038120180067983364', '2033749607535542273', 'newsCategory_delete', '删除', 'delete', '/api/common/news-category/newsCategory/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 ('2038120180067983365', '2033749607535542273', 'newsCategory_view', '查看', 'view', '/common/newsCategory/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, component, remark, is_deleted) VALUES (2033749607929806849, 1123598815738675201, 'newsContent', '资讯内容', 'menu', '/common/newsContent', 'iconfont iconicon_message', 15, 1, 0, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180458053634', '2033749607929806849', 'newsContent_add', '新增', 'add', '/common/newsContent/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 ('2038120180458053635', '2033749607929806849', 'newsContent_edit', '修改', 'edit', '/common/newsContent/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 ('2038120180458053636', '2033749607929806849', 'newsContent_delete', '删除', 'delete', '/api/common/news-content/newsContent/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 ('2038120180458053637', '2033749607929806849', 'newsContent_view', '查看', 'view', '/common/newsContent/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, component, remark, is_deleted) VALUES (2034868678830284801, 1123598815738675201, 'tourProduct', '旅游团产品', 'menu', '/common/tourProduct', 'iconfont iconicon_addressbook', 16, 1, 0, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120180839735298', '2034868678830284801', 'tourProduct_add', '新增', 'add', '/common/tourProduct/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 ('2038120180839735299', '2034868678830284801', 'tourProduct_edit', '修改', 'edit', '/common/tourProduct/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 ('2038120180839735300', '2034868678830284801', 'tourProduct_delete', '删除', 'delete', '/api/common/tour-product/tourProduct/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 ('2038120180839735301', '2034868678830284801', 'tourProduct_view', '查看', 'view', '/common/tourProduct/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, component, remark, is_deleted) VALUES (2034920957235105793, 1123598815738675201, 'commonTourProductOrder', '旅游团订单', 'menu', '/common/commonTourProductOrder', 'iconfont iconicon_addressbook', 17, 1, null, 1, null, '', 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037361283308748801, 1123598815738675201, 'commonEcoOrder', '生态产品订单', 'menu', '/common/commonEcoOrder', 'iconfont iconicon_message', 12, 1, -1, 1, '', '', 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037414831325212674, 0, 'upgrade', '动态升级', 'upgrade', '/upgrade', 'iconfont iconicon_message', 16, 1, null, 1, null, '', 0);
|
||||||
|
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416131144216577, 2037414831325212674, 'marketUpgradeConfig', '用户升级配置', 'menu', '/market/marketUpgradeConfig', null, 1, 1, 0, 1, null, null, 0);
|
||||||
|
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)VALUES ('2038120182441959427', '2037416131144216577', 'marketUpgradeConfig_add', '新增', 'add', '/market/marketUpgradeConfig/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 ('2038120182441959428', '2037416131144216577', 'marketUpgradeConfig_edit', '修改', 'edit', '/market/marketUpgradeConfig/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 ('2038120182441959429', '2037416131144216577', 'marketUpgradeConfig_delete', '删除', 'delete', '/api/market/upgrade-config/marketUpgradeConfig/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 ('2038120182441959430', '2037416131144216577', 'marketUpgradeConfig_view', '查看', 'view', '/market/marketUpgradeConfig/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, component, remark, is_deleted) VALUES (2037416131601395714, 2037414831325212674, 'marketUpgradeCashLog', '用户现金升级日志', 'menu', '/market/marketUpgradeCashLog', null, 2, 1, 0, 1, null, null, 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416131991465985, 2037414831325212674, 'marketUpgradeWelfareLog', '用户福利包升级日志', 'menu', '/market/marketUpgradeWelfareLog', null, 3, 1, 0, 1, null, null, 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416132381536257, 2037414831325212674, 'marketCashPerformanceLog', '现金业绩日志', 'menu', '/market/marketCashPerformanceLog', null, 4, 1, 0, 1, null, null, 0);
|
||||||
|
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2037416132771606529, 2037414831325212674, 'marketWelfarePerformanceLog', '福利包业绩日志', 'menu', '/market/marketWelfarePerformanceLog', null, 5, 1, 0, 1, null, null, 0);
|
||||||
|
|
||||||
@@ -1,203 +0,0 @@
|
|||||||
DROP TABLE IF EXISTS merchant_flagship_store CASCADE;
|
|
||||||
|
|
||||||
CREATE TABLE merchant_flagship_store
|
|
||||||
(
|
|
||||||
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- [主键]
|
|
||||||
store_name VARCHAR(255) NOT NULL, -- 商家全称
|
|
||||||
contact_phone VARCHAR(20), -- 商家联系电话
|
|
||||||
regions_id int8 NOT NULL,
|
|
||||||
full_address text NOT NULL, -- 详细地址
|
|
||||||
location geometry(Point, 4326) NOT NULL, -- 门店经纬度坐标(用于地图打点和距离计算)
|
|
||||||
thumbnail_url text, -- 缩略图
|
|
||||||
main_image_url text[] default '{}'::text[], -- 商家主图
|
|
||||||
detail_images text[] default '{}'::text[], -- 详情展示多图
|
|
||||||
business_hours VARCHAR(100), -- 营业时间描述
|
|
||||||
store_description text, -- 商家详细介绍
|
|
||||||
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 merchant_flagship_store IS '商家旗舰店信息表';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.id IS '主键 ID';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.store_name IS '店铺名字';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.contact_phone IS '商家联系电话';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.regions_id IS '地址id';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.full_address IS '完整详细地址';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.location IS '地理坐标 POINT(经度,纬度),用于地图定位和距离计算';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.main_image_url IS '商家主图';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.thumbnail_url IS '缩略图';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.detail_images IS '详情图';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.business_hours IS '营业时间,如:10:00--23:00';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.store_description IS '商家详细介绍';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.create_user IS '创建人';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.create_dept IS '创建部门';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.update_user IS '修改人';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.status IS '状态';
|
|
||||||
COMMENT ON COLUMN merchant_flagship_store.is_deleted IS '是否已删除';
|
|
||||||
|
|
||||||
|
|
||||||
-- 4.3 地理位置索引 (GiST):核心!用于“附近店铺”查询和距离排序
|
|
||||||
CREATE INDEX idx_mfs_location ON merchant_flagship_store USING gist(location);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS cultural_tourism_spot CASCADE;
|
|
||||||
CREATE TABLE cultural_tourism_spot
|
|
||||||
(
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
|
||||||
is_recommended int4 DEFAULT 0, -- 是否推荐
|
|
||||||
spot_name VARCHAR(255) NOT NULL, -- 景点名称
|
|
||||||
summary varchar(255), -- 简短摘要(列表页显示,如:“中国最美的地方”)
|
|
||||||
rating NUMERIC(3, 2) DEFAULT 0.00, -- 用户评分
|
|
||||||
visit_count int4 DEFAULT 0, -- 出行人数
|
|
||||||
thumbnail_url text, -- 缩略图
|
|
||||||
main_image_url text[] default '{}'::text[], -- 主图
|
|
||||||
detail_images text[] default '{}'::text[], -- 详情多图集合
|
|
||||||
video_url text, -- 宣传视频链接
|
|
||||||
description text, -- 详细介绍
|
|
||||||
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 cultural_tourism_spot IS '文旅景点信息表';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.id IS '主键ID';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.is_recommended IS '是否推荐';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.spot_name IS '景点全称';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.rating IS '用户评分,范围0.00~5.00';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.visit_count IS '出行人数';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.thumbnail_url IS '缩略图';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.main_image_url IS '主图';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.detail_images IS '详情图';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.video_url IS '宣传视频链接';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.summary IS '简短摘要';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.description IS '详细介绍';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.create_user IS '创建人';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.create_dept IS '创建部门';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.update_user IS '修改人';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.status IS '状态';
|
|
||||||
COMMENT ON COLUMN cultural_tourism_spot.is_deleted IS '是否已删除';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS news_category CASCADE;
|
|
||||||
|
|
||||||
CREATE TABLE news_category
|
|
||||||
(
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
|
||||||
category_name VARCHAR(50) NOT NULL, -- 分类名称
|
|
||||||
sort_order int4 DEFAULT 0, -- 排序
|
|
||||||
is_top int4 DEFAULT 0, -- 是否置顶
|
|
||||||
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 news_category IS '资讯分类表,用于管理顶部导航标签';
|
|
||||||
|
|
||||||
COMMENT ON COLUMN news_category.id IS '主键';
|
|
||||||
COMMENT ON COLUMN news_category.category_name IS '分类名称';
|
|
||||||
COMMENT ON COLUMN news_category.sort_order IS '排序';
|
|
||||||
COMMENT ON COLUMN news_category.is_top IS '是否置顶';
|
|
||||||
COMMENT ON COLUMN news_category.create_user IS '创建人';
|
|
||||||
COMMENT ON COLUMN news_category.create_dept IS '创建部门';
|
|
||||||
COMMENT ON COLUMN news_category.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN news_category.update_user IS '修改人';
|
|
||||||
COMMENT ON COLUMN news_category.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN news_category.status IS '状态';
|
|
||||||
COMMENT ON COLUMN news_category.is_deleted IS '是否已删除';
|
|
||||||
|
|
||||||
CREATE INDEX idx_nc_pinned_sort ON news_category(is_top DESC, sort_order DESC, create_time DESC);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS news_content CASCADE;
|
|
||||||
|
|
||||||
-- =================================================================
|
|
||||||
-- 2. 创建资讯内容表
|
|
||||||
-- =================================================================
|
|
||||||
CREATE TABLE news_content
|
|
||||||
(
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- 自增主键
|
|
||||||
category_id int8 NOT NULL, -- 所属分类ID
|
|
||||||
title VARCHAR(255) NOT NULL, -- 标题
|
|
||||||
summary varchar(255), -- 简短摘要
|
|
||||||
content_type int4 DEFAULT 0, -- 内容类型:0-图文 1-视频
|
|
||||||
video_url text, -- 视频链接
|
|
||||||
play_count int8 DEFAULT 0, -- 播放次数
|
|
||||||
thumbnail_url text, -- 缩略图
|
|
||||||
main_image_url text[] default '{}'::text[], -- 主图(
|
|
||||||
detail_images text[] default '{}'::text[], -- 详情多图集合
|
|
||||||
article_content text, -- 正文内容
|
|
||||||
comment_count int8 DEFAULT 0, -- 评论数量
|
|
||||||
is_featured int4 DEFAULT 0, -- 是否置顶
|
|
||||||
sort_order int4 DEFAULT 0, -- 排序
|
|
||||||
view_count int8 DEFAULT 0, -- 浏览次数
|
|
||||||
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 DEFAULT 1, -- 状态 ,0=下架,1=上架
|
|
||||||
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
-- =================================================================
|
|
||||||
-- 3. 添加字段备注
|
|
||||||
-- =================================================================
|
|
||||||
COMMENT ON TABLE news_content IS '资讯内容表';
|
|
||||||
|
|
||||||
COMMENT ON COLUMN news_content.id IS '主键ID';
|
|
||||||
COMMENT ON COLUMN news_content.category_id IS '所属分类ID';
|
|
||||||
COMMENT ON COLUMN news_content.title IS '资讯标题';
|
|
||||||
COMMENT ON COLUMN news_content.summary IS '简短摘要';
|
|
||||||
COMMENT ON COLUMN news_content.content_type IS '内容类型 0-图文 1-视频';
|
|
||||||
COMMENT ON COLUMN news_content.video_url IS '视频链接';
|
|
||||||
COMMENT ON COLUMN news_content.play_count IS '视频播放次数';
|
|
||||||
COMMENT ON COLUMN news_content.thumbnail_url IS '缩略图';
|
|
||||||
COMMENT ON COLUMN news_content.main_image_url IS '主图';
|
|
||||||
COMMENT ON COLUMN news_content.detail_images IS '详情多图';
|
|
||||||
COMMENT ON COLUMN news_content.article_content IS '正文内容';
|
|
||||||
COMMENT ON COLUMN news_content.comment_count IS '评论数量';
|
|
||||||
COMMENT ON COLUMN news_content.is_featured IS '是否置顶';
|
|
||||||
COMMENT ON COLUMN news_content.sort_order IS '排序';
|
|
||||||
COMMENT ON COLUMN news_content.view_count IS '浏览次数';
|
|
||||||
COMMENT ON COLUMN news_content.create_user IS '创建人';
|
|
||||||
COMMENT ON COLUMN news_content.create_dept IS '创建部门';
|
|
||||||
COMMENT ON COLUMN news_content.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN news_content.update_user IS '修改人';
|
|
||||||
COMMENT ON COLUMN news_content.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN news_content.status IS '状态 0=下架,1=上架';
|
|
||||||
COMMENT ON COLUMN news_content.is_deleted IS '是否已删除';
|
|
||||||
|
|
||||||
CREATE INDEX idx_ncc_featured_sort ON news_content(is_featured DESC, sort_order DESC, create_time DESC);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
DROP TABLE IF EXISTS tour_product;
|
|
||||||
CREATE TABLE tour_product
|
|
||||||
(
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
|
||||||
product_name varchar(100) NOT NULL, -- 产品名称 (如:恩施硒茶文化之旅)
|
|
||||||
sub_title varchar(255) DEFAULT NULL, -- 副标题/亮点 (如:4天3晚 | 研学之旅)
|
|
||||||
thumbnail_url text DEFAULT NULL, -- 缩略图
|
|
||||||
main_image_url text[] DEFAULT '{}'::text[], -- 商家主图 (数组)
|
|
||||||
detail_images text[] DEFAULT '{}'::text[], -- 详情展示多图 (数组)
|
|
||||||
city_name varchar(50) DEFAULT NULL, -- 目的地城市名称
|
|
||||||
duration_days int4 DEFAULT NULL, -- 行程天数
|
|
||||||
duration_nights int4 DEFAULT NULL, -- 住宿晚数
|
|
||||||
base_price decimal(10, 2) NOT NULL, -- 基础起售价
|
|
||||||
adult_price decimal(10, 2) DEFAULT NULL, -- 成人单价
|
|
||||||
child_price decimal(10, 2) DEFAULT NULL, -- 儿童单价
|
|
||||||
elderly_price decimal(10, 2) DEFAULT NULL, -- 老年人单价
|
|
||||||
min_people int4 DEFAULT 1, -- 最小成团人数
|
|
||||||
max_people int4 DEFAULT 9999, -- 最大接待人数
|
|
||||||
require_id_card int4 DEFAULT 0, -- 是否强制身份证
|
|
||||||
require_passport int4 DEFAULT 0, -- 是否强制护照
|
|
||||||
require_hk_macau_pass int4 DEFAULT 0, -- 是否强制港澳通行证
|
|
||||||
description text DEFAULT NULL, -- 产品详情描述
|
|
||||||
visit_count int4 DEFAULT 0, -- 已成团次数/销量
|
|
||||||
create_user int8 NULL, -- 创建人ID
|
|
||||||
create_dept int8 NULL, -- 创建部门ID
|
|
||||||
create_time timestamp(6) NULL, -- 创建时间
|
|
||||||
update_user int8 NULL, -- 修改人ID
|
|
||||||
update_time timestamp(6) NULL, -- 修改时间
|
|
||||||
status int4 NULL DEFAULT 1, -- 状态:0=下架,1=上架
|
|
||||||
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
|
||||||
);
|
|
||||||
|
|
||||||
-- 添加表注释
|
|
||||||
COMMENT ON TABLE tour_product IS '旅游产品表';
|
|
||||||
|
|
||||||
-- 添加列注释
|
|
||||||
COMMENT ON COLUMN tour_product.id IS '主键ID';
|
|
||||||
COMMENT ON COLUMN tour_product.product_name IS '产品名称 (如:恩施硒茶文化之旅)';
|
|
||||||
COMMENT ON COLUMN tour_product.sub_title IS '副标题/亮点 (如:4天3晚 | 研学之旅)';
|
|
||||||
COMMENT ON COLUMN tour_product.thumbnail_url IS '缩略图';
|
|
||||||
COMMENT ON COLUMN tour_product.main_image_url IS '商家主图 (数组)';
|
|
||||||
COMMENT ON COLUMN tour_product.detail_images IS '详情展示多图 (数组)';
|
|
||||||
COMMENT ON COLUMN tour_product.city_name IS '目的地城市名称';
|
|
||||||
COMMENT ON COLUMN tour_product.duration_days IS '行程天数';
|
|
||||||
COMMENT ON COLUMN tour_product.duration_nights IS '住宿晚数';
|
|
||||||
COMMENT ON COLUMN tour_product.base_price IS '基础起售价';
|
|
||||||
COMMENT ON COLUMN tour_product.adult_price IS '成人单价';
|
|
||||||
COMMENT ON COLUMN tour_product.child_price IS '儿童单价';
|
|
||||||
COMMENT ON COLUMN tour_product.elderly_price IS '老年人单价';
|
|
||||||
COMMENT ON COLUMN tour_product.min_people IS '最小成团人数';
|
|
||||||
COMMENT ON COLUMN tour_product.max_people IS '最大接待人数';
|
|
||||||
COMMENT ON COLUMN tour_product.require_id_card IS '是否强制身份证:0=否,1=是';
|
|
||||||
COMMENT ON COLUMN tour_product.require_passport IS '是否强制护照:0=否,1=是';
|
|
||||||
COMMENT ON COLUMN tour_product.require_hk_macau_pass IS '是否强制港澳通行证:0=否,1=是';
|
|
||||||
COMMENT ON COLUMN tour_product.description IS '产品详情描述';
|
|
||||||
COMMENT ON COLUMN tour_product.visit_count IS '已成团次数/销量';
|
|
||||||
COMMENT ON COLUMN tour_product.create_user IS '创建人ID';
|
|
||||||
COMMENT ON COLUMN tour_product.create_dept IS '创建部门ID';
|
|
||||||
COMMENT ON COLUMN tour_product.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN tour_product.update_user IS '修改人ID';
|
|
||||||
COMMENT ON COLUMN tour_product.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN tour_product.status IS '状态:0=下架,1=上架';
|
|
||||||
COMMENT ON COLUMN tour_product.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS tour_order_traveler;
|
|
||||||
CREATE TABLE tour_order_traveler
|
|
||||||
(
|
|
||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
|
||||||
order_id int8 NOT NULL, -- 关联订单ID
|
|
||||||
traveler_type int4 NOT NULL, -- 人员类型:1=成人,2=儿童,3=老人
|
|
||||||
user_name varchar(50) NOT NULL, -- 姓名
|
|
||||||
id_card_no varchar(20) DEFAULT NULL, -- 身份证号
|
|
||||||
passport_no varchar(20) DEFAULT NULL, -- 护照号码
|
|
||||||
hk_macau_pass_no varchar(20) DEFAULT NULL, -- 港澳通行证号码
|
|
||||||
gender int4 DEFAULT NULL, -- 性别:1=男,2=女
|
|
||||||
contact_phone varchar(20) DEFAULT NULL, -- 出行人本人手机
|
|
||||||
start_date timestamp(6) DEFAULT NULL, -- 出行日期
|
|
||||||
end_date timestamp(6) DEFAULT NULL, -- 预计返回日期
|
|
||||||
create_user int8 NULL, -- 创建人ID
|
|
||||||
create_dept int8 NULL, -- 创建部门ID
|
|
||||||
create_time timestamp(6) NULL, -- 创建时间
|
|
||||||
update_user int8 NULL, -- 修改人ID
|
|
||||||
update_time timestamp(6) NULL, -- 修改时间
|
|
||||||
status int4 NULL DEFAULT 1, -- 状态:0=无效,1=有效
|
|
||||||
is_deleted int4 DEFAULT 0 NULL -- 是否已删除:0=未删除,1=已删除
|
|
||||||
);
|
|
||||||
|
|
||||||
COMMENT ON TABLE tour_order_traveler IS '订单出行人明细表';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.id IS '主键ID';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.order_id IS '关联订单ID';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.traveler_type IS '人员类型:1=成人,2=儿童,3=老人';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.user_name IS '姓名';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.id_card_no IS '身份证号';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.passport_no IS '护照号码';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.hk_macau_pass_no IS '港澳通行证号码';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.gender IS '性别:1=男,2=女';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.contact_phone IS '出行人本人手机';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.start_date IS '出行日期';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.end_date IS '预计返回日期';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.create_user IS '创建人ID';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.create_dept IS '创建部门ID';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.create_time IS '创建时间';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.update_user IS '修改人ID';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.update_time IS '修改时间';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.status IS '状态:0=无效,1=有效';
|
|
||||||
COMMENT ON COLUMN tour_order_traveler.is_deleted IS '是否已删除:0=未删除,1=已删除';
|
|
||||||
|
|
||||||
CREATE INDEX idx_order_id ON tour_order_traveler (order_id);
|
|
||||||
46
pom.xml
46
pom.xml
@@ -277,6 +277,52 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.locationtech.jts</groupId>
|
||||||
|
<artifactId>jts-core</artifactId>
|
||||||
|
<version>1.19.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--blade-pay插件相关-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.javen205</groupId>
|
||||||
|
<artifactId>IJPay-WxPay</artifactId>
|
||||||
|
<version>2.9.12</version>
|
||||||
|
</dependency>
|
||||||
|
<!--blade-pay插件相关 二维码生成-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-extra</artifactId>
|
||||||
|
<version>5.8.29</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.zxing</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>3.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--支付宝SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.39.134.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--YunGouOS聚合支付相关-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yungouos.pay</groupId>
|
||||||
|
<artifactId>yungouos-pay-sdk</artifactId>
|
||||||
|
<version>2.0.38</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ package org.springblade;
|
|||||||
import org.springblade.common.constant.CommonConstant;
|
import org.springblade.common.constant.CommonConstant;
|
||||||
import org.springblade.core.launch.BladeApplication;
|
import org.springblade.core.launch.BladeApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
import org.springframework.retry.annotation.EnableRetry;
|
import org.springframework.retry.annotation.EnableRetry;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||||
@@ -41,6 +42,7 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
|
|||||||
@EnableRedisHttpSession
|
@EnableRedisHttpSession
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableRetry //重试机制
|
@EnableRetry //重试机制
|
||||||
|
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
33
src/main/java/org/springblade/common/cache/PaymentCache.java
vendored
Normal file
33
src/main/java/org/springblade/common/cache/PaymentCache.java
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package org.springblade.common.cache;
|
||||||
|
|
||||||
|
import org.springblade.core.cache.utils.CacheUtil;
|
||||||
|
import org.springblade.core.tool.utils.SpringUtil;
|
||||||
|
import org.springblade.modules.common.eums.PaymentType;
|
||||||
|
import org.springblade.plugin.pay.entity.AliPayAccountConfig;
|
||||||
|
import org.springblade.plugin.pay.entity.WxPayAccountConfig;
|
||||||
|
import org.springblade.plugin.pay.service.IAliPayAccountConfigService;
|
||||||
|
import org.springblade.plugin.pay.service.IWxPayAccountConfigService;
|
||||||
|
|
||||||
|
import static org.springblade.plugin.pay.constant.PayConstant.PAYMENT_CONFIG_CACHE;
|
||||||
|
|
||||||
|
public class PaymentCache {
|
||||||
|
|
||||||
|
private static final String PAYMENT_TYPE = "payment:type:";
|
||||||
|
|
||||||
|
private static final IAliPayAccountConfigService alipayAccountConfigService;
|
||||||
|
|
||||||
|
private static final IWxPayAccountConfigService wxpayAccountConfigService;
|
||||||
|
|
||||||
|
static {
|
||||||
|
alipayAccountConfigService = SpringUtil.getBean(IAliPayAccountConfigService.class);
|
||||||
|
wxpayAccountConfigService = SpringUtil.getBean(IWxPayAccountConfigService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AliPayAccountConfig getAliConfig() {
|
||||||
|
return CacheUtil.get(PAYMENT_CONFIG_CACHE, PAYMENT_TYPE, PaymentType.ALI.getCode(), alipayAccountConfigService::getDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WxPayAccountConfig getWxConfig() {
|
||||||
|
return CacheUtil.get(PAYMENT_CONFIG_CACHE, PAYMENT_TYPE, PaymentType.WECHAT.getCode(), wxpayAccountConfigService::getDefault);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,4 +25,29 @@ public class AsyncConfiguration {
|
|||||||
return executor;
|
return executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean("paymentAsyncExecutor")
|
||||||
|
public ThreadPoolTaskExecutor paymentAsyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(6);
|
||||||
|
executor.setMaxPoolSize(12);
|
||||||
|
executor.setQueueCapacity(200);
|
||||||
|
executor.setThreadNamePrefix("pay-");
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean("statsCommissionAsyncExecutor")
|
||||||
|
public ThreadPoolTaskExecutor statsCommissionAsyncExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(6);
|
||||||
|
executor.setMaxPoolSize(12);
|
||||||
|
executor.setQueueCapacity(200);
|
||||||
|
executor.setThreadNamePrefix("stats-commission-");
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
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 org.locationtech.jts.geom.Coordinate;
|
||||||
|
import org.locationtech.jts.geom.GeometryFactory;
|
||||||
|
import org.locationtech.jts.geom.Point;
|
||||||
|
import org.locationtech.jts.io.ParseException;
|
||||||
|
import org.locationtech.jts.io.WKTReader;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
@MappedJdbcTypes(JdbcType.OTHER) // 对应 PG 的 point 类型
|
||||||
|
@MappedTypes(Point.class)
|
||||||
|
public class PgJtsPointTypeHandler extends BaseTypeHandler<Point> {
|
||||||
|
|
||||||
|
private static final GeometryFactory FACTORY = new GeometryFactory();
|
||||||
|
private static final WKTReader WKT_READER = new WKTReader(FACTORY);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setNonNullParameter(PreparedStatement ps, int i, Point parameter, JdbcType jdbcType) throws SQLException {
|
||||||
|
if (parameter == null) {
|
||||||
|
ps.setNull(i, java.sql.Types.OTHER);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double x = parameter.getX(); // 经度
|
||||||
|
double y = parameter.getY(); // 纬度
|
||||||
|
|
||||||
|
// 【修正】使用 WKT 格式:POINT(经度 纬度)
|
||||||
|
// 注意:中间是空格,不是逗号;必须有 POINT 前缀
|
||||||
|
String wkt = String.format("POINT(%f %f)", x, y);
|
||||||
|
|
||||||
|
// 打印日志方便调试(可选)
|
||||||
|
// System.out.println("Inserting WKT: " + wkt);
|
||||||
|
|
||||||
|
// 将 WKT 字符串传入,PostGIS 会自动识别并转换
|
||||||
|
ps.setObject(i, wkt, java.sql.Types.OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||||
|
// 关键:获取字符串并解析
|
||||||
|
return parse(rs.getString(columnName));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||||
|
return parse(rs.getString(columnIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||||
|
return parse(cs.getString(columnIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Point parse(String value) throws SQLException {
|
||||||
|
if (value == null || value.trim().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 尝试直接作为 WKT 解析 (兼容 "POINT(x y)")
|
||||||
|
try {
|
||||||
|
return (Point) WKT_READER.read(value);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
// 2. 如果失败,尝试解析 PG 原生格式 "(x,y)"
|
||||||
|
// PG 原生格式不是标准 WKT,WKTReader 会报错,进入这里
|
||||||
|
if (value.startsWith("(") && value.endsWith(")")) {
|
||||||
|
try {
|
||||||
|
String content = value.substring(1, value.length() - 1);
|
||||||
|
String[] parts = content.split(",");
|
||||||
|
if (parts.length == 2) {
|
||||||
|
double x = Double.parseDouble(parts[0].trim());
|
||||||
|
double y = Double.parseDouble(parts[1].trim());
|
||||||
|
return FACTORY.createPoint(new Coordinate(x, y));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
throw new SQLException("Invalid Point format: " + value, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new SQLException("Failed to parse Point: " + value, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.springblade.common.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class IdCardValidatorUtil {
|
||||||
|
|
||||||
|
private static final Pattern REGEX_18 = Pattern.compile("^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[\\dXx]$");
|
||||||
|
|
||||||
|
// 加权因子
|
||||||
|
private static final int[] WEIGHTS = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
||||||
|
// 校验码映射
|
||||||
|
private static final String[] CHECK_CODES = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"};
|
||||||
|
|
||||||
|
public static Boolean validateIdCard(String idCard) {
|
||||||
|
if (StringUtils.isBlank(idCard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 格式初筛 (15位直接淘汰,只留18位)
|
||||||
|
if (!REGEX_18.matcher(idCard).matches()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 核心算法校验 (校验最后一位是否正确)
|
||||||
|
return verifyCheckSum(idCard.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ISO 7064:1983.MOD 11-2 校验算法
|
||||||
|
*/
|
||||||
|
private static boolean verifyCheckSum(String idCard) {
|
||||||
|
int sum = 0;
|
||||||
|
// 只取前17位进行计算
|
||||||
|
for (int i = 0; i < 17; i++) {
|
||||||
|
int digit = Character.getNumericValue(idCard.charAt(i));
|
||||||
|
if (digit < 0 || digit > 9) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sum += digit * WEIGHTS[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
int mod = sum % 11;
|
||||||
|
String expectedCheckCode = CHECK_CODES[mod];
|
||||||
|
String actualCheckCode = String.valueOf(idCard.charAt(17));
|
||||||
|
|
||||||
|
return expectedCheckCode.equals(actualCheckCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
package org.springblade.job.processor;
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
import org.springblade.core.redis.cache.BladeRedis;
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonOrderConfirmLogEntity;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonOrderConfirmLogService;
|
||||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionEntity;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
|
||||||
import org.springblade.modules.market.service.*;
|
import org.springblade.modules.market.service.*;
|
||||||
import org.springblade.modules.system.pojo.entity.User;
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
@@ -42,12 +43,17 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
private final IMarketUpgradeConfigService upgradeConfigService;
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
||||||
private final IMarketInfoService marketInfoService;
|
private final IMarketInfoService marketInfoService;
|
||||||
private final ICommonUserOrderService userOrderService;
|
private final ICommonOrderConfirmLogService orderConfirmLogService;
|
||||||
private final IUserService userService;
|
private final IUserService userService;
|
||||||
private final BladeRedis bladeRedis;
|
private final BladeRedis bladeRedis;
|
||||||
private final IMarketUserCommissionService userCommissionService;
|
private final IMarketUserCommissionService userCommissionService;
|
||||||
private final IMarketUserCommissionLogService userCommissionLogService;
|
private final IMarketUserCommissionLogService userCommissionLogService;
|
||||||
private final ApplicationEventPublisher publisher;
|
private final ApplicationEventPublisher publisher;
|
||||||
|
private final IMarketCommissionAccountService commissionAccountService;
|
||||||
|
private final IMarketCommissionAgencyLogService agencyLogService;
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
|
||||||
|
private static final Long AGENCY_ACCOUNT_ID = 2017486568441696258L;
|
||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -62,6 +68,25 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
.eq(MarketUpgradeCashLogEntity::getUpgradeDate, DateUtil.getYesterday())
|
.eq(MarketUpgradeCashLogEntity::getUpgradeDate, DateUtil.getYesterday())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
List<CommonUserOrderEntity> orderEntityList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.select(CommonUserOrderEntity::getUserId)
|
||||||
|
.eq(CommonUserOrderEntity::getOrderType, BusinessModule.SELF_OPERATED_MALL.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, 1)
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (orderEntityList.isEmpty()){
|
||||||
|
log.info( "{} : 没有自营商城订单", DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
return new ProcessResult(true, "result is success") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<Long> orderUserIdSet = orderEntityList.stream()
|
||||||
|
.map(CommonUserOrderEntity::getUserId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
.eq(MarketUpgradeConfigEntity::getType, 2)
|
.eq(MarketUpgradeConfigEntity::getType, 2)
|
||||||
@@ -85,24 +110,40 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 1. 分页查询订单 (修复内存溢出风险)
|
|
||||||
List<CommonUserOrderEntity> orderPageList = userOrderService.list(
|
String orderType = BusinessModule.SELF_OPERATED_MALL.getCode().toUpperCase();
|
||||||
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
List<CommonOrderConfirmLogEntity> orderPageList = orderConfirmLogService.list(
|
||||||
.eq(CommonUserOrderEntity::getPaymentStatus, 1)
|
Wrappers.lambdaQuery(CommonOrderConfirmLogEntity.class)
|
||||||
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
.eq(CommonOrderConfirmLogEntity::getIsAgencyDistributed, 0)
|
||||||
.lt(CommonUserOrderEntity::getCreateTime, endDate)
|
.func(queryWrapper -> queryWrapper.apply("UPPER(order_type) = {0}", orderType))
|
||||||
.orderByAsc(CommonUserOrderEntity::getId) // 稳定排序
|
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(1, 2))
|
||||||
|
.ge(CommonOrderConfirmLogEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonOrderConfirmLogEntity::getCreateTime, endDate)
|
||||||
|
.orderByAsc(CommonOrderConfirmLogEntity::getId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (orderPageList.isEmpty()){
|
||||||
|
log.info( "{} : 没有自营商城订单", DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
return new ProcessResult(true, "result is success") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
MarketCommissionAccountEntity agencyAccount = commissionAccountService.getById(AGENCY_ACCOUNT_ID);
|
||||||
|
|
||||||
|
if (agencyAccount == null || agencyAccount.getAmount().compareTo(BigDecimal.ZERO) < 0){
|
||||||
|
log.info( "{} : 极差代理账户余额不足", DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
return new ProcessResult(true, "result is success") ;
|
||||||
|
}
|
||||||
|
List<MarketCommissionAgencyLogEntity> agencyLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = new ArrayList<>();
|
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = new ArrayList<>();
|
||||||
Map<Long, BigDecimal> userRewardRateMap = new HashMap<>();
|
Map<Long, BigDecimal> userRewardRateMap = new HashMap<>();
|
||||||
Map<Long, BigDecimal> userLastAmountMap = new HashMap<>();
|
Map<Long, BigDecimal> userLastAmountMap = new HashMap<>();
|
||||||
List<MarketUserCommissionLogEntity> userCommissionLogList = new ArrayList<>();
|
List<MarketUserCommissionLogEntity> userCommissionLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
BigDecimal agencyLastAmount = agencyAccount.getAmount();
|
||||||
// 6. 处理订单
|
// 6. 处理订单
|
||||||
for (CommonUserOrderEntity order : orderPageList) {
|
for (CommonOrderConfirmLogEntity order : orderPageList) {
|
||||||
Long userId = order.getUserId();
|
Long userId = order.getUserId();
|
||||||
|
|
||||||
// 安全获取金额
|
// 安全获取金额
|
||||||
@@ -183,6 +224,11 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0){
|
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 未在自营商城消费
|
||||||
|
if (!orderUserIdSet.contains(ancestorId)){
|
||||||
|
log.info( " 用户ID:{} , {} 未在自营商城消费 ", ancestorId,DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!userLastAmountMap.containsKey(ancestorId)){
|
if (!userLastAmountMap.containsKey(ancestorId)){
|
||||||
MarketUserCommissionEntity benefitPoint = userCommissionService.getById(ancestorId);
|
MarketUserCommissionEntity benefitPoint = userCommissionService.getById(ancestorId);
|
||||||
@@ -216,6 +262,24 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
.setRemark(remarks + ",加速比例:" + rewardRate + ",加速金额:" + rewardRatePoint )
|
.setRemark(remarks + ",加速比例:" + rewardRate + ",加速金额:" + rewardRatePoint )
|
||||||
.setStatisticalDate(DateUtil.getYesterday());
|
.setStatisticalDate(DateUtil.getYesterday());
|
||||||
userCommissionLogList.add(userCommissionLog);
|
userCommissionLogList.add(userCommissionLog);
|
||||||
|
|
||||||
|
MarketCommissionAgencyLogEntity agencyLog = new MarketCommissionAgencyLogEntity();
|
||||||
|
agencyLog.setAccountId(agencyAccount.getId());
|
||||||
|
agencyLog.setUserId(ancestorId);
|
||||||
|
agencyLog.setAmount(rewardRatePoint);
|
||||||
|
agencyLog.setLastAmount(agencyLastAmount);
|
||||||
|
agencyLog.setSourceType(orderType);
|
||||||
|
agencyLog.setSourceId(order.getId());
|
||||||
|
agencyLog.setSourceDetail(JSONObject.toJSONString(order));
|
||||||
|
agencyLog.setType(1);
|
||||||
|
agencyLog.setStatisticalDate(DateUtil.getYesterday());
|
||||||
|
agencyLog.setIsComplete(2);
|
||||||
|
agencyLog.setRemark("极差代理奖励发放, 来源账号:" + account + ",来源订单id:" + order.getId());
|
||||||
|
agencyLogList.add(agencyLog);
|
||||||
|
agencyLastAmount = agencyLastAmount.subtract(rewardRatePoint);
|
||||||
|
|
||||||
|
agencyAccount.setAmount(agencyAccount.getAmount().subtract(rewardRatePoint));
|
||||||
|
|
||||||
if (userLastAmountMap.containsKey(ancestorId)){
|
if (userLastAmountMap.containsKey(ancestorId)){
|
||||||
userLastAmountMap.merge(ancestorId, rewardRatePoint, BigDecimal::add);
|
userLastAmountMap.merge(ancestorId, rewardRatePoint, BigDecimal::add);
|
||||||
}else {
|
}else {
|
||||||
@@ -224,9 +288,7 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
accelerationPoint = accelerationPoint.subtract(rewardRatePoint);
|
accelerationPoint = accelerationPoint.subtract(rewardRatePoint);
|
||||||
|
|
||||||
noticeItems.add(
|
noticeItems.add(new MarketUpgradeNoticeEvent.NoticeItem(userCommissionLog.getUserId() ,userCommissionLog.getRemark()));
|
||||||
new MarketUpgradeNoticeEvent.NoticeItem(userCommissionLog.getUserId() ,userCommissionLog.getRemark())
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,6 +308,15 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
|||||||
userCommissionLogService.saveBatch(userCommissionLogList , 5000);
|
userCommissionLogService.saveBatch(userCommissionLogList , 5000);
|
||||||
publisher.publishEvent(event);
|
publisher.publishEvent(event);
|
||||||
|
|
||||||
|
commissionAccountService.updateById(agencyAccount);
|
||||||
|
agencyLogService.saveBatch(agencyLogList , 5000);
|
||||||
|
|
||||||
|
orderPageList.forEach(order -> {
|
||||||
|
order.setIsAgencyDistributed(1);
|
||||||
|
order.setAgencyDistributeTime(new Date());
|
||||||
|
});
|
||||||
|
orderConfirmLogService.updateBatchById(orderPageList , 5000);
|
||||||
|
|
||||||
return new ProcessResult(true, "result is success");
|
return new ProcessResult(true, "result is success");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
import org.springblade.core.redis.cache.BladeRedis;
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
import org.springblade.modules.market.pojo.entity.*;
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
@@ -42,6 +45,7 @@ public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
|||||||
private final IMarketBenefitPointLogService benefitPointLogService;
|
private final IMarketBenefitPointLogService benefitPointLogService;
|
||||||
private final BladeRedis bladeRedis;
|
private final BladeRedis bladeRedis;
|
||||||
private final ApplicationEventPublisher publisher;
|
private final ApplicationEventPublisher publisher;
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -49,6 +53,8 @@ public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
|||||||
public ProcessResult process(TaskContext taskContext) throws Exception {
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
// 1. 初始化配置
|
// 1. 初始化配置
|
||||||
Date searchDate = DateUtil.getYesterday();
|
Date searchDate = DateUtil.getYesterday();
|
||||||
|
Date startDate = DateUtil.getYesterday();
|
||||||
|
Date endDate = DateUtil.getToday();
|
||||||
|
|
||||||
// 2. 预加载基础数据 (减少循环内DB查询)
|
// 2. 预加载基础数据 (减少循环内DB查询)
|
||||||
List<MarketBenefitPackageTemplateEntity> templateEntityList = benefitPackageTemplateService.list();
|
List<MarketBenefitPackageTemplateEntity> templateEntityList = benefitPackageTemplateService.list();
|
||||||
@@ -62,6 +68,31 @@ public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
|||||||
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||||
.orderByAsc(MarketBenefitPackageEntity::getId)
|
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (benefitPackageEntityList.isEmpty()){
|
||||||
|
log.info("没有需要处理的用户福利包");
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CommonUserOrderEntity> orderEntityList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.select(CommonUserOrderEntity::getUserId)
|
||||||
|
.eq(CommonUserOrderEntity::getOrderType, BusinessModule.SELF_OPERATED_MALL.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, 1)
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (orderEntityList.isEmpty()){
|
||||||
|
log.info( "{} : 没有自营商城订单", DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
return new ProcessResult(true, "result is success") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<Long> orderUserIdSet = orderEntityList.stream()
|
||||||
|
.map(CommonUserOrderEntity::getUserId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// 用户福利包分组map
|
// 用户福利包分组map
|
||||||
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
||||||
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||||
@@ -188,6 +219,11 @@ public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
|||||||
BigDecimal rewardRatePoint = rewardRate.multiply(totalUserBenefit).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal rewardRatePoint = rewardRate.multiply(totalUserBenefit).setScale(2, RoundingMode.HALF_UP);
|
||||||
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0) continue;
|
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0) continue;
|
||||||
|
|
||||||
|
// 未在自营商城消费
|
||||||
|
if (!orderUserIdSet.contains(ancestorId)){
|
||||||
|
log.info( " 用户ID:{} , {} 未在自营商城消费 ", ancestorId,DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
BigDecimal remainingPoint = rewardRatePoint; // 剩余需要扣除的金额
|
BigDecimal remainingPoint = rewardRatePoint; // 剩余需要扣除的金额
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.cache.PaymentCache;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.api.service.IPaymentService;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.eums.OrderStatus;
|
||||||
|
import org.springblade.modules.common.eums.PaymentStatus;
|
||||||
|
import org.springblade.modules.common.eums.PaymentType;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.plugin.pay.entity.AliPayAccountConfig;
|
||||||
|
import org.springblade.plugin.pay.service.IOrderService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
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.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户未支付订单关闭
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AliUserOrderCloseProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final ICommonUserOrderService commonUserOrderService;
|
||||||
|
private final IPaymentService paymentService;
|
||||||
|
private final IOrderService orderService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
// 1. 计算截止时间 (30分钟前)
|
||||||
|
Date expireTime = DateUtil.getMinutesLate(new Date(), 30);
|
||||||
|
AliPayAccountConfig config = PaymentCache.getAliConfig();
|
||||||
|
|
||||||
|
int batchSize = 500; // 【优化点3】分批处理,防止内存溢出
|
||||||
|
int currentCount = 0;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
// 2. 分批查询数据库
|
||||||
|
// 【优化点1】增加 orderByAsc 保证按时间顺序处理,增加 last("LIMIT") 限制数量
|
||||||
|
List<CommonUserOrderEntity> payOrderList = commonUserOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.UNPAID.getCode()) // 确保传的是 code 值,如果是枚举对象需调整
|
||||||
|
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.PENDING_PAYMENT.getCode())
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, expireTime)
|
||||||
|
.orderByAsc(CommonUserOrderEntity::getCreateTime)
|
||||||
|
.last("LIMIT " + batchSize)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (payOrderList == null || payOrderList.isEmpty()) {
|
||||||
|
break; // 没有数据了,退出循环
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CommonUserOrderEntity payOrder : payOrderList) {
|
||||||
|
try {
|
||||||
|
processSingleOrder(payOrder , config);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("处理超时订单异常,订单号: {}", payOrder.getId(), e);
|
||||||
|
// 单个失败不影响整体流程
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果本次查询数量小于批次大小,说明已经是最后一批,退出
|
||||||
|
if (payOrderList.size() < batchSize) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理单个订单逻辑
|
||||||
|
* 核心原则:先远程交互,成功后再开短事务更新本地
|
||||||
|
*/
|
||||||
|
private void processSingleOrder(CommonUserOrderEntity payOrder , AliPayAccountConfig config) {
|
||||||
|
Long orderId = payOrder.getId();
|
||||||
|
String orderNo = PaymentType.fromCodeOrNull(payOrder.getPaymentType()).getAbbr() + BusinessModule.fromCodeIgnoreCaseOrNull(payOrder.getOrderType()).getAbbr() + payOrder.getId();
|
||||||
|
log.info("处理超时订单,订单号: {}", orderNo);
|
||||||
|
if (payOrder == null) {
|
||||||
|
log.error("关联用户订单不存在,orderId: {}", orderId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AlipayTradeQueryResponse response = paymentService.aliQuery(orderNo);
|
||||||
|
log.info("查询结果: {}", response);
|
||||||
|
|
||||||
|
|
||||||
|
if (response == null) {
|
||||||
|
updateOrderToClosed(payOrder);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.getTradeStatus().equalsIgnoreCase("TRADE_SUCCESS") || response.getTradeStatus().equalsIgnoreCase("TRADE_FINISHED")){
|
||||||
|
orderService.paySuccess(orderNo, String.valueOf(config.getMchId()), response.getTradeNo(), DateUtil.convertFromDate(response.getSendPayDate() , "yyyy-MM-dd HH:mm:ss"), response.getBuyerUserId());
|
||||||
|
}else {
|
||||||
|
Boolean isClosed = paymentService.aliCloseOrder(orderNo);
|
||||||
|
if (!Boolean.TRUE.equals(isClosed)) {
|
||||||
|
log.error("订单 {} 调用支付宝关闭失败,保留本地状态等待下次重试", orderNo);
|
||||||
|
// 策略:不更新本地状态,下次定时任务再试。防止误关。
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateOrderToClosed(payOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事务方法:更新为关闭状态
|
||||||
|
* 使用 update(entity, wrapper) 方式实现乐观锁检查
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateOrderToClosed( CommonUserOrderEntity userOrder) {
|
||||||
|
// 支付单更新成功,再更新用户订单
|
||||||
|
userOrder.setOrderStatus(OrderStatus.CLOSED_TIMEOUT.getCode());
|
||||||
|
userOrder.setPaymentStatus(PaymentStatus.FAILED.getCode());
|
||||||
|
// userOrder.setUpdateTime(new Date());
|
||||||
|
commonUserOrderService.updateById(userOrder);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.cache.utils.CacheUtil;
|
||||||
|
import org.springblade.modules.market.constant.BladeMarketConstant;
|
||||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||||
@@ -14,6 +16,8 @@ import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
|||||||
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
||||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
||||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.Param;
|
||||||
|
import org.springblade.modules.system.service.IParamService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||||
import tech.powerjob.worker.core.processor.TaskContext;
|
import tech.powerjob.worker.core.processor.TaskContext;
|
||||||
@@ -27,6 +31,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 福利包每日发放福利积分到用户
|
* 福利包每日发放福利积分到用户
|
||||||
@@ -40,6 +46,7 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
|||||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||||
private final IMarketBenefitPointService benefitPointService;
|
private final IMarketBenefitPointService benefitPointService;
|
||||||
private final IMarketBenefitPointLogService benefitPointLogService;
|
private final IMarketBenefitPointLogService benefitPointLogService;
|
||||||
|
private final IParamService paramService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(TaskContext context) {
|
public ProcessResult process(TaskContext context) {
|
||||||
@@ -56,6 +63,10 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
|||||||
return new ProcessResult(false, "系统异常: " + e.getMessage());
|
return new ProcessResult(false, "系统异常: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CacheUtil.clear(PARAM_CACHE);
|
||||||
|
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
|
||||||
|
|
||||||
|
paramService.update(Wrappers.<Param>lambdaUpdate().eq(Param::getParamKey, BladeMarketConstant.APP_BENEFIT_PACK_ALLOCATE_ENABLED).set(Param::getParamValue, Boolean.TRUE));
|
||||||
// 返回结果,该结果会被持久化到数据库,在前端页面直接查看,极为方便
|
// 返回结果,该结果会被持久化到数据库,在前端页面直接查看,极为方便
|
||||||
return new ProcessResult(true, "result is success");
|
return new ProcessResult(true, "result is success");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.cache.utils.CacheUtil;
|
||||||
|
import org.springblade.modules.market.constant.BladeMarketConstant;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketPackageDailySettlementEntity;
|
import org.springblade.modules.market.pojo.entity.MarketPackageDailySettlementEntity;
|
||||||
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||||
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
import org.springblade.modules.market.service.IMarketPackageDailySettlementService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.Param;
|
||||||
|
import org.springblade.modules.system.service.IParamService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||||
import tech.powerjob.worker.core.processor.TaskContext;
|
import tech.powerjob.worker.core.processor.TaskContext;
|
||||||
@@ -19,6 +23,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 福利包每日发放结算记录
|
* 福利包每日发放结算记录
|
||||||
*/
|
*/
|
||||||
@@ -29,6 +35,7 @@ public class InitBenefitPackageSettlementProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
private final IMarketBenefitPackageService userBenefitPackageService;
|
private final IMarketBenefitPackageService userBenefitPackageService;
|
||||||
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
private final IMarketPackageDailySettlementService userPackageDailySettlementService;
|
||||||
|
private final IParamService paramService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(TaskContext context) {
|
public ProcessResult process(TaskContext context) {
|
||||||
@@ -36,6 +43,10 @@ public class InitBenefitPackageSettlementProcessor implements BasicProcessor {
|
|||||||
OmsLogger omsLogger = context.getOmsLogger(); // PowerJob 内置日志,控制台可查
|
OmsLogger omsLogger = context.getOmsLogger(); // PowerJob 内置日志,控制台可查
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
CacheUtil.clear(PARAM_CACHE);
|
||||||
|
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
|
||||||
|
|
||||||
|
paramService.update(Wrappers.<Param>lambdaUpdate().eq(Param::getParamKey, BladeMarketConstant.APP_BENEFIT_PACK_ALLOCATE_ENABLED).set(Param::getParamValue, Boolean.TRUE));
|
||||||
omsLogger.info("开始执行定时任务-初始化用户福利包每天结算记录...");
|
omsLogger.info("开始执行定时任务-初始化用户福利包每天结算记录...");
|
||||||
initUserPackageDailySettlement();
|
initUserPackageDailySettlement();
|
||||||
omsLogger.info("结束执行定时任务-初始化用户福利包每天结算记录");
|
omsLogger.info("结束执行定时任务-初始化用户福利包每天结算记录");
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageTemplateEntity;
|
||||||
|
import org.springblade.modules.market.service.IMarketBenefitPackageService;
|
||||||
|
import org.springblade.modules.market.service.IMarketBenefitPackageTemplateService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计福利包兑换数量
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StatsBenefitPackageProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketBenefitPackageTemplateService packageTemplateService;
|
||||||
|
private final IMarketBenefitPackageService benefitPackageService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
List<MarketBenefitPackageTemplateEntity> templateList = packageTemplateService.list(
|
||||||
|
Wrappers.<MarketBenefitPackageTemplateEntity>lambdaQuery()
|
||||||
|
.orderByDesc(MarketBenefitPackageTemplateEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
templateList.forEach(template -> {
|
||||||
|
|
||||||
|
long count = benefitPackageService.count(
|
||||||
|
Wrappers.<MarketBenefitPackageEntity>lambdaQuery()
|
||||||
|
.eq(MarketBenefitPackageEntity::getType , 1)
|
||||||
|
.eq(MarketBenefitPackageEntity::getPackageId, template.getId())
|
||||||
|
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||||
|
);
|
||||||
|
template.setExchangedQuantity(Math.toIntExact(count));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
packageTemplateService.updateBatchById(templateList);
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.springblade.job.processor;
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -8,7 +9,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
import org.springblade.core.redis.cache.BladeRedis;
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.eums.OrderStatus;
|
||||||
|
import org.springblade.modules.common.eums.PaymentStatus;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonOrderConfirmLogEntity;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonOrderConfirmLogService;
|
||||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
@@ -36,7 +42,7 @@ import java.util.stream.Collectors;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class StatsCalculatorCashProcessor implements BasicProcessor {
|
public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||||
|
|
||||||
private final ICommonUserOrderService userOrderService;
|
private final ICommonOrderConfirmLogService orderConfirmLogService;
|
||||||
private final IUserService userService;
|
private final IUserService userService;
|
||||||
private final IMarketInfoService marketInfoService;
|
private final IMarketInfoService marketInfoService;
|
||||||
private final IMarketCashPerformanceService cashPerformanceService;
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
@@ -49,20 +55,26 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
Date startDate = DateUtil.getYesterday();
|
Date startDate = DateUtil.getYesterday();
|
||||||
Date endDate = DateUtil.getToday();
|
Date endDate = DateUtil.getToday();
|
||||||
|
String orderType = BusinessModule.SELF_OPERATED_MALL.getCode().toUpperCase();
|
||||||
|
|
||||||
// 1. 分页查询订单 (修复内存溢出风险)
|
|
||||||
List<CommonUserOrderEntity> orderPageList = userOrderService.list(
|
List<CommonOrderConfirmLogEntity> orderPageList = orderConfirmLogService.list(
|
||||||
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
Wrappers.lambdaQuery(CommonOrderConfirmLogEntity.class)
|
||||||
.eq(CommonUserOrderEntity::getPaymentStatus, 1)
|
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(1, 2))
|
||||||
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
.func(queryWrapper -> queryWrapper.apply("UPPER(order_type) = {0}", orderType))
|
||||||
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
.ge(CommonOrderConfirmLogEntity::getCreateTime, startDate)
|
||||||
.orderByAsc(CommonUserOrderEntity::getId) // 稳定排序
|
.le(CommonOrderConfirmLogEntity::getCreateTime, endDate)
|
||||||
|
.orderByAsc(CommonOrderConfirmLogEntity::getId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (orderPageList.isEmpty()){
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 2. 提取所有用户ID,用于批量查询
|
// 2. 提取所有用户ID,用于批量查询
|
||||||
Set<Long> userIds = orderPageList.stream()
|
Set<Long> userIds = orderPageList.stream()
|
||||||
.map(CommonUserOrderEntity::getUserId)
|
.map(CommonOrderConfirmLogEntity::getUserId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// 3. 批量查询用户信息 (修复 N+1)
|
// 3. 批量查询用户信息 (修复 N+1)
|
||||||
@@ -79,7 +91,7 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
|||||||
Map<Long, MarketCashPerformanceEntity> owenCashPerformanceMap = new HashMap<>(); // 自身业绩
|
Map<Long, MarketCashPerformanceEntity> owenCashPerformanceMap = new HashMap<>(); // 自身业绩
|
||||||
|
|
||||||
// 6. 处理订单
|
// 6. 处理订单
|
||||||
for (CommonUserOrderEntity order : orderPageList) {
|
for (CommonOrderConfirmLogEntity order : orderPageList) {
|
||||||
Long userId = order.getUserId();
|
Long userId = order.getUserId();
|
||||||
|
|
||||||
// 安全获取金额
|
// 安全获取金额
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ public class StatsCalculatorWelfareProcessor implements BasicProcessor {
|
|||||||
.orderByAsc(MarketBenefitPackageEntity::getId)
|
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (benefitPackageEntityList.isEmpty()){
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
// 按用户分组
|
// 按用户分组
|
||||||
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
||||||
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
@@ -23,10 +26,7 @@ import tech.powerjob.worker.core.processor.TaskContext;
|
|||||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -42,12 +42,16 @@ public class TallyCashUpgradeProcessor implements BasicProcessor {
|
|||||||
private final IMarketUpgradeConfigService upgradeConfigService;
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
private final IMarketCashPerformanceService cashPerformanceService;
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
private final ApplicationEventPublisher publisher;
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(TaskContext taskContext) throws Exception {
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
Date startDate = DateUtil.getYesterday();
|
||||||
|
Date endDate = DateUtil.getToday();
|
||||||
|
|
||||||
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
.eq(MarketUpgradeConfigEntity::getType, 2)
|
.eq(MarketUpgradeConfigEntity::getType, 2)
|
||||||
@@ -73,6 +77,19 @@ public class TallyCashUpgradeProcessor implements BasicProcessor {
|
|||||||
.orderByAsc(MarketCashPerformanceEntity::getTotalAmount)
|
.orderByAsc(MarketCashPerformanceEntity::getTotalAmount)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
List<CommonUserOrderEntity> orderEntityList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.select(CommonUserOrderEntity::getUserId)
|
||||||
|
.eq(CommonUserOrderEntity::getOrderType, BusinessModule.SELF_OPERATED_MALL.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, 1)
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
);
|
||||||
|
|
||||||
|
Set<Long> orderUserIdSet = orderEntityList.stream()
|
||||||
|
.map(CommonUserOrderEntity::getUserId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
List<MarketUpgradeCashLogEntity> upgradeCashLogList = new ArrayList<>();
|
List<MarketUpgradeCashLogEntity> upgradeCashLogList = new ArrayList<>();
|
||||||
|
|
||||||
performanceList.forEach(performance -> {
|
performanceList.forEach(performance -> {
|
||||||
@@ -83,6 +100,11 @@ public class TallyCashUpgradeProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (count < minConfig.getDirectRecommend()){
|
||||||
|
log.error("用户ID:{} 没有达到升级条件 , 最低直推人数: {} , 现有直推人数: {}", performance.getId() , minConfig.getDirectRecommend() , count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
long lastLevelId = upgradeConfigList.get(0).getId();
|
long lastLevelId = upgradeConfigList.get(0).getId();
|
||||||
MarketUpgradeCashLogEntity lastUpgradeWelfareLog = upgradeCashLogService.getOne(
|
MarketUpgradeCashLogEntity lastUpgradeWelfareLog = upgradeCashLogService.getOne(
|
||||||
Wrappers.lambdaQuery(MarketUpgradeCashLogEntity.class)
|
Wrappers.lambdaQuery(MarketUpgradeCashLogEntity.class)
|
||||||
@@ -95,35 +117,36 @@ public class TallyCashUpgradeProcessor implements BasicProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
||||||
|
boolean contains = orderUserIdSet.contains(performance.getId());
|
||||||
|
String spending = contains ? "自营商城已消费" : "自营商城未消费";
|
||||||
|
|
||||||
MarketUpgradeCashLogEntity upgradeCashLog = new MarketUpgradeCashLogEntity();
|
MarketUpgradeCashLogEntity upgradeCashLog = new MarketUpgradeCashLogEntity();
|
||||||
upgradeCashLog.setUserId(performance.getId());
|
upgradeCashLog.setUserId(performance.getId());
|
||||||
upgradeCashLog.setLastLevel(lastLevelId);
|
upgradeCashLog.setLastLevel(lastLevelId);
|
||||||
upgradeCashLog.setCurrentLevelId(upgradeId);
|
upgradeCashLog.setCurrentLevelId(upgradeId);
|
||||||
upgradeCashLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
upgradeCashLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
||||||
upgradeCashLog.setUpgradeDate(DateUtil.getYesterday());
|
upgradeCashLog.setUpgradeDate(DateUtil.getYesterday());
|
||||||
upgradeCashLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人");
|
upgradeCashLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人," + spending);
|
||||||
upgradeCashLogList.add(upgradeCashLog);
|
upgradeCashLogList.add(upgradeCashLog);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
upgradeCashLogService.saveBatch(upgradeCashLogList, 2000);
|
||||||
if (upgradeCashLogService.saveBatch(upgradeCashLogList, 2000)){
|
// if (upgradeCashLogService.saveBatch(upgradeCashLogList, 2000)){
|
||||||
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeCashLogList.stream()
|
// List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeCashLogList.stream()
|
||||||
.map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
// .map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
||||||
upgradeConfig.getUserId(),
|
// upgradeConfig.getUserId(),
|
||||||
"当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
// "当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
||||||
))
|
// ))
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
|
// // 2. 发送事件 (只发一次,传入全部数据)
|
||||||
// 2. 发送事件 (只发一次,传入全部数据)
|
// MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
// noticeItems,
|
||||||
noticeItems,
|
// MarketBusinessModule.CASH_UPGRADE
|
||||||
MarketBusinessModule.CASH_UPGRADE
|
// );
|
||||||
);
|
//
|
||||||
|
// publisher.publishEvent(event);
|
||||||
publisher.publishEvent(event);
|
// log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
||||||
|
// }
|
||||||
log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
|
||||||
}
|
|
||||||
return new ProcessResult(true, "result is success");
|
return new ProcessResult(true, "result is success");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.market.eums.MarketBusinessModule;
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||||
@@ -22,10 +25,7 @@ import tech.powerjob.worker.core.processor.TaskContext;
|
|||||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -42,11 +42,15 @@ public class TallyWelfareUpgradeProcessor implements BasicProcessor {
|
|||||||
private final IMarketUpgradeWelfareLogService upgradeWelfareLogService;
|
private final IMarketUpgradeWelfareLogService upgradeWelfareLogService;
|
||||||
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||||
private final ApplicationEventPublisher publisher;
|
private final ApplicationEventPublisher publisher;
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(TaskContext taskContext) throws Exception {
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
Date startDate = DateUtil.getYesterday();
|
||||||
|
Date endDate = DateUtil.getToday();
|
||||||
|
|
||||||
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
.eq(MarketUpgradeConfigEntity::getType, 1)
|
.eq(MarketUpgradeConfigEntity::getType, 1)
|
||||||
@@ -72,6 +76,19 @@ public class TallyWelfareUpgradeProcessor implements BasicProcessor {
|
|||||||
.orderByAsc(MarketWelfarePerformanceEntity::getTotalAmount)
|
.orderByAsc(MarketWelfarePerformanceEntity::getTotalAmount)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
List<CommonUserOrderEntity> orderEntityList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.select(CommonUserOrderEntity::getUserId)
|
||||||
|
.eq(CommonUserOrderEntity::getOrderType, BusinessModule.SELF_OPERATED_MALL.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, 1)
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
);
|
||||||
|
|
||||||
|
Set<Long> orderUserIdSet = orderEntityList.stream()
|
||||||
|
.map(CommonUserOrderEntity::getUserId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
List<MarketUpgradeWelfareLogEntity> upgradeWelfareLogList = new ArrayList<>();
|
List<MarketUpgradeWelfareLogEntity> upgradeWelfareLogList = new ArrayList<>();
|
||||||
|
|
||||||
performanceList.forEach(performance -> {
|
performanceList.forEach(performance -> {
|
||||||
@@ -81,6 +98,10 @@ public class TallyWelfareUpgradeProcessor implements BasicProcessor {
|
|||||||
.eq(MarketInfoEntity::getPid, performance.getId())
|
.eq(MarketInfoEntity::getPid, performance.getId())
|
||||||
|
|
||||||
);
|
);
|
||||||
|
if (count < minConfig.getDirectRecommend()){
|
||||||
|
log.error("用户ID:{} 没有达到升级条件 , 最低直推人数: {} , 现有直推人数: {}", performance.getId() , minConfig.getDirectRecommend() , count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
long lastLevelId = upgradeConfigList.get(0).getId();
|
long lastLevelId = upgradeConfigList.get(0).getId();
|
||||||
MarketUpgradeWelfareLogEntity lastUpgradeWelfareLog = upgradeWelfareLogService.getOne(
|
MarketUpgradeWelfareLogEntity lastUpgradeWelfareLog = upgradeWelfareLogService.getOne(
|
||||||
@@ -94,33 +115,38 @@ public class TallyWelfareUpgradeProcessor implements BasicProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
||||||
|
|
||||||
|
boolean contains = orderUserIdSet.contains(performance.getId());
|
||||||
|
String spending = contains ? "自营商城已消费" : "自营商城未消费";
|
||||||
|
|
||||||
MarketUpgradeWelfareLogEntity upgradeWelfareLog = new MarketUpgradeWelfareLogEntity();
|
MarketUpgradeWelfareLogEntity upgradeWelfareLog = new MarketUpgradeWelfareLogEntity();
|
||||||
upgradeWelfareLog.setUserId(performance.getId());
|
upgradeWelfareLog.setUserId(performance.getId());
|
||||||
upgradeWelfareLog.setLastLevel(lastLevelId);
|
upgradeWelfareLog.setLastLevel(lastLevelId);
|
||||||
upgradeWelfareLog.setCurrentLevelId(upgradeId);
|
upgradeWelfareLog.setCurrentLevelId(upgradeId);
|
||||||
upgradeWelfareLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
upgradeWelfareLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
||||||
upgradeWelfareLog.setUpgradeDate(DateUtil.getYesterday());
|
upgradeWelfareLog.setUpgradeDate(DateUtil.getYesterday());
|
||||||
upgradeWelfareLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人");
|
upgradeWelfareLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人," + spending);
|
||||||
upgradeWelfareLogList.add(upgradeWelfareLog);
|
upgradeWelfareLogList.add(upgradeWelfareLog);
|
||||||
});
|
});
|
||||||
if (upgradeWelfareLogService.saveBatch(upgradeWelfareLogList, 2000)){
|
upgradeWelfareLogService.saveBatch(upgradeWelfareLogList, 2000);
|
||||||
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeWelfareLogList.stream()
|
// if (upgradeWelfareLogService.saveBatch(upgradeWelfareLogList, 2000)){
|
||||||
.map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
// List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeWelfareLogList.stream()
|
||||||
upgradeConfig.getUserId(),
|
// .map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
||||||
"当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
// upgradeConfig.getUserId(),
|
||||||
))
|
// "当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
||||||
.collect(Collectors.toList());
|
// ))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
// 2. 发送事件 (只发一次,传入全部数据)
|
//
|
||||||
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
// // 2. 发送事件 (只发一次,传入全部数据)
|
||||||
noticeItems,
|
// MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
MarketBusinessModule.WELFARE_UPGRADE
|
// noticeItems,
|
||||||
);
|
// MarketBusinessModule.WELFARE_UPGRADE
|
||||||
|
// );
|
||||||
publisher.publishEvent(event);
|
//
|
||||||
|
// publisher.publishEvent(event);
|
||||||
log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
//
|
||||||
}
|
// log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
||||||
|
// }
|
||||||
|
|
||||||
return new ProcessResult(true, "result is success");
|
return new ProcessResult(true, "result is success");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import jakarta.validation.constraints.Min;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springblade.core.redis.debounce.RedisDebounce;
|
import org.springblade.core.redis.debounce.RedisDebounce;
|
||||||
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.api.R;
|
||||||
import org.springblade.modules.api.request.ForgetPwdSmsRequest;
|
import org.springblade.modules.api.request.*;
|
||||||
import org.springblade.modules.api.request.ResetPasswordRequest;
|
import org.springblade.modules.api.vo.*;
|
||||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||||
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
import org.springblade.modules.common.service.*;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ public class APPCommonController {
|
|||||||
|
|
||||||
private final IUserService userService;
|
private final IUserService userService;
|
||||||
private final ICommonRegionsInfoService commonRegionsInfoService;
|
private final ICommonRegionsInfoService commonRegionsInfoService;
|
||||||
|
private final ICommonTourInfoService commonTourInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新版本
|
* 最新版本
|
||||||
@@ -69,5 +69,27 @@ public class APPCommonController {
|
|||||||
return R.status(userService.retrievePassword(request));
|
return R.status(userService.retrievePassword(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/tour-info-list")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "出行人列表")
|
||||||
|
public R<List<CommonTourInfoApiVO>> tourUserProfileList() {
|
||||||
|
return R.data(commonTourInfoService.tourUserProfileList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/submit-tour-info")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增出行人信息")
|
||||||
|
public R<Boolean> submitTourUserProfile(@RequestBody CommonTourUserInfoRequest request) {
|
||||||
|
return R.data(commonTourInfoService.submitTourUserProfile(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-tour-info")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "删除出行人信息")
|
||||||
|
public R<Boolean> removeTourUserProfile(@RequestBody CommonRemoveTourRequest request) {
|
||||||
|
return R.data(commonTourInfoService.removeTourUserProfile(request.getIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
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.request.ConfirmOrderRequest;
|
||||||
|
import org.springblade.modules.api.request.CreateMallOrderRequest;
|
||||||
|
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||||
|
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||||
|
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||||
|
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.modules.mall.service.IMallProductService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/app-eco")
|
||||||
|
@Tag(name = "APP生态产品接口", description = "APP生态产品接口")
|
||||||
|
public class APPEcoController {
|
||||||
|
|
||||||
|
private final IMallProductService productService;
|
||||||
|
private final ICommonUserOrderService orderService;
|
||||||
|
/**
|
||||||
|
* 生态产品-商品列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "生态产品-商品列表")
|
||||||
|
public R<List<MallProductApiVO>> ecosystemProductList() {
|
||||||
|
return R.data(productService.apiVoEcosListToCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "详情", description = "传入vo")
|
||||||
|
public R<MallProductDetailApiVO> detail(@Valid MallProductDetailApiVO vo) {
|
||||||
|
return R.data(productService.apiDetailVO(vo.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单
|
||||||
|
*/
|
||||||
|
@PostMapping("/create-order")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "下单", description = "传入CreateMallOrderRequest")
|
||||||
|
public R<CreateOrderResponse> createOrder(@Valid @RequestBody CreateMallOrderRequest request) {
|
||||||
|
return R.data(orderService.createEcoOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
||||||
|
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
||||||
|
return R.status(orderService.confirmEcoOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户订单详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/order-detail")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "用户订单详情")
|
||||||
|
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
||||||
|
return R.data(orderService.orderDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.springblade.modules.api.app;
|
package org.springblade.modules.api.app;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -7,9 +8,14 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.api.request.ConfirmOrderRequest;
|
||||||
|
import org.springblade.modules.api.request.CreateMallOrderRequest;
|
||||||
|
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||||
|
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||||
import org.springblade.modules.api.vo.MallCategoryApiVO;
|
import org.springblade.modules.api.vo.MallCategoryApiVO;
|
||||||
import org.springblade.modules.api.vo.MallProductApiVO;
|
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
import org.springblade.modules.mall.convert.AppMallConvert;
|
import org.springblade.modules.mall.convert.AppMallConvert;
|
||||||
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
|
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
|
||||||
import org.springblade.modules.mall.service.IMallCategoryService;
|
import org.springblade.modules.mall.service.IMallCategoryService;
|
||||||
@@ -22,22 +28,23 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@RequestMapping("/app-mall")
|
@RequestMapping("/app-mall")
|
||||||
@Tag(name = "APP用户接口", description = "APP用户接口")
|
@Tag(name = "APP自营商城接口", description = "APP自营商城接口")
|
||||||
public class APPMallController {
|
public class APPMallController {
|
||||||
|
|
||||||
private final IMallProductService productService;
|
private final IMallProductService productService;
|
||||||
|
|
||||||
private final IMallCategoryService categoryService;
|
private final IMallCategoryService categoryService;
|
||||||
|
|
||||||
|
private final ICommonUserOrderService orderService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品列表
|
* 商品分类
|
||||||
*/
|
*/
|
||||||
@GetMapping("/categories")
|
@GetMapping("/categories")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
@Operation(summary = "列表")
|
@Operation(summary = "列表")
|
||||||
public R<List<MallCategoryApiVO>> categories() {
|
public R<List<MallCategoryApiVO>> categories() {
|
||||||
List<MallCategoryEntity> list = categoryService.list();
|
return R.data(AppMallConvert.INSTANCE.convertMallCategoryApiListVO(categoryService.categoryList()));
|
||||||
return R.data(AppMallConvert.INSTANCE.convertMallCategoryApiListVO(list));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,5 +68,36 @@ public class APPMallController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单
|
||||||
|
*/
|
||||||
|
@PostMapping("/create-order")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "下单", description = "传入CreateMallOrderRequest")
|
||||||
|
public R<CreateOrderResponse> createOrder(@Valid @RequestBody CreateMallOrderRequest request) {
|
||||||
|
return R.data(orderService.createMallOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
||||||
|
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
||||||
|
return R.status(orderService.confirmMallOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户订单详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/order-detail")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "用户订单详情")
|
||||||
|
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
||||||
|
return R.data(orderService.orderDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
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 lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsCategoryApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsContentApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsContentDetailApiVO;
|
||||||
|
import org.springblade.modules.common.service.INewsCategoryService;
|
||||||
|
import org.springblade.modules.common.service.INewsContentService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/app-news")
|
||||||
|
@Tag(name = "APP资讯接口", description = "APP资讯接口")
|
||||||
|
public class APPNewsController {
|
||||||
|
|
||||||
|
private final INewsCategoryService newsCategoryService;
|
||||||
|
private final INewsContentService newsContentService;
|
||||||
|
|
||||||
|
@GetMapping("/category-list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "资讯分类列表")
|
||||||
|
public R<List<CommonNewsCategoryApiVO>> newsCategoryList() {
|
||||||
|
return R.data(newsCategoryService.newsCategoryList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "资讯列表")
|
||||||
|
public R<IPage<CommonNewsContentApiVO>> newsContentList(IPage<CommonNewsContentApiVO> page , @RequestParam(required = false) Long categoryId) {
|
||||||
|
return R.data(newsContentService.newsCategoryList(page , categoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "资讯详情")
|
||||||
|
public R<CommonNewsContentDetailApiVO> newsContentDetail(CommonNewsContentApiVO vo) {
|
||||||
|
return R.data(newsContentService.newsContentDetail(vo.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package org.springblade.modules.api.app;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.tool.api.R;
|
||||||
|
import org.springblade.modules.api.request.MerchantStoreRequest;
|
||||||
|
import org.springblade.modules.api.vo.CommonMerchantStoreApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonMerchantStoreDetailApiVO;
|
||||||
|
import org.springblade.modules.common.service.IMerchantFlagshipStoreService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/app-store")
|
||||||
|
@Tag(name = "APP商家店铺接口", description = "APP商家店铺接口")
|
||||||
|
public class APPStoreController {
|
||||||
|
|
||||||
|
private final IMerchantFlagshipStoreService merchantFlagshipStoreService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "商家店铺列表")
|
||||||
|
public R<IPage<CommonMerchantStoreApiVO>> merchantStoreList(MerchantStoreRequest request , IPage<CommonMerchantStoreApiVO> page) {
|
||||||
|
return R.data(merchantFlagshipStoreService.merchantStoreList(request , page));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "商家店铺详情")
|
||||||
|
public R<CommonMerchantStoreDetailApiVO> merchantStoreDetail(CommonMerchantStoreApiVO vo) {
|
||||||
|
return R.data(merchantFlagshipStoreService.merchantStoreDetail(vo.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
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.tool.api.R;
|
||||||
|
import org.springblade.modules.api.request.*;
|
||||||
|
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||||
|
import org.springblade.modules.api.vo.*;
|
||||||
|
import org.springblade.modules.common.service.ICommonTourInfoService;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.modules.common.service.ITourProductService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/app-tour")
|
||||||
|
@Tag(name = "APP旅游团接口", description = "APP旅游团接口")
|
||||||
|
public class APPTourController {
|
||||||
|
|
||||||
|
private final ITourProductService tourProductService;
|
||||||
|
private final ICommonUserOrderService orderService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/product-list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "旅游团列表")
|
||||||
|
public R<IPage<CommonTourProductApiVO>> tourProductList(IPage<CommonTourProductApiVO> page , TourProductRequest request) {
|
||||||
|
return R.data(tourProductService.tourProductList(page ,request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/product-top-list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "旅游团推荐列表")
|
||||||
|
public R<IPage<CommonTourProductApiVO>> tourProductTopList(IPage<CommonTourProductApiVO> page , TourProductRequest request) {
|
||||||
|
return R.data(tourProductService.tourProductTopList(page ,request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/product-detail")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "旅游团详情")
|
||||||
|
public R<CommonTourProductDetailApiVO> tourProductDetail(CommonTourProductApiVO vo) {
|
||||||
|
return R.data(tourProductService.tourProductDetail(vo.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅行团下单
|
||||||
|
*/
|
||||||
|
@PostMapping("/create-order")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "下单", description = "传入CreateTravelOrderRequest")
|
||||||
|
public R<CreateOrderResponse> createOrder(@Valid @RequestBody CreateTravelOrderRequest request) {
|
||||||
|
return R.data(orderService.createTravelOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
||||||
|
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
||||||
|
return R.status(orderService.confirmTravelOrder(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/order-detail")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "旅行团订单详情")
|
||||||
|
public R<CommonTravelOrderDetailApiVO> orderDetail(Long id) {
|
||||||
|
return R.data(orderService.travelOrderDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
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 lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourismSpotApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourismSpotDetailApiVO;
|
||||||
|
import org.springblade.modules.common.service.ICulturalTourismSpotService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/app-tourism-spot")
|
||||||
|
@Tag(name = "APP文旅接口", description = "APP文旅接口")
|
||||||
|
public class APPTourismSpotController {
|
||||||
|
|
||||||
|
private final ICulturalTourismSpotService culturalTourismSpotService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "文旅景点列表")
|
||||||
|
public R<IPage<CommonTourismSpotApiVO>> tourismSpotList(IPage<CommonTourismSpotApiVO> page) {
|
||||||
|
return R.data(culturalTourismSpotService.tourismSpotList(page));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/top-list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "文旅景点推荐列表")
|
||||||
|
public R<IPage<CommonTourismSpotApiVO>> tourismSpotTopList(IPage<CommonTourismSpotApiVO> page) {
|
||||||
|
return R.data(culturalTourismSpotService.tourismSpotTopList(page));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "文旅景点详情")
|
||||||
|
public R<CommonTourismSpotDetailApiVO> tourismSpotDetail(CommonTourismSpotApiVO vo) {
|
||||||
|
return R.data(culturalTourismSpotService.tourismSpotDetail(vo.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,8 +11,8 @@ import org.springblade.core.mp.support.Condition;
|
|||||||
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.mp.support.Query;
|
||||||
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.api.R;
|
||||||
import org.springblade.modules.api.request.*;
|
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.response.PaymentResponse;
|
||||||
|
import org.springblade.modules.api.service.IPaymentService;
|
||||||
import org.springblade.modules.api.vo.*;
|
import org.springblade.modules.api.vo.*;
|
||||||
import org.springblade.modules.common.service.*;
|
import org.springblade.modules.common.service.*;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
@@ -42,6 +42,8 @@ public class APPUserController {
|
|||||||
|
|
||||||
private final ICommonLotteryPrizeService lotteryPrizeService;
|
private final ICommonLotteryPrizeService lotteryPrizeService;
|
||||||
|
|
||||||
|
private final IPaymentService paymentService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否修改过密码
|
* 是否修改过密码
|
||||||
@@ -74,56 +76,37 @@ public class APPUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下单
|
* 支付宝支付
|
||||||
*/
|
*/
|
||||||
@PostMapping("/create-order")
|
@PostMapping("/ali-pay")
|
||||||
@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)
|
@ApiOperationSupport(order = 5)
|
||||||
@Operation(summary = "支付", description = "传入PaymentRequest")
|
@Operation(summary = "支付", description = "传入PaymentRequest")
|
||||||
public R<PaymentResponse> pay(@Valid @RequestBody PaymentRequest request) {
|
public R<PaymentResponse> aliPay(@Valid @RequestBody PaymentRequest request) {
|
||||||
return R.data(orderService.pay(request));
|
return R.data(paymentService.aliAppPay(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认收货
|
* 微信支付
|
||||||
*/
|
*/
|
||||||
@PostMapping("/confirm")
|
@PostMapping("/wx-pay")
|
||||||
@ApiOperationSupport(order = 5)
|
@ApiOperationSupport(order = 6)
|
||||||
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
@Operation(summary = "支付", description = "传入PaymentRequest")
|
||||||
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
public R<PaymentResponse> wxPay(@Valid @RequestBody PaymentRequest request) {
|
||||||
return R.status(orderService.confirm(request));
|
return R.data(paymentService.wxAppPay(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单列表
|
* 用户订单列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/order-page")
|
@GetMapping("/order-page")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 7)
|
||||||
@Operation(summary = "用户订单分页列表", description = "传入userAddress")
|
@Operation(summary = "用户订单分页列表", description = "传入userAddress")
|
||||||
public R<IPage<CommonUserOrderApiVO>> orderList(CommonUserOrderApiVO userOrder, Query query) {
|
public R<IPage<CommonUserOrderApiVO>> orderList(CommonUserOrderApiVO userOrder, Query query) {
|
||||||
IPage<CommonUserOrderApiVO> pages = orderService.selectOrderApiPage(Condition.getPage(query), userOrder);
|
IPage<CommonUserOrderApiVO> pages = orderService.selectOrderApiPage(Condition.getPage(query), userOrder);
|
||||||
return R.data(pages);
|
return R.data(pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户订单详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/order-detail")
|
|
||||||
@ApiOperationSupport(order = 7)
|
|
||||||
@Operation(summary = "用户订单详情")
|
|
||||||
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
|
||||||
return R.data(orderService.orderDetail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/system-notice")
|
@GetMapping("/system-notice")
|
||||||
@ApiOperationSupport(order = 8)
|
@ApiOperationSupport(order = 8)
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package org.springblade.modules.api.constant;
|
||||||
|
|
||||||
|
public interface AppAliPayConstant {
|
||||||
|
|
||||||
|
String APP_ALI_AES_KEY = "yichuyilu.app.ali.aes.key";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
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 CommonRemoveTourRequest implements Serializable {
|
||||||
|
@NotEmpty(message = "至少选择一条出行人信息")
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommonTourUserInfoRequest implements Serializable {
|
||||||
|
private Long id;
|
||||||
|
private String contactPhone;
|
||||||
|
private String userName;
|
||||||
|
private String idCardNo;
|
||||||
|
private String passportNo;
|
||||||
|
private String hkMacauPassNo;
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ import lombok.Data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CreateOrderRequest implements Serializable {
|
public class CreateMallOrderRequest implements Serializable {
|
||||||
|
|
||||||
@NotEmpty(message = "请填写联系人")
|
@NotEmpty(message = "请填写联系人")
|
||||||
private String consignee;
|
private String consignee;
|
||||||
@@ -34,4 +34,5 @@ public class CreateOrderRequest implements Serializable {
|
|||||||
|
|
||||||
@NotNull(message = "无效标识")
|
@NotNull(message = "无效标识")
|
||||||
private Boolean isOfflinePayment;
|
private Boolean isOfflinePayment;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
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;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CreateTravelOrderRequest implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NotEmpty(message = "订单类型为空")
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
@NotEmpty(message = "商品编号为空")
|
||||||
|
private String itemCode;
|
||||||
|
|
||||||
|
@Min(value = 1, message = "无效商品数量")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
|
||||||
|
@NotNull(message = "无效支付方式")
|
||||||
|
private Integer paymentType;
|
||||||
|
|
||||||
|
@NotNull(message = "无效标识")
|
||||||
|
private Boolean isOfflinePayment;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅行团出行日期
|
||||||
|
*/
|
||||||
|
private Date tourStartDate;
|
||||||
|
/**
|
||||||
|
* 旅行团返回日期
|
||||||
|
*/
|
||||||
|
private Date tourEndDate;
|
||||||
|
|
||||||
|
private List<Long> tourInfoIds;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MerchantStoreRequest implements Serializable {
|
||||||
|
|
||||||
|
private BigDecimal longitude;
|
||||||
|
private BigDecimal latitude;
|
||||||
|
// private BigDecimal distance = new BigDecimal("2000");
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TourProductRequest implements Serializable {
|
||||||
|
|
||||||
|
private String cityName;
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.springblade.modules.api.response;
|
package org.springblade.modules.api.response;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class PaymentResponse implements Serializable {
|
public class PaymentResponse implements Serializable {
|
||||||
|
|
||||||
private Integer paymentType;
|
private Integer paymentType;
|
||||||
@@ -13,4 +15,9 @@ public class PaymentResponse implements Serializable {
|
|||||||
|
|
||||||
private String params;
|
private String params;
|
||||||
|
|
||||||
|
public PaymentResponse(Integer paymentType, String payChannel, String params) {
|
||||||
|
this.paymentType = paymentType;
|
||||||
|
this.payChannel = payChannel;
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.springblade.modules.api.service;
|
||||||
|
|
||||||
|
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||||
|
import org.springblade.modules.api.request.PaymentRequest;
|
||||||
|
import org.springblade.modules.api.response.PaymentResponse;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IPaymentService {
|
||||||
|
|
||||||
|
PaymentResponse aliAppPay(PaymentRequest request) ;
|
||||||
|
|
||||||
|
AlipayTradeQueryResponse aliQuery(String orderNo);
|
||||||
|
|
||||||
|
Boolean aliCloseOrder(String orderNo);
|
||||||
|
|
||||||
|
PaymentResponse wxAppPay(PaymentRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package org.springblade.modules.api.service.impl;
|
||||||
|
|
||||||
|
import com.alipay.api.response.AlipayTradeCloseResponse;
|
||||||
|
import com.alipay.api.response.AlipayTradeQueryResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.cache.PaymentCache;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
|
import org.springblade.core.tool.utils.StringPool;
|
||||||
|
import org.springblade.modules.api.request.PaymentRequest;
|
||||||
|
import org.springblade.modules.api.response.PaymentResponse;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.eums.PaymentType;
|
||||||
|
import org.springblade.modules.api.service.IPaymentService;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.plugin.pay.api.alipay.IAliPayApiService;
|
||||||
|
import org.springblade.plugin.pay.constant.PayConstant;
|
||||||
|
import org.springblade.plugin.pay.entity.AliPayAccountConfig;
|
||||||
|
import org.springblade.plugin.pay.entity.Order;
|
||||||
|
import org.springblade.plugin.pay.service.IOrderService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class IPaymentServiceImpl implements IPaymentService {
|
||||||
|
|
||||||
|
private final ICommonUserOrderService commonUserOrderService;
|
||||||
|
|
||||||
|
private final IOrderService orderService;
|
||||||
|
|
||||||
|
private final IAliPayApiService aliPayApiService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public PaymentResponse aliAppPay(PaymentRequest request) {
|
||||||
|
|
||||||
|
if (!request.getPaymentType().equals(PaymentType.ALI.getCode())) {
|
||||||
|
throw new ServiceException("请选择正确的支付方式");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonUserOrderEntity userOrder = commonUserOrderService.getById(Long.valueOf(request.getOrderId()));
|
||||||
|
if (userOrder == null) {
|
||||||
|
throw new ServiceException("无效订单");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userOrder.getPaymentType().equals(request.getPaymentType())) {
|
||||||
|
throw new ServiceException("无效订单");
|
||||||
|
}
|
||||||
|
|
||||||
|
AliPayAccountConfig config = PaymentCache.getAliConfig();
|
||||||
|
Order order = orderService.save(config.getAppId(), config.getMchId(), config.getPayName(), userOrder.getItemName(), Objects.toString(userOrder.getActualAmount(), "0"), PayConstant.ALIPAY, PayConstant.APPPAY, config.getNotifyUrl(), PaymentType.ALI.getAbbr() + BusinessModule.fromCodeIgnoreCaseOrNull(userOrder.getOrderType()).getAbbr() + userOrder.getId());
|
||||||
|
String content = aliPayApiService.appPay(order, config, StringPool.EMPTY);
|
||||||
|
return new PaymentResponse(PaymentType.ALI.getCode(), PaymentType.ALI.getName(), content);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AlipayTradeQueryResponse aliQuery(String orderNo) {
|
||||||
|
AliPayAccountConfig config = PaymentCache.getAliConfig();
|
||||||
|
|
||||||
|
AlipayTradeQueryResponse response;
|
||||||
|
try {
|
||||||
|
response = aliPayApiService.query(orderNo, config);
|
||||||
|
log.info("支付宝账单:[{}]的支付结果为:{}", orderNo, response.getBody());
|
||||||
|
return response;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询订单异常:{}", e.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean aliCloseOrder(String orderNo) {
|
||||||
|
AliPayAccountConfig config = PaymentCache.getAliConfig();
|
||||||
|
|
||||||
|
AlipayTradeCloseResponse response;
|
||||||
|
try {
|
||||||
|
response = aliPayApiService.closeOrder(orderNo, config);
|
||||||
|
log.info("关闭支付宝账单:[{}]的支付结果为:{}", orderNo, response.getBody());
|
||||||
|
return response.getMsg().equalsIgnoreCase("SUCCESS")
|
||||||
|
|| response.getCode().equalsIgnoreCase("10000");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("关闭支付宝账单异常:{}", e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PaymentResponse wxAppPay(PaymentRequest request) {
|
||||||
|
throw new ServiceException("当前微信支付未开放");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonMerchantStoreApiVO implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "无效店铺")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
private String fullAddress;
|
||||||
|
|
||||||
|
private String thumbnailUrl;
|
||||||
|
|
||||||
|
private BigDecimal distance;
|
||||||
|
|
||||||
|
private BigDecimal lng;
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonMerchantStoreDetailApiVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
private String fullAddress;
|
||||||
|
|
||||||
|
private List<String> mainImageUrl;
|
||||||
|
|
||||||
|
private List<String> detailImages;
|
||||||
|
|
||||||
|
private String businessHours;
|
||||||
|
|
||||||
|
private String storeDescription;
|
||||||
|
|
||||||
|
private BigDecimal lng;
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommonModulePayTypeApiVO {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
private Integer isEnable;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonNewsCategoryApiVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonNewsContentApiVO implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "无效资讯")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 视频链接
|
||||||
|
*/
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缩略图
|
||||||
|
*/
|
||||||
|
private String thumbnailUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论数量
|
||||||
|
*/
|
||||||
|
private Long commentCount;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springblade.common.handler.PgStringArrayToListTypeHandler;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonNewsContentDetailApiVO implements Serializable {
|
||||||
|
|
||||||
|
private String videoUrl;
|
||||||
|
private Long playCount;
|
||||||
|
|
||||||
|
private List<String> mainImageUrl;
|
||||||
|
|
||||||
|
private List<String> detailImages;
|
||||||
|
|
||||||
|
private String articleContent;
|
||||||
|
|
||||||
|
private Long commentCount;
|
||||||
|
|
||||||
|
|
||||||
|
private Long viewCount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonTourInfoApiVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String contactPhone;
|
||||||
|
private String userName;
|
||||||
|
private String idCardNo;
|
||||||
|
private String hkMacauPassNo;
|
||||||
|
private String passportNo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonTourProductApiVO implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "无效旅游团")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
private String thumbnailUrl;
|
||||||
|
|
||||||
|
private Integer visitCount;
|
||||||
|
|
||||||
|
private Integer rating;
|
||||||
|
|
||||||
|
private BigDecimal basePrice;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonTourProductDetailApiVO implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
private String subTitle;
|
||||||
|
private Integer durationDays;
|
||||||
|
private Integer durationNights;
|
||||||
|
|
||||||
|
private List<String> mainImageUrl;
|
||||||
|
|
||||||
|
private List<String> detailImages;
|
||||||
|
|
||||||
|
private BigDecimal basePrice;
|
||||||
|
|
||||||
|
private BigDecimal adultPrice;
|
||||||
|
|
||||||
|
private BigDecimal childPrice;
|
||||||
|
|
||||||
|
private BigDecimal elderlyPrice;
|
||||||
|
|
||||||
|
private Integer minPeople;
|
||||||
|
|
||||||
|
private Integer maxPeople;
|
||||||
|
|
||||||
|
private Integer requireIdCard;
|
||||||
|
|
||||||
|
private Integer requirePassport;
|
||||||
|
|
||||||
|
private Integer requireHkMacauPass;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Integer visitCount;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonTourismSpotApiVO implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "无效景点")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String spotName;
|
||||||
|
|
||||||
|
private BigDecimal rating;
|
||||||
|
|
||||||
|
private Integer visitCount;
|
||||||
|
|
||||||
|
private String thumbnailUrl;
|
||||||
|
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonTourismSpotDetailApiVO implements Serializable {
|
||||||
|
|
||||||
|
private List<String> mainImageUrl;
|
||||||
|
private List<String> detailImages;
|
||||||
|
private String videoUrl;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourOrderDetailEntity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommonTravelOrderDetailApiVO 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 Integer orderStatus;
|
||||||
|
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
private BigDecimal actualAmount;
|
||||||
|
|
||||||
|
private Integer paymentType;
|
||||||
|
|
||||||
|
private Date paymentTime;
|
||||||
|
|
||||||
|
private Integer paymentStatus;
|
||||||
|
|
||||||
|
|
||||||
|
private String contractUrl;
|
||||||
|
/**
|
||||||
|
* 合同签署状态:0=未签署,1=已签署,2=已过期
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Integer contractStatus;
|
||||||
|
/**
|
||||||
|
* 导游姓名
|
||||||
|
*/
|
||||||
|
private String guideName;
|
||||||
|
/**
|
||||||
|
* 导游联系电话
|
||||||
|
*/
|
||||||
|
private String guidePhone;
|
||||||
|
|
||||||
|
private Date tourStartDate;
|
||||||
|
/**
|
||||||
|
* 预计返回日期
|
||||||
|
*/
|
||||||
|
private Date tourEndDate;
|
||||||
|
/**
|
||||||
|
* 备注信息
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private List<TourOrderDetailEntity.TravelerDetail> travelerDetail;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package org.springblade.modules.api.vo;
|
package org.springblade.modules.api.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -25,4 +28,13 @@ public class CommonUserOrderApiVO implements Serializable {
|
|||||||
|
|
||||||
private BigDecimal actualAmount;
|
private BigDecimal actualAmount;
|
||||||
|
|
||||||
|
@DateTimeFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
@JsonFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.springblade.modules.common.constant;
|
||||||
|
|
||||||
|
public interface BladeCommonConstant {
|
||||||
|
|
||||||
|
// 业务模块支付类型
|
||||||
|
String BUSINESS_MODULE_PAY_TYPE = "common.business.module.pay.type";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
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.CommonOrderConfirmLogEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonOrderConfirmLogVO;
|
||||||
|
import org.springblade.modules.common.wrapper.CommonOrderConfirmLogWrapper;
|
||||||
|
import org.springblade.modules.common.service.ICommonOrderConfirmLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/order-confirm-log")
|
||||||
|
@Tag(name = "订单确认收货记录", description = "订单确认收货记录接口")
|
||||||
|
public class CommonOrderConfirmLogController extends BladeController {
|
||||||
|
|
||||||
|
private final ICommonOrderConfirmLogService commonOrderConfirmLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commonOrderConfirmLog")
|
||||||
|
public R<CommonOrderConfirmLogVO> detail(CommonOrderConfirmLogEntity commonOrderConfirmLog) {
|
||||||
|
CommonOrderConfirmLogEntity detail = commonOrderConfirmLogService.getOne(Condition.getQueryWrapper(commonOrderConfirmLog));
|
||||||
|
return R.data(CommonOrderConfirmLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commonOrderConfirmLog")
|
||||||
|
public R<IPage<CommonOrderConfirmLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonOrderConfirmLog, Query query) {
|
||||||
|
IPage<CommonOrderConfirmLogEntity> pages = commonOrderConfirmLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commonOrderConfirmLog, CommonOrderConfirmLogEntity.class));
|
||||||
|
return R.data(CommonOrderConfirmLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commonOrderConfirmLog")
|
||||||
|
public R<IPage<CommonOrderConfirmLogVO>> page(CommonOrderConfirmLogVO commonOrderConfirmLog, Query query) {
|
||||||
|
IPage<CommonOrderConfirmLogVO> pages = commonOrderConfirmLogService.selectCommonOrderConfirmLogPage(Condition.getPage(query), commonOrderConfirmLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commonOrderConfirmLog")
|
||||||
|
public R save(@Valid @RequestBody CommonOrderConfirmLogEntity commonOrderConfirmLog) {
|
||||||
|
return R.status(commonOrderConfirmLogService.save(commonOrderConfirmLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commonOrderConfirmLog")
|
||||||
|
public R update(@Valid @RequestBody CommonOrderConfirmLogEntity commonOrderConfirmLog) {
|
||||||
|
return R.status(commonOrderConfirmLogService.updateById(commonOrderConfirmLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commonOrderConfirmLog")
|
||||||
|
public R submit(@Valid @RequestBody CommonOrderConfirmLogEntity commonOrderConfirmLog) {
|
||||||
|
return R.status(commonOrderConfirmLogService.saveOrUpdate(commonOrderConfirmLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commonOrderConfirmLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.springblade.modules.common.controller;
|
package org.springblade.modules.common.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
@@ -36,6 +37,8 @@ import org.springblade.core.mp.support.Condition;
|
|||||||
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.mp.support.Query;
|
||||||
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.api.R;
|
||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springblade.modules.common.convert.CommonRegionConvert;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonRegionsDicVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||||
@@ -44,6 +47,8 @@ import org.springblade.modules.common.wrapper.CommonRegionsInfoWrapper;
|
|||||||
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
import org.springblade.modules.common.service.ICommonRegionsInfoService;
|
||||||
import org.springblade.core.boot.ctrl.BladeController;
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地区详情表 控制器
|
* 地区详情表 控制器
|
||||||
*
|
*
|
||||||
@@ -129,4 +134,17 @@ public class CommonRegionsInfoController extends BladeController {
|
|||||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
return R.status(regionsInfoService.deleteLogic(Func.toLongList(ids)));
|
return R.status(regionsInfoService.deleteLogic(Func.toLongList(ids)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("selectProvinceAndCity/{parentCode}")
|
||||||
|
@ApiOperationSupport(order = 8)
|
||||||
|
public R<List<CommonRegionsDicVO>> selectProvinceAndCity(@PathVariable String parentCode) {
|
||||||
|
List<CommonRegionsInfoEntity> regionList = regionsInfoService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonRegionsInfoEntity.class)
|
||||||
|
.eq(CommonRegionsInfoEntity::getPid, Integer.valueOf(parentCode))
|
||||||
|
);
|
||||||
|
|
||||||
|
return R.data(CommonRegionConvert.INSTANCE.convertRegionsListToVO(regionList));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
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.CommonTourInfoEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonTourInfoVO;
|
||||||
|
import org.springblade.modules.common.wrapper.CommonTourInfoWrapper;
|
||||||
|
import org.springblade.modules.common.service.ICommonTourInfoService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/tour-info/commonTourInfo")
|
||||||
|
@Tag(name = "基础出行人档案", description = "基础出行人档案接口")
|
||||||
|
public class CommonTourInfoController extends BladeController {
|
||||||
|
|
||||||
|
private final ICommonTourInfoService commonTourInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入commonTourInfo")
|
||||||
|
public R<CommonTourInfoVO> detail(CommonTourInfoEntity commonTourInfo) {
|
||||||
|
CommonTourInfoEntity detail = commonTourInfoService.getOne(Condition.getQueryWrapper(commonTourInfo));
|
||||||
|
return R.data(CommonTourInfoWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入commonTourInfo")
|
||||||
|
public R<IPage<CommonTourInfoVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> commonTourInfo, Query query) {
|
||||||
|
IPage<CommonTourInfoEntity> pages = commonTourInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(commonTourInfo, CommonTourInfoEntity.class));
|
||||||
|
return R.data(CommonTourInfoWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入commonTourInfo")
|
||||||
|
public R<IPage<CommonTourInfoVO>> page(CommonTourInfoVO commonTourInfo, Query query) {
|
||||||
|
IPage<CommonTourInfoVO> pages = commonTourInfoService.selectCommonTourInfoPage(Condition.getPage(query), commonTourInfo);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入commonTourInfo")
|
||||||
|
public R save(@Valid @RequestBody CommonTourInfoEntity commonTourInfo) {
|
||||||
|
return R.status(commonTourInfoService.save(commonTourInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入commonTourInfo")
|
||||||
|
public R update(@Valid @RequestBody CommonTourInfoEntity commonTourInfo) {
|
||||||
|
return R.status(commonTourInfoService.updateById(commonTourInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入commonTourInfo")
|
||||||
|
public R submit(@Valid @RequestBody CommonTourInfoEntity commonTourInfo) {
|
||||||
|
return R.status(commonTourInfoService.saveOrUpdate(commonTourInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(commonTourInfoService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ import org.springblade.core.tool.api.R;
|
|||||||
import org.springblade.core.tool.utils.Func;
|
import org.springblade.core.tool.utils.Func;
|
||||||
import org.springblade.modules.common.manager.CommonUserManager;
|
import org.springblade.modules.common.manager.CommonUserManager;
|
||||||
import org.springblade.modules.common.pojo.vo.CommonImportUserBackOrderError;
|
import org.springblade.modules.common.pojo.vo.CommonImportUserBackOrderError;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonUserTourOrderVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -103,6 +104,22 @@ public class CommonUserOrderController extends BladeController {
|
|||||||
return R.data(pages);
|
return R.data(pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/eco-page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入order")
|
||||||
|
public R<IPage<CommonUserOrderVO>> ecoOrderPage(CommonUserOrderVO order, Query query) {
|
||||||
|
IPage<CommonUserOrderVO> pages = orderService.selectEcoOrderPage(Condition.getPage(query), order);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/tour-order-page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入order")
|
||||||
|
public R<IPage<CommonUserTourOrderVO>> tourOrderPage(CommonUserTourOrderVO order, Query query) {
|
||||||
|
IPage<CommonUserTourOrderVO> pages = orderService.selectTourOrderPage(Condition.getPage(query), order);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单 新增
|
* 用户订单 新增
|
||||||
*/
|
*/
|
||||||
@@ -175,14 +192,39 @@ public class CommonUserOrderController extends BladeController {
|
|||||||
@GetMapping("/export-order-to-excel")
|
@GetMapping("/export-order-to-excel")
|
||||||
@ApiOperationSupport(order = 11)
|
@ApiOperationSupport(order = 11)
|
||||||
@Operation(summary = "导出用户订单")
|
@Operation(summary = "导出用户订单")
|
||||||
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
public void exportFlowToExcel(@RequestParam(required = false) Integer orderStatus ,
|
||||||
List<CommonUserOrderExcel> excelList = commonUserManager.exportUserOrderToExcel(account ,searchDateRange);
|
@RequestParam(required = false) String account ,
|
||||||
ExcelUtil.export(response, "用户积分流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户订单日志", excelList, CommonUserOrderExcel.class);
|
@RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||||
|
List<CommonUserOrderExcel> excelList = commonUserManager.exportUserMallOrderToExcel(orderStatus , account ,searchDateRange);
|
||||||
|
ExcelUtil.export(response, "用户订单日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户订单日志", excelList, CommonUserOrderExcel.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-eco-order-excel")
|
||||||
|
@ApiOperationSupport(order = 11)
|
||||||
|
@Operation(summary = "导出生态产品订单")
|
||||||
|
public void exportEcoFlowToExcel(@RequestParam(required = false) Integer orderStatus ,
|
||||||
|
@RequestParam(required = false) String account ,
|
||||||
|
@RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||||
|
List<CommonUserOrderExcel> excelList = commonUserManager.exportUserEcoOrderToExcel(orderStatus , account ,searchDateRange);
|
||||||
|
ExcelUtil.export(response, "生态产品订单" + org.springblade.core.tool.utils.DateUtil.time(), "生态产品订单日志", excelList, CommonUserOrderExcel.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/export-tour-order-to-excel")
|
||||||
|
@ApiOperationSupport(order = 12)
|
||||||
|
@Operation(summary = "导出用户订单")
|
||||||
|
public void exportTourFlowToExcel(@RequestParam(required = false) Integer orderStatus ,
|
||||||
|
@RequestParam(required = false) String account ,
|
||||||
|
@RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||||
|
List<CommonUserOrderExcel> excelList = commonUserManager.exportUserTourOrderToExcel(orderStatus , account ,searchDateRange);
|
||||||
|
ExcelUtil.export(response, "用户订单日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户订单日志", excelList, CommonUserOrderExcel.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/import-user-back-order")
|
@PostMapping("/import-user-back-order")
|
||||||
@ApiOperationSupport(order = 12)
|
@ApiOperationSupport(order = 13)
|
||||||
@Operation(summary = "批量导入补单", description = "传入excel")
|
@Operation(summary = "批量导入补单", description = "传入excel")
|
||||||
public R<List<CommonImportUserBackOrderError>> importUserBackOrder(MultipartFile file) {
|
public R<List<CommonImportUserBackOrderError>> importUserBackOrder(MultipartFile file) {
|
||||||
return R.data(commonUserManager.importUserBackOrder(file));
|
return R.data(commonUserManager.importUserBackOrder(file));
|
||||||
@@ -192,11 +234,18 @@ public class CommonUserOrderController extends BladeController {
|
|||||||
* 用户订单 填写快递
|
* 用户订单 填写快递
|
||||||
*/
|
*/
|
||||||
@PostMapping("/fill-express")
|
@PostMapping("/fill-express")
|
||||||
@ApiOperationSupport(order = 10)
|
@ApiOperationSupport(order = 14)
|
||||||
@Operation(summary = "填写快递", description = "传入order")
|
@Operation(summary = "填写快递", description = "传入order")
|
||||||
public R fillExpress(@Valid @RequestBody CommonUserOrderEntity order) {
|
public R fillExpress(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||||
return R.status(orderService.fillExpress(order.getId(), order.getExpressNo()));
|
return R.status(orderService.fillExpress(order.getId(), order.getExpressNo()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/confirm-itinerary")
|
||||||
|
@ApiOperationSupport(order = 15)
|
||||||
|
@Operation(summary = "确认行程", description = "传入order")
|
||||||
|
public R confirmItinerary(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||||
|
return R.status(orderService.confirmItinerary(order.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
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.log.exception.ServiceException;
|
||||||
|
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.CulturalTourismSpotEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CulturalTourismSpotVO;
|
||||||
|
import org.springblade.modules.common.wrapper.CulturalTourismSpotWrapper;
|
||||||
|
import org.springblade.modules.common.service.ICulturalTourismSpotService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/tourism-spot")
|
||||||
|
@Tag(name = "文旅景点信息", description = "文旅景点信息接口")
|
||||||
|
public class CulturalTourismSpotController extends BladeController {
|
||||||
|
|
||||||
|
private final ICulturalTourismSpotService culturalTourismSpotService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入culturalTourismSpot")
|
||||||
|
public R<CulturalTourismSpotVO> detail(CulturalTourismSpotEntity culturalTourismSpot) {
|
||||||
|
CulturalTourismSpotEntity detail = culturalTourismSpotService.getOne(Condition.getQueryWrapper(culturalTourismSpot));
|
||||||
|
return R.data(CulturalTourismSpotWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入culturalTourismSpot")
|
||||||
|
public R<IPage<CulturalTourismSpotVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> culturalTourismSpot, Query query) {
|
||||||
|
IPage<CulturalTourismSpotEntity> pages = culturalTourismSpotService.page(Condition.getPage(query), Condition.getQueryWrapper(culturalTourismSpot, CulturalTourismSpotEntity.class));
|
||||||
|
return R.data(CulturalTourismSpotWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入culturalTourismSpot")
|
||||||
|
public R<IPage<CulturalTourismSpotVO>> page(CulturalTourismSpotVO culturalTourismSpot, Query query) {
|
||||||
|
IPage<CulturalTourismSpotVO> pages = culturalTourismSpotService.selectCulturalTourismSpotPage(Condition.getPage(query), culturalTourismSpot);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入culturalTourismSpot")
|
||||||
|
public R save(@Valid @RequestBody CulturalTourismSpotEntity culturalTourismSpot) {
|
||||||
|
return R.status(culturalTourismSpotService.save(culturalTourismSpot));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入culturalTourismSpot")
|
||||||
|
public R update(@Valid @RequestBody CulturalTourismSpotEntity culturalTourismSpot) {
|
||||||
|
return R.status(culturalTourismSpotService.updateById(culturalTourismSpot));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入culturalTourismSpot")
|
||||||
|
public R submit(@Valid @RequestBody CulturalTourismSpotEntity culturalTourismSpot) {
|
||||||
|
if(!isValidRating(culturalTourismSpot.getRating())){
|
||||||
|
throw new ServiceException("评分在0.1在5.0之间");
|
||||||
|
}
|
||||||
|
return R.status(culturalTourismSpotService.saveOrUpdate(culturalTourismSpot));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(culturalTourismSpotService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isValidRating(BigDecimal rating) {
|
||||||
|
if (rating == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
BigDecimal min = new BigDecimal("0.1");
|
||||||
|
BigDecimal max = new BigDecimal("5.0");
|
||||||
|
|
||||||
|
if (rating.compareTo(min) < 0 || rating.compareTo(max) > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int scale = rating.stripTrailingZeros().scale();
|
||||||
|
return scale <= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
|
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.MerchantFlagshipStoreEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.MerchantFlagshipStoreVO;
|
||||||
|
import org.springblade.modules.common.wrapper.MerchantFlagshipStoreWrapper;
|
||||||
|
import org.springblade.modules.common.service.IMerchantFlagshipStoreService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/merchant-store")
|
||||||
|
@Tag(name = "商家旗舰店信息", description = "商家旗舰店信息接口")
|
||||||
|
public class MerchantFlagshipStoreController extends BladeController {
|
||||||
|
|
||||||
|
private final IMerchantFlagshipStoreService merchantFlagshipStoreService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入merchantFlagshipStore")
|
||||||
|
public R<MerchantFlagshipStoreVO> detail(MerchantFlagshipStoreEntity merchantFlagshipStore) {
|
||||||
|
MerchantFlagshipStoreEntity detail = merchantFlagshipStoreService.getByDetail(merchantFlagshipStore.getId());
|
||||||
|
return R.data(MerchantFlagshipStoreWrapper.build().entityVO(detail));
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入merchantFlagshipStore")
|
||||||
|
public R<IPage<MerchantFlagshipStoreVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> merchantFlagshipStore, Query query) {
|
||||||
|
IPage<MerchantFlagshipStoreEntity> pages = merchantFlagshipStoreService.page(Condition.getPage(query), Condition.getQueryWrapper(merchantFlagshipStore, MerchantFlagshipStoreEntity.class));
|
||||||
|
return R.data(MerchantFlagshipStoreWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入merchantFlagshipStore")
|
||||||
|
public R<IPage<MerchantFlagshipStoreVO>> page(MerchantFlagshipStoreVO merchantFlagshipStore, Query query) {
|
||||||
|
IPage<MerchantFlagshipStoreVO> pages = merchantFlagshipStoreService.selectMerchantFlagshipStorePage(Condition.getPage(query), merchantFlagshipStore);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入merchantFlagshipStore")
|
||||||
|
public R save(@Valid @RequestBody MerchantFlagshipStoreVO merchantFlagshipStore) {
|
||||||
|
return R.status(merchantFlagshipStoreService.saveStore(merchantFlagshipStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入merchantFlagshipStore")
|
||||||
|
public R update(@Valid @RequestBody MerchantFlagshipStoreVO merchantFlagshipStore) {
|
||||||
|
return R.status(merchantFlagshipStoreService.updateStore(merchantFlagshipStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入merchantFlagshipStore")
|
||||||
|
public R submit(@Valid @RequestBody MerchantFlagshipStoreEntity merchantFlagshipStore) {
|
||||||
|
return R.status(merchantFlagshipStoreService.saveOrUpdate(merchantFlagshipStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(merchantFlagshipStoreService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
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.NewsCategoryEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.NewsCategoryVO;
|
||||||
|
import org.springblade.modules.common.wrapper.NewsCategoryWrapper;
|
||||||
|
import org.springblade.modules.common.service.INewsCategoryService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/news-category")
|
||||||
|
@Tag(name = "资讯分类", description = "资讯分类接口")
|
||||||
|
public class NewsCategoryController extends BladeController {
|
||||||
|
|
||||||
|
private final INewsCategoryService newsCategoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入newsCategory")
|
||||||
|
public R<NewsCategoryVO> detail(NewsCategoryEntity newsCategory) {
|
||||||
|
NewsCategoryEntity detail = newsCategoryService.getOne(Condition.getQueryWrapper(newsCategory));
|
||||||
|
return R.data(NewsCategoryWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 资讯分类 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入newsCategory")
|
||||||
|
public R<IPage<NewsCategoryVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> newsCategory, Query query) {
|
||||||
|
IPage<NewsCategoryEntity> pages = newsCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(newsCategory, NewsCategoryEntity.class));
|
||||||
|
return R.data(NewsCategoryWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入newsCategory")
|
||||||
|
public R<IPage<NewsCategoryVO>> page(NewsCategoryVO newsCategory, Query query) {
|
||||||
|
IPage<NewsCategoryVO> pages = newsCategoryService.selectNewsCategoryPage(Condition.getPage(query), newsCategory);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入newsCategory")
|
||||||
|
public R save(@Valid @RequestBody NewsCategoryEntity newsCategory) {
|
||||||
|
return R.status(newsCategoryService.save(newsCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入newsCategory")
|
||||||
|
public R update(@Valid @RequestBody NewsCategoryEntity newsCategory) {
|
||||||
|
return R.status(newsCategoryService.updateById(newsCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入newsCategory")
|
||||||
|
public R submit(@Valid @RequestBody NewsCategoryEntity newsCategory) {
|
||||||
|
return R.status(newsCategoryService.saveOrUpdate(newsCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(newsCategoryService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/dictionary")
|
||||||
|
@ApiOperationSupport(order = 8)
|
||||||
|
@Operation(summary = "获取字典", description = "获取字典")
|
||||||
|
public R<List<NewsCategoryEntity>> dictionary() {
|
||||||
|
List<NewsCategoryEntity> list = newsCategoryService.list();
|
||||||
|
return R.data(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
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.NewsContentEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.NewsContentVO;
|
||||||
|
import org.springblade.modules.common.wrapper.NewsContentWrapper;
|
||||||
|
import org.springblade.modules.common.service.INewsContentService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/news-content")
|
||||||
|
@Tag(name = "资讯内容", description = "资讯内容接口")
|
||||||
|
public class NewsContentController extends BladeController {
|
||||||
|
|
||||||
|
private final INewsContentService newsContentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入newsContent")
|
||||||
|
public R<NewsContentVO> detail(NewsContentEntity newsContent) {
|
||||||
|
NewsContentEntity detail = newsContentService.getOne(Condition.getQueryWrapper(newsContent));
|
||||||
|
return R.data(NewsContentWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 资讯内容 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入newsContent")
|
||||||
|
public R<IPage<NewsContentVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> newsContent, Query query) {
|
||||||
|
IPage<NewsContentEntity> pages = newsContentService.page(Condition.getPage(query), Condition.getQueryWrapper(newsContent, NewsContentEntity.class));
|
||||||
|
return R.data(NewsContentWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入newsContent")
|
||||||
|
public R<IPage<NewsContentVO>> page(NewsContentVO newsContent, Query query) {
|
||||||
|
IPage<NewsContentVO> pages = newsContentService.selectNewsContentPage(Condition.getPage(query), newsContent);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入newsContent")
|
||||||
|
public R save(@Valid @RequestBody NewsContentEntity newsContent) {
|
||||||
|
return R.status(newsContentService.save(newsContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入newsContent")
|
||||||
|
public R update(@Valid @RequestBody NewsContentEntity newsContent) {
|
||||||
|
return R.status(newsContentService.updateById(newsContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入newsContent")
|
||||||
|
public R submit(@Valid @RequestBody NewsContentEntity newsContent) {
|
||||||
|
return R.status(newsContentService.saveOrUpdate(newsContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(newsContentService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
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.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourOrderDetailEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.TourOrderDetailVO;
|
||||||
|
import org.springblade.modules.common.wrapper.TourOrderDetailWrapper;
|
||||||
|
import org.springblade.modules.common.service.ITourOrderDetailService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/tour-order-detail")
|
||||||
|
@Tag(name = "旅游团订单详情", description = "旅游团订单详情接口")
|
||||||
|
public class TourOrderDetailController extends BladeController {
|
||||||
|
|
||||||
|
private final ITourOrderDetailService tourOrderDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入tourOrderDetail")
|
||||||
|
public R<TourOrderDetailVO> detail(TourOrderDetailEntity tourOrderDetail) {
|
||||||
|
TourOrderDetailEntity detail = tourOrderDetailService.getOne(Condition.getQueryWrapper(tourOrderDetail));
|
||||||
|
return R.data(TourOrderDetailWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入tourOrderDetail")
|
||||||
|
public R<IPage<TourOrderDetailVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> tourOrderDetail, Query query) {
|
||||||
|
IPage<TourOrderDetailEntity> pages = tourOrderDetailService.page(Condition.getPage(query), Condition.getQueryWrapper(tourOrderDetail, TourOrderDetailEntity.class));
|
||||||
|
return R.data(TourOrderDetailWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入tourOrderDetail")
|
||||||
|
public R<IPage<TourOrderDetailVO>> page(TourOrderDetailVO tourOrderDetail, Query query) {
|
||||||
|
IPage<TourOrderDetailVO> pages = tourOrderDetailService.selectTourOrderDetailPage(Condition.getPage(query), tourOrderDetail);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入tourOrderDetail")
|
||||||
|
public R save(@Valid @RequestBody TourOrderDetailEntity tourOrderDetail) {
|
||||||
|
return R.status(tourOrderDetailService.save(tourOrderDetail));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入tourOrderDetail")
|
||||||
|
public R update(@Valid @RequestBody TourOrderDetailEntity tourOrderDetail) {
|
||||||
|
return R.status(tourOrderDetailService.updateById(tourOrderDetail));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入tourOrderDetail")
|
||||||
|
public R submit(@Valid @RequestBody TourOrderDetailEntity tourOrderDetail) {
|
||||||
|
return R.status(tourOrderDetailService.saveOrUpdate(tourOrderDetail));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(tourOrderDetailService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/confirm-guide-info")
|
||||||
|
@ApiOperationSupport(order = 8)
|
||||||
|
@Operation(summary = "提交导游信息", description = "传入order")
|
||||||
|
public R confirmGuideInfo(@Valid @RequestBody TourOrderDetailVO order) {
|
||||||
|
return R.status(tourOrderDetailService.confirmGuideInfo(order.getId() , order.getGuideName(), order.getGuidePhone()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/fill-contractUrl")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@Operation(summary = "提交电子合同", description = "传入order")
|
||||||
|
public R fillContractUrl(@Valid @RequestBody TourOrderDetailVO order) {
|
||||||
|
return R.status(tourOrderDetailService.fillContractUrl(order.getId() , order.getContractUrl()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
/**
|
||||||
|
* 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.TourProductEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.TourProductVO;
|
||||||
|
import org.springblade.modules.common.wrapper.TourProductWrapper;
|
||||||
|
import org.springblade.modules.common.service.ITourProductService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/tour-product")
|
||||||
|
@Tag(name = "旅游产品", description = "旅游产品接口")
|
||||||
|
public class TourProductController extends BladeController {
|
||||||
|
|
||||||
|
private final ITourProductService tourProductService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入tourProduct")
|
||||||
|
public R<TourProductVO> detail(TourProductEntity tourProduct) {
|
||||||
|
TourProductEntity detail = tourProductService.getOne(Condition.getQueryWrapper(tourProduct));
|
||||||
|
return R.data(TourProductWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 旅游产品 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入tourProduct")
|
||||||
|
public R<IPage<TourProductVO>> list(TourProductEntity tourProduct, Query query) {
|
||||||
|
IPage<TourProductEntity> pages = tourProductService.page(Condition.getPage(query), Condition.getQueryWrapper(tourProduct).orderByDesc("id"));
|
||||||
|
return R.data(TourProductWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入tourProduct")
|
||||||
|
public R<IPage<TourProductVO>> page(TourProductVO tourProduct, Query query) {
|
||||||
|
IPage<TourProductVO> pages = tourProductService.selectTourProductPage(Condition.getPage(query), tourProduct);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入tourProduct")
|
||||||
|
public R save(@Valid @RequestBody TourProductVO tourProduct) {
|
||||||
|
return R.status(tourProductService.saveTourProduct(tourProduct));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入tourProduct")
|
||||||
|
public R update(@Valid @RequestBody TourProductVO tourProduct) {
|
||||||
|
return R.status(tourProductService.updateTourProduct(tourProduct));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入tourProduct")
|
||||||
|
public R submit(@Valid @RequestBody TourProductEntity tourProduct) {
|
||||||
|
return R.status(tourProductService.saveOrUpdate(tourProduct));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(tourProductService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,8 +4,10 @@ import org.mapstruct.Mapper;
|
|||||||
import org.mapstruct.Mapping;
|
import org.mapstruct.Mapping;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import org.springblade.modules.api.request.AddressSubmitRequest;
|
import org.springblade.modules.api.request.AddressSubmitRequest;
|
||||||
import org.springblade.modules.api.request.CreateOrderRequest;
|
import org.springblade.modules.api.request.CreateMallOrderRequest;
|
||||||
|
import org.springblade.modules.api.request.CreateTravelOrderRequest;
|
||||||
import org.springblade.modules.api.vo.*;
|
import org.springblade.modules.api.vo.*;
|
||||||
|
import org.springblade.modules.common.pojo.dto.BusinessModulePayTypeDTO;
|
||||||
import org.springblade.modules.common.pojo.entity.*;
|
import org.springblade.modules.common.pojo.entity.*;
|
||||||
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
import org.springblade.modules.common.pojo.vo.AppCommonRegionsInfoVO;
|
||||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||||
@@ -38,7 +40,22 @@ public interface AppCommonConvert {
|
|||||||
@Mapping(target = "deliveryAddress", source = "request.address")
|
@Mapping(target = "deliveryAddress", source = "request.address")
|
||||||
@Mapping(target = "itemName", source = "product.productName")
|
@Mapping(target = "itemName", source = "product.productName")
|
||||||
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
||||||
CommonUserOrderEntity convertMallProductToOrder(CreateOrderRequest request, MallProductEntity product);
|
CommonUserOrderEntity convertMallProductToOrder(CreateMallOrderRequest request, MallProductEntity product);
|
||||||
|
|
||||||
|
|
||||||
|
@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 = "itemCode", source = "request.itemCode")
|
||||||
|
@Mapping(target = "quantity", source = "request.quantity")
|
||||||
|
@Mapping(target = "itemName", source = "product.productName")
|
||||||
|
@Mapping(target = "imageUrl", source = "product.thumbnailUrl")
|
||||||
|
CommonUserOrderEntity convertTourProductToOrder(CreateTravelOrderRequest request, TourProductEntity product);
|
||||||
|
|
||||||
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
||||||
|
|
||||||
@@ -46,6 +63,8 @@ public interface AppCommonConvert {
|
|||||||
|
|
||||||
CommonUserOrderDetailApiVO convertOrderDetailApiVO(CommonUserOrderEntity entity);
|
CommonUserOrderDetailApiVO convertOrderDetailApiVO(CommonUserOrderEntity entity);
|
||||||
|
|
||||||
|
CommonTravelOrderDetailApiVO convertTravelOrderDetailApiVO(CommonUserOrderEntity entity);
|
||||||
|
|
||||||
CommonUserOrderApiVO convertOrderApiVO(CommonUserOrderVO vo);
|
CommonUserOrderApiVO convertOrderApiVO(CommonUserOrderVO vo);
|
||||||
|
|
||||||
List<CommonUserOrderApiVO> convertOrderApiListVO(List<CommonUserOrderVO> voList);
|
List<CommonUserOrderApiVO> convertOrderApiListVO(List<CommonUserOrderVO> voList);
|
||||||
@@ -62,4 +81,15 @@ public interface AppCommonConvert {
|
|||||||
|
|
||||||
CommonUserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
CommonUserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
||||||
|
|
||||||
|
TourOrderDetailEntity.TravelerDetail convertTourInfoListToOrderDetail(CommonTourInfoEntity entity);
|
||||||
|
|
||||||
|
List<TourOrderDetailEntity.TravelerDetail> convertTourInfoListToOrderDetail(List<CommonTourInfoEntity> list);
|
||||||
|
|
||||||
|
TourOrderDetailEntity.ProductDetail convertTourProductToOrderDetail(TourProductEntity tourProduct);
|
||||||
|
|
||||||
|
List<TourOrderDetailEntity.ProductDetail> convertTourProductListToOrderDetail(List<TourProductEntity> tourProduct);
|
||||||
|
|
||||||
|
CommonModulePayTypeApiVO convertModulePayTypeToApiVO(BusinessModulePayTypeDTO.PayType dto);
|
||||||
|
|
||||||
|
List<CommonModulePayTypeApiVO> convertModulePayTypeListToApiVO(List<BusinessModulePayTypeDTO.PayType> list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.common.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsCategoryApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsContentApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonNewsContentDetailApiVO;
|
||||||
|
import org.springblade.modules.common.pojo.entity.NewsCategoryEntity;
|
||||||
|
import org.springblade.modules.common.pojo.entity.NewsContentEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommonNewsContentConvert {
|
||||||
|
|
||||||
|
CommonNewsContentConvert INSTANCE = Mappers.getMapper(CommonNewsContentConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
List<CommonNewsCategoryApiVO> convertNewsCategoryApiVO(List<NewsCategoryEntity> categoryList);
|
||||||
|
|
||||||
|
@Mapping(target = "type", source = "contentType")
|
||||||
|
CommonNewsContentApiVO convertNewsContentApiVO(NewsContentEntity newsContentEntity);
|
||||||
|
|
||||||
|
CommonNewsContentDetailApiVO convertNewsContentDetailApiVO(NewsContentEntity entity);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.springblade.modules.common.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonRegionsInfoEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonRegionsDicVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommonRegionConvert {
|
||||||
|
|
||||||
|
CommonRegionConvert INSTANCE = Mappers.getMapper(CommonRegionConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Mapping(target = "code", expression = "java(String.valueOf(entity.getId()))")
|
||||||
|
CommonRegionsDicVO convertRegionsToVO(CommonRegionsInfoEntity entity);
|
||||||
|
|
||||||
|
List<CommonRegionsDicVO> convertRegionsListToVO(List<CommonRegionsInfoEntity> list);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.springblade.modules.common.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourInfoApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourProductApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourProductDetailApiVO;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonTourInfoEntity;
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourProductEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommonTourInfoConvert {
|
||||||
|
|
||||||
|
CommonTourInfoConvert INSTANCE = Mappers.getMapper(CommonTourInfoConvert.class);
|
||||||
|
|
||||||
|
CommonTourInfoApiVO convertTourInfoApiVO(CommonTourInfoEntity entity);
|
||||||
|
|
||||||
|
|
||||||
|
List<CommonTourInfoApiVO> convertTourInfoListApiVO(List<CommonTourInfoEntity> list);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package org.springblade.modules.common.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.api.vo.*;
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourProductEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommonTourProductConvert {
|
||||||
|
|
||||||
|
CommonTourProductConvert INSTANCE = Mappers.getMapper(CommonTourProductConvert.class);
|
||||||
|
|
||||||
|
CommonTourProductApiVO convertTourProductApiVO(TourProductEntity entity);
|
||||||
|
|
||||||
|
CommonTourProductDetailApiVO convertTourProductDetailApiVO(TourProductEntity entity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.common.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourismSpotApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonTourismSpotDetailApiVO;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CulturalTourismSpotEntity;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommonTourismSpotConvert {
|
||||||
|
|
||||||
|
CommonTourismSpotConvert INSTANCE = Mappers.getMapper(CommonTourismSpotConvert.class);
|
||||||
|
|
||||||
|
CommonTourismSpotApiVO convertTourismSpotApiVO(CulturalTourismSpotEntity culturalTourismSpotEntity);
|
||||||
|
|
||||||
|
CommonTourismSpotDetailApiVO convertTourismSpotDetailApiVO(CulturalTourismSpotEntity tourismSpot);
|
||||||
|
}
|
||||||
@@ -6,10 +6,10 @@ import lombok.RequiredArgsConstructor;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public enum BusinessModule {
|
public enum BusinessModule {
|
||||||
|
|
||||||
SELF_OPERATED_MALL("自营商城", "self_mall"),
|
SELF_OPERATED_MALL("自营商城", "self_mall" , "S"),
|
||||||
ECOSYSTEM_PRODUCT("生态商品", "eco_product"),
|
ECOSYSTEM_PRODUCT("生态商品", "eco_product" , "E"),
|
||||||
TRAVEL_GROUP("旅游团", "travel_group"),
|
TRAVEL_GROUP("旅游团", "travel_group" , "T"),
|
||||||
LOTTERY("幸运抽奖", "lottery");
|
LOTTERY("幸运抽奖", "lottery" , "L");
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
@@ -17,6 +17,9 @@ public enum BusinessModule {
|
|||||||
@Getter
|
@Getter
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String abbr;
|
||||||
|
|
||||||
|
|
||||||
// ========================
|
// ========================
|
||||||
// 根据 code 查找(忽略大小写)
|
// 根据 code 查找(忽略大小写)
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
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 ExcelOrderStatus {
|
||||||
|
|
||||||
|
PENDING_PAYMENT(0, "待支付"),
|
||||||
|
PAID(1, "已支付"),
|
||||||
|
CANCELLED(2, "已取消"),
|
||||||
|
SHIPPED(3, "已发货"),
|
||||||
|
COMPLETED(4, "已完成"),
|
||||||
|
CLOSED_TIMEOUT(5, "已关闭"),
|
||||||
|
REFUNDING(6, "退款中"),
|
||||||
|
REFUNDED(7, "已退款");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
ExcelOrderStatus(int code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String formatUserMessage(String orderId) {
|
||||||
|
return message.formatted(orderId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static final Map<Integer, ExcelOrderStatus> BY_CODE = Stream.of(values())
|
||||||
|
.collect(Collectors.toUnmodifiableMap(ExcelOrderStatus::getCode, Function.identity()));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据状态码(int)获取对应的 OrderStatus 枚举
|
||||||
|
*
|
||||||
|
* @throws IllegalArgumentException 如果状态码无效
|
||||||
|
*/
|
||||||
|
public static ExcelOrderStatus fromCode(int code) {
|
||||||
|
ExcelOrderStatus status = BY_CODE.get(code);
|
||||||
|
if (status == null) {
|
||||||
|
throw new IllegalArgumentException("无效的订单状态码: " + code);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全版本:根据状态码获取枚举,若无效则返回 null(适用于非严格场景)
|
||||||
|
*/
|
||||||
|
public static ExcelOrderStatus fromCodeOrNull(int code) {
|
||||||
|
return BY_CODE.get(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,26 +1,28 @@
|
|||||||
package org.springblade.modules.common.eums;
|
package org.springblade.modules.common.eums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@Getter
|
@RequiredArgsConstructor
|
||||||
public enum PaymentType {
|
public enum PaymentType {
|
||||||
|
|
||||||
ALI(1, "支付宝"),
|
ALI(1, "支付宝" , "A"),
|
||||||
WECHAT(2, "微信"),
|
WECHAT(2, "微信" , "W"),
|
||||||
OFFLINE(99, "线下支付");
|
OFFLINE(99, "线下支付" , "O");
|
||||||
|
|
||||||
|
@Getter
|
||||||
private final int code;
|
private final int code;
|
||||||
|
@Getter
|
||||||
private final String name;
|
private final String name;
|
||||||
|
@Getter
|
||||||
|
private final String abbr;
|
||||||
|
|
||||||
|
|
||||||
PaymentType(int code, String name) {
|
|
||||||
this.code = code;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 静态映射:code -> enum ==========
|
// ========== 静态映射:code -> enum ==========
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.springblade.modules.common.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.modules.common.eums.PaymentType;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PaymentCallbackEvent implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Date payTime;
|
||||||
|
private PaymentType paymentType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.springblade.modules.common.event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class StatsCommissionAccountEvent implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package org.springblade.modules.common.listener;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.eums.OrderStatus;
|
||||||
|
import org.springblade.modules.common.eums.PaymentStatus;
|
||||||
|
import org.springblade.modules.common.event.PaymentCallbackEvent;
|
||||||
|
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||||
|
import org.springblade.modules.common.event.StatsCommissionAccountEvent;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PaymentListener {
|
||||||
|
|
||||||
|
private final ICommonUserOrderService commonUserOrderService;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
@Async("paymentAsyncExecutor")
|
||||||
|
@EventListener
|
||||||
|
public void callbackSuccessPayment(PaymentCallbackEvent event) {
|
||||||
|
log.info("支付回调监听 : {}" , event);
|
||||||
|
|
||||||
|
|
||||||
|
CommonUserOrderEntity userOrder = commonUserOrderService.getById(event.getId());
|
||||||
|
if (userOrder == null){
|
||||||
|
log.error("支付回调监听 : 订单不存在 , 订单id : {}" , userOrder.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (userOrder.getOrderStatus() == 1){
|
||||||
|
log.error("支付回调监听 : 订单已支付 , 订单id : {}" , userOrder.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
userOrder.setOrderStatus(OrderStatus.PAID.getCode());
|
||||||
|
userOrder.setPaymentStatus(PaymentStatus.PAID.getCode());
|
||||||
|
userOrder.setPaymentTime(event.getPayTime());
|
||||||
|
if ( !commonUserOrderService.updateById(userOrder)){
|
||||||
|
log.error("支付回调监听 : 订单支付失败 , 订单id : {}" , userOrder.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log.info("支付回调监听 : 订单支付成功 , 订单id : {}" , userOrder.getId());
|
||||||
|
publisher.publishEvent(new StatsCommissionAccountEvent().setId(userOrder.getId()));
|
||||||
|
publisher.publishEvent(new PaymentSuccessEvent(userOrder.getId(), userOrder.getUserId(), BusinessModule.fromCodeIgnoreCase(userOrder.getOrderType())));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
package org.springblade.modules.common.listener;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.common.event.StatsCommissionAccountEvent;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
|
import org.springblade.modules.market.service.*;
|
||||||
|
import org.springframework.aop.framework.AopContext;
|
||||||
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StatsCommissionAccountListener {
|
||||||
|
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
private final IMarketCommissionAccountService commissionAccountService;
|
||||||
|
private final IMarketCommissionAdvertisingLogService advertisingLogService;
|
||||||
|
private final IMarketCommissionAgencyLogService agencyLogService;
|
||||||
|
private final IMarketCommissionCoCreatorLogService creatorLogService;
|
||||||
|
private final IMarketCommissionGoodsCostLogService goodsCostLogService;
|
||||||
|
private final IMarketCommissionOperationLogService operationLogService;
|
||||||
|
private final IMarketCommissionServiceProviderLogService serviceProviderLogService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final Long GOODS_COST_ACCOUNT_ID = 2017485441885196290L;
|
||||||
|
private static final Long OPERATION_ACCOUNT_ID = 2017486179294171138L;
|
||||||
|
private static final Long ADVERTISING_ACCOUNT_ID = 2017486299502923778L;
|
||||||
|
private static final Long SERVICE_PROVIDER_ACCOUNT_ID = 2017486437340336130L;
|
||||||
|
private static final Long AGENCY_ACCOUNT_ID = 2017486568441696258L;
|
||||||
|
private static final Long CREATOR_ACCOUNT_ID = 2017486664117964802L;
|
||||||
|
|
||||||
|
@Async("statsCommissionAsyncExecutor")
|
||||||
|
@EventListener
|
||||||
|
public void callbackSuccessPayment(StatsCommissionAccountEvent event) {
|
||||||
|
try {
|
||||||
|
// 【关键优化】使用 AopContext 获取当前代理对象,避免循环依赖
|
||||||
|
// 必须确保启动类或配置类上有 @EnableAspectJAutoProxy(exposeProxy = true)
|
||||||
|
StatsCommissionAccountListener proxy;
|
||||||
|
try {
|
||||||
|
proxy = (StatsCommissionAccountListener) AopContext.currentProxy();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
log.warn("AopContext 未开启 (exposeProxy=false),降级为直接调用,事务可能失效!请检查启动类配置。", e);
|
||||||
|
proxy = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy.processCommissionInternal(event);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("统计佣金入账处理异常,订单 ID: {}, 错误信息:{}", event.getId(), e.getMessage(), e);
|
||||||
|
// 生产环境建议:此处可记录到死信表或发送告警
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void processCommissionInternal(StatsCommissionAccountEvent event) {
|
||||||
|
log.info("开始处理统计佣金入账,订单 ID: {}", event.getId());
|
||||||
|
|
||||||
|
CommonUserOrderEntity userOrder = userOrderService.getById(event.getId());
|
||||||
|
if (userOrder == null) {
|
||||||
|
throw new RuntimeException("订单不存在,订单 ID: " + event.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal totalActualAmount = userOrder.getActualAmount();
|
||||||
|
if (totalActualAmount == null || totalActualAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
log.warn("订单金额为 0 或空,跳过佣金计算,订单 ID: {}", event.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String orderType = userOrder.getOrderType();
|
||||||
|
Long orderId = userOrder.getId();
|
||||||
|
String orderJson = JSONObject.toJSONString(userOrder);
|
||||||
|
Date statisticalDate = DateUtil.getToday();
|
||||||
|
|
||||||
|
// --- 1. 广告补贴 (5%) ---
|
||||||
|
BigDecimal advertisingAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.05));
|
||||||
|
if (advertisingAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(ADVERTISING_ACCOUNT_ID, advertisingAmount, () -> {
|
||||||
|
MarketCommissionAdvertisingLogEntity logEntity = new MarketCommissionAdvertisingLogEntity();
|
||||||
|
logEntity.setAccountId(ADVERTISING_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(advertisingAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO); // 并发下难以获取精确旧余额
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 广告补贴");
|
||||||
|
advertisingLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 2. 极差代理 (15%) ---
|
||||||
|
BigDecimal agencyAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.15));
|
||||||
|
if (agencyAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(AGENCY_ACCOUNT_ID, agencyAmount, () -> {
|
||||||
|
MarketCommissionAgencyLogEntity logEntity = new MarketCommissionAgencyLogEntity();
|
||||||
|
logEntity.setAccountId(AGENCY_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(agencyAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO);
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 极差代理");
|
||||||
|
agencyLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 3. 联创 (5%) ---
|
||||||
|
BigDecimal creatorAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.05));
|
||||||
|
if (creatorAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(CREATOR_ACCOUNT_ID, creatorAmount, () -> {
|
||||||
|
MarketCommissionCoCreatorLogEntity logEntity = new MarketCommissionCoCreatorLogEntity();
|
||||||
|
logEntity.setAccountId(CREATOR_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(creatorAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO);
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 联创佣金");
|
||||||
|
creatorLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 4. 商品成本 (25%) ---
|
||||||
|
BigDecimal goodsCostAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.25));
|
||||||
|
if (goodsCostAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(GOODS_COST_ACCOUNT_ID, goodsCostAmount, () -> {
|
||||||
|
MarketCommissionGoodsCostLogEntity logEntity = new MarketCommissionGoodsCostLogEntity();
|
||||||
|
logEntity.setAccountId(GOODS_COST_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(goodsCostAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO);
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 商品成本");
|
||||||
|
goodsCostLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 5. 运营 (5%) ---
|
||||||
|
BigDecimal operationAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.05));
|
||||||
|
if (operationAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(OPERATION_ACCOUNT_ID, operationAmount, () -> {
|
||||||
|
MarketCommissionOperationLogEntity logEntity = new MarketCommissionOperationLogEntity();
|
||||||
|
logEntity.setAccountId(OPERATION_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(operationAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO);
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 运营佣金");
|
||||||
|
operationLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 6. 服务商 (5%) ---
|
||||||
|
BigDecimal serviceProviderAmount = totalActualAmount.multiply(BigDecimal.valueOf(0.05));
|
||||||
|
if (serviceProviderAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
updateAccountAndSaveLog(SERVICE_PROVIDER_ACCOUNT_ID, serviceProviderAmount, () -> {
|
||||||
|
MarketCommissionServiceProviderLogEntity logEntity = new MarketCommissionServiceProviderLogEntity();
|
||||||
|
logEntity.setAccountId(SERVICE_PROVIDER_ACCOUNT_ID);
|
||||||
|
logEntity.setAmount(serviceProviderAmount);
|
||||||
|
logEntity.setLastAmount(BigDecimal.ZERO);
|
||||||
|
logEntity.setSourceType(orderType);
|
||||||
|
logEntity.setSourceId(orderId);
|
||||||
|
logEntity.setSourceDetail(orderJson);
|
||||||
|
logEntity.setType(1);
|
||||||
|
logEntity.setStatisticalDate(statisticalDate);
|
||||||
|
logEntity.setIsComplete(1);
|
||||||
|
logEntity.setIsSalaryPaid(1); // 特有字段
|
||||||
|
logEntity.setRemark("自营商城订单入账 - 服务商佣金");
|
||||||
|
serviceProviderLogService.save(logEntity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("佣金入账处理成功,订单 ID: {}", event.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 核心原子操作:更新账户余额 + 执行日志保存回调
|
||||||
|
* 保证两者在同一个事务中,要么都成功,要么都回滚
|
||||||
|
*/
|
||||||
|
private void updateAccountAndSaveLog(Long accountId, BigDecimal amount, Runnable logSaveAction) {
|
||||||
|
// 1. 数据库原子累加
|
||||||
|
boolean updated = commissionAccountService.update(new LambdaUpdateWrapper<MarketCommissionAccountEntity>()
|
||||||
|
.eq(MarketCommissionAccountEntity::getId, accountId)
|
||||||
|
.setSql("amount = amount + " + amount.toPlainString())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!updated) {
|
||||||
|
log.error("佣金账户更新失败,账户 ID: {}, 金额:{}", accountId, amount);
|
||||||
|
throw new RuntimeException("佣金账户更新失败,ID: " + accountId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 执行具体的日志保存逻辑
|
||||||
|
logSaveAction.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package org.springblade.modules.common.manager;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.cache.ParamCache;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
|
import org.springblade.modules.api.vo.CommonModulePayTypeApiVO;
|
||||||
|
import org.springblade.modules.common.constant.BladeCommonConstant;
|
||||||
|
import org.springblade.modules.common.convert.AppCommonConvert;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
import org.springblade.modules.common.pojo.dto.BusinessModulePayTypeDTO;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AppCommonManager {
|
||||||
|
|
||||||
|
public List<CommonModulePayTypeApiVO> getModulePayTypeList(String moduleCode) {
|
||||||
|
|
||||||
|
BusinessModule businessModule = BusinessModule.fromCodeIgnoreCaseOrNull(moduleCode);
|
||||||
|
if (businessModule == null) {
|
||||||
|
log.error("无效业务模块");
|
||||||
|
throw new ServiceException("无效业务模块");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<BusinessModulePayTypeDTO> payTypeDTOList = JSONArray.parseArray(ParamCache.getValue(BladeCommonConstant.BUSINESS_MODULE_PAY_TYPE), BusinessModulePayTypeDTO.class);
|
||||||
|
BusinessModulePayTypeDTO result = payTypeDTOList.stream()
|
||||||
|
.filter(dto -> moduleCode.equals(dto.getCode()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null); // 如果找不到,返回 null
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
log.error("无效业务模块");
|
||||||
|
throw new ServiceException("无效业务模块");
|
||||||
|
}
|
||||||
|
|
||||||
|
return AppCommonConvert.INSTANCE.convertModulePayTypeListToApiVO(result.getPayTypeList());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,10 +7,9 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.common.utils.date.DateUtil;
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
import org.springblade.core.excel.util.ExcelUtil;
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
import org.springblade.modules.common.eums.BusinessModule;
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.modules.common.eums.OrderStatus;
|
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||||
import org.springblade.modules.common.eums.PaymentStatus;
|
import org.springblade.modules.common.eums.*;
|
||||||
import org.springblade.modules.common.eums.PaymentType;
|
|
||||||
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||||
import org.springblade.modules.common.excel.CommonUserBackOrderExcel;
|
import org.springblade.modules.common.excel.CommonUserBackOrderExcel;
|
||||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||||
@@ -95,28 +94,23 @@ public class CommonUserManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CommonUserOrderExcel> exportUserOrderToExcel(String account, List<String> searchDateRange) {
|
public List<CommonUserOrderExcel> exportUserMallOrderToExcel(Integer orderStatus, String account, List<String> searchDateRange) {
|
||||||
Assert.isTrue(StringUtils.hasLength(account), "请选择账号");
|
|
||||||
|
|
||||||
User user = userService.getOne(
|
|
||||||
Wrappers.lambdaQuery(User.class)
|
|
||||||
.eq(User::getAccount, account)
|
|
||||||
);
|
|
||||||
Assert.notNull(user, "账号不存在");
|
|
||||||
Date startDate = null;
|
Date startDate = null;
|
||||||
Date endDate = null;
|
Date endDate = null;
|
||||||
if (searchDateRange == null) {
|
if (searchDateRange == null) {
|
||||||
throw new RuntimeException("请选择时间范围");
|
throw new ServiceException("请选择时间范围");
|
||||||
}
|
}
|
||||||
|
|
||||||
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||||
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||||
|
|
||||||
if (startDate.getTime() >= endDate.getTime()) {
|
if (startDate.getTime() >= endDate.getTime()) {
|
||||||
throw new RuntimeException("开始时间不能大于结束时间");
|
throw new ServiceException("开始时间不能大于结束时间");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CommonUserOrderVO> commonUserOrderList = commonUserOrderService.exportUserOrderToExcel(user.getId(), startDate, endDate);
|
List<CommonUserOrderVO> commonUserOrderList = commonUserOrderService.exportUserMallOrderToExcel(orderStatus, account, startDate, endDate);
|
||||||
|
|
||||||
List<CommonUserOrderExcel> excelList = new ArrayList<>();
|
List<CommonUserOrderExcel> excelList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -147,7 +141,7 @@ public class CommonUserManager {
|
|||||||
commonUserOrderExcel.setPaymentTime(order.getPaymentTime());
|
commonUserOrderExcel.setPaymentTime(order.getPaymentTime());
|
||||||
commonUserOrderExcel.setPaymentStatus(PaymentStatus.fromCodeOrNull(order.getPaymentStatus()).getDescription());
|
commonUserOrderExcel.setPaymentStatus(PaymentStatus.fromCodeOrNull(order.getPaymentStatus()).getDescription());
|
||||||
commonUserOrderExcel.setCreateTime(order.getCreateTime());
|
commonUserOrderExcel.setCreateTime(order.getCreateTime());
|
||||||
|
commonUserOrderExcel.setOrderStatus(ExcelOrderStatus.fromCode(order.getOrderStatus()).getMessage());
|
||||||
excelList.add(commonUserOrderExcel);
|
excelList.add(commonUserOrderExcel);
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -155,6 +149,104 @@ public class CommonUserManager {
|
|||||||
return excelList;
|
return excelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CommonUserOrderExcel> exportUserEcoOrderToExcel(Integer orderStatus, String account, List<String> searchDateRange) {
|
||||||
|
Date startDate = null;
|
||||||
|
Date endDate = null;
|
||||||
|
if (searchDateRange == null) {
|
||||||
|
throw new ServiceException("请选择时间范围");
|
||||||
|
}
|
||||||
|
|
||||||
|
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||||
|
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||||
|
|
||||||
|
if (startDate.getTime() >= endDate.getTime()) {
|
||||||
|
throw new ServiceException("开始时间不能大于结束时间");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CommonUserOrderVO> commonUserOrderList = commonUserOrderService.exportUserEcoOrderToExcel(orderStatus, account, startDate, endDate);
|
||||||
|
|
||||||
|
List<CommonUserOrderExcel> excelList = new ArrayList<>();
|
||||||
|
|
||||||
|
commonUserOrderList.forEach(order -> {
|
||||||
|
|
||||||
|
CommonUserOrderExcel commonUserOrderExcel = new CommonUserOrderExcel();
|
||||||
|
commonUserOrderExcel.setId(order.getId());
|
||||||
|
commonUserOrderExcel.setAccount(order.getAccount());
|
||||||
|
commonUserOrderExcel.setConsigneePhone(order.getConsigneePhone());
|
||||||
|
commonUserOrderExcel.setConsignee(order.getConsignee());
|
||||||
|
commonUserOrderExcel.setDeliveryAddress(order.getDeliveryAddress());
|
||||||
|
commonUserOrderExcel.setItemName(order.getItemName());
|
||||||
|
commonUserOrderExcel.setImageUrl(order.getImageUrl());
|
||||||
|
commonUserOrderExcel.setQuantity(order.getQuantity());
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray specsJsonArray = JSONArray.parse(JSONArray.toJSONString(order.getSpecs()));
|
||||||
|
List<String> specsJsonString = new ArrayList<>();
|
||||||
|
specsJsonArray.forEach(spec -> {
|
||||||
|
JSONObject specJsonObject = (JSONObject) spec;
|
||||||
|
specsJsonString.add(specJsonObject.getString("attr") + ":" + specJsonObject.getString("value"));
|
||||||
|
});
|
||||||
|
|
||||||
|
commonUserOrderExcel.setSpecs(JSONArray.toJSONString(specsJsonString));
|
||||||
|
commonUserOrderExcel.setTotalAmount(order.getTotalAmount());
|
||||||
|
commonUserOrderExcel.setActualAmount(order.getActualAmount());
|
||||||
|
commonUserOrderExcel.setPaymentType(PaymentType.fromCodeOrNull(order.getPaymentType()).getName());
|
||||||
|
commonUserOrderExcel.setPaymentTime(order.getPaymentTime());
|
||||||
|
commonUserOrderExcel.setPaymentStatus(PaymentStatus.fromCodeOrNull(order.getPaymentStatus()).getDescription());
|
||||||
|
commonUserOrderExcel.setCreateTime(order.getCreateTime());
|
||||||
|
commonUserOrderExcel.setOrderStatus(ExcelOrderStatus.fromCode(order.getOrderStatus()).getMessage());
|
||||||
|
excelList.add(commonUserOrderExcel);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return excelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CommonUserOrderExcel> exportUserTourOrderToExcel(Integer orderStatus, String account, List<String> searchDateRange) {
|
||||||
|
Date startDate = null;
|
||||||
|
Date endDate = null;
|
||||||
|
if (searchDateRange == null) {
|
||||||
|
throw new ServiceException("请选择时间范围");
|
||||||
|
}
|
||||||
|
|
||||||
|
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||||
|
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||||
|
|
||||||
|
if (startDate.getTime() >= endDate.getTime()) {
|
||||||
|
throw new ServiceException("开始时间不能大于结束时间");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CommonUserOrderVO> commonUserOrderList = commonUserOrderService.exportUserTourOrderToExcel(orderStatus, account, startDate, endDate);
|
||||||
|
|
||||||
|
List<CommonUserOrderExcel> excelList = new ArrayList<>();
|
||||||
|
|
||||||
|
commonUserOrderList.forEach(order -> {
|
||||||
|
|
||||||
|
CommonUserOrderExcel commonUserOrderExcel = new CommonUserOrderExcel();
|
||||||
|
commonUserOrderExcel.setId(order.getId());
|
||||||
|
commonUserOrderExcel.setAccount(order.getAccount());
|
||||||
|
commonUserOrderExcel.setConsigneePhone(order.getConsigneePhone());
|
||||||
|
commonUserOrderExcel.setConsignee(order.getConsignee());
|
||||||
|
commonUserOrderExcel.setDeliveryAddress(order.getDeliveryAddress());
|
||||||
|
commonUserOrderExcel.setItemName(order.getItemName());
|
||||||
|
commonUserOrderExcel.setImageUrl(order.getImageUrl());
|
||||||
|
commonUserOrderExcel.setQuantity(order.getQuantity());
|
||||||
|
|
||||||
|
commonUserOrderExcel.setTotalAmount(order.getTotalAmount());
|
||||||
|
commonUserOrderExcel.setActualAmount(order.getActualAmount());
|
||||||
|
commonUserOrderExcel.setPaymentType(PaymentType.fromCodeOrNull(order.getPaymentType()).getName());
|
||||||
|
commonUserOrderExcel.setPaymentTime(order.getPaymentTime());
|
||||||
|
commonUserOrderExcel.setPaymentStatus(PaymentStatus.fromCodeOrNull(order.getPaymentStatus()).getDescription());
|
||||||
|
commonUserOrderExcel.setCreateTime(order.getCreateTime());
|
||||||
|
commonUserOrderExcel.setOrderStatus(ExcelOrderStatus.fromCode(order.getOrderStatus()).getMessage());
|
||||||
|
excelList.add(commonUserOrderExcel);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return excelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<CommonImportUserBackOrderError> importUserBackOrder(MultipartFile file) {
|
public List<CommonImportUserBackOrderError> importUserBackOrder(MultipartFile file) {
|
||||||
|
|
||||||
List<CommonUserBackOrderExcel> read = ExcelUtil.read(file, CommonUserBackOrderExcel.class);
|
List<CommonUserBackOrderExcel> read = ExcelUtil.read(file, CommonUserBackOrderExcel.class);
|
||||||
@@ -252,4 +344,6 @@ public class CommonUserManager {
|
|||||||
return errorExcelList;
|
return errorExcelList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonOrderConfirmLogEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonOrderConfirmLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-25
|
||||||
|
*/
|
||||||
|
public interface CommonOrderConfirmLogMapper extends BaseMapper<CommonOrderConfirmLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param commonOrderConfirmLog 查询参数
|
||||||
|
* @return List<CommonOrderConfirmLogVO>
|
||||||
|
*/
|
||||||
|
List<CommonOrderConfirmLogVO> selectCommonOrderConfirmLogPage(IPage page, CommonOrderConfirmLogVO commonOrderConfirmLog);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?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.CommonOrderConfirmLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="commonOrderConfirmLogResultMap" type="org.springblade.modules.common.pojo.entity.CommonOrderConfirmLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="order_id" property="orderId"/>
|
||||||
|
<result column="address_id" property="addressId"/>
|
||||||
|
<result column="actual_amount" property="actualAmount"/>
|
||||||
|
<result column="order_type" property="orderType"/>
|
||||||
|
<result column="payment_type" property="paymentType"/>
|
||||||
|
<result column="is_agency_distributed" property="isAgencyDistributed"/>
|
||||||
|
<result column="agency_distribute_time" property="agencyDistributeTime"/>
|
||||||
|
<result column="is_service_distributed" property="isServiceDistributed"/>
|
||||||
|
<result column="service_distribute_time" property="serviceDistributeTime"/>
|
||||||
|
<result column="status" property="status"/>
|
||||||
|
<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="is_deleted" property="isDeleted"/>
|
||||||
|
<result column="remark" property="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCommonOrderConfirmLogPage" resultMap="commonOrderConfirmLogResultMap">
|
||||||
|
select * from common_order_confirm_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonTourInfoEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonTourInfoVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
public interface CommonTourInfoMapper extends BaseMapper<CommonTourInfoEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param commonTourInfo 查询参数
|
||||||
|
* @return List<CommonTourInfoVO>
|
||||||
|
*/
|
||||||
|
List<CommonTourInfoVO> selectCommonTourInfoPage(IPage page, CommonTourInfoVO commonTourInfo);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.CommonTourInfoMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="commonTourInfoResultMap" type="org.springblade.modules.common.pojo.entity.CommonTourInfoEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="id_card_no" property="idCardNo"/>
|
||||||
|
<result column="passport_no" property="passportNo"/>
|
||||||
|
<result column="hk_macau_pass_no" property="hkMacauPassNo"/>
|
||||||
|
<result column="user_name" property="userName"/>
|
||||||
|
<result column="gender" property="gender"/>
|
||||||
|
<result column="contact_phone" property="contactPhone"/>
|
||||||
|
<result column="traveler_type" property="travelerType"/>
|
||||||
|
<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="selectCommonTourInfoPage" resultMap="commonTourInfoResultMap">
|
||||||
|
select * from common_tour_info where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonUserTourOrderVO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -53,6 +54,8 @@ public interface CommonUserOrderMapper extends BaseMapper<CommonUserOrderEntity>
|
|||||||
*/
|
*/
|
||||||
List<CommonUserOrderVO> selectOrderPage(IPage page, CommonUserOrderVO order);
|
List<CommonUserOrderVO> selectOrderPage(IPage page, CommonUserOrderVO order);
|
||||||
|
|
||||||
|
List<CommonUserTourOrderVO> selectTourOrderPage(IPage page, CommonUserTourOrderVO order);
|
||||||
|
|
||||||
List<CommonUserOrderEntity> selectOrderEntityPage(IPage page, CommonUserOrderEntity order);
|
List<CommonUserOrderEntity> selectOrderEntityPage(IPage page, CommonUserOrderEntity order);
|
||||||
|
|
||||||
|
|
||||||
@@ -64,5 +67,7 @@ public interface CommonUserOrderMapper extends BaseMapper<CommonUserOrderEntity>
|
|||||||
*/
|
*/
|
||||||
List<CommonUserOrderExcel> exportOrder(@Param("ew") Wrapper<CommonUserOrderEntity> queryWrapper);
|
List<CommonUserOrderExcel> exportOrder(@Param("ew") Wrapper<CommonUserOrderEntity> queryWrapper);
|
||||||
|
|
||||||
List<CommonUserOrderVO> selectOrderExcelList(Long userId, Date startDate, Date endDate);
|
List<CommonUserOrderVO> selectOrderExcelList(Integer orderStatus, String account ,Date startDate, Date endDate , String orderType);
|
||||||
|
|
||||||
|
Long countOrderExcelList(Integer orderStatus, String account ,Date startDate, Date endDate , String orderType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,13 @@
|
|||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="CommonUserTourOrderResultMap" type="org.springblade.modules.common.pojo.vo.CommonUserTourOrderVO">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result column="traveler_detail" property="travelerDetail" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
|
||||||
|
<result column="product_snapshot" property="productSnapshot" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectOrderPage" resultMap="CommonUserOrderResultMap">
|
<select id="selectOrderPage" resultMap="CommonUserOrderResultMap">
|
||||||
select uo.*, bu.account as account , mp.specs
|
select uo.*, bu.account as account , mp.specs
|
||||||
@@ -66,14 +73,62 @@
|
|||||||
and uo.create_time < #{order.endDate}
|
and uo.create_time < #{order.endDate}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="order.orderType != null and order.orderType !='' ">
|
||||||
|
AND UPPER(uo.order_type) = UPPER(#{order.orderType})
|
||||||
|
</if>
|
||||||
|
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectTourOrderPage" resultMap="CommonUserTourOrderResultMap">
|
||||||
|
select
|
||||||
|
tod.id as order_detail_id,
|
||||||
|
tod.traveler_detail,
|
||||||
|
tod.product_snapshot,
|
||||||
|
tod.contract_url,
|
||||||
|
tod.contract_status,
|
||||||
|
tod.guide_name,
|
||||||
|
tod.guide_phone,
|
||||||
|
tod.start_date as tour_start_date,
|
||||||
|
tod.end_date as tour_end_date,
|
||||||
|
tod.remark,
|
||||||
|
uo.*,
|
||||||
|
bu.account as account
|
||||||
|
from tour_order_detail tod
|
||||||
|
left join user_order uo on tod.order_id = uo.id
|
||||||
|
left join blade_user bu on uo.user_id = bu.id
|
||||||
|
where tod.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>
|
||||||
|
|
||||||
|
<if test="order.startDate != null">
|
||||||
|
and uo.create_time >= #{order.startDate}
|
||||||
|
and uo.create_time < #{order.endDate}
|
||||||
|
</if>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectOrderEntityPage" resultType="org.springblade.modules.common.pojo.entity.CommonUserOrderEntity">
|
<select id="selectOrderEntityPage" resultType="org.springblade.modules.common.pojo.entity.CommonUserOrderEntity">
|
||||||
select * from user_order where is_deleted = 0 and user_id = #{order.userId}
|
select * from user_order where is_deleted = 0 and user_id = #{order.userId}
|
||||||
<if test="order.orderStatus !=null and order.orderStatus > 0 ">
|
<if test="order.orderStatus !=null and order.orderStatus > 0 ">
|
||||||
and order_status = #{order.orderStatus}
|
and order_status = #{order.orderStatus}
|
||||||
</if>
|
</if>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@@ -88,10 +143,17 @@
|
|||||||
left join blade_user bu on uo.user_id = bu.id
|
left join blade_user bu on uo.user_id = bu.id
|
||||||
left join mall_product mp ON CAST(uo.item_code AS BIGINT) = mp.id
|
left join mall_product mp ON CAST(uo.item_code AS BIGINT) = mp.id
|
||||||
where uo.is_deleted = 0
|
where uo.is_deleted = 0
|
||||||
and uo.payment_status = 1
|
|
||||||
|
|
||||||
<if test="userId != null">
|
<if test="orderStatus != null ">
|
||||||
and uo.user_id = #{userId}
|
and uo.order_status = #{orderStatus}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="orderType != null and orderType !='' ">
|
||||||
|
AND UPPER(uo.order_type) = UPPER(#{orderType})
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="account != null and account != '' ">
|
||||||
|
and bu.account = #{account}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="startDate != null">
|
<if test="startDate != null">
|
||||||
@@ -102,4 +164,35 @@
|
|||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="countOrderExcelList" resultType="java.lang.Long">
|
||||||
|
select count(*)
|
||||||
|
from user_order uo
|
||||||
|
left join blade_user bu on uo.user_id = bu.id
|
||||||
|
left join mall_product mp ON CAST(uo.item_code AS BIGINT) = mp.id
|
||||||
|
where uo.is_deleted = 0
|
||||||
|
and uo.payment_status = 1
|
||||||
|
|
||||||
|
<if test="orderStatus != null">
|
||||||
|
and uo.order_status = #{orderStatus}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="orderType != null and orderType !='' ">
|
||||||
|
AND UPPER(uo.order_type) = UPPER(#{orderType})
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="account != null and account != '' ">
|
||||||
|
and bu.account = #{account}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="startDate != null">
|
||||||
|
and uo.create_time >= #{startDate}
|
||||||
|
and uo.create_time < #{endDate}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.CulturalTourismSpotEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CulturalTourismSpotVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
public interface CulturalTourismSpotMapper extends BaseMapper<CulturalTourismSpotEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param culturalTourismSpot 查询参数
|
||||||
|
* @return List<CulturalTourismSpotVO>
|
||||||
|
*/
|
||||||
|
List<CulturalTourismSpotVO> selectCulturalTourismSpotPage(IPage page, CulturalTourismSpotVO culturalTourismSpot);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?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.CulturalTourismSpotMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="culturalTourismSpotResultMap" type="org.springblade.modules.common.pojo.entity.CulturalTourismSpotEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="spot_name" property="spotName"/>
|
||||||
|
<result column="rating" property="rating"/>
|
||||||
|
<result column="visit_count" property="visitCount"/>
|
||||||
|
<result column="thumbnail_url" property="thumbnailUrl"/>
|
||||||
|
<result column="main_image_url" property="mainImageUrl" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="detail_images" property="detailImages" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="video_url" property="videoUrl"/>
|
||||||
|
<result column="summary" property="summary"/>
|
||||||
|
<result column="description" property="description"/>
|
||||||
|
<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="selectCulturalTourismSpotPage" resultMap="culturalTourismSpotResultMap">
|
||||||
|
select * from cultural_tourism_spot where is_deleted = 0 order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springblade.modules.api.request.MerchantStoreRequest;
|
||||||
|
import org.springblade.modules.api.vo.CommonMerchantStoreApiVO;
|
||||||
|
import org.springblade.modules.api.vo.CommonMerchantStoreDetailApiVO;
|
||||||
|
import org.springblade.modules.common.pojo.entity.MerchantFlagshipStoreEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.MerchantFlagshipStoreVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
public interface MerchantFlagshipStoreMapper extends BaseMapper<MerchantFlagshipStoreEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param merchantFlagshipStore 查询参数
|
||||||
|
* @return List<MerchantFlagshipStoreVO>
|
||||||
|
*/
|
||||||
|
List<MerchantFlagshipStoreVO> selectMerchantFlagshipStorePage(IPage page, MerchantFlagshipStoreVO merchantFlagshipStore);
|
||||||
|
|
||||||
|
|
||||||
|
List<CommonMerchantStoreApiVO> merchantStoreList(
|
||||||
|
@Param("request") MerchantStoreRequest request,
|
||||||
|
@Param("offset") int offset,
|
||||||
|
@Param("limit") int limit
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. 只查总数 (复用你之前写好的逻辑,或者单独写一个简单的)
|
||||||
|
* 这里的 ID 可以随意,只要 XML 对应即可
|
||||||
|
*/
|
||||||
|
Long merchantStoreListCount(@Param("request") MerchantStoreRequest request);
|
||||||
|
|
||||||
|
CommonMerchantStoreDetailApiVO merchantStoreDetail(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<?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.MerchantFlagshipStoreMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="merchantFlagshipStoreResultMap" type="org.springblade.modules.common.pojo.entity.MerchantFlagshipStoreEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="store_name" property="storeName"/>
|
||||||
|
<result column="contact_phone" property="contactPhone"/>
|
||||||
|
<result column="regions_id" property="regionsId"/>
|
||||||
|
<result column="full_address" property="fullAddress"/>
|
||||||
|
<result column="main_image_url" property="mainImageUrl" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="thumbnail_url" property="thumbnailUrl"/>
|
||||||
|
<result column="detail_images" property="detailImages" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="business_hours" property="businessHours"/>
|
||||||
|
<result column="store_description" property="storeDescription"/>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap id="merchantStoreDetailApiMap" type="org.springblade.modules.api.vo.CommonMerchantStoreDetailApiVO">
|
||||||
|
<result column="store_name" property="storeName"/>
|
||||||
|
<result column="contact_phone" property="contactPhone"/>
|
||||||
|
<result column="full_address" property="fullAddress"/>
|
||||||
|
<result column="main_image_url" property="mainImageUrl" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="detail_images" property="detailImages" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="business_hours" property="businessHours"/>
|
||||||
|
<result column="store_description" property="storeDescription"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectMerchantFlagshipStorePage" resultMap="merchantFlagshipStoreResultMap">
|
||||||
|
select * from merchant_flagship_store where is_deleted = 0 order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 1. 手动定义的 Count 查询 (解决分页插件解析 <-> 报错的问题) -->
|
||||||
|
<select id="merchantStoreListCount" resultType="java.lang.Long">
|
||||||
|
SELECT COUNT(*) FROM (
|
||||||
|
SELECT 1
|
||||||
|
FROM merchant_flagship_store
|
||||||
|
WHERE
|
||||||
|
ST_DWithin(location, ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326), 5000000)
|
||||||
|
AND is_deleted = 0
|
||||||
|
) TOTAL
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 2. 原始数据查询 -->
|
||||||
|
<select id="merchantStoreList" resultType="org.springblade.modules.api.vo.CommonMerchantStoreApiVO">
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
store_name,
|
||||||
|
full_address,
|
||||||
|
thumbnail_url,
|
||||||
|
ST_X(location) AS lng,
|
||||||
|
ST_Y(location) AS lat,
|
||||||
|
ROUND(ST_DistanceSphere(location, ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326))::numeric, 2) AS distance
|
||||||
|
FROM
|
||||||
|
merchant_flagship_store
|
||||||
|
WHERE
|
||||||
|
ST_DWithin(location, ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326), 5000000)
|
||||||
|
AND is_deleted = 0
|
||||||
|
ORDER BY
|
||||||
|
location <-> ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326)
|
||||||
|
LIMIT #{limit} OFFSET #{offset}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="merchantStoreDetail" resultMap="merchantStoreDetailApiMap">
|
||||||
|
select
|
||||||
|
store_name,
|
||||||
|
contact_phone,
|
||||||
|
full_address,
|
||||||
|
main_image_url,
|
||||||
|
detail_images,
|
||||||
|
business_hours,
|
||||||
|
store_description,
|
||||||
|
ST_X(location) AS lng,
|
||||||
|
ST_Y(location) AS lat
|
||||||
|
from
|
||||||
|
merchant_flagship_store
|
||||||
|
where
|
||||||
|
is_deleted = 0 and id = #{id}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.api.request.MerchantStoreRequest;
|
||||||
|
import org.springblade.modules.api.vo.CommonMerchantStoreApiVO;
|
||||||
|
import org.springblade.modules.common.pojo.entity.NewsCategoryEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.NewsCategoryVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
public interface NewsCategoryMapper extends BaseMapper<NewsCategoryEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param newsCategory 查询参数
|
||||||
|
* @return List<NewsCategoryVO>
|
||||||
|
*/
|
||||||
|
List<NewsCategoryVO> selectNewsCategoryPage(IPage page, NewsCategoryVO newsCategory);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?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.NewsCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="newsCategoryResultMap" type="org.springblade.modules.common.pojo.entity.NewsCategoryEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="category_name" property="categoryName"/>
|
||||||
|
<result column="sort_order" property="sortOrder"/>
|
||||||
|
<result column="is_top" property="isTop"/>
|
||||||
|
<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="selectNewsCategoryPage" resultMap="newsCategoryResultMap">
|
||||||
|
select * from news_category where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.NewsContentEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.NewsContentVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
public interface NewsContentMapper extends BaseMapper<NewsContentEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param newsContent 查询参数
|
||||||
|
* @return List<NewsContentVO>
|
||||||
|
*/
|
||||||
|
List<NewsContentVO> selectNewsContentPage(IPage page, NewsContentVO newsContent);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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.NewsContentMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="newsContentResultMap" type="org.springblade.modules.common.pojo.entity.NewsContentEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="category_id" property="categoryId"/>
|
||||||
|
<result column="title" property="title"/>
|
||||||
|
<result column="summary" property="summary"/>
|
||||||
|
<result column="content_type" property="contentType"/>
|
||||||
|
<result column="video_url" property="videoUrl"/>
|
||||||
|
<result column="play_count" property="playCount"/>
|
||||||
|
<result column="thumbnail_url" property="thumbnailUrl"/>
|
||||||
|
<result column="main_image_url" property="mainImageUrl" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="detail_images" property="detailImages" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="article_content" property="articleContent"/>
|
||||||
|
<result column="comment_count" property="commentCount"/>
|
||||||
|
<result column="is_featured" property="isFeatured"/>
|
||||||
|
<result column="sort_order" property="sortOrder"/>
|
||||||
|
<result column="view_count" property="viewCount"/>
|
||||||
|
<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="selectNewsContentPage" resultMap="newsContentResultMap">
|
||||||
|
select * from news_content where is_deleted = 0 order by id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourOrderDetailEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.TourOrderDetailVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
public interface TourOrderDetailMapper extends BaseMapper<TourOrderDetailEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param tourOrderDetail 查询参数
|
||||||
|
* @return List<TourOrderDetailVO>
|
||||||
|
*/
|
||||||
|
List<TourOrderDetailVO> selectTourOrderDetailPage(IPage page, TourOrderDetailVO tourOrderDetail);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?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.TourOrderDetailMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="tourOrderDetailResultMap" type="org.springblade.modules.common.pojo.entity.TourOrderDetailEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="order_id" property="orderId"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="traveler_detail" property="travelerDetail" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
|
||||||
|
<result column="product_snapshot" property="productSnapshot" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
|
||||||
|
<result column="contract_url" property="contractUrl"/>
|
||||||
|
<result column="contract_status" property="contractStatus"/>
|
||||||
|
<result column="guide_name" property="guideName"/>
|
||||||
|
<result column="guide_phone" property="guidePhone"/>
|
||||||
|
<result column="start_date" property="startDate"/>
|
||||||
|
<result column="end_date" property="endDate"/>
|
||||||
|
<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="selectTourOrderDetailPage" resultMap="tourOrderDetailResultMap">
|
||||||
|
select * from tour_order_detail where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.TourProductEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.TourProductVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游产品 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
public interface TourProductMapper extends BaseMapper<TourProductEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param tourProduct 查询参数
|
||||||
|
* @return List<TourProductVO>
|
||||||
|
*/
|
||||||
|
List<TourProductVO> selectTourProductPage(IPage page, TourProductVO tourProduct);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.TourProductMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="tourProductResultMap" type="org.springblade.modules.common.pojo.entity.TourProductEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="product_name" property="productName"/>
|
||||||
|
<result column="sub_title" property="subTitle"/>
|
||||||
|
<result column="thumbnail_url" property="thumbnailUrl"/>
|
||||||
|
<result column="main_image_url" property="mainImageUrl" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="detail_images" property="detailImages" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
|
||||||
|
<result column="city_name" property="cityName"/>
|
||||||
|
<result column="duration_days" property="durationDays"/>
|
||||||
|
<result column="duration_nights" property="durationNights"/>
|
||||||
|
<result column="base_price" property="basePrice"/>
|
||||||
|
<result column="adult_price" property="adultPrice"/>
|
||||||
|
<result column="child_price" property="childPrice"/>
|
||||||
|
<result column="elderly_price" property="elderlyPrice"/>
|
||||||
|
<result column="min_people" property="minPeople"/>
|
||||||
|
<result column="max_people" property="maxPeople"/>
|
||||||
|
<result column="require_id_card" property="requireIdCard"/>
|
||||||
|
<result column="require_passport" property="requirePassport"/>
|
||||||
|
<result column="require_hk_macau_pass" property="requireHkMacauPass"/>
|
||||||
|
<result column="description" property="description"/>
|
||||||
|
<result column="visit_count" property="visitCount"/>
|
||||||
|
<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="selectTourProductPage" resultMap="tourProductResultMap">
|
||||||
|
select * from tour_product where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.springblade.modules.common.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusinessModulePayTypeDTO {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private List<PayType> payTypeList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class PayType {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
private Integer isEnable;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.CommonOrderConfirmLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单确认收货记录 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommonOrderConfirmLogDTO extends CommonOrderConfirmLogEntity {
|
||||||
|
@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.CommonTourInfoEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础出行人档案 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommonTourInfoDTO extends CommonTourInfoEntity {
|
||||||
|
@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.CulturalTourismSpotEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文旅景点信息 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CulturalTourismSpotDTO extends CulturalTourismSpotEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.springblade.modules.common.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class LocationDTO implements Serializable {
|
||||||
|
|
||||||
|
private Double longitude;
|
||||||
|
|
||||||
|
private Double latitude;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user