Compare commits
39 Commits
release-20
...
1a8e0d07bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a8e0d07bb | ||
|
|
8bb7fa49d5 | ||
|
|
e2496d4bfd | ||
| 539e28762c | |||
| 7e1a58eb66 | |||
|
|
2cf3aa552a | ||
|
|
e8573b90db | ||
| e04672fbeb | |||
| 2d89f30925 | |||
|
|
a9824fe6c3 | ||
|
|
a51369ad85 | ||
|
|
fca67baccb | ||
| 3712034b1d | |||
| 92ee5438d8 | |||
| 1fb4082744 | |||
| 70993a163b | |||
|
|
b8146181c7 | ||
| 3c5f3c4c5e | |||
| e9c5b2a95b | |||
| 1ca7528c45 | |||
| 8f50f02b92 | |||
|
|
75e737ada8 | ||
| 59782c4ba7 | |||
|
|
16533f3e44 | ||
|
|
f98e178a20 | ||
|
|
8b0521a69d | ||
|
|
f4b994e6d9 | ||
| ee02df1a8c | |||
| f9d7ae75e9 | |||
|
|
f955917cc5 | ||
| f528e4f07c | |||
| 8cbabac829 | |||
|
|
4146d4cf03 | ||
|
|
041259e92c | ||
| b769ff9f71 | |||
| db4a1c587b | |||
|
|
a49ed00e37 | ||
| b4d8384150 | |||
| 6e41399631 |
39
doc/sql/executed/20260224_increase.sql
Normal file
39
doc/sql/executed/20260224_increase.sql
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
DROP TABLE IF EXISTS user_sms_log;
|
||||||
|
CREATE TABLE user_sms_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键
|
||||||
|
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
|
||||||
|
sms_type int4 NOT NULL DEFAULT 0, -- 短信类型 0-找回密码
|
||||||
|
content TEXT, -- 存储短信业务发送的具体内容,用于回溯审计
|
||||||
|
stat_date timestamp(6) NOT NULL, -- 统计日期,格式 '2026-02-24'
|
||||||
|
remarks varchar(200) NULL, -- 备注
|
||||||
|
create_user int8 NULL, -- 创建人
|
||||||
|
create_dept int8 NULL, -- 创建部门
|
||||||
|
create_time timestamp(6) NULL, -- 创建时间
|
||||||
|
update_user int8 NULL, -- 修改人
|
||||||
|
update_time timestamp(6) NULL, -- 修改时间
|
||||||
|
status int4 NULL, -- 状态
|
||||||
|
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 用于按天统计查询用户发送短信次数
|
||||||
|
CREATE INDEX idx_usl_stat ON user_sms_log (user_id, sms_type, stat_date, create_time);
|
||||||
|
-- 用于按时间倒序查看某个用户的发送记录
|
||||||
|
CREATE INDEX idx_usl_uid_time ON user_sms_log (user_id, sms_type, create_time DESC);
|
||||||
|
|
||||||
|
COMMENT ON TABLE user_sms_log IS '用户短信日志';
|
||||||
|
COMMENT ON COLUMN user_sms_log.id IS '主键';
|
||||||
|
COMMENT ON COLUMN user_sms_log.user_id IS '用户id';
|
||||||
|
COMMENT ON COLUMN user_sms_log.sms_type IS '短信类型 0-找回密码';
|
||||||
|
COMMENT ON COLUMN user_sms_log.content IS '存储短信业务发送的具体内容,用于回溯审计';
|
||||||
|
COMMENT ON COLUMN user_sms_log.stat_date IS '统计日期';
|
||||||
|
COMMENT ON COLUMN user_sms_log.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN user_sms_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN user_sms_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_sms_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_sms_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_sms_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
270
doc/sql/executed/20260310_increase.sql
Normal file
270
doc/sql/executed/20260310_increase.sql
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
DROP TABLE IF EXISTS market_upgrade_config;
|
||||||
|
CREATE TABLE market_upgrade_config
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
type int4 NOT NULL, -- 等级类型:1=福利值, 2=现金
|
||||||
|
level_name varchar(50) NOT NULL, -- 等级名称,如 '社区经销商V1', '无等级'
|
||||||
|
direct_recommend int4, -- 直推人数 (持有福利包人数 / 统计现金下单人数)
|
||||||
|
requirement_value decimal(20, 2), -- 要求值 (福利值 / 金额),使用 numeric 防止金额精度丢失
|
||||||
|
reward_rate decimal(5, 2), -- 加速/分红比例 (如 8% 存为 8.00)
|
||||||
|
description varchar(255), -- 详细规则备注 (对应图片中的括号说明)
|
||||||
|
sort_order int4 DEFAULT 0, -- 排序
|
||||||
|
next_level_id int8, -- 下一个等级的ID (关联自身ID)
|
||||||
|
has_next_level 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 market_upgrade_config IS '用户等级升级配置表';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.type IS '等级类型:1=福利值, 2=现金';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.level_name IS '等级名称';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.direct_recommend IS '直推人数要求';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.requirement_value IS '业绩/福利值要求';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.reward_rate IS '加速或分红比例';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.description IS '等级详细说明';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.next_level_id IS '下一个等级的ID';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.has_next_level IS '是否拥有下一级';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_upgrade_config.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (1, 1, '无等级', 0, '0.00', '0.00', '初始等级', 1, 2, 1, NULL, NULL, '2026-03-11 17:26:31.524', NULL, '2026-03-11 17:26:31.524', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2, 1, '社区经销商V1', 10, '100000.00', '0.08', '福利包加速动态: 社区经销商V1', 2, 3, 1, NULL, NULL, '2026-03-11 17:26:31.524', NULL, '2026-03-11 17:26:31.524', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (3, 1, '区县经销商V2', 20, '1000000.00', '0.06', '福利包加速动态: 区县经销商V2', 3, 4, 1, NULL, NULL, '2026-03-11 17:26:31.524', NULL, '2026-03-11 17:26:31.524', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (4, 1, '市级经销商V3', 30, '5000000.00', '0.04', '福利包加速动态: 市级经销商V3', 4, 5, 1, NULL, NULL, '2026-03-11 17:26:31.524', NULL, '2026-03-11 17:26:31.524', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (5, 1, '联合创始人V4', 40, '20000000.00', '0.02', '福利包加速动态: 联合创始人V4', 5, NULL, 0, NULL, NULL, '2026-03-11 17:26:31.524', NULL, '2026-03-11 17:26:31.524', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (6, 2, '无等级', 0, '0.00', '0.00', '初始等级', 1, 7, 1, NULL, NULL, '2026-03-11 17:28:42.821', NULL, '2026-03-11 17:28:42.821', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (7, 2, '社区经销商V1', 10, '100000.00', '0.05', '现金加速动态: 社区经销商V1', 2, 8, 1, NULL, NULL, '2026-03-11 17:28:42.822', NULL, '2026-03-11 17:28:42.822', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (8, 2, '区县经销商V2', 20, '1000000.00', '0.05', '现金加速动态: 区县经销商V2', 3, 9, 1, NULL, NULL, '2026-03-11 17:28:42.822', NULL, '2026-03-11 17:28:42.822', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (9, 2, '市级经销商V3', 30, '5000000.00', '0.05', '现金加速动态: 市级经销商V3', 4, 10, 1, NULL, NULL, '2026-03-11 17:28:42.822', NULL, '2026-03-11 17:28:42.822', 1, 0);
|
||||||
|
INSERT INTO "market_upgrade_config" ("id", "type", "level_name", "direct_recommend", "requirement_value", "reward_rate", "description", "sort_order", "next_level_id", "has_next_level", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (10, 2, '联合创始人V4', 40, '20000000.00', '0.05', '现金加速动态: 联合创始人V4(全网加权,单独乘区,不累加级差)', 5, NULL, 0, NULL, NULL, '2026-03-11 17:28:42.822', NULL, '2026-03-11 17:28:42.822', 1, 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_upgrade_welfare_log;
|
||||||
|
CREATE TABLE market_upgrade_welfare_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
|
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
||||||
|
current_level_id int8, -- 用户当前等级
|
||||||
|
current_level_name varchar(50), -- 用户当前等级
|
||||||
|
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
||||||
|
remarks 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 -- 是否已删除
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX idx_muwl_uid
|
||||||
|
ON market_upgrade_welfare_log (user_id, upgrade_date ,create_time DESC);
|
||||||
|
|
||||||
|
COMMENT ON TABLE market_upgrade_welfare_log IS '用户福利包升级日志表';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.user_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.last_level IS '升级前等级';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.current_level_id IS '当前等级ID';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.current_level_name IS '当前等级名称';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.upgrade_date IS '升级日期';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.remarks IS '升级详情备注';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_upgrade_welfare_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_upgrade_cash_log;
|
||||||
|
CREATE TABLE market_upgrade_cash_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
|
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
||||||
|
current_level_id int8, -- 用户当前等级
|
||||||
|
current_level_name varchar(50), -- 用户当前等级
|
||||||
|
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
||||||
|
remarks 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 -- 是否已删除
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX idx_mucl_uid
|
||||||
|
ON market_upgrade_cash_log (user_id, upgrade_date ,create_time DESC);
|
||||||
|
COMMENT ON TABLE market_upgrade_cash_log IS '用户现金升级日志表';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.user_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.last_level IS '升级前等级';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.current_level_id IS '当前等级ID';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.current_level_name IS '当前等级名称';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.upgrade_date IS '升级日期';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.remarks IS '升级详情备注';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_upgrade_cash_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_welfare_performance;
|
||||||
|
CREATE TABLE market_welfare_performance
|
||||||
|
(
|
||||||
|
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
||||||
|
owen_amount decimal(14, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
||||||
|
total_amount decimal(14, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
||||||
|
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
||||||
|
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 market_welfare_performance IS '福利包业绩表';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.owen_amount IS '自身业绩';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.total_amount IS '总业绩';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.version IS '版本号';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_welfare_performance_log;
|
||||||
|
CREATE TABLE market_welfare_performance_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
|
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
||||||
|
performance decimal(14, 2) NOT NULL, -- 业绩
|
||||||
|
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
||||||
|
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
||||||
|
remarks 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 market_welfare_performance_log IS '福利包业绩日志表';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.user_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.stat_date IS '统计时间';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.performance IS '当前业绩';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.source_id IS '来源ID';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.source_detail IS '来源详情';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_welfare_performance_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
CREATE INDEX idx_mwpl_uid ON market_welfare_performance_log (user_id, stat_date DESC);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_cash_performance;
|
||||||
|
CREATE TABLE market_cash_performance
|
||||||
|
(
|
||||||
|
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
||||||
|
owen_amount decimal(14, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
||||||
|
total_amount decimal(14, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
||||||
|
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
||||||
|
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 market_cash_performance IS '现金业绩表';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.id IS '主键ID';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.owen_amount IS '自身业绩';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.total_amount IS '总业绩';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.version IS '版本号';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_cash_performance.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS market_cash_performance_log;
|
||||||
|
CREATE TABLE market_cash_performance_log
|
||||||
|
(
|
||||||
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
|
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
||||||
|
performance decimal(14, 2) NOT NULL, -- 业绩
|
||||||
|
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
||||||
|
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
||||||
|
remarks 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 market_cash_performance_log IS '现金业绩日志表';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.user_id IS '用户ID';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.stat_date IS '统计时间';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.performance IS '当前业绩';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.source_id IS '来源ID';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.source_detail IS '来源详情';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.status IS '状态';
|
||||||
|
COMMENT ON COLUMN market_cash_performance_log.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
CREATE INDEX idx_mcpl_uid ON market_cash_performance_log (user_id, stat_date DESC);
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------ 参数配置
|
||||||
|
|
||||||
|
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 (2029205589205626881, '后台划拨福利包数量配置', 'market.benefit.pack.allocate.number', '{2019440113307066370:10,2019440172115402754:4,2019440222086340610:2,2019440263022747650:1}', '后台划拨福利包数量配置', null, null, '2026-03-04 22:41:27.922000', null, '2026-03-04 22:41:27.922000', 1, 0);
|
||||||
|
|
||||||
|
|
||||||
380
doc/sql/pending/20260316_increase.sql
Normal file
380
doc/sql/pending/20260316_increase.sql
Normal file
@@ -0,0 +1,380 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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, -- 用户评分
|
||||||
|
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.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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
20
pom.xml
20
pom.xml
@@ -277,6 +277,26 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot3-starter</artifactId>
|
||||||
|
<version>1.7.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.locationtech.jts</groupId>
|
||||||
|
<artifactId>jts-core</artifactId>
|
||||||
|
<version>1.19.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,267 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
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.event.MarketUpgradeNoticeEvent;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
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.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金动态升级- 现金分红
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AccelUpgradeCashProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
|
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
private final IUserService userService;
|
||||||
|
private final BladeRedis bladeRedis;
|
||||||
|
private final IMarketUserCommissionService userCommissionService;
|
||||||
|
private final IMarketUserCommissionLogService userCommissionLogService;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
Date startDate = DateUtil.getYesterday();
|
||||||
|
Date endDate = DateUtil.getToday();
|
||||||
|
|
||||||
|
List<MarketUpgradeCashLogEntity> list = upgradeCashLogService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeCashLogEntity.class)
|
||||||
|
.eq(MarketUpgradeCashLogEntity::getUpgradeDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
|
||||||
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
|
.eq(MarketUpgradeConfigEntity::getType, 2)
|
||||||
|
.orderByAsc(MarketUpgradeConfigEntity::getSortOrder)
|
||||||
|
);
|
||||||
|
Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap = upgradeConfigList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeConfigEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
|
||||||
|
Map<Long, MarketUpgradeCashLogEntity> upgradeCashLogMap = list.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeCashLogEntity::getUserId, Function.identity()));
|
||||||
|
|
||||||
|
BigDecimal totalRewardRate = upgradeConfigList.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
BigDecimal amount = entity.getRewardRate();
|
||||||
|
if (amount == null) return BigDecimal.ZERO;
|
||||||
|
return amount;
|
||||||
|
})
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
totalRewardRate = totalRewardRate.subtract(upgradeConfigList.get(upgradeConfigList.size() - 1).getRewardRate());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 1. 分页查询订单 (修复内存溢出风险)
|
||||||
|
List<CommonUserOrderEntity> orderPageList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentStatus, 1)
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.lt(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
.orderByAsc(CommonUserOrderEntity::getId) // 稳定排序
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = new ArrayList<>();
|
||||||
|
Map<Long, BigDecimal> userRewardRateMap = new HashMap<>();
|
||||||
|
Map<Long, BigDecimal> userLastAmountMap = new HashMap<>();
|
||||||
|
List<MarketUserCommissionLogEntity> userCommissionLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
// 6. 处理订单
|
||||||
|
for (CommonUserOrderEntity order : orderPageList) {
|
||||||
|
Long userId = order.getUserId();
|
||||||
|
|
||||||
|
// 安全获取金额
|
||||||
|
BigDecimal actualAmount = order.getActualAmount();
|
||||||
|
if (actualAmount == null) {
|
||||||
|
actualAmount = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
BigDecimal finalActualAmount = actualAmount;
|
||||||
|
// 构建详情
|
||||||
|
String sourceDetail = String.format("现金加速详情:订单号:%d;商品:%s;实付金额:%s元",
|
||||||
|
order.getId(), order.getItemName(), actualAmount);
|
||||||
|
|
||||||
|
// 获取用户账号 (用于脱敏)
|
||||||
|
User user = userService.getById(userId);
|
||||||
|
String account = user != null ? SensitiveUtil.process(user.getAccount()) : "未知";
|
||||||
|
String remarks = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") + "现金加速,来源:" + account;
|
||||||
|
|
||||||
|
|
||||||
|
// 获取该用户的所有上级ID (包含自己)
|
||||||
|
List<Long> ancestorIds = selectAncestorId(userId);
|
||||||
|
// 移除列表中等于 userId 的元素
|
||||||
|
ancestorIds.remove(userId);
|
||||||
|
|
||||||
|
BigDecimal accelerationPoint = totalRewardRate.multiply(finalActualAmount).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
if (accelerationPoint.compareTo(BigDecimal.ZERO) <= 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
long indexLevelId = upgradeConfigList.get(0).getId();
|
||||||
|
MarketUpgradeCashLogEntity userLog = upgradeCashLogMap.get(userId);
|
||||||
|
if (userLog != null) {
|
||||||
|
indexLevelId = userLog.getCurrentLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (Long ancestorId : ancestorIds){
|
||||||
|
if (accelerationPoint.compareTo(BigDecimal.ZERO) <= 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!upgradeCashLogMap.containsKey(ancestorId)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
MarketUpgradeCashLogEntity upgradeCashLog = upgradeCashLogMap.get(ancestorId);
|
||||||
|
|
||||||
|
long currentLevelId = upgradeCashLog.getCurrentLevelId();
|
||||||
|
|
||||||
|
|
||||||
|
if (indexLevelId >= currentLevelId) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal rewardRate = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
// 2. 持续尝试升级,直到不满足条件或到达顶层
|
||||||
|
while (true) {
|
||||||
|
MarketUpgradeConfigEntity config = upgradeConfigMap.get(indexLevelId);
|
||||||
|
if (config == null || config.getId() > currentLevelId) break;
|
||||||
|
|
||||||
|
// 安全获取比例
|
||||||
|
BigDecimal rate = config.getRewardRate();
|
||||||
|
BigDecimal configRate = rate == null ? BigDecimal.ZERO : rate;
|
||||||
|
|
||||||
|
if (config.getHasNextLevel() == 1 && config.getId() < 10){
|
||||||
|
rewardRate = rewardRate.add(configRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (config.getHasNextLevel() != 1) break;
|
||||||
|
indexLevelId = config.getNextLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal rewardRatePoint = rewardRate.multiply(finalActualAmount).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userLastAmountMap.containsKey(ancestorId)){
|
||||||
|
MarketUserCommissionEntity benefitPoint = userCommissionService.getById(ancestorId);
|
||||||
|
if (benefitPoint == null){
|
||||||
|
benefitPoint = new MarketUserCommissionEntity();
|
||||||
|
benefitPoint.setId(ancestorId);
|
||||||
|
benefitPoint.setCreateUser(ancestorId);
|
||||||
|
userCommissionService.save(benefitPoint);
|
||||||
|
userLastAmountMap.put(ancestorId, benefitPoint.getAmount());
|
||||||
|
}else {
|
||||||
|
userLastAmountMap.put(ancestorId, benefitPoint.getAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userRewardRateMap.containsKey(ancestorId)){
|
||||||
|
userRewardRateMap.put(ancestorId, rewardRatePoint);
|
||||||
|
}else {
|
||||||
|
userRewardRateMap.put(ancestorId, userRewardRateMap.get(ancestorId).add(rewardRatePoint));
|
||||||
|
}
|
||||||
|
|
||||||
|
MarketUserCommissionLogEntity userCommissionLog = new MarketUserCommissionLogEntity()
|
||||||
|
.setUserId(ancestorId)
|
||||||
|
.setAmount(rewardRatePoint)
|
||||||
|
.setLastAmount(userLastAmountMap.get(ancestorId))
|
||||||
|
.setSourceId(userId)
|
||||||
|
.setSourceDetail(sourceDetail)
|
||||||
|
.setType(1)
|
||||||
|
.setSourceType(MarketBusinessModule.CASH_ACCELERATION.getCode())
|
||||||
|
.setIsComplete(1)
|
||||||
|
.setRemark(remarks + ",加速比例:" + rewardRate + ",加速金额:" + rewardRatePoint )
|
||||||
|
.setStatisticalDate(DateUtil.getYesterday());
|
||||||
|
userCommissionLogList.add(userCommissionLog);
|
||||||
|
if (userLastAmountMap.containsKey(ancestorId)){
|
||||||
|
userLastAmountMap.merge(ancestorId, rewardRatePoint, BigDecimal::add);
|
||||||
|
}else {
|
||||||
|
userLastAmountMap.put(ancestorId, rewardRatePoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
accelerationPoint = accelerationPoint.subtract(rewardRatePoint);
|
||||||
|
|
||||||
|
noticeItems.add(
|
||||||
|
new MarketUpgradeNoticeEvent.NoticeItem(userCommissionLog.getUserId() ,userCommissionLog.getRemark())
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
|
noticeItems,
|
||||||
|
MarketBusinessModule.CASH_ACCELERATION
|
||||||
|
);
|
||||||
|
|
||||||
|
userRewardRateMap.forEach((userId, rewardRate) -> {
|
||||||
|
MarketUserCommissionEntity benefitPoint = userCommissionService.getById(userId);
|
||||||
|
benefitPoint.setAmount(benefitPoint.getAmount().add(rewardRate));
|
||||||
|
userCommissionService.updateById(benefitPoint);
|
||||||
|
});
|
||||||
|
userCommissionLogService.saveBatch(userCommissionLogList , 5000);
|
||||||
|
publisher.publishEvent(event);
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private List<Long> selectAncestorId(Long userId){
|
||||||
|
List<Long> userAncestorCache = new ArrayList<>(List.of(userId));
|
||||||
|
String key = "yiyu:market:user:ancestor:";
|
||||||
|
Object ancestorIdsObject = bladeRedis.get(key + userId);
|
||||||
|
if (ancestorIdsObject == null) {
|
||||||
|
userAncestorCache.addAll(marketInfoService.selectAncestorIds(userId));
|
||||||
|
bladeRedis.set(key + userId, userAncestorCache);
|
||||||
|
}else {
|
||||||
|
return JSONArray.parseArray(JSONArray.toJSONString(ancestorIdsObject), Long.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
return userAncestorCache;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,359 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
|
import org.springblade.modules.market.service.*;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包动态升级- 福利积分加速
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AccelUpgradeWelfareProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
|
private final IMarketUpgradeWelfareLogService upgradeWelfareLogService;
|
||||||
|
private final IMarketBenefitPackageTemplateService benefitPackageTemplateService;
|
||||||
|
private final IMarketBenefitPackageService benefitPackageService;
|
||||||
|
private final IMarketBenefitPointService benefitPointService;
|
||||||
|
private final IMarketBenefitPointLogService benefitPointLogService;
|
||||||
|
private final BladeRedis bladeRedis;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
// 1. 初始化配置
|
||||||
|
Date searchDate = DateUtil.getYesterday();
|
||||||
|
|
||||||
|
// 2. 预加载基础数据 (减少循环内DB查询)
|
||||||
|
List<MarketBenefitPackageTemplateEntity> templateEntityList = benefitPackageTemplateService.list();
|
||||||
|
Map<Long, MarketBenefitPackageTemplateEntity> templateEntityMap = templateEntityList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketBenefitPackageTemplateEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 用户福利包list
|
||||||
|
List<MarketBenefitPackageEntity> benefitPackageEntityList = benefitPackageService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||||
|
.eq(MarketBenefitPackageEntity::getStatisticalDate, searchDate)
|
||||||
|
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||||
|
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||||
|
);
|
||||||
|
// 用户福利包分组map
|
||||||
|
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
||||||
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||||
|
|
||||||
|
// 升级配置list
|
||||||
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
|
.eq(MarketUpgradeConfigEntity::getType, 1)
|
||||||
|
.orderByAsc(MarketUpgradeConfigEntity::getSortOrder)
|
||||||
|
);
|
||||||
|
Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap = upgradeConfigList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeConfigEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 升级日志list
|
||||||
|
List<MarketUpgradeWelfareLogEntity> upgradeWelfareLogList = upgradeWelfareLogService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeWelfareLogEntity.class)
|
||||||
|
.eq(MarketUpgradeWelfareLogEntity::getUpgradeDate, DateUtil.getYesterday())
|
||||||
|
);
|
||||||
|
Map<Long, MarketUpgradeWelfareLogEntity> upgradeWelfareLogMap = upgradeWelfareLogList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeWelfareLogEntity::getUserId, Function.identity()));
|
||||||
|
|
||||||
|
// 计算总奖励比例 (安全判空)
|
||||||
|
BigDecimal totalRewardRate = upgradeConfigList.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
BigDecimal rate = entity.getRewardRate();
|
||||||
|
return rate != null ? rate : BigDecimal.ZERO;
|
||||||
|
})
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
log.info("福利积分加速任务开始,预加载模板:{}个, 配置:{}个, 日志:{}个",
|
||||||
|
templateEntityList.size(), upgradeConfigList.size(), upgradeWelfareLogList.size());
|
||||||
|
|
||||||
|
List<MarketBenefitPointLogEntity> pointLogList = new ArrayList<>();
|
||||||
|
Map<Long, BigDecimal> userRewardRateMap = new HashMap<>();
|
||||||
|
Map<Long, BigDecimal> userLastAmountMap = new HashMap<>();
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (Map.Entry<Long, List<MarketBenefitPackageEntity>> entry : packageEntityMap.entrySet()) {
|
||||||
|
Long userId = entry.getKey();
|
||||||
|
List<MarketBenefitPackageEntity> packageList = entry.getValue();
|
||||||
|
|
||||||
|
// 1. 计算用户总收益 (安全转换)
|
||||||
|
BigDecimal totalUserBenefit = packageList.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
BigDecimal amount = entity.getUserBenefit();
|
||||||
|
if (amount == null) return BigDecimal.ZERO;
|
||||||
|
return amount;
|
||||||
|
})
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
// 2. 构建来源详情 (防御空指针)
|
||||||
|
String sourceDetail = packageList.stream()
|
||||||
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getPackageId, Collectors.counting()))
|
||||||
|
.entrySet().stream()
|
||||||
|
.map(e -> {
|
||||||
|
MarketBenefitPackageTemplateEntity template = templateEntityMap.get(e.getKey());
|
||||||
|
// 防御:如果模板不存在,显示ID
|
||||||
|
String name = (template != null && template.getPackageName() != null) ?
|
||||||
|
template.getPackageName() : "ID:" + e.getKey();
|
||||||
|
return name + "(" + e.getValue() + "个);";
|
||||||
|
})
|
||||||
|
.collect(Collectors.joining("", "福利积分加速详情:", ""));
|
||||||
|
|
||||||
|
|
||||||
|
String account = packageList.get(0).getPhone() != null ? SensitiveUtil.process(String.valueOf(packageList.get(0).getPhone())) : "未知";
|
||||||
|
String remarks = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") + "福利积分加速来源:" + account;
|
||||||
|
|
||||||
|
// 4. 获取上级链 (排除自己)
|
||||||
|
List<Long> ancestorIds = selectAncestorId(userId);
|
||||||
|
ancestorIds.remove(userId); // 移除自己
|
||||||
|
// 5. 计算加速总额
|
||||||
|
BigDecimal accelerationPoint = totalRewardRate.multiply(totalUserBenefit).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
// 修正逻辑:如果加速金额<=0,跳过该用户,不要中断整个分页任务
|
||||||
|
if (accelerationPoint.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 6. 确定起始等级ID
|
||||||
|
long indexLevelId = upgradeConfigList.get(0).getId();
|
||||||
|
MarketUpgradeWelfareLogEntity userLog = upgradeWelfareLogMap.get(userId);
|
||||||
|
if (userLog != null) {
|
||||||
|
indexLevelId = userLog.getCurrentLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 遍历上级进行分润计算
|
||||||
|
for (Long ancestorId : ancestorIds) {
|
||||||
|
// 基础校验
|
||||||
|
MarketUpgradeWelfareLogEntity ancestorLog = upgradeWelfareLogMap.get(ancestorId);
|
||||||
|
if (ancestorLog == null) continue;
|
||||||
|
|
||||||
|
// 当前上级的等级ID
|
||||||
|
long currentLevelId = ancestorLog.getCurrentLevelId();
|
||||||
|
if (indexLevelId >= currentLevelId) continue;
|
||||||
|
|
||||||
|
if (!packageEntityMap.containsKey(ancestorId)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 先判断该上级的福利包是否为空
|
||||||
|
List<MarketBenefitPackageEntity> ancestorPackages = packageEntityMap.get(ancestorId)
|
||||||
|
.stream()
|
||||||
|
.filter(p -> p.getStatus() == 2)
|
||||||
|
.toList();
|
||||||
|
// 福利包为空 跳过
|
||||||
|
if (ancestorPackages.isEmpty()){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算该上级的奖励比例
|
||||||
|
BigDecimal rewardRate = BigDecimal.ZERO;
|
||||||
|
while (true) {
|
||||||
|
MarketUpgradeConfigEntity config = upgradeConfigMap.get(indexLevelId);
|
||||||
|
if (config == null || config.getId() > currentLevelId) break;
|
||||||
|
|
||||||
|
// 安全获取比例
|
||||||
|
BigDecimal rate = config.getRewardRate();
|
||||||
|
BigDecimal configRate = rate == null ? BigDecimal.ZERO : rate;
|
||||||
|
rewardRate = rewardRate.add(configRate);
|
||||||
|
|
||||||
|
if (config.getHasNextLevel() != 1) break;
|
||||||
|
indexLevelId = config.getNextLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算该上级的奖励金额
|
||||||
|
BigDecimal rewardRatePoint = rewardRate.multiply(totalUserBenefit).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
if (rewardRatePoint.compareTo(BigDecimal.ZERO) <= 0) continue;
|
||||||
|
|
||||||
|
|
||||||
|
BigDecimal remainingPoint = rewardRatePoint; // 剩余需要扣除的金额
|
||||||
|
|
||||||
|
// 新增的积分
|
||||||
|
BigDecimal ancestorAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
List<MarketBenefitPackageEntity> updatePackages = new ArrayList<>();
|
||||||
|
|
||||||
|
for (MarketBenefitPackageEntity pkg : ancestorPackages) {
|
||||||
|
if (remainingPoint.compareTo(BigDecimal.ZERO) <= 0) break;
|
||||||
|
|
||||||
|
BigDecimal newOut = pkg.getAmountOut().add(remainingPoint);
|
||||||
|
BigDecimal total = pkg.getAmountTotal();
|
||||||
|
|
||||||
|
if (newOut.compareTo(total) <= 0) {
|
||||||
|
// 全部扣除,包未用完
|
||||||
|
pkg.setAmountOut(newOut);
|
||||||
|
ancestorAmount = ancestorAmount.add(remainingPoint);
|
||||||
|
remainingPoint = BigDecimal.ZERO;
|
||||||
|
} else {
|
||||||
|
// 包用完,扣除剩余部分
|
||||||
|
remainingPoint = newOut.subtract(total);
|
||||||
|
ancestorAmount = newOut.subtract(total);
|
||||||
|
pkg.setAmountOut(total);
|
||||||
|
pkg.setStatus(3); // 标记为已用完
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePackages.add(pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
packageEntityMap.put(ancestorId , updatePackages);
|
||||||
|
|
||||||
|
|
||||||
|
if (!userLastAmountMap.containsKey(ancestorId)){
|
||||||
|
MarketBenefitPointEntity benefitPoint = benefitPointService.getById(ancestorId);
|
||||||
|
if (benefitPoint == null){
|
||||||
|
benefitPoint = new MarketBenefitPointEntity();
|
||||||
|
benefitPoint.setId(ancestorId);
|
||||||
|
benefitPoint.setCreateUser(ancestorId);
|
||||||
|
benefitPointService.save(benefitPoint);
|
||||||
|
userLastAmountMap.put(ancestorId, benefitPoint.getAmount());
|
||||||
|
}else {
|
||||||
|
userLastAmountMap.put(ancestorId, benefitPoint.getAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!userRewardRateMap.containsKey(ancestorId)){
|
||||||
|
userRewardRateMap.put(ancestorId, ancestorAmount);
|
||||||
|
}else {
|
||||||
|
userRewardRateMap.put(ancestorId, userRewardRateMap.get(ancestorId).add(ancestorAmount));
|
||||||
|
}
|
||||||
|
|
||||||
|
// A. 构建积分日志
|
||||||
|
MarketBenefitPointLogEntity logEntity = new MarketBenefitPointLogEntity()
|
||||||
|
.setUserId(ancestorId)
|
||||||
|
.setAmount(ancestorAmount)
|
||||||
|
.setLastAmount(userLastAmountMap.get(ancestorId)) // 这里通常需要查库,或者在最后统一处理
|
||||||
|
.setFee(BigDecimal.ZERO)
|
||||||
|
.setSourceId(userId)
|
||||||
|
.setSourceDetail(sourceDetail)
|
||||||
|
.setType(1)
|
||||||
|
.setSourceType(MarketBusinessModule.WELFARE_ACCELERATION.getCode())
|
||||||
|
.setIsComplete(1)
|
||||||
|
.setRemark(remarks + ",加速比例:" + rewardRate + ",加速金额:" + rewardRatePoint)
|
||||||
|
.setStatisticalDate(DateUtil.getYesterday());
|
||||||
|
pointLogList.add(logEntity);
|
||||||
|
|
||||||
|
|
||||||
|
if (userLastAmountMap.containsKey(ancestorId)){
|
||||||
|
userLastAmountMap.merge(ancestorId, ancestorAmount, BigDecimal::add);
|
||||||
|
}else {
|
||||||
|
userLastAmountMap.put(ancestorId, ancestorAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// C. 构建通知
|
||||||
|
noticeItems.add(new MarketUpgradeNoticeEvent.NoticeItem(ancestorId, logEntity.getRemark()));
|
||||||
|
|
||||||
|
// 更新剩余加速金额
|
||||||
|
accelerationPoint = accelerationPoint.subtract(rewardRatePoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 批量提交 (在分页结束时一次性提交,大幅提高性能) ---
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (!userRewardRateMap.isEmpty()){
|
||||||
|
|
||||||
|
// userRewardRateMap 转 List<MarketBenefitPointEntity>
|
||||||
|
List<MarketBenefitPointEntity> userRewardRateList = userRewardRateMap.entrySet().stream()
|
||||||
|
.map(entry -> {
|
||||||
|
MarketBenefitPointEntity entity = new MarketBenefitPointEntity();
|
||||||
|
entity.setId(entry.getKey());
|
||||||
|
entity.setAmount(entry.getValue());
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
return entity;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
int batchSize = 2000;
|
||||||
|
Lists.partition(userRewardRateList, batchSize).forEach(subList -> {
|
||||||
|
// 在这里处理每一批数据
|
||||||
|
log.info("处理批次-福利积分加速,数量:{}", subList.size());
|
||||||
|
benefitPointService.addBenefitPointBatch(subList);
|
||||||
|
// 模拟处理耗时
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("福利积分加速-线程中断:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 批量保存积分日志
|
||||||
|
if (!pointLogList.isEmpty()) {
|
||||||
|
benefitPointLogService.saveBatch(pointLogList , 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 批量更新福利包
|
||||||
|
if (!packageEntityMap.isEmpty()) {
|
||||||
|
|
||||||
|
// packageEntityMap value 转 List<MarketBenefitPackageEntity>
|
||||||
|
List<MarketBenefitPackageEntity> packageUpdateList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Map.Entry<Long, List<MarketBenefitPackageEntity>> entry : packageEntityMap.entrySet()) {
|
||||||
|
packageUpdateList.addAll(entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
benefitPackageService.updateBatchById(packageUpdateList , 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 发布通知事件
|
||||||
|
if (!noticeItems.isEmpty()) {
|
||||||
|
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
|
noticeItems, MarketBusinessModule.WELFARE_ACCELERATION);
|
||||||
|
publisher.publishEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("分页处理完成,提交日志:{}条, 更新福利包:{}个", pointLogList.size(), packageEntityMap.size());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
log.error("福利包动态福利积分加速失败:{}", e.getMessage());
|
||||||
|
throw new RuntimeException("福利包动态福利积分加速失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
log.info("福利积分加速任务全部完成");
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Long> selectAncestorId(Long userId){
|
||||||
|
List<Long> userAncestorCache = new ArrayList<>(List.of(userId));
|
||||||
|
String key = "yiyu:market:user:ancestor:";
|
||||||
|
Object ancestorIdsObject = bladeRedis.get(key + userId);
|
||||||
|
if (ancestorIdsObject == null) {
|
||||||
|
userAncestorCache.addAll(marketInfoService.selectAncestorIds(userId));
|
||||||
|
bladeRedis.set(key + userId, userAncestorCache);
|
||||||
|
}else {
|
||||||
|
return JSONArray.parseArray(JSONArray.toJSONString(ancestorIdsObject), Long.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
return userAncestorCache;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -136,7 +136,7 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
|
|||||||
.setSourceId(pkg.getId())
|
.setSourceId(pkg.getId())
|
||||||
.setSourceDetail(JSONObject.toJSONString(pkg))
|
.setSourceDetail(JSONObject.toJSONString(pkg))
|
||||||
.setIsComplete(0)
|
.setIsComplete(0)
|
||||||
.setStatisticalDate(new Date())
|
.setStatisticalDate(DateUtil.getToday())
|
||||||
.setRemark(pkg.getPackageName() + "每日福利积分产出")
|
.setRemark(pkg.getPackageName() + "每日福利积分产出")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponEntity;
|
import org.springblade.modules.market.service.*;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionEntity;
|
|
||||||
import org.springblade.modules.market.service.IMarketBenefitPointService;
|
|
||||||
import org.springblade.modules.market.service.IMarketCashCouponService;
|
|
||||||
import org.springblade.modules.market.service.IMarketInfoService;
|
|
||||||
import org.springblade.modules.market.service.IMarketUserCommissionService;
|
|
||||||
import org.springblade.modules.system.pojo.entity.User;
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -37,6 +31,9 @@ public class InitUserAssetsProcessor implements BasicProcessor {
|
|||||||
|
|
||||||
private final IMarketUserCommissionService commissionService;
|
private final IMarketUserCommissionService commissionService;
|
||||||
|
|
||||||
|
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||||
|
|
||||||
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(TaskContext taskContext) throws Exception {
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
@@ -72,6 +69,18 @@ public class InitUserAssetsProcessor implements BasicProcessor {
|
|||||||
commission.setId(user.getId());
|
commission.setId(user.getId());
|
||||||
commissionService.save(commission);
|
commissionService.save(commission);
|
||||||
}
|
}
|
||||||
|
MarketWelfarePerformanceEntity welfarePerformance = welfarePerformanceService.getById(user.getId());
|
||||||
|
if (welfarePerformance == null) {
|
||||||
|
welfarePerformance = new MarketWelfarePerformanceEntity();
|
||||||
|
welfarePerformance.setId(user.getId());
|
||||||
|
welfarePerformanceService.save(welfarePerformance);
|
||||||
|
}
|
||||||
|
MarketCashPerformanceEntity cashPerformance = cashPerformanceService.getById(user.getId());
|
||||||
|
if (cashPerformance == null) {
|
||||||
|
cashPerformance = new MarketCashPerformanceEntity();
|
||||||
|
cashPerformance.setId(user.getId());
|
||||||
|
cashPerformanceService.save(cashPerformance);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return new ProcessResult(true, "result is success");
|
return new ProcessResult(true, "result is success");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.modules.market.pojo.entity.*;
|
||||||
|
import org.springblade.modules.market.service.*;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化用户业绩 现金动态业绩 , 福利包动态业绩(执行一次)
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class InitUserPerformanceProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
|
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
List<MarketInfoEntity> marketInfoEntityList = marketInfoService.list();
|
||||||
|
marketInfoEntityList.forEach(marketInfoEntity -> {
|
||||||
|
MarketCashPerformanceEntity cashPerformance = cashPerformanceService.getById(marketInfoEntity.getId());
|
||||||
|
if (cashPerformance == null) {
|
||||||
|
cashPerformance = new MarketCashPerformanceEntity();
|
||||||
|
cashPerformance.setId(marketInfoEntity.getId());
|
||||||
|
cashPerformance.setOwenAmount(BigDecimal.ZERO);
|
||||||
|
cashPerformance.setTotalAmount(BigDecimal.ZERO);
|
||||||
|
cashPerformance.setVersion(1);
|
||||||
|
cashPerformanceService.save(cashPerformance);
|
||||||
|
}
|
||||||
|
MarketWelfarePerformanceEntity welfarePerformance = welfarePerformanceService.getById(marketInfoEntity.getId());
|
||||||
|
if (welfarePerformance == null) {
|
||||||
|
welfarePerformance = new MarketWelfarePerformanceEntity();
|
||||||
|
welfarePerformance.setId(marketInfoEntity.getId());
|
||||||
|
welfarePerformance.setOwenAmount(BigDecimal.ZERO);
|
||||||
|
welfarePerformance.setTotalAmount(BigDecimal.ZERO);
|
||||||
|
welfarePerformance.setVersion(1);
|
||||||
|
welfarePerformanceService.save(welfarePerformance);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceLogService;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceService;
|
||||||
|
import org.springblade.modules.market.service.IMarketInfoService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||||
|
import tech.powerjob.worker.core.processor.TaskContext;
|
||||||
|
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金动态业绩每日计算
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final ICommonUserOrderService userOrderService;
|
||||||
|
private final IUserService userService;
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
|
private final IMarketCashPerformanceLogService cashPerformanceLogService;
|
||||||
|
private final BladeRedis bladeRedis;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
Date startDate = DateUtil.getYesterday();
|
||||||
|
Date endDate = DateUtil.getToday();
|
||||||
|
|
||||||
|
// 1. 分页查询订单 (修复内存溢出风险)
|
||||||
|
List<CommonUserOrderEntity> orderPageList = userOrderService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserOrderEntity.class)
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentStatus, 1)
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, List.of(1,2))
|
||||||
|
.ge(CommonUserOrderEntity::getCreateTime, startDate)
|
||||||
|
.le(CommonUserOrderEntity::getCreateTime, endDate)
|
||||||
|
.orderByAsc(CommonUserOrderEntity::getId) // 稳定排序
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// 2. 提取所有用户ID,用于批量查询
|
||||||
|
Set<Long> userIds = orderPageList.stream()
|
||||||
|
.map(CommonUserOrderEntity::getUserId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
// 3. 批量查询用户信息 (修复 N+1)
|
||||||
|
Map<Long, User> userMap = userService.listByIds(new ArrayList<>(userIds)).stream()
|
||||||
|
.collect(Collectors.toMap(User::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 4. 批量查询上级链 (修复 N+1) - 假设你有一个批量方法 batchSelectAncestorIds
|
||||||
|
// 如果没有,请参考之前的方法实现它
|
||||||
|
Map<Long, List<Long>> userAncestorCache = batchSelectAncestorIds(userIds);
|
||||||
|
|
||||||
|
// 5. 准备数据容器
|
||||||
|
List<MarketCashPerformanceLogEntity> cashPerformanceLogList = new ArrayList<>();
|
||||||
|
Map<Long, MarketCashPerformanceEntity> cashPerformanceMap = new HashMap<>(); // 团队业绩
|
||||||
|
Map<Long, MarketCashPerformanceEntity> owenCashPerformanceMap = new HashMap<>(); // 自身业绩
|
||||||
|
|
||||||
|
// 6. 处理订单
|
||||||
|
for (CommonUserOrderEntity order : orderPageList) {
|
||||||
|
Long userId = order.getUserId();
|
||||||
|
|
||||||
|
// 安全获取金额
|
||||||
|
BigDecimal actualAmount = order.getActualAmount();
|
||||||
|
if (actualAmount == null) {
|
||||||
|
actualAmount = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
BigDecimal finalActualAmount = actualAmount;
|
||||||
|
// 构建详情
|
||||||
|
String sourceDetail = String.format("现金业绩详情:订单号:%d;商品:%s;实付金额:%s元",
|
||||||
|
order.getId(), order.getItemName(), actualAmount);
|
||||||
|
|
||||||
|
// 获取用户账号 (用于脱敏)
|
||||||
|
User user = userMap.get(userId);
|
||||||
|
String account = user != null ? SensitiveUtil.process(user.getAccount()) : "未知";
|
||||||
|
String remarks = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") + "业绩来源:" + account;
|
||||||
|
|
||||||
|
// 获取该用户的所有上级ID (包含自己)
|
||||||
|
List<Long> ancestorIds = userAncestorCache.getOrDefault(userId, Collections.emptyList());
|
||||||
|
|
||||||
|
// --- 累加日志和业绩 ---
|
||||||
|
|
||||||
|
// 1. 构建日志
|
||||||
|
for (Long ancestorId : ancestorIds) {
|
||||||
|
MarketCashPerformanceLogEntity log = new MarketCashPerformanceLogEntity();
|
||||||
|
log.setUserId(ancestorId);
|
||||||
|
log.setStatDate(DateUtil.getYesterday());
|
||||||
|
log.setPerformance(actualAmount);
|
||||||
|
log.setSourceId(userId);
|
||||||
|
log.setSourceDetail(sourceDetail);
|
||||||
|
log.setRemarks(remarks);
|
||||||
|
cashPerformanceLogList.add(log);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 累加团队业绩 (给所有上级)
|
||||||
|
for (Long ancestorId : ancestorIds) {
|
||||||
|
|
||||||
|
if(!cashPerformanceMap.containsKey(ancestorId)){
|
||||||
|
MarketCashPerformanceEntity entity = new MarketCashPerformanceEntity();
|
||||||
|
entity.setId(ancestorId);
|
||||||
|
entity.setTotalAmount(finalActualAmount);
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
cashPerformanceMap.put(ancestorId, entity);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
MarketCashPerformanceEntity entity = cashPerformanceMap.get(ancestorId);
|
||||||
|
entity.setTotalAmount(entity.getTotalAmount().add(finalActualAmount));
|
||||||
|
cashPerformanceMap.put(ancestorId, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!owenCashPerformanceMap.containsKey(userId)){
|
||||||
|
MarketCashPerformanceEntity entity = new MarketCashPerformanceEntity();
|
||||||
|
entity.setId(userId);
|
||||||
|
entity.setOwenAmount(finalActualAmount);
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
owenCashPerformanceMap.put(userId, entity);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
MarketCashPerformanceEntity entity = owenCashPerformanceMap.get(userId);
|
||||||
|
entity.setOwenAmount(entity.getTotalAmount().add(finalActualAmount));
|
||||||
|
owenCashPerformanceMap.put(userId, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 批量入库
|
||||||
|
if (!cashPerformanceLogList.isEmpty()) {
|
||||||
|
cashPerformanceLogService.saveBatch(cashPerformanceLogList, 5000);
|
||||||
|
}
|
||||||
|
if (!cashPerformanceMap.isEmpty()) {
|
||||||
|
|
||||||
|
ArrayList<MarketCashPerformanceEntity> marketCashPerformanceList = new ArrayList<>(cashPerformanceMap.values());
|
||||||
|
int batchSize = 2000;
|
||||||
|
Lists.partition(marketCashPerformanceList, batchSize).forEach(subList -> {
|
||||||
|
// 在这里处理每一批数据
|
||||||
|
log.info("处理批次-团队业绩,数量:{}", subList.size());
|
||||||
|
cashPerformanceService.addPerformanceBatch(subList);
|
||||||
|
// 模拟处理耗时
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("现金动态团队业绩-线程中断:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!owenCashPerformanceMap.isEmpty()) {
|
||||||
|
ArrayList<MarketCashPerformanceEntity> marketCashPerformanceList = new ArrayList<>(owenCashPerformanceMap.values());
|
||||||
|
int batchSize = 2000;
|
||||||
|
Lists.partition(marketCashPerformanceList, batchSize).forEach(subList -> {
|
||||||
|
// 在这里处理每一批数据
|
||||||
|
log.info("处理批次-自身业绩,数量:{}", subList.size());
|
||||||
|
cashPerformanceService.addOwenPerformanceBatch(subList);
|
||||||
|
// 模拟处理耗时
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("现金动态自身业绩-线程中断:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理本页数据,帮助 GC
|
||||||
|
cashPerformanceLogList.clear();
|
||||||
|
cashPerformanceMap.clear();
|
||||||
|
owenCashPerformanceMap.clear();
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Map<Long, List<Long>> batchSelectAncestorIds(Set<Long> userIdList){
|
||||||
|
Map<Long, List<Long>> userAncestorCache = new HashMap<>();
|
||||||
|
String key = "yiyu:market:user:ancestor:";
|
||||||
|
userIdList.forEach(userId -> {
|
||||||
|
Object ancestorIdsObject = bladeRedis.get(key + userId);
|
||||||
|
if (ancestorIdsObject == null) {
|
||||||
|
|
||||||
|
List<Long> ancestorIds = new ArrayList<>(List.of(userId));
|
||||||
|
ancestorIds.addAll(marketInfoService.selectAncestorIds(userId));
|
||||||
|
bladeRedis.set(key + userId, ancestorIds);
|
||||||
|
userAncestorCache.put(userId, ancestorIds);
|
||||||
|
}else {
|
||||||
|
userAncestorCache.put(userId, JSONArray.parseArray(JSONArray.toJSONString(ancestorIdsObject), Long.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return userAncestorCache;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,230 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.redis.cache.BladeRedis;
|
||||||
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPackageTemplateEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.service.*;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包动态业绩每日计算
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StatsCalculatorWelfareProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||||
|
private final IMarketWelfarePerformanceLogService welfarePerformanceLogService;
|
||||||
|
private final IMarketBenefitPackageTemplateService benefitPackageTemplateService;
|
||||||
|
private final IMarketBenefitPackageService benefitPackageService;
|
||||||
|
|
||||||
|
private final BladeRedis bladeRedis;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
Date searchDate = DateUtil.getYesterday();
|
||||||
|
|
||||||
|
// 福利包模版
|
||||||
|
List<MarketBenefitPackageTemplateEntity> templateEntityList = benefitPackageTemplateService.list();
|
||||||
|
Map<Long, MarketBenefitPackageTemplateEntity> templateEntityMap = templateEntityList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketBenefitPackageTemplateEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 昨日兑换的福利包
|
||||||
|
List<MarketBenefitPackageEntity> benefitPackageEntityList = benefitPackageService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketBenefitPackageEntity.class)
|
||||||
|
.eq(MarketBenefitPackageEntity::getStatisticalDate, searchDate)
|
||||||
|
.eq(MarketBenefitPackageEntity::getStatus, 2)
|
||||||
|
.orderByAsc(MarketBenefitPackageEntity::getId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 按用户分组
|
||||||
|
Map<Long, List<MarketBenefitPackageEntity>> packageEntityMap = benefitPackageEntityList.stream()
|
||||||
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getUserId));
|
||||||
|
|
||||||
|
// 批量获取上级链
|
||||||
|
Map<Long, List<Long>> userAncestorCache = batchSelectAncestorIds(packageEntityMap.keySet());
|
||||||
|
|
||||||
|
|
||||||
|
// 准备数据容器:现在存储的是实体对象
|
||||||
|
List<MarketWelfarePerformanceLogEntity> welfarePerformanceLogList = new ArrayList<>();
|
||||||
|
Map<Long, MarketWelfarePerformanceEntity> welfarePerformanceMap = new HashMap<>(); // 团队业绩
|
||||||
|
Map<Long, MarketWelfarePerformanceEntity> owenWelfarePerformanceMap = new HashMap<>(); // 自身业绩
|
||||||
|
|
||||||
|
// 处理每个用户的数据
|
||||||
|
for (Map.Entry<Long, List<MarketBenefitPackageEntity>> entry : packageEntityMap.entrySet()) {
|
||||||
|
Long userId = entry.getKey();
|
||||||
|
List<MarketBenefitPackageEntity> packageList = entry.getValue();
|
||||||
|
|
||||||
|
// 计算总金额 (强制转为 BigDecimal 以防 Double 混入)
|
||||||
|
BigDecimal totalGiveAmount = packageList.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
BigDecimal amount = entity.getGiveAmount();
|
||||||
|
if (amount == null) return BigDecimal.ZERO;
|
||||||
|
return amount;
|
||||||
|
})
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
// 构建来源详情
|
||||||
|
String sourceDetail = packageList.stream()
|
||||||
|
.collect(Collectors.groupingBy(MarketBenefitPackageEntity::getPackageId, Collectors.counting()))
|
||||||
|
.entrySet().stream()
|
||||||
|
.map(e -> {
|
||||||
|
MarketBenefitPackageTemplateEntity template = templateEntityMap.get(e.getKey());
|
||||||
|
return template != null ? template.getPackageName() + "(" + e.getValue() + "个);" : "";
|
||||||
|
})
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.collect(Collectors.joining("", "用户业绩详情:", ""));
|
||||||
|
|
||||||
|
|
||||||
|
String account = packageList.get(0) != null ? SensitiveUtil.process(String.valueOf(packageList.get(0).getPhone())) : "未知";
|
||||||
|
String remarks = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") + "业绩来源:" + account;
|
||||||
|
|
||||||
|
List<Long> ancestorIds = userAncestorCache.getOrDefault(userId, Collections.emptyList());
|
||||||
|
|
||||||
|
|
||||||
|
if (!owenWelfarePerformanceMap.containsKey(userId)){
|
||||||
|
MarketWelfarePerformanceEntity entity = new MarketWelfarePerformanceEntity();
|
||||||
|
entity.setId(userId);
|
||||||
|
entity.setOwenAmount(totalGiveAmount);
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
owenWelfarePerformanceMap.put(userId, entity);
|
||||||
|
}else {
|
||||||
|
MarketWelfarePerformanceEntity entity = owenWelfarePerformanceMap.get(userId);
|
||||||
|
entity.setOwenAmount(entity.getOwenAmount().add(totalGiveAmount));
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
owenWelfarePerformanceMap.put(userId, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. 累加团队业绩 (给所有上级)
|
||||||
|
for (Long ancestorId : ancestorIds) {
|
||||||
|
|
||||||
|
if (!welfarePerformanceMap.containsKey(ancestorId)){
|
||||||
|
MarketWelfarePerformanceEntity entity = new MarketWelfarePerformanceEntity();
|
||||||
|
entity.setId(ancestorId);
|
||||||
|
entity.setTotalAmount(totalGiveAmount);
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
welfarePerformanceMap.put(ancestorId, entity);
|
||||||
|
}else {
|
||||||
|
MarketWelfarePerformanceEntity entity = welfarePerformanceMap.get(ancestorId);
|
||||||
|
entity.setTotalAmount(entity.getTotalAmount().add(totalGiveAmount));
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
welfarePerformanceMap.put(ancestorId, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 构建日志
|
||||||
|
List<MarketWelfarePerformanceLogEntity> logs = createPackageInfoLog(sourceDetail, remarks, ancestorIds, userId, totalGiveAmount);
|
||||||
|
welfarePerformanceLogList.addAll(logs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量入库
|
||||||
|
if (!welfarePerformanceLogList.isEmpty()) {
|
||||||
|
welfarePerformanceLogService.saveBatch(welfarePerformanceLogList, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注意:将 Map 的值转为 List 传入 Mapper
|
||||||
|
if (!welfarePerformanceMap.isEmpty()) {
|
||||||
|
|
||||||
|
ArrayList<MarketWelfarePerformanceEntity> marketWelfarePerformanceList = new ArrayList<>(welfarePerformanceMap.values());
|
||||||
|
int batchSize = 2000;
|
||||||
|
|
||||||
|
Lists.partition(marketWelfarePerformanceList, batchSize).forEach(subList -> {
|
||||||
|
// 在这里处理每一批数据
|
||||||
|
log.info("处理批次-团队业绩,数量:{}", subList.size());
|
||||||
|
welfarePerformanceService.addPerformanceBatch(subList);
|
||||||
|
// 模拟处理耗时
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("福利包动态团队业绩-线程中断:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!owenWelfarePerformanceMap.isEmpty()) {
|
||||||
|
ArrayList<MarketWelfarePerformanceEntity> marketWelfarePerformanceList = new ArrayList<>(owenWelfarePerformanceMap.values());
|
||||||
|
int batchSize = 2000;
|
||||||
|
Lists.partition(marketWelfarePerformanceList, batchSize).forEach(subList -> {
|
||||||
|
// 在这里处理每一批数据
|
||||||
|
log.info("处理批次-自身业绩,数量:{}", subList.size());
|
||||||
|
welfarePerformanceService.addOwenPerformanceBatch(subList);
|
||||||
|
// 模拟处理耗时
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("福利包动态自身业绩-线程中断:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Map<Long, List<Long>> batchSelectAncestorIds(Set<Long> userIdList){
|
||||||
|
Map<Long, List<Long>> userAncestorCache = new HashMap<>();
|
||||||
|
String key = "yiyu:market:user:ancestor:";
|
||||||
|
userIdList.forEach(userId -> {
|
||||||
|
Object ancestorIdsObject = bladeRedis.get(key + userId);
|
||||||
|
if (ancestorIdsObject == null) {
|
||||||
|
|
||||||
|
List<Long> ancestorIds = new ArrayList<>(List.of(userId));
|
||||||
|
ancestorIds.addAll(marketInfoService.selectAncestorIds(userId));
|
||||||
|
bladeRedis.set(key + userId, ancestorIds);
|
||||||
|
userAncestorCache.put(userId, ancestorIds);
|
||||||
|
}else {
|
||||||
|
userAncestorCache.put(userId, JSONArray.parseArray(JSONArray.toJSONString(ancestorIdsObject), Long.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return userAncestorCache;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<MarketWelfarePerformanceLogEntity> createPackageInfoLog(String sourceDetail , String remarks , List<Long> userIdList ,Long sourceId , BigDecimal performance) {
|
||||||
|
|
||||||
|
List<MarketWelfarePerformanceLogEntity> list = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Long aLong : userIdList) {
|
||||||
|
|
||||||
|
MarketWelfarePerformanceLogEntity performanceLog = new MarketWelfarePerformanceLogEntity();
|
||||||
|
performanceLog.setUserId(aLong);
|
||||||
|
performanceLog.setStatDate(DateUtil.getYesterday());
|
||||||
|
performanceLog.setPerformance(performance);
|
||||||
|
performanceLog.setSourceDetail(sourceDetail);
|
||||||
|
performanceLog.setRemarks(remarks);
|
||||||
|
performanceLog.setSourceId(sourceId);
|
||||||
|
list.add(performanceLog);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceService;
|
||||||
|
import org.springblade.modules.market.service.IMarketInfoService;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeCashLogService;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeConfigService;
|
||||||
|
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金动态升级
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TallyCashUpgradeProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
|
private final IMarketCashPerformanceService cashPerformanceService;
|
||||||
|
private final IMarketUpgradeCashLogService upgradeCashLogService;
|
||||||
|
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
|
.eq(MarketUpgradeConfigEntity::getType, 2)
|
||||||
|
.orderByAsc(MarketUpgradeConfigEntity::getSortOrder)
|
||||||
|
);
|
||||||
|
Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap = upgradeConfigList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeConfigEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 找出 upgradeConfigList requirementValue > 0 最小的一个元素
|
||||||
|
MarketUpgradeConfigEntity minConfig = upgradeConfigList.stream()
|
||||||
|
.filter(config -> config.getRequirementValue().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
.min(Comparator.comparing(MarketUpgradeConfigEntity::getRequirementValue))
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (minConfig == null){
|
||||||
|
log.error("没有找到福利值升级最小配置");
|
||||||
|
throw new RuntimeException("没有找到福利值升级最小配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MarketCashPerformanceEntity> performanceList = cashPerformanceService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketCashPerformanceEntity.class)
|
||||||
|
.ge(MarketCashPerformanceEntity::getTotalAmount, minConfig.getRequirementValue())
|
||||||
|
.orderByAsc(MarketCashPerformanceEntity::getTotalAmount)
|
||||||
|
);
|
||||||
|
|
||||||
|
List<MarketUpgradeCashLogEntity> upgradeCashLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
performanceList.forEach(performance -> {
|
||||||
|
|
||||||
|
long count = marketInfoService.count(
|
||||||
|
Wrappers.lambdaQuery(MarketInfoEntity.class)
|
||||||
|
.eq(MarketInfoEntity::getPid, performance.getId())
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
long lastLevelId = upgradeConfigList.get(0).getId();
|
||||||
|
MarketUpgradeCashLogEntity lastUpgradeWelfareLog = upgradeCashLogService.getOne(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeCashLogEntity.class)
|
||||||
|
.eq(MarketUpgradeCashLogEntity::getUserId, performance.getId())
|
||||||
|
.orderByDesc(MarketUpgradeCashLogEntity::getCreateTime)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
if (lastUpgradeWelfareLog != null){
|
||||||
|
lastLevelId = lastUpgradeWelfareLog.getCurrentLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
||||||
|
MarketUpgradeCashLogEntity upgradeCashLog = new MarketUpgradeCashLogEntity();
|
||||||
|
upgradeCashLog.setUserId(performance.getId());
|
||||||
|
upgradeCashLog.setLastLevel(lastLevelId);
|
||||||
|
upgradeCashLog.setCurrentLevelId(upgradeId);
|
||||||
|
upgradeCashLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
||||||
|
upgradeCashLog.setUpgradeDate(DateUtil.getYesterday());
|
||||||
|
upgradeCashLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人");
|
||||||
|
upgradeCashLogList.add(upgradeCashLog);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (upgradeCashLogService.saveBatch(upgradeCashLogList, 2000)){
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeCashLogList.stream()
|
||||||
|
.map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
||||||
|
upgradeConfig.getUserId(),
|
||||||
|
"当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
||||||
|
))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 2. 发送事件 (只发一次,传入全部数据)
|
||||||
|
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
|
noticeItems,
|
||||||
|
MarketBusinessModule.CASH_UPGRADE
|
||||||
|
);
|
||||||
|
|
||||||
|
publisher.publishEvent(event);
|
||||||
|
|
||||||
|
log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
||||||
|
}
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long getUpgradeId(Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap,
|
||||||
|
Long currentLevelId,
|
||||||
|
BigDecimal performance,
|
||||||
|
Long childCount){
|
||||||
|
|
||||||
|
if (!upgradeConfigMap.containsKey(currentLevelId)) {
|
||||||
|
throw new RuntimeException("没有找到对应的福利值升级配置, levelId: " + currentLevelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long levelId = currentLevelId;
|
||||||
|
|
||||||
|
// 2. 持续尝试升级,直到不满足条件或到达顶层
|
||||||
|
while (true) {
|
||||||
|
MarketUpgradeConfigEntity config = upgradeConfigMap.get(levelId);
|
||||||
|
|
||||||
|
// 3. 检查是否满足升级条件(业绩达标 && 下级数量达标)
|
||||||
|
boolean meetsPerformance = performance.compareTo(config.getRequirementValue()) >= 0;
|
||||||
|
boolean meetsChildCount = childCount >= config.getDirectRecommend();
|
||||||
|
|
||||||
|
// 4. 如果有下一级 且 满足条件,则跳到下一级;否则停止
|
||||||
|
if (config.getHasNextLevel() == 1 && meetsPerformance && meetsChildCount) {
|
||||||
|
levelId = config.getNextLevelId();
|
||||||
|
} else {
|
||||||
|
break; // 不满足条件 或 已经是顶级,跳出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return levelId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
package org.springblade.job.processor;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.service.IMarketInfoService;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeConfigService;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeWelfareLogService;
|
||||||
|
import org.springblade.modules.market.service.IMarketWelfarePerformanceService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包动态升级
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TallyWelfareUpgradeProcessor implements BasicProcessor {
|
||||||
|
|
||||||
|
private final IMarketInfoService marketInfoService;
|
||||||
|
private final IMarketUpgradeConfigService upgradeConfigService;
|
||||||
|
private final IMarketUpgradeWelfareLogService upgradeWelfareLogService;
|
||||||
|
private final IMarketWelfarePerformanceService welfarePerformanceService;
|
||||||
|
private final ApplicationEventPublisher publisher;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public ProcessResult process(TaskContext taskContext) throws Exception {
|
||||||
|
|
||||||
|
List<MarketUpgradeConfigEntity> upgradeConfigList = upgradeConfigService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeConfigEntity.class)
|
||||||
|
.eq(MarketUpgradeConfigEntity::getType, 1)
|
||||||
|
.orderByAsc(MarketUpgradeConfigEntity::getSortOrder)
|
||||||
|
);
|
||||||
|
Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap = upgradeConfigList.stream()
|
||||||
|
.collect(Collectors.toMap(MarketUpgradeConfigEntity::getId, Function.identity()));
|
||||||
|
|
||||||
|
// 找出 upgradeConfigList requirementValue > 0 最小的一个元素
|
||||||
|
MarketUpgradeConfigEntity minConfig = upgradeConfigList.stream()
|
||||||
|
.filter(config -> config.getRequirementValue().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
.min(Comparator.comparing(MarketUpgradeConfigEntity::getRequirementValue))
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (minConfig == null){
|
||||||
|
log.error("没有找到福利值升级最小配置");
|
||||||
|
throw new RuntimeException("没有找到福利值升级最小配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MarketWelfarePerformanceEntity> performanceList = welfarePerformanceService.list(
|
||||||
|
Wrappers.lambdaQuery(MarketWelfarePerformanceEntity.class)
|
||||||
|
.ge(MarketWelfarePerformanceEntity::getTotalAmount, minConfig.getRequirementValue())
|
||||||
|
.orderByAsc(MarketWelfarePerformanceEntity::getTotalAmount)
|
||||||
|
);
|
||||||
|
|
||||||
|
List<MarketUpgradeWelfareLogEntity> upgradeWelfareLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
performanceList.forEach(performance -> {
|
||||||
|
|
||||||
|
long count = marketInfoService.count(
|
||||||
|
Wrappers.lambdaQuery(MarketInfoEntity.class)
|
||||||
|
.eq(MarketInfoEntity::getPid, performance.getId())
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
long lastLevelId = upgradeConfigList.get(0).getId();
|
||||||
|
MarketUpgradeWelfareLogEntity lastUpgradeWelfareLog = upgradeWelfareLogService.getOne(
|
||||||
|
Wrappers.lambdaQuery(MarketUpgradeWelfareLogEntity.class)
|
||||||
|
.eq(MarketUpgradeWelfareLogEntity::getUserId, performance.getId())
|
||||||
|
.orderByDesc(MarketUpgradeWelfareLogEntity::getCreateTime)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
if (lastUpgradeWelfareLog != null){
|
||||||
|
lastLevelId = lastUpgradeWelfareLog.getCurrentLevelId();
|
||||||
|
}
|
||||||
|
|
||||||
|
Long upgradeId = getUpgradeId(upgradeConfigMap, minConfig.getId(), performance.getTotalAmount(), count);
|
||||||
|
MarketUpgradeWelfareLogEntity upgradeWelfareLog = new MarketUpgradeWelfareLogEntity();
|
||||||
|
upgradeWelfareLog.setUserId(performance.getId());
|
||||||
|
upgradeWelfareLog.setLastLevel(lastLevelId);
|
||||||
|
upgradeWelfareLog.setCurrentLevelId(upgradeId);
|
||||||
|
upgradeWelfareLog.setCurrentLevelName(upgradeConfigMap.get(upgradeId).getLevelName());
|
||||||
|
upgradeWelfareLog.setUpgradeDate(DateUtil.getYesterday());
|
||||||
|
upgradeWelfareLog.setRemarks(DateUtil.convertFromDate(DateUtil.getYesterday() , "yyyy-MM-dd") +"升级详情: 业绩 " + performance.getTotalAmount() + "福利值, 下级人数" + count + "人");
|
||||||
|
upgradeWelfareLogList.add(upgradeWelfareLog);
|
||||||
|
});
|
||||||
|
if (upgradeWelfareLogService.saveBatch(upgradeWelfareLogList, 2000)){
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> noticeItems = upgradeWelfareLogList.stream()
|
||||||
|
.map(upgradeConfig -> new MarketUpgradeNoticeEvent.NoticeItem(
|
||||||
|
upgradeConfig.getUserId(),
|
||||||
|
"当前等级:" + upgradeConfig.getCurrentLevelName() + "," +upgradeConfig.getRemarks()
|
||||||
|
))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 2. 发送事件 (只发一次,传入全部数据)
|
||||||
|
MarketUpgradeNoticeEvent event = new MarketUpgradeNoticeEvent(
|
||||||
|
noticeItems,
|
||||||
|
MarketBusinessModule.WELFARE_UPGRADE
|
||||||
|
);
|
||||||
|
|
||||||
|
publisher.publishEvent(event);
|
||||||
|
|
||||||
|
log.info("已发布批量升级事件,数量: {}", noticeItems.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ProcessResult(true, "result is success");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long getUpgradeId(Map<Long, MarketUpgradeConfigEntity> upgradeConfigMap,
|
||||||
|
Long currentLevelId,
|
||||||
|
BigDecimal performance,
|
||||||
|
Long childCount){
|
||||||
|
|
||||||
|
if (!upgradeConfigMap.containsKey(currentLevelId)) {
|
||||||
|
throw new RuntimeException("没有找到对应的福利值升级配置, levelId: " + currentLevelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long levelId = currentLevelId;
|
||||||
|
|
||||||
|
// 2. 持续尝试升级,直到不满足条件或到达顶层
|
||||||
|
while (true) {
|
||||||
|
MarketUpgradeConfigEntity config = upgradeConfigMap.get(levelId);
|
||||||
|
|
||||||
|
// 3. 检查是否满足升级条件(业绩达标 && 下级数量达标)
|
||||||
|
boolean meetsPerformance = performance.compareTo(config.getRequirementValue()) >= 0;
|
||||||
|
boolean meetsChildCount = childCount >= config.getDirectRecommend();
|
||||||
|
|
||||||
|
// 4. 如果有下一级 且 满足条件,则跳到下一级;否则停止
|
||||||
|
if (config.getHasNextLevel() == 1 && meetsPerformance && meetsChildCount) {
|
||||||
|
levelId = config.getNextLevelId();
|
||||||
|
} else {
|
||||||
|
break; // 不满足条件 或 已经是顶级,跳出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return levelId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,9 +7,12 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jakarta.validation.constraints.Max;
|
import jakarta.validation.constraints.Max;
|
||||||
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
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.*;
|
||||||
|
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.*;
|
||||||
|
|
||||||
@@ -24,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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新版本
|
* 最新版本
|
||||||
@@ -49,4 +52,44 @@ public class APPCommonController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 发送忘记密码的短信
|
||||||
|
@RedisDebounce(key = "sms:forget_pwd", param = "#request.phone", interval = 60, includeRemainingTime = true, message = "短信发送过于频繁")
|
||||||
|
@PostMapping("/send-forget-pwd-sms")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "发送忘记密码短信")
|
||||||
|
public R<Boolean> sendForgetPwdSms(@RequestBody ForgetPwdSmsRequest request) {
|
||||||
|
return R.status(userService.sendForgetPwdSms(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交验证码和新密码进行修改
|
||||||
|
@PostMapping("/retrieve-password")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "重置密码")
|
||||||
|
public R<Boolean> retrievePassword(@RequestBody ResetPasswordRequest 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,35 @@
|
|||||||
|
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 lombok.AllArgsConstructor;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||||
|
import org.springblade.modules.mall.service.IMallProductService;
|
||||||
|
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-eco")
|
||||||
|
@Tag(name = "APP生态产品接口", description = "APP生态产品接口")
|
||||||
|
public class APPEcoController {
|
||||||
|
|
||||||
|
private final IMallProductService productService;
|
||||||
|
/**
|
||||||
|
* 生态产品-商品列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "生态产品-商品列表")
|
||||||
|
public R<List<MallProductApiVO>> ecosystemProductList() {
|
||||||
|
return R.data(productService.apiVoListToCategory(2033413760969809921L));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
@@ -22,7 +23,7 @@ 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;
|
||||||
@@ -36,7 +37,10 @@ public class APPMallController {
|
|||||||
@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();
|
List<MallCategoryEntity> list = categoryService.list(
|
||||||
|
Wrappers.lambdaQuery(MallCategoryEntity.class)
|
||||||
|
.notIn(MallCategoryEntity::getId, List.of(2033413707249164290L ,2033413760969809921L))
|
||||||
|
);
|
||||||
return R.data(AppMallConvert.INSTANCE.convertMallCategoryApiListVO(list));
|
return R.data(AppMallConvert.INSTANCE.convertMallCategoryApiListVO(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +64,19 @@ public class APPMallController {
|
|||||||
return R.data(productService.apiDetailVO(vo.getId()));
|
return R.data(productService.apiDetailVO(vo.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自营商城-商品列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/direct-mall-list")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "自营商城-商品列表")
|
||||||
|
public R<List<MallProductApiVO>> directMallList() {
|
||||||
|
return R.data(productService.apiVoListToCategory(2033413707249164290L));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,42 @@
|
|||||||
|
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 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<List<CommonMerchantStoreApiVO>> merchantStoreList(MerchantStoreRequest request) {
|
||||||
|
return R.data(merchantFlagshipStoreService.merchantStoreList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "商家店铺详情")
|
||||||
|
public R<CommonMerchantStoreDetailApiVO> merchantStoreDetail(CommonMerchantStoreApiVO vo) {
|
||||||
|
return R.data(merchantFlagshipStoreService.merchantStoreDetail(vo.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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.request.CommonRemoveTourRequest;
|
||||||
|
import org.springblade.modules.api.request.CommonTourUserInfoRequest;
|
||||||
|
import org.springblade.modules.api.request.TourProductRequest;
|
||||||
|
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.service.ICommonTourInfoService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
@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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -93,6 +93,16 @@ public class APPUserController {
|
|||||||
return R.data(orderService.pay(request));
|
return R.data(orderService.pay(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认收货
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
||||||
|
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
||||||
|
return R.status(orderService.confirm(request));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单列表
|
* 用户订单列表
|
||||||
*/
|
*/
|
||||||
@@ -105,18 +115,18 @@ public class APPUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单列表
|
* 用户订单详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/order-detail")
|
@GetMapping("/order-detail")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 7)
|
||||||
@Operation(summary = "用户订单分页列表")
|
@Operation(summary = "用户订单详情")
|
||||||
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
public R<CommonUserOrderDetailApiVO> orderDetail(Long id) {
|
||||||
return R.data(orderService.orderDetail(id));
|
return R.data(orderService.orderDetail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/system-notice")
|
@GetMapping("/system-notice")
|
||||||
@ApiOperationSupport(order = 7)
|
@ApiOperationSupport(order = 8)
|
||||||
@Operation(summary = "APP系统消息列表")
|
@Operation(summary = "APP系统消息列表")
|
||||||
public R<List<CommonUserNoticeApiVO>> systemNotice() {
|
public R<List<CommonUserNoticeApiVO>> systemNotice() {
|
||||||
return R.data(userNoticeService.appSystemNoticeList());
|
return R.data(userNoticeService.appSystemNoticeList());
|
||||||
@@ -124,7 +134,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/user-notice")
|
@GetMapping("/user-notice")
|
||||||
@ApiOperationSupport(order = 8)
|
@ApiOperationSupport(order = 9)
|
||||||
@Operation(summary = "用户消息列表", description = "传入userNoticeVO")
|
@Operation(summary = "用户消息列表", description = "传入userNoticeVO")
|
||||||
public R<IPage<CommonUserNoticeApiVO>> noticePage(Query query) {
|
public R<IPage<CommonUserNoticeApiVO>> noticePage(Query query) {
|
||||||
IPage<CommonUserNoticeApiVO> pages = userNoticeService.selectAppUserNoticeApiPage(Condition.getPage(query), new CommonUserNoticeApiVO());
|
IPage<CommonUserNoticeApiVO> pages = userNoticeService.selectAppUserNoticeApiPage(Condition.getPage(query), new CommonUserNoticeApiVO());
|
||||||
@@ -133,7 +143,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/notice-detail")
|
@GetMapping("/notice-detail")
|
||||||
@ApiOperationSupport(order = 9)
|
@ApiOperationSupport(order = 10)
|
||||||
@Operation(summary = "用户读取消息")
|
@Operation(summary = "用户读取消息")
|
||||||
public R<CommonUserNoticeDetailApiVO> noticeDetail(Long id) {
|
public R<CommonUserNoticeDetailApiVO> noticeDetail(Long id) {
|
||||||
return R.data(userNoticeService.userNoticeDetail(id));
|
return R.data(userNoticeService.userNoticeDetail(id));
|
||||||
@@ -141,7 +151,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/unread")
|
@GetMapping("/unread")
|
||||||
@ApiOperationSupport(order = 10)
|
@ApiOperationSupport(order = 11)
|
||||||
@Operation(summary = "用户未读消息数量")
|
@Operation(summary = "用户未读消息数量")
|
||||||
public R<Long> unreadNum() {
|
public R<Long> unreadNum() {
|
||||||
return R.data(userNoticeService.appUnreadNoticeNum());
|
return R.data(userNoticeService.appUnreadNoticeNum());
|
||||||
@@ -149,7 +159,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/user-address")
|
@GetMapping("/user-address")
|
||||||
@ApiOperationSupport(order = 11)
|
@ApiOperationSupport(order = 12)
|
||||||
@Operation(summary = "用户收货地址", description = "传入userAddressVO")
|
@Operation(summary = "用户收货地址", description = "传入userAddressVO")
|
||||||
public R<List<CommonUserAddressApiVO>> addressList(Query query) {
|
public R<List<CommonUserAddressApiVO>> addressList(Query query) {
|
||||||
return R.data(addressService.selectAddressList(Condition.getPage(query), new CommonUserAddressApiVO()));
|
return R.data(addressService.selectAddressList(Condition.getPage(query), new CommonUserAddressApiVO()));
|
||||||
@@ -157,7 +167,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/submit-address")
|
@PostMapping("/submit-address")
|
||||||
@ApiOperationSupport(order = 12)
|
@ApiOperationSupport(order = 13)
|
||||||
@Operation(summary = "提交用户收货地址", description = "传入AddressSubmitRequest")
|
@Operation(summary = "提交用户收货地址", description = "传入AddressSubmitRequest")
|
||||||
public R<Boolean> submitAddress(@Valid @RequestBody AddressSubmitRequest request) {
|
public R<Boolean> submitAddress(@Valid @RequestBody AddressSubmitRequest request) {
|
||||||
return R.status(addressService.submitAddress(request));
|
return R.status(addressService.submitAddress(request));
|
||||||
@@ -165,7 +175,7 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-address")
|
@DeleteMapping("/delete-address")
|
||||||
@ApiOperationSupport(order = 13)
|
@ApiOperationSupport(order = 14)
|
||||||
@Operation(summary = "删除用户收货地址", description = "传入id")
|
@Operation(summary = "删除用户收货地址", description = "传入id")
|
||||||
public R<Boolean> removeAddress(@Valid @RequestBody AddressRemoveRequest request) {
|
public R<Boolean> removeAddress(@Valid @RequestBody AddressRemoveRequest request) {
|
||||||
return R.status(addressService.removeAddress(request.getIds()));
|
return R.status(addressService.removeAddress(request.getIds()));
|
||||||
@@ -173,42 +183,42 @@ public class APPUserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/user-points")
|
@GetMapping("/user-points")
|
||||||
@ApiOperationSupport(order = 14)
|
@ApiOperationSupport(order = 15)
|
||||||
@Operation(summary = "用户积分查询")
|
@Operation(summary = "用户积分查询")
|
||||||
public R<BigDecimal> userPoints() {
|
public R<BigDecimal> userPoints() {
|
||||||
return R.data(pointService.queryPoint());
|
return R.data(pointService.queryPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/lottery-prizes")
|
@GetMapping("/lottery-prizes")
|
||||||
@ApiOperationSupport(order = 15)
|
@ApiOperationSupport(order = 16)
|
||||||
@Operation(summary = "奖品列表")
|
@Operation(summary = "奖品列表")
|
||||||
public R<List<CommonLotteryPrizeApiVO>> lotteryPrizes() {
|
public R<List<CommonLotteryPrizeApiVO>> lotteryPrizes() {
|
||||||
return R.data(lotteryPrizeService.staticList());
|
return R.data(lotteryPrizeService.staticList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/lottery-records")
|
@GetMapping("/lottery-records")
|
||||||
@ApiOperationSupport(order = 16)
|
@ApiOperationSupport(order = 17)
|
||||||
@Operation(summary = "抽奖记录")
|
@Operation(summary = "抽奖记录")
|
||||||
public R<IPage<CommonLotteryRecordApiVO>> lotteryRecords(Query query) {
|
public R<IPage<CommonLotteryRecordApiVO>> lotteryRecords(Query query) {
|
||||||
return R.data(lotteryRecordService.selectLotteryRecordApiPage(Condition.getPage(query), new CommonLotteryRecordApiVO()));
|
return R.data(lotteryRecordService.selectLotteryRecordApiPage(Condition.getPage(query), new CommonLotteryRecordApiVO()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/lottery-draw")
|
@PostMapping("/lottery-draw")
|
||||||
@ApiOperationSupport(order = 17)
|
@ApiOperationSupport(order = 18)
|
||||||
@Operation(summary = "用户抽奖", description = "传入LotteriesDrawRequest")
|
@Operation(summary = "用户抽奖", description = "传入LotteriesDrawRequest")
|
||||||
public R<CommonLotteryPrizeApiVO> draw(@Valid @RequestBody LotteryDrawRequest request) {
|
public R<CommonLotteryPrizeApiVO> draw(@Valid @RequestBody LotteryDrawRequest request) {
|
||||||
return R.data(lotteryPrizeService.draw(request));
|
return R.data(lotteryPrizeService.draw(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/lottery-rules")
|
@GetMapping("/lottery-rules")
|
||||||
@ApiOperationSupport(order = 18)
|
@ApiOperationSupport(order = 19)
|
||||||
@Operation(summary = "抽奖规则")
|
@Operation(summary = "抽奖规则")
|
||||||
public R<String> lotteryRules() {
|
public R<String> lotteryRules() {
|
||||||
return R.data(lotteryPrizeService.rules());
|
return R.data(lotteryPrizeService.rules());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/lottery-winners")
|
@GetMapping("/lottery-winners")
|
||||||
@ApiOperationSupport(order = 19)
|
@ApiOperationSupport(order = 20)
|
||||||
@Operation(summary = "获奖名单")
|
@Operation(summary = "获奖名单")
|
||||||
public R<List<CommonLotteryWinnerApiVO>> lotteryWinners() {
|
public R<List<CommonLotteryWinnerApiVO>> lotteryWinners() {
|
||||||
return R.data(lotteryRecordService.lotteryWinners());
|
return R.data(lotteryRecordService.lotteryWinners());
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ConfirmOrderRequest implements Serializable {
|
||||||
|
|
||||||
|
@NotNull(message = "Id is missing")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
package org.springblade.modules.api.request;
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CreateOrderRequest implements Serializable {
|
public class CreateOrderRequest implements Serializable {
|
||||||
|
|
||||||
@NotEmpty(message = "请填写联系人")
|
// @NotEmpty(message = "请填写联系人")
|
||||||
private String consignee;
|
private String consignee;
|
||||||
|
|
||||||
@NotEmpty(message = "请填写联系电话")
|
// @NotEmpty(message = "请填写联系电话")
|
||||||
private String consigneePhone;
|
private String consigneePhone;
|
||||||
|
|
||||||
@NotEmpty(message = "订单类型为空")
|
@NotEmpty(message = "订单类型为空")
|
||||||
@@ -22,11 +25,11 @@ public class CreateOrderRequest implements Serializable {
|
|||||||
@NotEmpty(message = "商品编号为空")
|
@NotEmpty(message = "商品编号为空")
|
||||||
private String itemCode;
|
private String itemCode;
|
||||||
|
|
||||||
@NotNull(message = "商品数量不能为空")
|
// @NotNull(message = "商品数量不能为空")
|
||||||
@Min(value = 1, message = "无效商品数量")
|
@Min(value = 1, message = "无效商品数量")
|
||||||
private Integer quantity;
|
private Integer quantity;
|
||||||
|
|
||||||
@NotEmpty(message = "请填写收货地址")
|
// @NotEmpty(message = "请填写收货地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@NotNull(message = "无效支付方式")
|
@NotNull(message = "无效支付方式")
|
||||||
@@ -34,4 +37,19 @@ public class CreateOrderRequest implements Serializable {
|
|||||||
|
|
||||||
@NotNull(message = "无效标识")
|
@NotNull(message = "无效标识")
|
||||||
private Boolean isOfflinePayment;
|
private Boolean isOfflinePayment;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅行团出行日期
|
||||||
|
*/
|
||||||
|
private Date tourStartDate;
|
||||||
|
/**
|
||||||
|
* 旅行团返回日期
|
||||||
|
*/
|
||||||
|
private Date tourEndDate;
|
||||||
|
|
||||||
|
private List<Long> tourInfoIds;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ForgetPwdSmsRequest implements Serializable {
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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,13 @@
|
|||||||
|
package org.springblade.modules.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ResetPasswordRequest implements Serializable {
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
private String smsCode;
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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,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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -110,9 +110,13 @@ public class AppRegisterTokenGranter extends PasswordTokenGranter {
|
|||||||
user.setPassword(DigestUtil.encrypt(ParamCache.getValue(INIT_PASSWD_VALUE)));
|
user.setPassword(DigestUtil.encrypt(ParamCache.getValue(INIT_PASSWD_VALUE)));
|
||||||
|
|
||||||
String code = request.getCode();
|
String code = request.getCode();
|
||||||
Assert.isTrue(code.contains(StringPool.COMMA), ExceptionCode.INVALID_USER.getMessage());
|
if (!code.contains(StringPool.COMMA)) {
|
||||||
|
throw new UserInvalidException("无效验证码");
|
||||||
|
}
|
||||||
String[] splitCode = code.split(StringPool.COMMA);
|
String[] splitCode = code.split(StringPool.COMMA);
|
||||||
Assert.isTrue(splitCode.length == 2, ExceptionCode.INVALID_USER.getMessage());
|
if (splitCode.length != 2) {
|
||||||
|
throw new UserInvalidException("无效验证码");
|
||||||
|
}
|
||||||
String smsCode = splitCode[0];
|
String smsCode = splitCode[0];
|
||||||
String invitationCode = splitCode[1];
|
String invitationCode = splitCode[1];
|
||||||
if (StringUtil.isBlank(smsCode)) {
|
if (StringUtil.isBlank(smsCode)) {
|
||||||
@@ -128,9 +132,13 @@ public class AppRegisterTokenGranter extends PasswordTokenGranter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invitor = service.getByPhone(invitorCode);
|
invitor = service.getByPhone(invitorCode);
|
||||||
Assert.notNull(invitor, "无效邀请码");
|
if (invitor == null) {
|
||||||
|
throw new UserInvalidException("无效邀请码");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!dynpsService.verifySms(request.getPhone(), smsCode)) {
|
||||||
|
throw new UserInvalidException("验证码验证失败");
|
||||||
}
|
}
|
||||||
Assert.isTrue(dynpsService.verifySms(request.getPhone(), smsCode), "验证码验证失败");
|
|
||||||
|
|
||||||
// 执行用户注册
|
// 执行用户注册
|
||||||
if (service.registerAppUser(user)) {
|
if (service.registerAppUser(user)) {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.springblade.modules.common.client;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dtflys.forest.annotation.Get;
|
||||||
|
import com.dtflys.forest.annotation.Query;
|
||||||
|
import com.dtflys.forest.annotation.Var;
|
||||||
|
import org.springblade.modules.common.request.GeoInfoRequest;
|
||||||
|
import org.springblade.modules.common.response.GeoInfoResponse;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface AMapClient {
|
||||||
|
|
||||||
|
@Get("{baseUrl}/geocode/geo")
|
||||||
|
GeoInfoResponse geoInfo(@Var("baseUrl") String baseUrl, @Query GeoInfoRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.springblade.modules.common.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "amap")
|
||||||
|
public class AMapConfiguration {
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
private String baseUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,13 +32,15 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import org.springblade.core.redis.debounce.RedisDebounce;
|
|
||||||
import org.springblade.core.secure.BladeUser;
|
import org.springblade.core.secure.BladeUser;
|
||||||
import org.springblade.core.secure.annotation.IsAdmin;
|
import org.springblade.core.secure.annotation.IsAdmin;
|
||||||
import org.springblade.core.mp.support.Condition;
|
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.manager.CommonUserManager;
|
||||||
|
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;
|
||||||
@@ -53,6 +55,7 @@ import org.springblade.core.excel.util.ExcelUtil;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单 控制器
|
* 用户订单 控制器
|
||||||
@@ -67,6 +70,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
public class CommonUserOrderController extends BladeController {
|
public class CommonUserOrderController extends BladeController {
|
||||||
|
|
||||||
private final ICommonUserOrderService orderService;
|
private final ICommonUserOrderService orderService;
|
||||||
|
private final CommonUserManager commonUserManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单 详情
|
* 用户订单 详情
|
||||||
@@ -100,6 +104,14 @@ public class CommonUserOrderController extends BladeController {
|
|||||||
return R.data(pages);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户订单 新增
|
* 用户订单 新增
|
||||||
*/
|
*/
|
||||||
@@ -162,11 +174,52 @@ public class CommonUserOrderController extends BladeController {
|
|||||||
* 用户订单 确认收款
|
* 用户订单 确认收款
|
||||||
*/
|
*/
|
||||||
@PostMapping("/confirm-payment")
|
@PostMapping("/confirm-payment")
|
||||||
@ApiOperationSupport(order = 5)
|
@ApiOperationSupport(order = 10)
|
||||||
@Operation(summary = "确认收款", description = "传入order")
|
@Operation(summary = "确认收款", description = "传入order")
|
||||||
public R confirmPayment(@Valid @RequestBody CommonUserOrderEntity order) {
|
public R confirmPayment(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||||
return R.status(orderService.confirmPayment(order.getId()));
|
return R.status(orderService.confirmPayment(order.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/export-order-to-excel")
|
||||||
|
@ApiOperationSupport(order = 11)
|
||||||
|
@Operation(summary = "导出用户订单")
|
||||||
|
public void exportFlowToExcel(@RequestParam(required = false) Integer orderStatus ,
|
||||||
|
@RequestParam(required = false) String account ,
|
||||||
|
@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-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")
|
||||||
|
@ApiOperationSupport(order = 13)
|
||||||
|
@Operation(summary = "批量导入补单", description = "传入excel")
|
||||||
|
public R<List<CommonImportUserBackOrderError>> importUserBackOrder(MultipartFile file) {
|
||||||
|
return R.data(commonUserManager.importUserBackOrder(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户订单 填写快递
|
||||||
|
*/
|
||||||
|
@PostMapping("/fill-express")
|
||||||
|
@ApiOperationSupport(order = 14)
|
||||||
|
@Operation(summary = "填写快递", description = "传入order")
|
||||||
|
public R fillExpress(@Valid @RequestBody CommonUserOrderEntity order) {
|
||||||
|
return R.status(orderService.fillExpress(order.getId(), order.getExpressNo()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,21 +7,19 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import org.springblade.core.secure.BladeUser;
|
|
||||||
import org.springblade.core.secure.annotation.IsAdmin;
|
|
||||||
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.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.excel.CommonUserPointLogExcel;
|
||||||
|
import org.springblade.modules.common.manager.CommonUserManager;
|
||||||
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.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||||
import org.springblade.modules.common.wrapper.CommonUserPointLogWrapper;
|
import org.springblade.modules.common.wrapper.CommonUserPointLogWrapper;
|
||||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||||
import org.springblade.core.boot.ctrl.BladeController;
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
import org.springblade.core.tool.utils.DateUtil;
|
|
||||||
import org.springblade.core.excel.util.ExcelUtil;
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -41,6 +39,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
public class CommonUserPointLogController extends BladeController {
|
public class CommonUserPointLogController extends BladeController {
|
||||||
|
|
||||||
private final ICommonUserPointLogService commonUserPointLogService;
|
private final ICommonUserPointLogService commonUserPointLogService;
|
||||||
|
private final CommonUserManager commonUserManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户商城积分流水表 详情
|
* 用户商城积分流水表 详情
|
||||||
@@ -115,4 +114,14 @@ public class CommonUserPointLogController extends BladeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/exportFlowToExcel")
|
||||||
|
@ApiOperationSupport(order = 8)
|
||||||
|
@Operation(summary = "导出用户佣金流水")
|
||||||
|
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||||
|
List<CommonUserPointLogExcel> excelList = commonUserManager.exportUserPointToExcel(account ,searchDateRange);
|
||||||
|
ExcelUtil.export(response, "用户积分流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户积分流水日志", excelList, CommonUserPointLogExcel.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
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.CommonUserSmsLogEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonUserSmsLogVO;
|
||||||
|
import org.springblade.modules.common.wrapper.CommonUserSmsLogWrapper;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserSmsLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-02-24
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("common/usersmslog")
|
||||||
|
@Tag(name = "用户短信日志", description = "用户短信日志接口")
|
||||||
|
public class CommonUserSmsLogController extends BladeController {
|
||||||
|
|
||||||
|
private final ICommonUserSmsLogService userSmsLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入userSmsLog")
|
||||||
|
public R<CommonUserSmsLogVO> detail(CommonUserSmsLogEntity userSmsLog) {
|
||||||
|
CommonUserSmsLogEntity detail = userSmsLogService.getOne(Condition.getQueryWrapper(userSmsLog));
|
||||||
|
return R.data(CommonUserSmsLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户短信日志 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入userSmsLog")
|
||||||
|
public R<IPage<CommonUserSmsLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userSmsLog, Query query) {
|
||||||
|
IPage<CommonUserSmsLogEntity> pages = userSmsLogService.page(Condition.getPage(query), Condition.getQueryWrapper(userSmsLog, CommonUserSmsLogEntity.class));
|
||||||
|
return R.data(CommonUserSmsLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入userSmsLog")
|
||||||
|
public R<IPage<CommonUserSmsLogVO>> page(CommonUserSmsLogVO userSmsLog, Query query) {
|
||||||
|
IPage<CommonUserSmsLogVO> pages = userSmsLogService.selectUserSmsLogPage(Condition.getPage(query), userSmsLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入userSmsLog")
|
||||||
|
public R save(@Valid @RequestBody CommonUserSmsLogEntity userSmsLog) {
|
||||||
|
return R.status(userSmsLogService.save(userSmsLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入userSmsLog")
|
||||||
|
public R update(@Valid @RequestBody CommonUserSmsLogEntity userSmsLog) {
|
||||||
|
return R.status(userSmsLogService.updateById(userSmsLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入userSmsLog")
|
||||||
|
public R submit(@Valid @RequestBody CommonUserSmsLogEntity userSmsLog) {
|
||||||
|
return R.status(userSmsLogService.saveOrUpdate(userSmsLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(userSmsLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.getById(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,125 @@
|
|||||||
|
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)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,6 +40,24 @@ public interface AppCommonConvert {
|
|||||||
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
||||||
CommonUserOrderEntity convertMallProductToOrder(CreateOrderRequest request, MallProductEntity product);
|
CommonUserOrderEntity convertMallProductToOrder(CreateOrderRequest 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 = "consigneePhone", source = "request.consigneePhone")
|
||||||
|
@Mapping(target = "consignee", source = "request.consignee")
|
||||||
|
@Mapping(target = "itemCode", source = "request.itemCode")
|
||||||
|
@Mapping(target = "quantity", source = "request.quantity")
|
||||||
|
@Mapping(target = "deliveryAddress", source = "request.address")
|
||||||
|
@Mapping(target = "itemName", source = "product.productName")
|
||||||
|
@Mapping(target = "imageUrl", source = "product.thumbnailUrl")
|
||||||
|
CommonUserOrderEntity convertTourProductToOrder(CreateOrderRequest request, TourProductEntity product);
|
||||||
|
|
||||||
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
||||||
|
|
||||||
List<CommonUserOrderApiVO> convertUserOrderEntityListTOApiList(List<CommonUserOrderEntity> entityList);
|
List<CommonUserOrderApiVO> convertUserOrderEntityListTOApiList(List<CommonUserOrderEntity> entityList);
|
||||||
@@ -62,4 +80,11 @@ 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.springblade.modules.common.eums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum PaymentType {
|
||||||
|
|
||||||
|
ALI(1, "支付宝"),
|
||||||
|
WECHAT(2, "微信"),
|
||||||
|
OFFLINE(99, "线下支付");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
PaymentType(int code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 静态映射:code -> enum ==========
|
||||||
|
|
||||||
|
private static final Map<Integer, PaymentType> BY_CODE = Stream.of(values())
|
||||||
|
.collect(Collectors.toUnmodifiableMap(PaymentType::getCode, Function.identity()));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据整型状态码获取对应的枚举(严格模式)
|
||||||
|
*
|
||||||
|
* @throws IllegalArgumentException 如果状态码无效
|
||||||
|
*/
|
||||||
|
public static PaymentType fromCode(int code) {
|
||||||
|
PaymentType status = BY_CODE.get(code);
|
||||||
|
if (status == null) {
|
||||||
|
throw new IllegalArgumentException("无效的支付状态码: " + code);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全版本:无效状态码返回 null
|
||||||
|
*/
|
||||||
|
public static PaymentType fromCodeOrNull(int code) {
|
||||||
|
return BY_CODE.get(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.common.eums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum UserCommissionFlowType {
|
||||||
|
|
||||||
|
EARNED_FROM_REFERRAL(1, "好友通过您的邀请下单,您已获得 ¥%s 推广奖励!佣金已到账,快去查看吧!"),
|
||||||
|
|
||||||
|
TEAM_SETTLEMENT_REWARD(1, "🎉 恭喜!您的团队本日达成目标,您获得 ¥%s 团队结算奖励,已发放至佣金账户!"),
|
||||||
|
|
||||||
|
WITHDRAW_SUCCESS(2, "您已成功提现 ¥%s 邀请奖励,款项将在1-3个工作日内到账,请注意查收!");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
|
||||||
|
private final String userMessageTemplate;
|
||||||
|
|
||||||
|
UserCommissionFlowType(int code, String userMessageTemplate) {
|
||||||
|
this.code = code;
|
||||||
|
this.userMessageTemplate = userMessageTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String format(String amount) {
|
||||||
|
return String.format(userMessageTemplate, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,7 +28,7 @@ public enum UserPointFlowType {
|
|||||||
private final int code;
|
private final int code;
|
||||||
private final String userMessageTemplate;
|
private final String userMessageTemplate;
|
||||||
|
|
||||||
private UserPointFlowType(int code, String userMessageTemplate) {
|
UserPointFlowType(int code, String userMessageTemplate) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.userMessageTemplate = userMessageTemplate;
|
this.userMessageTemplate = userMessageTemplate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.springblade.modules.common.event;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public class EarnedCommissionEvent {
|
||||||
|
|
||||||
|
private final Long orderId;
|
||||||
|
|
||||||
|
private final Long userId;
|
||||||
|
|
||||||
|
private final BigDecimal commission;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.springblade.modules.common.event;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springblade.modules.common.eums.BusinessModule;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public class FillExpressEvent {
|
||||||
|
|
||||||
|
private final Long orderId;
|
||||||
|
|
||||||
|
private final Long userId;
|
||||||
|
|
||||||
|
private final BusinessModule businessModule;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.springblade.modules.common.excel;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@HeadRowHeight(20)
|
||||||
|
@ContentRowHeight(18)
|
||||||
|
public class CommonUserBackOrderExcel {
|
||||||
|
|
||||||
|
@ExcelProperty("订单号")
|
||||||
|
private Long orderNo;
|
||||||
|
|
||||||
|
@ExcelProperty("实际支付金额")
|
||||||
|
private BigDecimal actualAmount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,30 +1,5 @@
|
|||||||
/**
|
|
||||||
* BladeX Commercial License Agreement
|
|
||||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* Use of this software is governed by the Commercial License Agreement
|
|
||||||
* obtained after purchasing a license from BladeX.
|
|
||||||
* <p>
|
|
||||||
* 1. This software is for development use only under a valid license
|
|
||||||
* from BladeX.
|
|
||||||
* <p>
|
|
||||||
* 2. Redistribution of this software's source code to any third party
|
|
||||||
* without a commercial license is strictly prohibited.
|
|
||||||
* <p>
|
|
||||||
* 3. Licensees may copyright their own code but cannot use segments
|
|
||||||
* from this software for such purposes. Copyright of this software
|
|
||||||
* remains with BladeX.
|
|
||||||
* <p>
|
|
||||||
* Using this software signifies agreement to this License, and the software
|
|
||||||
* must not be used for illegal purposes.
|
|
||||||
* <p>
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
|
||||||
* not liable for any claims arising from secondary or illegal development.
|
|
||||||
* <p>
|
|
||||||
* Author: Chill Zhuang (bladejava@qq.com)
|
|
||||||
*/
|
|
||||||
package org.springblade.modules.common.excel;
|
|
||||||
|
|
||||||
|
package org.springblade.modules.common.excel;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -34,6 +9,8 @@ import cn.idev.excel.annotation.ExcelProperty;
|
|||||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
|
||||||
@@ -48,130 +25,63 @@ import java.io.Serial;
|
|||||||
@ColumnWidth(25)
|
@ColumnWidth(25)
|
||||||
@HeadRowHeight(20)
|
@HeadRowHeight(20)
|
||||||
@ContentRowHeight(18)
|
@ContentRowHeight(18)
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CommonUserOrderExcel implements Serializable {
|
public class CommonUserOrderExcel implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
@ExcelProperty(value = "订单号")
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
|
||||||
* 用户id
|
@ExcelProperty(value = "下单账号")
|
||||||
*/
|
private String account;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("用户id")
|
@ExcelProperty(value = "电话")
|
||||||
private Long userId;
|
|
||||||
/**
|
|
||||||
* 收件人手机号
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("收件人手机号")
|
|
||||||
private String consigneePhone;
|
private String consigneePhone;
|
||||||
/**
|
|
||||||
* 收件人
|
@ExcelProperty(value = "收货人")
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("收件人")
|
|
||||||
private String consignee;
|
private String consignee;
|
||||||
/**
|
|
||||||
* 订单类型
|
@ExcelProperty(value = "收货地址")
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("订单类型")
|
|
||||||
private String orderType;
|
|
||||||
/**
|
|
||||||
* 商品编号
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("商品编号")
|
|
||||||
private String itemCode;
|
|
||||||
/**
|
|
||||||
* 商品名称
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("商品名称")
|
|
||||||
private String itemName;
|
|
||||||
/**
|
|
||||||
* 图片
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("图片")
|
|
||||||
private String imageUrl;
|
|
||||||
/**
|
|
||||||
* 数量
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("数量")
|
|
||||||
private Integer quantity;
|
|
||||||
/**
|
|
||||||
* 收货地址(实物商品必填,虚拟商品可为空)
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("收货地址(实物商品必填,虚拟商品可为空)")
|
|
||||||
private String deliveryAddress;
|
private String deliveryAddress;
|
||||||
/**
|
|
||||||
* 快递公司名称
|
@ExcelProperty(value = "商品名称")
|
||||||
*/
|
private String itemName;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("快递公司名称")
|
@ExcelProperty(value = "商品图片")
|
||||||
private String expressCompany;
|
private String imageUrl;
|
||||||
/**
|
|
||||||
* 快递单号(物流单号)
|
@ExcelProperty(value = "商品数量")
|
||||||
*/
|
private Integer quantity;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("快递单号(物流单号)")
|
@ExcelProperty(value = "商品规格")
|
||||||
|
private String specs;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "物流单号")
|
||||||
private String expressNo;
|
private String expressNo;
|
||||||
/**
|
|
||||||
* 订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款
|
@ExcelProperty(value = "订单状态")
|
||||||
*/
|
private String orderStatus;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("订单状态 0=待支付 1=已支付(待发货/待使用)2=已取消 3=已发货/已出票(进行中)4=已完成 5=已关闭(超时未支付)6=退款中 7: 已退款")
|
@ExcelProperty(value = "订单金额")
|
||||||
private Integer orderStatus;
|
|
||||||
/**
|
|
||||||
* 订单金额
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("订单金额")
|
|
||||||
private BigDecimal totalAmount;
|
private BigDecimal totalAmount;
|
||||||
/**
|
|
||||||
* 实际支付金额
|
@ExcelProperty(value = "实际支付")
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("实际支付金额")
|
|
||||||
private BigDecimal actualAmount;
|
private BigDecimal actualAmount;
|
||||||
/**
|
|
||||||
* 支付方式
|
@ExcelProperty(value = "支付方式")
|
||||||
*/
|
private String paymentType;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("支付方式")
|
@ExcelProperty(value = "支付时间")
|
||||||
private Integer paymentType;
|
|
||||||
/**
|
|
||||||
* 支付时间
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("支付时间")
|
|
||||||
private Date paymentTime;
|
private Date paymentTime;
|
||||||
/**
|
|
||||||
* 支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)
|
@ExcelProperty(value = "支付状态")
|
||||||
*/
|
private String paymentStatus;
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("支付状态 0=未支付 1=已支付 2=支付失败 3=支付中(如跳转网银)")
|
@ExcelProperty(value = "下单时间")
|
||||||
private Integer paymentStatus;
|
private Date createTime;
|
||||||
/**
|
|
||||||
* 支付凭证编号
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("支付凭证编号")
|
|
||||||
private String paymentTrack;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty("")
|
|
||||||
private Integer isDeleted;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package org.springblade.modules.common.excel;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@HeadRowHeight(20)
|
||||||
|
@ContentRowHeight(18)
|
||||||
|
public class CommonUserPointLogExcel implements Serializable {
|
||||||
|
|
||||||
|
@ExcelProperty("账号")
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
@ExcelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ExcelProperty("上一笔金额")
|
||||||
|
private BigDecimal lastAmount;
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty("收入/支出")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelProperty("统计时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,17 +4,20 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.modules.common.eums.NoticeType;
|
import org.springblade.modules.common.eums.NoticeType;
|
||||||
import org.springblade.modules.common.eums.OrderStatus;
|
import org.springblade.modules.common.eums.OrderStatus;
|
||||||
|
import org.springblade.modules.common.eums.UserCommissionFlowType;
|
||||||
import org.springblade.modules.common.eums.UserPointFlowType;
|
import org.springblade.modules.common.eums.UserPointFlowType;
|
||||||
import org.springblade.modules.common.event.GrantUserPointEvent;
|
import org.springblade.modules.common.event.*;
|
||||||
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
|
||||||
import org.springblade.modules.common.event.SpendUserPointEvent;
|
|
||||||
import org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity;
|
import org.springblade.modules.common.pojo.entity.CommonUserNoticeEntity;
|
||||||
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
import org.springblade.modules.common.service.ICommonUserNoticeService;
|
||||||
|
import org.springblade.modules.market.event.MarketUpgradeNoticeEvent;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.event.TransactionPhase;
|
import org.springframework.transaction.event.TransactionPhase;
|
||||||
import org.springframework.transaction.event.TransactionalEventListener;
|
import org.springframework.transaction.event.TransactionalEventListener;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -74,4 +77,87 @@ public class NoticeListener {
|
|||||||
log.warn("用户获取积分事务回滚,userId={}", event.getUserId());
|
log.warn("用户获取积分事务回滚,userId={}", event.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||||
|
public void onMarketUserUpgrade(MarketUpgradeNoticeEvent event) {
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> items = event.getNoticeItems();
|
||||||
|
log.info("【监听器】开始处理一对一批量升级事件,总数量: {}", items.size());
|
||||||
|
|
||||||
|
int batchSize = 100; // 每次处理 100 条
|
||||||
|
long delayMs = 50; // 每批延迟 50ms
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < items.size(); i += batchSize) {
|
||||||
|
int end = Math.min(i + batchSize, items.size());
|
||||||
|
List<MarketUpgradeNoticeEvent.NoticeItem> subList = items.subList(i, end);
|
||||||
|
|
||||||
|
// 1. 批量构建实体
|
||||||
|
List<CommonUserNoticeEntity> noticeList = subList.stream().map(item -> {
|
||||||
|
CommonUserNoticeEntity notice = new CommonUserNoticeEntity();
|
||||||
|
notice.setUserId(item.getUserId());
|
||||||
|
notice.setNoticeType(NoticeType.MARKET_USER.getCode());
|
||||||
|
notice.setModuleType(event.getBusinessModule().getCode());
|
||||||
|
notice.setTitle(event.getBusinessModule().getDisplayName());
|
||||||
|
notice.setContent(item.getContent()); // 使用传入的专属内容
|
||||||
|
return notice;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 2. 批量保存
|
||||||
|
boolean success = noticeService.saveBatch(noticeList, noticeList.size());
|
||||||
|
if (success) {
|
||||||
|
log.info("【监听器】批次处理完成,范围: {}-{}", i, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 限流:处理完一批后休眠
|
||||||
|
// 注意:只有在还有下一批数据时才休眠
|
||||||
|
if (i + batchSize < items.size()) {
|
||||||
|
Thread.sleep(delayMs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
log.error("【监听器】处理批量任务时被中断", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||||
|
public void onMarketUserUpgradeFailure(MarketUpgradeNoticeEvent event) {
|
||||||
|
log.warn("用户动态升级事务回滚,userId={}", event.getNoticeItems());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||||
|
public void onFillExpress(FillExpressEvent event) {
|
||||||
|
CommonUserNoticeEntity notice = new CommonUserNoticeEntity();
|
||||||
|
notice.setUserId(event.getUserId());
|
||||||
|
notice.setNoticeType(NoticeType.APP_USER.getCode());
|
||||||
|
notice.setModuleType(event.getBusinessModule().getCode());
|
||||||
|
notice.setTitle(event.getBusinessModule().getDisplayName());
|
||||||
|
notice.setContent(OrderStatus.SHIPPED.formatUserMessage(String.valueOf(event.getOrderId())));
|
||||||
|
noticeService.save(notice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||||
|
public void onFillExpressFailure(FillExpressEvent event) {
|
||||||
|
log.warn("发货事务回滚,orderId={}", event.getOrderId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
|
||||||
|
public void onEarnedCommission(EarnedCommissionEvent event) {
|
||||||
|
CommonUserNoticeEntity notice = new CommonUserNoticeEntity();
|
||||||
|
notice.setUserId(event.getUserId());
|
||||||
|
notice.setNoticeType(NoticeType.MARKET_USER.getCode());
|
||||||
|
notice.setTitle("佣金通知");
|
||||||
|
notice.setContent(UserCommissionFlowType.EARNED_FROM_REFERRAL.format(String.valueOf(event.getCommission())));
|
||||||
|
noticeService.save(notice);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_ROLLBACK)
|
||||||
|
public void onEarnedCommissionFailure(EarnedCommissionEvent event) {
|
||||||
|
log.warn("奖励佣金事务回滚,orderId={}", event.getOrderId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,295 @@
|
|||||||
|
package org.springblade.modules.common.manager;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springblade.common.utils.date.DateUtil;
|
||||||
|
import org.springblade.core.excel.util.ExcelUtil;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
|
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||||
|
import org.springblade.modules.common.eums.*;
|
||||||
|
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||||
|
import org.springblade.modules.common.excel.CommonUserBackOrderExcel;
|
||||||
|
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||||
|
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonImportUserBackOrderError;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||||
|
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||||
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
|
import org.springblade.modules.system.service.IUserService;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CommonUserManager {
|
||||||
|
private final IUserService userService;
|
||||||
|
private final ICommonUserPointLogService commonUserPointLogService;
|
||||||
|
private final ICommonUserOrderService commonUserOrderService;
|
||||||
|
private final ApplicationEventPublisher eventPublisher;
|
||||||
|
private final ICommonUserPointService userPointService;
|
||||||
|
|
||||||
|
public List<CommonUserPointLogExcel> exportUserPointToExcel(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 endDate = null;
|
||||||
|
if (searchDateRange == null) {
|
||||||
|
throw new RuntimeException("请选择时间范围");
|
||||||
|
}
|
||||||
|
|
||||||
|
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 RuntimeException("开始时间不能大于结束时间");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CommonUserPointLogEntity> pointLogList = commonUserPointLogService.list(
|
||||||
|
Wrappers.lambdaQuery(CommonUserPointLogEntity.class)
|
||||||
|
.eq(CommonUserPointLogEntity::getIsComplete, 1)
|
||||||
|
.eq(CommonUserPointLogEntity::getUserId, user.getId())
|
||||||
|
.ge(CommonUserPointLogEntity::getCreateTime, startDate)
|
||||||
|
.lt(CommonUserPointLogEntity::getCreateTime, endDate)
|
||||||
|
.orderByDesc(CommonUserPointLogEntity::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
List<CommonUserPointLogExcel> excelList = new ArrayList<>();
|
||||||
|
|
||||||
|
pointLogList.forEach(pointLog -> {
|
||||||
|
|
||||||
|
CommonUserPointLogExcel pointLogExcel = new CommonUserPointLogExcel();
|
||||||
|
|
||||||
|
pointLogExcel.setAccount(user.getAccount());
|
||||||
|
pointLogExcel.setAmount(pointLog.getAmount());
|
||||||
|
pointLogExcel.setLastAmount(pointLog.getLastAmount());
|
||||||
|
pointLogExcel.setType(pointLog.getType() == 1 ? "收入" : "支出");
|
||||||
|
pointLogExcel.setCreateTime(pointLog.getCreateTime());
|
||||||
|
pointLogExcel.setRemark(pointLog.getRemark());
|
||||||
|
|
||||||
|
excelList.add(pointLogExcel);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return excelList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CommonUserOrderExcel> exportUserMallOrderToExcel(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.exportUserMallOrderToExcel(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) {
|
||||||
|
|
||||||
|
List<CommonUserBackOrderExcel> read = ExcelUtil.read(file, CommonUserBackOrderExcel.class);
|
||||||
|
|
||||||
|
List<CommonImportUserBackOrderError> errorExcelList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < read.size(); i++) {
|
||||||
|
int row = i + 2;
|
||||||
|
|
||||||
|
CommonUserBackOrderExcel backOrderExcel = read.get(i);
|
||||||
|
|
||||||
|
if (backOrderExcel.getOrderNo() == null || backOrderExcel.getActualAmount() == null) {
|
||||||
|
log.error("第{}行错误 ,订单号或金额必填", row);
|
||||||
|
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单号或金额必填")
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonUserOrderEntity userOrder = commonUserOrderService.getById(backOrderExcel.getOrderNo());
|
||||||
|
|
||||||
|
if (userOrder == null) {
|
||||||
|
log.error("第{}行错误 ,订单号不存在", row);
|
||||||
|
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单号不存在")
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (userOrder.getPaymentStatus() != 0) {
|
||||||
|
|
||||||
|
log.error("第{}行错误 ,订单:{}", row, PaymentStatus.fromCodeOrNull(userOrder.getPaymentStatus()).getDescription());
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单:" + PaymentStatus.fromCodeOrNull(userOrder.getPaymentStatus()).getDescription())
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (userOrder.getOrderStatus() >= 1) {
|
||||||
|
log.error("第{}行错误 ,订单:已支付 ", row);
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单:已支付")
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (userOrder.getActualAmount().compareTo(backOrderExcel.getActualAmount()) != 0) {
|
||||||
|
log.error("第{}行错误 ,订单金额不一致", row);
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单金额不一致")
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boolean updated = commonUserOrderService.update(Wrappers.<CommonUserOrderEntity>lambdaUpdate()
|
||||||
|
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.PAID.getCode())
|
||||||
|
.set(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.PAID.getCode())
|
||||||
|
.set(CommonUserOrderEntity::getPaymentTime, new Date())
|
||||||
|
.eq(CommonUserOrderEntity::getId, userOrder.getId())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentType, PaymentType.OFFLINE.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.PENDING_PAYMENT.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getPaymentStatus, PaymentStatus.UNPAID.getCode())
|
||||||
|
.eq(CommonUserOrderEntity::getIsDeleted, 0)
|
||||||
|
);
|
||||||
|
if (!updated) {
|
||||||
|
log.error("第{}行错误 ,订单号提交失败", row);
|
||||||
|
errorExcelList.add(
|
||||||
|
new CommonImportUserBackOrderError()
|
||||||
|
.setOrderNo(backOrderExcel.getOrderNo())
|
||||||
|
.setAmount(backOrderExcel.getActualAmount())
|
||||||
|
.setErrorMsg("第" + row + "行错误 ,订单号提交,请刷新重试")
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
eventPublisher.publishEvent(new PaymentSuccessEvent(userOrder.getId(), userOrder.getUserId(), BusinessModule.SELF_OPERATED_MALL));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return errorExcelList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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,9 @@ 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.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,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);
|
||||||
|
|
||||||
|
|
||||||
@@ -62,4 +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(Integer orderStatus, String account ,Date startDate, Date endDate , String orderType);
|
||||||
|
|
||||||
|
Long countOrderExcelList(Integer orderStatus, String account ,Date startDate, Date endDate , String orderType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,25 @@
|
|||||||
<result column="is_deleted" property="isDeleted"/>
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="CommonUserOrderResultMap" type="org.springblade.modules.common.pojo.vo.CommonUserOrderVO">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="specs" column="specs" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
|
||||||
|
|
||||||
<select id="selectOrderPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserOrderVO">
|
</resultMap>
|
||||||
select uo.*, bu.account as account
|
|
||||||
|
<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 uo.*, bu.account as account , mp.specs
|
||||||
from user_order uo
|
from user_order uo
|
||||||
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
|
||||||
where uo.is_deleted = 0
|
where uo.is_deleted = 0
|
||||||
<if test="order.id != null">
|
<if test="order.id != null">
|
||||||
and uo.id = #{order.id}
|
and uo.id = #{order.id}
|
||||||
@@ -53,14 +67,68 @@
|
|||||||
<if test="order.orderStatus != null">
|
<if test="order.orderStatus != null">
|
||||||
and uo.order_status = #{order.orderStatus}
|
and uo.order_status = #{order.orderStatus}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="order.startDate != null">
|
||||||
|
and uo.create_time >= #{order.startDate}
|
||||||
|
and uo.create_time < #{order.endDate}
|
||||||
|
</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>
|
||||||
|
|
||||||
|
|
||||||
@@ -69,4 +137,62 @@
|
|||||||
FROM user_order ${ew.customSqlSegment}
|
FROM user_order ${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderExcelList" resultMap="CommonUserOrderResultMap">
|
||||||
|
select uo.*, bu.account as account , mp.specs as specs
|
||||||
|
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
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
order by create_time desc
|
||||||
|
</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,26 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.common.pojo.entity.CommonUserSmsLogEntity;
|
||||||
|
import org.springblade.modules.common.pojo.vo.CommonUserSmsLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-02-24
|
||||||
|
*/
|
||||||
|
public interface CommonUserSmsLogMapper extends BaseMapper<CommonUserSmsLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param userSmsLog 查询参数
|
||||||
|
* @return List<UserSmsLogVO>
|
||||||
|
*/
|
||||||
|
List<CommonUserSmsLogVO> selectUserSmsLogPage(IPage page, CommonUserSmsLogVO userSmsLog);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?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.CommonUserSmsLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="userSmsLogResultMap" type="org.springblade.modules.common.pojo.entity.CommonUserSmsLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="sms_type" property="smsType"/>
|
||||||
|
<result column="content" property="content"/>
|
||||||
|
<result column="stat_date" property="statDate"/>
|
||||||
|
<result column="remarks" property="remarks"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="create_dept" property="createDept"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="status" property="status"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectUserSmsLogPage" resultMap="userSmsLogResultMap">
|
||||||
|
select * from user_sms_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</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,33 @@
|
|||||||
|
package org.springblade.modules.common.mapper;
|
||||||
|
|
||||||
|
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(MerchantStoreRequest request);
|
||||||
|
|
||||||
|
CommonMerchantStoreDetailApiVO merchantStoreDetail(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?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>
|
||||||
|
|
||||||
|
<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(#{longitude}, #{latitude}), 4326))::numeric,2) AS distance
|
||||||
|
FROM
|
||||||
|
merchant_flagship_store
|
||||||
|
WHERE
|
||||||
|
|
||||||
|
ST_DWithin(location,ST_SetSRID(ST_Point(#{longitude}, #{latitude}), 4326),#{distance})
|
||||||
|
|
||||||
|
AND is_deleted = 0
|
||||||
|
ORDER BY
|
||||||
|
location <-> ST_SetSRID(ST_Point(#{longitude}, #{latitude}), 4326)
|
||||||
|
|
||||||
|
|
||||||
|
</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,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.CommonUserSmsLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户短信日志 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-02-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommonUserSmsLogDTO extends CommonUserSmsLogEntity {
|
||||||
|
@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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.MerchantFlagshipStoreEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家旗舰店信息 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MerchantFlagshipStoreDTO extends MerchantFlagshipStoreEntity {
|
||||||
|
@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.NewsCategoryEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯分类 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class NewsCategoryDTO extends NewsCategoryEntity {
|
||||||
|
@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.NewsContentEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资讯内容 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class NewsContentDTO extends NewsContentEntity {
|
||||||
|
@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.TourOrderDetailEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅游团订单详情 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class TourOrderDetailDTO extends TourOrderDetailEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user