Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
DROP TABLE IF EXISTS market_upgrade_config;
|
DROP TABLE IF EXISTS market_upgrade_config;
|
||||||
CREATE TABLE market_upgrade_config
|
CREATE TABLE market_upgrade_config
|
||||||
(
|
(
|
||||||
id int8 PRIMARY KEY GENERATED ALWAYS AS IDENTITY, -- 主键ID
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
type int4 NOT NULL, -- 等级类型:1=福利包, 2=现金
|
type int4 NOT NULL, -- 等级类型:1=福利值, 2=现金
|
||||||
level_name varchar(50) NOT NULL, -- 等级名称,如 '社区经销商V1', '无等级'
|
level_name varchar(50) NOT NULL, -- 等级名称,如 '社区经销商V1', '无等级'
|
||||||
direct_recommend int4, -- 直推人数 (持有福利包人数 / 统计现金下单人数)
|
direct_recommend int4, -- 直推人数 (持有福利包人数 / 统计现金下单人数)
|
||||||
requirement_value decimal(20, 2), -- 要求值 (福利值 / 金额),使用 numeric 防止金额精度丢失
|
requirement_value decimal(20, 2), -- 要求值 (福利值 / 金额),使用 numeric 防止金额精度丢失
|
||||||
@@ -21,7 +21,7 @@ CREATE TABLE market_upgrade_config
|
|||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE market_upgrade_config IS '用户等级升级配置表';
|
COMMENT ON TABLE market_upgrade_config IS '用户等级升级配置表';
|
||||||
COMMENT ON COLUMN market_upgrade_config.type IS '等级类型:1=福利包, 2=现金';
|
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.level_name IS '等级名称';
|
||||||
COMMENT ON COLUMN market_upgrade_config.direct_recommend 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.requirement_value IS '业绩/福利值要求';
|
||||||
@@ -38,17 +38,16 @@ COMMENT ON COLUMN market_upgrade_config.status IS '状态';
|
|||||||
COMMENT ON COLUMN market_upgrade_config.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN market_upgrade_config.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO market_upgrade_config (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, '无等级', 0, 0.00, 0.00, '初始等级', 0, 2, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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 (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, '无等级', 0, 0.00, 0.00, '初始等级', 0, 7, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '联合创始人V4', 40, 20000000.00, 0.05, '5% (全网加权, 单独乘区, 不累加级差)', 4, null, 0, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '社区经销商V1', 10, 100000.00, 0.08, '福利包加速动态', 1, 3, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '区县经销商V2', 20, 1000000.00, 0.06, '福利包加速动态', 2, 4, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '区县经销商V2', 20, 1000000.00, 0.05, '现金分红动态', 2, 9, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '市级经销商V3', 30, 5000000.00, 0.05, '现金分红动态', 3, 10, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '社区经销商V1', 10, 100000.00, 0.05, '现金分红动态', 1, 8, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '联合创始人V4', 40, 20000000.00, 0.02, '福利包加速动态', 4, null, 0, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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 (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, '市级经销商V3', 30, 5000000.00, 0.04, '福利包加速动态', 3, 5, 1, 1, 1, '2026-03-10 02:49:18.827445', 1, '2026-03-10 02:49:18.827445', 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ CREATE TABLE market_upgrade_welfare_log
|
|||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
user_id int8 NOT NULL, -- 用户ID
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
||||||
current_level_id int4, -- 用户当前等级
|
current_level_id int8, -- 用户当前等级
|
||||||
current_level_name varchar(50), -- 用户当前等级
|
current_level_name varchar(50), -- 用户当前等级
|
||||||
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
||||||
remarks text, -- 详细升级信息/备注
|
remarks text, -- 详细升级信息/备注
|
||||||
@@ -98,7 +97,7 @@ CREATE TABLE market_upgrade_cash_log
|
|||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
user_id int8 NOT NULL, -- 用户ID
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
last_level int8, -- 升级前的等级ID (关联配置表ID)
|
||||||
current_level_id int4, -- 用户当前等级
|
current_level_id int8, -- 用户当前等级
|
||||||
current_level_name varchar(50), -- 用户当前等级
|
current_level_name varchar(50), -- 用户当前等级
|
||||||
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
upgrade_date timestamp(6) NOT NULL, -- 升级时间 (到天结束)
|
||||||
remarks text, -- 详细升级信息/备注
|
remarks text, -- 详细升级信息/备注
|
||||||
@@ -133,8 +132,8 @@ DROP TABLE IF EXISTS market_welfare_performance;
|
|||||||
CREATE TABLE market_welfare_performance
|
CREATE TABLE market_welfare_performance
|
||||||
(
|
(
|
||||||
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
||||||
owen_amount decimal(20, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
owen_amount decimal(14, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
||||||
total_amount decimal(20, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
total_amount decimal(14, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
||||||
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
||||||
create_user int8 NULL, -- 创建人
|
create_user int8 NULL, -- 创建人
|
||||||
create_dept int8 NULL, -- 创建部门
|
create_dept int8 NULL, -- 创建部门
|
||||||
@@ -165,8 +164,7 @@ CREATE TABLE market_welfare_performance_log
|
|||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
user_id int8 NOT NULL, -- 用户ID
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
||||||
last_amount decimal(20, 2) DEFAULT 0.00, -- 上一份业绩
|
performance decimal(14, 2) NOT NULL, -- 业绩
|
||||||
current_amount decimal(20, 2) NOT NULL, -- 本次业绩
|
|
||||||
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
||||||
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
||||||
remarks text, -- 备注
|
remarks text, -- 备注
|
||||||
@@ -182,8 +180,7 @@ CREATE TABLE market_welfare_performance_log
|
|||||||
COMMENT ON TABLE market_welfare_performance_log IS '福利包业绩日志表';
|
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.user_id IS '用户ID';
|
||||||
COMMENT ON COLUMN market_welfare_performance_log.stat_date IS '统计时间';
|
COMMENT ON COLUMN market_welfare_performance_log.stat_date IS '统计时间';
|
||||||
COMMENT ON COLUMN market_welfare_performance_log.last_amount IS '上一份业绩';
|
COMMENT ON COLUMN market_welfare_performance_log.performance IS '当前业绩';
|
||||||
COMMENT ON COLUMN market_welfare_performance_log.current_amount IS '当前业绩';
|
|
||||||
COMMENT ON COLUMN market_welfare_performance_log.source_id IS '来源ID';
|
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.source_detail IS '来源详情';
|
||||||
COMMENT ON COLUMN market_welfare_performance_log.remarks IS '备注';
|
COMMENT ON COLUMN market_welfare_performance_log.remarks IS '备注';
|
||||||
@@ -203,8 +200,8 @@ DROP TABLE IF EXISTS market_cash_performance;
|
|||||||
CREATE TABLE market_cash_performance
|
CREATE TABLE market_cash_performance
|
||||||
(
|
(
|
||||||
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
id int8 PRIMARY KEY, -- 主键ID (用户ID)
|
||||||
owen_amount decimal(20, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
owen_amount decimal(14, 2) DEFAULT 0.00, -- 自身业绩 (直推/个人产生的)
|
||||||
total_amount decimal(20, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
total_amount decimal(14, 2) DEFAULT 0.00, -- 总业绩 (团队/包含下级的业绩)
|
||||||
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
version int4 DEFAULT 1, -- 版本号 (用于乐观锁,防止并发更新覆盖)
|
||||||
create_user int8 NULL, -- 创建人
|
create_user int8 NULL, -- 创建人
|
||||||
create_dept int8 NULL, -- 创建部门
|
create_dept int8 NULL, -- 创建部门
|
||||||
@@ -235,8 +232,7 @@ CREATE TABLE market_cash_performance_log
|
|||||||
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
id int8 NOT NULL PRIMARY KEY, -- 主键ID
|
||||||
user_id int8 NOT NULL, -- 用户ID
|
user_id int8 NOT NULL, -- 用户ID
|
||||||
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
stat_date timestamp(6) NOT NULL, -- 统计时间 (到天)
|
||||||
last_amount decimal(20, 2) DEFAULT 0.00, -- 上一份业绩
|
performance decimal(14, 2) NOT NULL, -- 业绩
|
||||||
current_amount decimal(20, 2) NOT NULL, -- 本次业绩
|
|
||||||
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
source_id int8, -- 来源ID (例如:订单ID, 产生业绩的具体业务ID)
|
||||||
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
source_detail varchar(255), -- 来源详情 (例如:订单号, 业务简述)
|
||||||
remarks text, -- 备注
|
remarks text, -- 备注
|
||||||
@@ -252,8 +248,7 @@ CREATE TABLE market_cash_performance_log
|
|||||||
COMMENT ON TABLE market_cash_performance_log IS '现金业绩日志表';
|
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.user_id IS '用户ID';
|
||||||
COMMENT ON COLUMN market_cash_performance_log.stat_date IS '统计时间';
|
COMMENT ON COLUMN market_cash_performance_log.stat_date IS '统计时间';
|
||||||
COMMENT ON COLUMN market_cash_performance_log.last_amount IS '上一份业绩';
|
COMMENT ON COLUMN market_cash_performance_log.performance IS '当前业绩';
|
||||||
COMMENT ON COLUMN market_cash_performance_log.current_amount IS '当前业绩';
|
|
||||||
COMMENT ON COLUMN market_cash_performance_log.source_id IS '来源ID';
|
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.source_detail IS '来源详情';
|
||||||
COMMENT ON COLUMN market_cash_performance_log.remarks IS '备注';
|
COMMENT ON COLUMN market_cash_performance_log.remarks IS '备注';
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,220 @@
|
|||||||
|
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)
|
||||||
|
.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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,11 +10,15 @@ import org.springblade.modules.common.event.PaymentSuccessEvent;
|
|||||||
import org.springblade.modules.common.event.SpendUserPointEvent;
|
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 +78,54 @@ 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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketCashPerformanceWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/cash-performance//marketCashPerformance")
|
||||||
|
@Tag(name = "现金业绩", description = "现金业绩接口")
|
||||||
|
public class MarketCashPerformanceController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketCashPerformanceService marketCashPerformanceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketCashPerformance")
|
||||||
|
public R<MarketCashPerformanceVO> detail(MarketCashPerformanceEntity marketCashPerformance) {
|
||||||
|
MarketCashPerformanceEntity detail = marketCashPerformanceService.getOne(Condition.getQueryWrapper(marketCashPerformance));
|
||||||
|
return R.data(MarketCashPerformanceWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 现金业绩 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketCashPerformance")
|
||||||
|
public R<IPage<MarketCashPerformanceVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCashPerformance, Query query) {
|
||||||
|
IPage<MarketCashPerformanceEntity> pages = marketCashPerformanceService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCashPerformance, MarketCashPerformanceEntity.class));
|
||||||
|
return R.data(MarketCashPerformanceWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketCashPerformance")
|
||||||
|
public R<IPage<MarketCashPerformanceVO>> page(MarketCashPerformanceVO marketCashPerformance, Query query) {
|
||||||
|
IPage<MarketCashPerformanceVO> pages = marketCashPerformanceService.selectMarketCashPerformancePage(Condition.getPage(query), marketCashPerformance);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketCashPerformance")
|
||||||
|
public R save(@Valid @RequestBody MarketCashPerformanceEntity marketCashPerformance) {
|
||||||
|
return R.status(marketCashPerformanceService.save(marketCashPerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketCashPerformance")
|
||||||
|
public R update(@Valid @RequestBody MarketCashPerformanceEntity marketCashPerformance) {
|
||||||
|
return R.status(marketCashPerformanceService.updateById(marketCashPerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketCashPerformance")
|
||||||
|
public R submit(@Valid @RequestBody MarketCashPerformanceEntity marketCashPerformance) {
|
||||||
|
return R.status(marketCashPerformanceService.saveOrUpdate(marketCashPerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketCashPerformanceService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketCashPerformanceLogWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/cash-performance-log//marketCashPerformanceLog")
|
||||||
|
@Tag(name = "现金业绩日志", description = "现金业绩日志接口")
|
||||||
|
public class MarketCashPerformanceLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketCashPerformanceLogService marketCashPerformanceLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketCashPerformanceLog")
|
||||||
|
public R<MarketCashPerformanceLogVO> detail(MarketCashPerformanceLogEntity marketCashPerformanceLog) {
|
||||||
|
MarketCashPerformanceLogEntity detail = marketCashPerformanceLogService.getOne(Condition.getQueryWrapper(marketCashPerformanceLog));
|
||||||
|
return R.data(MarketCashPerformanceLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketCashPerformanceLog")
|
||||||
|
public R<IPage<MarketCashPerformanceLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketCashPerformanceLog, Query query) {
|
||||||
|
IPage<MarketCashPerformanceLogEntity> pages = marketCashPerformanceLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketCashPerformanceLog, MarketCashPerformanceLogEntity.class));
|
||||||
|
return R.data(MarketCashPerformanceLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketCashPerformanceLog")
|
||||||
|
public R<IPage<MarketCashPerformanceLogVO>> page(MarketCashPerformanceLogVO marketCashPerformanceLog, Query query) {
|
||||||
|
IPage<MarketCashPerformanceLogVO> pages = marketCashPerformanceLogService.selectMarketCashPerformanceLogPage(Condition.getPage(query), marketCashPerformanceLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketCashPerformanceLog")
|
||||||
|
public R save(@Valid @RequestBody MarketCashPerformanceLogEntity marketCashPerformanceLog) {
|
||||||
|
return R.status(marketCashPerformanceLogService.save(marketCashPerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketCashPerformanceLog")
|
||||||
|
public R update(@Valid @RequestBody MarketCashPerformanceLogEntity marketCashPerformanceLog) {
|
||||||
|
return R.status(marketCashPerformanceLogService.updateById(marketCashPerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketCashPerformanceLog")
|
||||||
|
public R submit(@Valid @RequestBody MarketCashPerformanceLogEntity marketCashPerformanceLog) {
|
||||||
|
return R.status(marketCashPerformanceLogService.saveOrUpdate(marketCashPerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketCashPerformanceLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeCashLogVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketUpgradeCashLogWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeCashLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/upgrade-cash-log//marketUpgradeCashLog")
|
||||||
|
@Tag(name = "用户现金升级日志", description = "用户现金升级日志接口")
|
||||||
|
public class MarketUpgradeCashLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketUpgradeCashLogService marketUpgradeCashLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketUpgradeCashLog")
|
||||||
|
public R<MarketUpgradeCashLogVO> detail(MarketUpgradeCashLogEntity marketUpgradeCashLog) {
|
||||||
|
MarketUpgradeCashLogEntity detail = marketUpgradeCashLogService.getOne(Condition.getQueryWrapper(marketUpgradeCashLog));
|
||||||
|
return R.data(MarketUpgradeCashLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeCashLog")
|
||||||
|
public R<IPage<MarketUpgradeCashLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketUpgradeCashLog, Query query) {
|
||||||
|
IPage<MarketUpgradeCashLogEntity> pages = marketUpgradeCashLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketUpgradeCashLog, MarketUpgradeCashLogEntity.class));
|
||||||
|
return R.data(MarketUpgradeCashLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeCashLog")
|
||||||
|
public R<IPage<MarketUpgradeCashLogVO>> page(MarketUpgradeCashLogVO marketUpgradeCashLog, Query query) {
|
||||||
|
IPage<MarketUpgradeCashLogVO> pages = marketUpgradeCashLogService.selectMarketUpgradeCashLogPage(Condition.getPage(query), marketUpgradeCashLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketUpgradeCashLog")
|
||||||
|
public R save(@Valid @RequestBody MarketUpgradeCashLogEntity marketUpgradeCashLog) {
|
||||||
|
return R.status(marketUpgradeCashLogService.save(marketUpgradeCashLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketUpgradeCashLog")
|
||||||
|
public R update(@Valid @RequestBody MarketUpgradeCashLogEntity marketUpgradeCashLog) {
|
||||||
|
return R.status(marketUpgradeCashLogService.updateById(marketUpgradeCashLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketUpgradeCashLog")
|
||||||
|
public R submit(@Valid @RequestBody MarketUpgradeCashLogEntity marketUpgradeCashLog) {
|
||||||
|
return R.status(marketUpgradeCashLogService.saveOrUpdate(marketUpgradeCashLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketUpgradeCashLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeConfigVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketUpgradeConfigWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeConfigService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/upgrade-config//marketUpgradeConfig")
|
||||||
|
@Tag(name = "用户等级升级配置", description = "用户等级升级配置接口")
|
||||||
|
public class MarketUpgradeConfigController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketUpgradeConfigService marketUpgradeConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketUpgradeConfig")
|
||||||
|
public R<MarketUpgradeConfigVO> detail(MarketUpgradeConfigEntity marketUpgradeConfig) {
|
||||||
|
MarketUpgradeConfigEntity detail = marketUpgradeConfigService.getOne(Condition.getQueryWrapper(marketUpgradeConfig));
|
||||||
|
return R.data(MarketUpgradeConfigWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeConfig")
|
||||||
|
public R<IPage<MarketUpgradeConfigVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketUpgradeConfig, Query query) {
|
||||||
|
IPage<MarketUpgradeConfigEntity> pages = marketUpgradeConfigService.page(Condition.getPage(query), Condition.getQueryWrapper(marketUpgradeConfig, MarketUpgradeConfigEntity.class));
|
||||||
|
return R.data(MarketUpgradeConfigWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeConfig")
|
||||||
|
public R<IPage<MarketUpgradeConfigVO>> page(MarketUpgradeConfigVO marketUpgradeConfig, Query query) {
|
||||||
|
IPage<MarketUpgradeConfigVO> pages = marketUpgradeConfigService.selectMarketUpgradeConfigPage(Condition.getPage(query), marketUpgradeConfig);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketUpgradeConfig")
|
||||||
|
public R save(@Valid @RequestBody MarketUpgradeConfigEntity marketUpgradeConfig) {
|
||||||
|
return R.status(marketUpgradeConfigService.save(marketUpgradeConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketUpgradeConfig")
|
||||||
|
public R update(@Valid @RequestBody MarketUpgradeConfigEntity marketUpgradeConfig) {
|
||||||
|
return R.status(marketUpgradeConfigService.updateById(marketUpgradeConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketUpgradeConfig")
|
||||||
|
public R submit(@Valid @RequestBody MarketUpgradeConfigEntity marketUpgradeConfig) {
|
||||||
|
return R.status(marketUpgradeConfigService.saveOrUpdate(marketUpgradeConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketUpgradeConfigService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeWelfareLogVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketUpgradeWelfareLogWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeWelfareLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/upgrade-welfare-log//marketUpgradeWelfareLog")
|
||||||
|
@Tag(name = "用户福利包升级日志", description = "用户福利包升级日志接口")
|
||||||
|
public class MarketUpgradeWelfareLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketUpgradeWelfareLogService marketUpgradeWelfareLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R<MarketUpgradeWelfareLogVO> detail(MarketUpgradeWelfareLogEntity marketUpgradeWelfareLog) {
|
||||||
|
MarketUpgradeWelfareLogEntity detail = marketUpgradeWelfareLogService.getOne(Condition.getQueryWrapper(marketUpgradeWelfareLog));
|
||||||
|
return R.data(MarketUpgradeWelfareLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R<IPage<MarketUpgradeWelfareLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketUpgradeWelfareLog, Query query) {
|
||||||
|
IPage<MarketUpgradeWelfareLogEntity> pages = marketUpgradeWelfareLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketUpgradeWelfareLog, MarketUpgradeWelfareLogEntity.class));
|
||||||
|
return R.data(MarketUpgradeWelfareLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R<IPage<MarketUpgradeWelfareLogVO>> page(MarketUpgradeWelfareLogVO marketUpgradeWelfareLog, Query query) {
|
||||||
|
IPage<MarketUpgradeWelfareLogVO> pages = marketUpgradeWelfareLogService.selectMarketUpgradeWelfareLogPage(Condition.getPage(query), marketUpgradeWelfareLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R save(@Valid @RequestBody MarketUpgradeWelfareLogEntity marketUpgradeWelfareLog) {
|
||||||
|
return R.status(marketUpgradeWelfareLogService.save(marketUpgradeWelfareLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R update(@Valid @RequestBody MarketUpgradeWelfareLogEntity marketUpgradeWelfareLog) {
|
||||||
|
return R.status(marketUpgradeWelfareLogService.updateById(marketUpgradeWelfareLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketUpgradeWelfareLog")
|
||||||
|
public R submit(@Valid @RequestBody MarketUpgradeWelfareLogEntity marketUpgradeWelfareLog) {
|
||||||
|
return R.status(marketUpgradeWelfareLogService.saveOrUpdate(marketUpgradeWelfareLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketUpgradeWelfareLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketWelfarePerformanceWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketWelfarePerformanceService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/welfare-performance//marketWelfarePerformance")
|
||||||
|
@Tag(name = "福利包业绩", description = "福利包业绩接口")
|
||||||
|
public class MarketWelfarePerformanceController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketWelfarePerformanceService marketWelfarePerformanceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketWelfarePerformance")
|
||||||
|
public R<MarketWelfarePerformanceVO> detail(MarketWelfarePerformanceEntity marketWelfarePerformance) {
|
||||||
|
MarketWelfarePerformanceEntity detail = marketWelfarePerformanceService.getOne(Condition.getQueryWrapper(marketWelfarePerformance));
|
||||||
|
return R.data(MarketWelfarePerformanceWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 福利包业绩 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketWelfarePerformance")
|
||||||
|
public R<IPage<MarketWelfarePerformanceVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketWelfarePerformance, Query query) {
|
||||||
|
IPage<MarketWelfarePerformanceEntity> pages = marketWelfarePerformanceService.page(Condition.getPage(query), Condition.getQueryWrapper(marketWelfarePerformance, MarketWelfarePerformanceEntity.class));
|
||||||
|
return R.data(MarketWelfarePerformanceWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketWelfarePerformance")
|
||||||
|
public R<IPage<MarketWelfarePerformanceVO>> page(MarketWelfarePerformanceVO marketWelfarePerformance, Query query) {
|
||||||
|
IPage<MarketWelfarePerformanceVO> pages = marketWelfarePerformanceService.selectMarketWelfarePerformancePage(Condition.getPage(query), marketWelfarePerformance);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketWelfarePerformance")
|
||||||
|
public R save(@Valid @RequestBody MarketWelfarePerformanceEntity marketWelfarePerformance) {
|
||||||
|
return R.status(marketWelfarePerformanceService.save(marketWelfarePerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketWelfarePerformance")
|
||||||
|
public R update(@Valid @RequestBody MarketWelfarePerformanceEntity marketWelfarePerformance) {
|
||||||
|
return R.status(marketWelfarePerformanceService.updateById(marketWelfarePerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketWelfarePerformance")
|
||||||
|
public R submit(@Valid @RequestBody MarketWelfarePerformanceEntity marketWelfarePerformance) {
|
||||||
|
return R.status(marketWelfarePerformanceService.saveOrUpdate(marketWelfarePerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketWelfarePerformanceService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package org.springblade.modules.market.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.Condition;
|
||||||
|
import org.springblade.core.mp.support.Query;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.core.tool.utils.Func;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO;
|
||||||
|
import org.springblade.modules.market.wrapper.MarketWelfarePerformanceLogWrapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketWelfarePerformanceLogService;
|
||||||
|
import org.springblade.core.boot.ctrl.BladeController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 控制器
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/market/welfare-performance-log//marketWelfarePerformanceLog")
|
||||||
|
@Tag(name = "福利包业绩日志", description = "福利包业绩日志接口")
|
||||||
|
public class MarketWelfarePerformanceLogController extends BladeController {
|
||||||
|
|
||||||
|
private final IMarketWelfarePerformanceLogService marketWelfarePerformanceLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@Operation(summary = "详情", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R<MarketWelfarePerformanceLogVO> detail(MarketWelfarePerformanceLogEntity marketWelfarePerformanceLog) {
|
||||||
|
MarketWelfarePerformanceLogEntity detail = marketWelfarePerformanceLogService.getOne(Condition.getQueryWrapper(marketWelfarePerformanceLog));
|
||||||
|
return R.data(MarketWelfarePerformanceLogWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@Operation(summary = "分页", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R<IPage<MarketWelfarePerformanceLogVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> marketWelfarePerformanceLog, Query query) {
|
||||||
|
IPage<MarketWelfarePerformanceLogEntity> pages = marketWelfarePerformanceLogService.page(Condition.getPage(query), Condition.getQueryWrapper(marketWelfarePerformanceLog, MarketWelfarePerformanceLogEntity.class));
|
||||||
|
return R.data(MarketWelfarePerformanceLogWrapper.build().pageVO(pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 自定义分页
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@Operation(summary = "分页", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R<IPage<MarketWelfarePerformanceLogVO>> page(MarketWelfarePerformanceLogVO marketWelfarePerformanceLog, Query query) {
|
||||||
|
IPage<MarketWelfarePerformanceLogVO> pages = marketWelfarePerformanceLogService.selectMarketWelfarePerformanceLogPage(Condition.getPage(query), marketWelfarePerformanceLog);
|
||||||
|
return R.data(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@Operation(summary = "新增", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R save(@Valid @RequestBody MarketWelfarePerformanceLogEntity marketWelfarePerformanceLog) {
|
||||||
|
return R.status(marketWelfarePerformanceLogService.save(marketWelfarePerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@Operation(summary = "修改", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R update(@Valid @RequestBody MarketWelfarePerformanceLogEntity marketWelfarePerformanceLog) {
|
||||||
|
return R.status(marketWelfarePerformanceLogService.updateById(marketWelfarePerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 新增或修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@Operation(summary = "新增或修改", description = "传入marketWelfarePerformanceLog")
|
||||||
|
public R submit(@Valid @RequestBody MarketWelfarePerformanceLogEntity marketWelfarePerformanceLog) {
|
||||||
|
return R.status(marketWelfarePerformanceLogService.saveOrUpdate(marketWelfarePerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||||
|
return R.status(marketWelfarePerformanceLogService.deleteLogic(Func.toLongList(ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,7 +8,12 @@ public enum MarketBusinessModule {
|
|||||||
|
|
||||||
BENEFIT_PACKAGE("福利包", "benefit_package"),
|
BENEFIT_PACKAGE("福利包", "benefit_package"),
|
||||||
TRANSFER("转账", "transfer"),
|
TRANSFER("转账", "transfer"),
|
||||||
LOTTERY("抽奖", "lottery")
|
LOTTERY("抽奖", "lottery"),
|
||||||
|
WELFARE_UPGRADE("福利值动态升级", "welfare_upgrade"),
|
||||||
|
WELFARE_ACCELERATION("福利值动态加速", "welfare_acceleration"),
|
||||||
|
|
||||||
|
CASH_UPGRADE("现金动态升级", "cash_upgrade"),
|
||||||
|
CASH_ACCELERATION("现金动态加速", "cash_acceleration"),
|
||||||
;
|
;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.springblade.modules.market.event;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springblade.modules.market.eums.MarketBusinessModule;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class MarketUpgradeNoticeEvent {
|
||||||
|
|
||||||
|
// 升级日志项
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class NoticeItem {
|
||||||
|
private Long userId;
|
||||||
|
private String content; // 这里的 content 是每个用户独有的
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量数据列表
|
||||||
|
private List<NoticeItem> noticeItems;
|
||||||
|
private MarketBusinessModule businessModule;
|
||||||
|
|
||||||
|
// 构造函数
|
||||||
|
public MarketUpgradeNoticeEvent(List<NoticeItem> noticeItems, MarketBusinessModule businessModule) {
|
||||||
|
this.noticeItems = noticeItems;
|
||||||
|
this.businessModule = businessModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.springblade.modules.market.mapper;
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointVO;
|
import org.springblade.modules.market.pojo.vo.MarketBenefitPointVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
@@ -29,4 +30,6 @@ public interface MarketBenefitPointMapper extends BaseMapper<MarketBenefitPointE
|
|||||||
|
|
||||||
int deductBenefitPoint(Long userId, BigDecimal amount, Integer version);
|
int deductBenefitPoint(Long userId, BigDecimal amount, Integer version);
|
||||||
|
|
||||||
|
int addBenefitPointBatch(@Param("teamBenefitPointList") List<MarketBenefitPointEntity> teamBenefitPointList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,4 +47,26 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addBenefitPointBatch">
|
||||||
|
INSERT INTO benefit_point (
|
||||||
|
id,
|
||||||
|
amount,
|
||||||
|
update_time,
|
||||||
|
version
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="teamBenefitPointList" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.amount},
|
||||||
|
#{entity.updateTime},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
|
amount = benefit_point.amount + EXCLUDED.amount,
|
||||||
|
update_time = EXCLUDED.update_time,
|
||||||
|
version = benefit_point.version + 1
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketCashPerformanceLogMapper extends BaseMapper<MarketCashPerformanceLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketCashPerformanceLog 查询参数
|
||||||
|
* @return List<MarketCashPerformanceLogVO>
|
||||||
|
*/
|
||||||
|
List<MarketCashPerformanceLogVO> selectMarketCashPerformanceLogPage(IPage page, MarketCashPerformanceLogVO marketCashPerformanceLog);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.market.mapper.MarketCashPerformanceLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketCashPerformanceLogResultMap" type="org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="stat_date" property="statDate"/>
|
||||||
|
<result column="last_amount" property="lastAmount"/>
|
||||||
|
<result column="current_amount" property="currentAmount"/>
|
||||||
|
<result column="source_id" property="sourceId"/>
|
||||||
|
<result column="source_detail" property="sourceDetail"/>
|
||||||
|
<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="selectMarketCashPerformanceLogPage" resultMap="marketCashPerformanceLogResultMap">
|
||||||
|
select * from market_cash_performance_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketCashPerformanceMapper extends BaseMapper<MarketCashPerformanceEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketCashPerformance 查询参数
|
||||||
|
* @return List<MarketCashPerformanceVO>
|
||||||
|
*/
|
||||||
|
List<MarketCashPerformanceVO> selectMarketCashPerformancePage(IPage page, MarketCashPerformanceVO marketCashPerformance);
|
||||||
|
|
||||||
|
|
||||||
|
int addPerformanceBatch(@Param("teamCashList") List<MarketCashPerformanceEntity> teamList);
|
||||||
|
|
||||||
|
int addOwenPerformanceBatch(@Param("owenCashList") List<MarketCashPerformanceEntity> owenList);
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<?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.market.mapper.MarketCashPerformanceMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketCashPerformanceResultMap" type="org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="owen_amount" property="owenAmount"/>
|
||||||
|
<result column="total_amount" property="totalAmount"/>
|
||||||
|
<result column="version" property="version"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="create_dept" property="createDept"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="status" property="status"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectMarketCashPerformancePage" resultMap="marketCashPerformanceResultMap">
|
||||||
|
select * from market_cash_performance where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addPerformanceBatch">
|
||||||
|
INSERT INTO market_cash_performance (
|
||||||
|
id,
|
||||||
|
total_amount,
|
||||||
|
update_time,
|
||||||
|
version
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="teamCashList" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.totalAmount},
|
||||||
|
#{entity.updateTime},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
|
total_amount = market_cash_performance.total_amount + EXCLUDED.total_amount,
|
||||||
|
update_time = EXCLUDED.update_time,
|
||||||
|
version = market_cash_performance.version + 1
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addOwenPerformanceBatch">
|
||||||
|
INSERT INTO market_cash_performance (
|
||||||
|
id,
|
||||||
|
owen_amount,
|
||||||
|
update_time,
|
||||||
|
version
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="owenCashList" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.owenAmount},
|
||||||
|
#{entity.updateTime},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
|
owen_amount = market_cash_performance.owen_amount + EXCLUDED.owen_amount,
|
||||||
|
update_time = EXCLUDED.update_time,
|
||||||
|
version = market_cash_performance.version + 1
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeCashLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketUpgradeCashLogMapper extends BaseMapper<MarketUpgradeCashLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeCashLog 查询参数
|
||||||
|
* @return List<MarketUpgradeCashLogVO>
|
||||||
|
*/
|
||||||
|
List<MarketUpgradeCashLogVO> selectMarketUpgradeCashLogPage(IPage page, MarketUpgradeCashLogVO marketUpgradeCashLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?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.market.mapper.MarketUpgradeCashLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketUpgradeCashLogResultMap" type="org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="last_level" property="lastLevel"/>
|
||||||
|
<result column="current_level_id" property="currentLevelId"/>
|
||||||
|
<result column="current_level_name" property="currentLevelName"/>
|
||||||
|
<result column="upgrade_date" property="upgradeDate"/>
|
||||||
|
<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="selectMarketUpgradeCashLogPage" resultMap="marketUpgradeCashLogResultMap">
|
||||||
|
select * from market_upgrade_cash_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeConfigVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketUpgradeConfigMapper extends BaseMapper<MarketUpgradeConfigEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeConfig 查询参数
|
||||||
|
* @return List<MarketUpgradeConfigVO>
|
||||||
|
*/
|
||||||
|
List<MarketUpgradeConfigVO> selectMarketUpgradeConfigPage(IPage page, MarketUpgradeConfigVO marketUpgradeConfig);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.market.mapper.MarketUpgradeConfigMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketUpgradeConfigResultMap" type="org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="type" property="type"/>
|
||||||
|
<result column="level_name" property="levelName"/>
|
||||||
|
<result column="direct_recommend" property="directRecommend"/>
|
||||||
|
<result column="requirement_value" property="requirementValue"/>
|
||||||
|
<result column="reward_rate" property="rewardRate"/>
|
||||||
|
<result column="description" property="description"/>
|
||||||
|
<result column="sort_order" property="sortOrder"/>
|
||||||
|
<result column="next_level_id" property="nextLevelId"/>
|
||||||
|
<result column="has_next_level" property="hasNextLevel"/>
|
||||||
|
<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="selectMarketUpgradeConfigPage" resultMap="marketUpgradeConfigResultMap">
|
||||||
|
select * from market_upgrade_config where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeWelfareLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketUpgradeWelfareLogMapper extends BaseMapper<MarketUpgradeWelfareLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeWelfareLog 查询参数
|
||||||
|
* @return List<MarketUpgradeWelfareLogVO>
|
||||||
|
*/
|
||||||
|
List<MarketUpgradeWelfareLogVO> selectMarketUpgradeWelfareLogPage(IPage page, MarketUpgradeWelfareLogVO marketUpgradeWelfareLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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.market.mapper.MarketUpgradeWelfareLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketUpgradeWelfareLogResultMap" type="org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="last_level" property="lastLevel"/>
|
||||||
|
<result column="current_level_id" property="currentLevelId"/>
|
||||||
|
<result column="current_level_name" property="currentLevelName"/>
|
||||||
|
<result column="upgrade_date" property="upgradeDate"/>
|
||||||
|
<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="selectMarketUpgradeWelfareLogPage" resultMap="marketUpgradeWelfareLogResultMap">
|
||||||
|
select * from market_upgrade_welfare_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketWelfarePerformanceLogMapper extends BaseMapper<MarketWelfarePerformanceLogEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketWelfarePerformanceLog 查询参数
|
||||||
|
* @return List<MarketWelfarePerformanceLogVO>
|
||||||
|
*/
|
||||||
|
List<MarketWelfarePerformanceLogVO> selectMarketWelfarePerformanceLogPage(IPage page, MarketWelfarePerformanceLogVO marketWelfarePerformanceLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?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.market.mapper.MarketWelfarePerformanceLogMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketWelfarePerformanceLogResultMap" type="org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="user_id" property="userId"/>
|
||||||
|
<result column="stat_date" property="statDate"/>
|
||||||
|
<result column="last_amount" property="lastAmount"/>
|
||||||
|
<result column="current_amount" property="currentAmount"/>
|
||||||
|
<result column="source_id" property="sourceId"/>
|
||||||
|
<result column="source_detail" property="sourceDetail"/>
|
||||||
|
<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="selectMarketWelfarePerformanceLogPage" resultMap="marketWelfarePerformanceLogResultMap">
|
||||||
|
select * from market_welfare_performance_log where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.springblade.modules.market.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface MarketWelfarePerformanceMapper extends BaseMapper<MarketWelfarePerformanceEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketWelfarePerformance 查询参数
|
||||||
|
* @return List<MarketWelfarePerformanceVO>
|
||||||
|
*/
|
||||||
|
List<MarketWelfarePerformanceVO> selectMarketWelfarePerformancePage(IPage page, MarketWelfarePerformanceVO marketWelfarePerformance);
|
||||||
|
|
||||||
|
|
||||||
|
int addPerformance(Long userId, BigDecimal performance);
|
||||||
|
|
||||||
|
int addOwenPerformance(Long userId, BigDecimal performance);
|
||||||
|
|
||||||
|
int addPerformanceBatch(@Param("teamList") List<MarketWelfarePerformanceEntity> teamList);
|
||||||
|
|
||||||
|
// 自身业绩:使用 selfAmountMap
|
||||||
|
int addOwenPerformanceBatch(@Param("ownList") List<MarketWelfarePerformanceEntity> ownList);
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<?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.market.mapper.MarketWelfarePerformanceMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="marketWelfarePerformanceResultMap" type="org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="owen_amount" property="owenAmount"/>
|
||||||
|
<result column="total_amount" property="totalAmount"/>
|
||||||
|
<result column="version" property="version"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="create_dept" property="createDept"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="status" property="status"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectMarketWelfarePerformancePage" resultMap="marketWelfarePerformanceResultMap">
|
||||||
|
select * from market_welfare_performance where is_deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="addPerformance">
|
||||||
|
update market_welfare_performance set total_amount = total_amount + #{performance} , version = version + 1 where id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="addOwenPerformance">
|
||||||
|
update market_welfare_performance set owen_amount = owen_amount + #{performance} , version = version + 1 where id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addPerformanceBatch">
|
||||||
|
|
||||||
|
INSERT INTO market_welfare_performance (
|
||||||
|
id,
|
||||||
|
total_amount,
|
||||||
|
update_time,
|
||||||
|
version
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="teamList" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.totalAmount},
|
||||||
|
#{entity.updateTime},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
|
total_amount = market_welfare_performance.total_amount + EXCLUDED.total_amount,
|
||||||
|
update_time = EXCLUDED.update_time,
|
||||||
|
version = market_welfare_performance.version + 1
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="addOwenPerformanceBatch">
|
||||||
|
INSERT INTO market_welfare_performance (
|
||||||
|
id,
|
||||||
|
owen_amount,
|
||||||
|
update_time,
|
||||||
|
version
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="ownList" item="entity" separator=",">
|
||||||
|
(
|
||||||
|
#{entity.id},
|
||||||
|
#{entity.owenAmount},
|
||||||
|
#{entity.updateTime},
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
|
owen_amount = market_welfare_performance.owen_amount + EXCLUDED.owen_amount,
|
||||||
|
update_time = EXCLUDED.update_time,
|
||||||
|
version = market_welfare_performance.version + 1
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceDTO extends MarketCashPerformanceEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceLogDTO extends MarketCashPerformanceLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeCashLogDTO extends MarketUpgradeCashLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeConfigDTO extends MarketUpgradeConfigEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeWelfareLogDTO extends MarketUpgradeWelfareLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceDTO extends MarketWelfarePerformanceEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.dto;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 数据传输对象实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceLogDTO extends MarketWelfarePerformanceLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_cash_performance")
|
||||||
|
@Schema(description = "MarketCashPerformance对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自身业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "自身业绩")
|
||||||
|
private BigDecimal owenAmount;
|
||||||
|
/**
|
||||||
|
* 总业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "总业绩")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
/**
|
||||||
|
* 版本号
|
||||||
|
*/
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_cash_performance_log")
|
||||||
|
@Schema(description = "MarketCashPerformanceLog对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceLogEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 统计时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "统计时间")
|
||||||
|
private Date statDate;
|
||||||
|
/**
|
||||||
|
* 业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "业绩")
|
||||||
|
private BigDecimal performance;
|
||||||
|
/**
|
||||||
|
* 来源ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "来源ID")
|
||||||
|
private Long sourceId;
|
||||||
|
/**
|
||||||
|
* 来源详情
|
||||||
|
*/
|
||||||
|
@Schema(description = "来源详情")
|
||||||
|
private String sourceDetail;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_upgrade_cash_log")
|
||||||
|
@Schema(description = "MarketUpgradeCashLog对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeCashLogEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 升级前等级
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级前等级")
|
||||||
|
private Long lastLevel;
|
||||||
|
/**
|
||||||
|
* 当前等级ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前等级ID")
|
||||||
|
private Long currentLevelId;
|
||||||
|
/**
|
||||||
|
* 当前等级名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前等级名称")
|
||||||
|
private String currentLevelName;
|
||||||
|
/**
|
||||||
|
* 升级日期
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级日期")
|
||||||
|
private Date upgradeDate;
|
||||||
|
/**
|
||||||
|
* 升级详情备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级详情备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_upgrade_config")
|
||||||
|
@Schema(description = "MarketUpgradeConfig对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class MarketUpgradeConfigEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 等级类型:1=福利包, 2=现金
|
||||||
|
*/
|
||||||
|
@Schema(description = "等级类型:1=福利值, 2=现金")
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 等级名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "等级名称")
|
||||||
|
private String levelName;
|
||||||
|
/**
|
||||||
|
* 直推人数要求
|
||||||
|
*/
|
||||||
|
@Schema(description = "直推人数要求")
|
||||||
|
private Integer directRecommend;
|
||||||
|
/**
|
||||||
|
* 业绩/福利值要求
|
||||||
|
*/
|
||||||
|
@Schema(description = "业绩/福利值要求")
|
||||||
|
private BigDecimal requirementValue;
|
||||||
|
/**
|
||||||
|
* 加速或分红比例
|
||||||
|
*/
|
||||||
|
@Schema(description = "加速或分红比例")
|
||||||
|
private BigDecimal rewardRate;
|
||||||
|
/**
|
||||||
|
* 等级详细说明
|
||||||
|
*/
|
||||||
|
@Schema(description = "等级详细说明")
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Schema(description = "")
|
||||||
|
private Integer sortOrder;
|
||||||
|
/**
|
||||||
|
* 下一个等级的ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "下一个等级的ID")
|
||||||
|
private Long nextLevelId;
|
||||||
|
/**
|
||||||
|
* 是否拥有下一级
|
||||||
|
*/
|
||||||
|
@Schema(description = "是否拥有下一级")
|
||||||
|
private Integer hasNextLevel;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_upgrade_welfare_log")
|
||||||
|
@Schema(description = "MarketUpgradeWelfareLog对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeWelfareLogEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 升级前等级
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级前等级")
|
||||||
|
private Long lastLevel;
|
||||||
|
/**
|
||||||
|
* 当前等级ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前等级ID")
|
||||||
|
private Long currentLevelId;
|
||||||
|
/**
|
||||||
|
* 当前等级名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "当前等级名称")
|
||||||
|
private String currentLevelName;
|
||||||
|
/**
|
||||||
|
* 升级日期
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级日期")
|
||||||
|
private Date upgradeDate;
|
||||||
|
/**
|
||||||
|
* 升级详情备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "升级详情备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.springblade.core.mp.base.BaseEntity;
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ import java.io.Serial;
|
|||||||
@TableName("user_commission")
|
@TableName("user_commission")
|
||||||
@Schema(description = "UserCommission对象")
|
@Schema(description = "UserCommission对象")
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
public class MarketUserCommissionEntity extends BaseEntity {
|
public class MarketUserCommissionEntity extends BaseEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_welfare_performance")
|
||||||
|
@Schema(description = "MarketWelfarePerformance对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自身业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "自身业绩")
|
||||||
|
private BigDecimal owenAmount;
|
||||||
|
/**
|
||||||
|
* 总业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "总业绩")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
/**
|
||||||
|
* 版本号
|
||||||
|
*/
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package org.springblade.modules.market.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springblade.core.mp.base.BaseEntity;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("market_welfare_performance_log")
|
||||||
|
@Schema(description = "MarketWelfarePerformanceLog对象")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceLogEntity extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 统计时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "统计时间")
|
||||||
|
private Date statDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业绩
|
||||||
|
*/
|
||||||
|
@Schema(description = "业绩")
|
||||||
|
private BigDecimal performance;
|
||||||
|
/**
|
||||||
|
* 来源ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "来源ID")
|
||||||
|
private Long sourceId;
|
||||||
|
/**
|
||||||
|
* 来源详情
|
||||||
|
*/
|
||||||
|
@Schema(description = "来源详情")
|
||||||
|
private String sourceDetail;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceLogVO extends MarketCashPerformanceLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketCashPerformanceVO extends MarketCashPerformanceEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeCashLogVO extends MarketUpgradeCashLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeConfigVO extends MarketUpgradeConfigEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketUpgradeWelfareLogVO extends MarketUpgradeWelfareLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceLogVO extends MarketWelfarePerformanceLogEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.springblade.modules.market.pojo.vo;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 视图实体类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class MarketWelfarePerformanceVO extends MarketWelfarePerformanceEntity {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
package org.springblade.modules.market.service;
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springblade.modules.market.pojo.dto.MarketBenefitPointApiDTO;
|
import org.springblade.modules.market.pojo.dto.MarketBenefitPointApiDTO;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
|
||||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointVO;
|
import org.springblade.modules.market.pojo.vo.MarketBenefitPointVO;
|
||||||
@@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import org.springblade.core.mp.base.BaseService;
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户福利值表 服务类
|
* 用户福利值表 服务类
|
||||||
@@ -46,4 +48,6 @@ public interface IMarketBenefitPointService extends BaseService<MarketBenefitPoi
|
|||||||
|
|
||||||
Boolean transfer(Long from, Long to, BigDecimal amount);
|
Boolean transfer(Long from, Long to, BigDecimal amount);
|
||||||
|
|
||||||
|
int addBenefitPointBatch(List<MarketBenefitPointEntity> teamBenefitPointList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketCashPerformanceLogService extends BaseService<MarketCashPerformanceLogEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketCashPerformanceLog 查询参数
|
||||||
|
* @return IPage<MarketCashPerformanceLogVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketCashPerformanceLogVO> selectMarketCashPerformanceLogPage(IPage<MarketCashPerformanceLogVO> page, MarketCashPerformanceLogVO marketCashPerformanceLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketCashPerformanceService extends BaseService<MarketCashPerformanceEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketCashPerformance 查询参数
|
||||||
|
* @return IPage<MarketCashPerformanceVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketCashPerformanceVO> selectMarketCashPerformancePage(IPage<MarketCashPerformanceVO> page, MarketCashPerformanceVO marketCashPerformance);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean addPerformanceBatch(List<MarketCashPerformanceEntity> marketCashPerformanceEntities);
|
||||||
|
|
||||||
|
Boolean addOwenPerformanceBatch(List<MarketCashPerformanceEntity> marketCashPerformanceEntities);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeCashLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketUpgradeCashLogService extends BaseService<MarketUpgradeCashLogEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeCashLog 查询参数
|
||||||
|
* @return IPage<MarketUpgradeCashLogVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketUpgradeCashLogVO> selectMarketUpgradeCashLogPage(IPage<MarketUpgradeCashLogVO> page, MarketUpgradeCashLogVO marketUpgradeCashLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeConfigVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketUpgradeConfigService extends BaseService<MarketUpgradeConfigEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeConfig 查询参数
|
||||||
|
* @return IPage<MarketUpgradeConfigVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketUpgradeConfigVO> selectMarketUpgradeConfigPage(IPage<MarketUpgradeConfigVO> page, MarketUpgradeConfigVO marketUpgradeConfig);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeWelfareLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketUpgradeWelfareLogService extends BaseService<MarketUpgradeWelfareLogEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketUpgradeWelfareLog 查询参数
|
||||||
|
* @return IPage<MarketUpgradeWelfareLogVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketUpgradeWelfareLogVO> selectMarketUpgradeWelfareLogPage(IPage<MarketUpgradeWelfareLogVO> page, MarketUpgradeWelfareLogVO marketUpgradeWelfareLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketWelfarePerformanceLogService extends BaseService<MarketWelfarePerformanceLogEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketWelfarePerformanceLog 查询参数
|
||||||
|
* @return IPage<MarketWelfarePerformanceLogVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketWelfarePerformanceLogVO> selectMarketWelfarePerformanceLogPage(IPage<MarketWelfarePerformanceLogVO> page, MarketWelfarePerformanceLogVO marketWelfarePerformanceLog);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.springblade.modules.market.service;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 服务类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public interface IMarketWelfarePerformanceService extends BaseService<MarketWelfarePerformanceEntity> {
|
||||||
|
/**
|
||||||
|
* 自定义分页
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param marketWelfarePerformance 查询参数
|
||||||
|
* @return IPage<MarketWelfarePerformanceVO>
|
||||||
|
*/
|
||||||
|
IPage<MarketWelfarePerformanceVO> selectMarketWelfarePerformancePage(IPage<MarketWelfarePerformanceVO> page, MarketWelfarePerformanceVO marketWelfarePerformance);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean addPerformance(Long userId, BigDecimal performance);
|
||||||
|
|
||||||
|
Boolean addOwenPerformance(Long userId, BigDecimal performance);
|
||||||
|
|
||||||
|
Boolean addPerformanceBatch(List<MarketWelfarePerformanceEntity> teamList);
|
||||||
|
|
||||||
|
Boolean addOwenPerformanceBatch(List<MarketWelfarePerformanceEntity> ownList);
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户福利值表 服务实现类
|
* 用户福利值表 服务实现类
|
||||||
@@ -176,6 +177,11 @@ public class MarketBenefitPointServiceImpl extends BaseServiceImpl<MarketBenefit
|
|||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int addBenefitPointBatch(List<MarketBenefitPointEntity> teamBenefitPointList) {
|
||||||
|
return this.baseMapper.addBenefitPointBatch(teamBenefitPointList);
|
||||||
|
}
|
||||||
|
|
||||||
@Recover
|
@Recover
|
||||||
public boolean recover(OptimisticLockException ex, Long from, Long to, BigDecimal amount) {
|
public boolean recover(OptimisticLockException ex, Long from, Long to, BigDecimal amount) {
|
||||||
log.error("重试失败,from: [{}], to: [{}], amount: [{}] , ex: [{}]", from, to, amount ,ex.getMessage());
|
log.error("重试失败,from: [{}], to: [{}], amount: [{}] , ex: [{}]", from, to, amount ,ex.getMessage());
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketCashPerformanceLogMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketCashPerformanceLogServiceImpl extends BaseServiceImpl<MarketCashPerformanceLogMapper, MarketCashPerformanceLogEntity> implements IMarketCashPerformanceLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketCashPerformanceLogVO> selectMarketCashPerformanceLogPage(IPage<MarketCashPerformanceLogVO> page, MarketCashPerformanceLogVO marketCashPerformanceLog) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketCashPerformanceLogPage(page, marketCashPerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketCashPerformanceMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketCashPerformanceService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketCashPerformanceServiceImpl extends BaseServiceImpl<MarketCashPerformanceMapper, MarketCashPerformanceEntity> implements IMarketCashPerformanceService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketCashPerformanceVO> selectMarketCashPerformancePage(IPage<MarketCashPerformanceVO> page, MarketCashPerformanceVO marketCashPerformance) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketCashPerformancePage(page, marketCashPerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addPerformanceBatch(List<MarketCashPerformanceEntity> marketCashPerformanceEntities) {
|
||||||
|
return this.baseMapper.addPerformanceBatch(marketCashPerformanceEntities) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addOwenPerformanceBatch(List<MarketCashPerformanceEntity> marketCashPerformanceEntities) {
|
||||||
|
return this.baseMapper.addOwenPerformanceBatch(marketCashPerformanceEntities) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeCashLogVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketUpgradeCashLogMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeCashLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketUpgradeCashLogServiceImpl extends BaseServiceImpl<MarketUpgradeCashLogMapper, MarketUpgradeCashLogEntity> implements IMarketUpgradeCashLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketUpgradeCashLogVO> selectMarketUpgradeCashLogPage(IPage<MarketUpgradeCashLogVO> page, MarketUpgradeCashLogVO marketUpgradeCashLog) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketUpgradeCashLogPage(page, marketUpgradeCashLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeConfigVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketUpgradeConfigMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeConfigService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketUpgradeConfigServiceImpl extends BaseServiceImpl<MarketUpgradeConfigMapper, MarketUpgradeConfigEntity> implements IMarketUpgradeConfigService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketUpgradeConfigVO> selectMarketUpgradeConfigPage(IPage<MarketUpgradeConfigVO> page, MarketUpgradeConfigVO marketUpgradeConfig) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketUpgradeConfigPage(page, marketUpgradeConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeWelfareLogVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketUpgradeWelfareLogMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketUpgradeWelfareLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketUpgradeWelfareLogServiceImpl extends BaseServiceImpl<MarketUpgradeWelfareLogMapper, MarketUpgradeWelfareLogEntity> implements IMarketUpgradeWelfareLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketUpgradeWelfareLogVO> selectMarketUpgradeWelfareLogPage(IPage<MarketUpgradeWelfareLogVO> page, MarketUpgradeWelfareLogVO marketUpgradeWelfareLog) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketUpgradeWelfareLogPage(page, marketUpgradeWelfareLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketWelfarePerformanceLogMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketWelfarePerformanceLogService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketWelfarePerformanceLogServiceImpl extends BaseServiceImpl<MarketWelfarePerformanceLogMapper, MarketWelfarePerformanceLogEntity> implements IMarketWelfarePerformanceLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketWelfarePerformanceLogVO> selectMarketWelfarePerformanceLogPage(IPage<MarketWelfarePerformanceLogVO> page, MarketWelfarePerformanceLogVO marketWelfarePerformanceLog) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketWelfarePerformanceLogPage(page, marketWelfarePerformanceLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.springblade.modules.market.service.impl;
|
||||||
|
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceVO;
|
||||||
|
import org.springblade.modules.market.mapper.MarketWelfarePerformanceMapper;
|
||||||
|
import org.springblade.modules.market.service.IMarketWelfarePerformanceService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 服务实现类
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MarketWelfarePerformanceServiceImpl extends BaseServiceImpl<MarketWelfarePerformanceMapper, MarketWelfarePerformanceEntity> implements IMarketWelfarePerformanceService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MarketWelfarePerformanceVO> selectMarketWelfarePerformancePage(IPage<MarketWelfarePerformanceVO> page, MarketWelfarePerformanceVO marketWelfarePerformance) {
|
||||||
|
return page.setRecords(baseMapper.selectMarketWelfarePerformancePage(page, marketWelfarePerformance));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addPerformance(Long userId, BigDecimal performance) {
|
||||||
|
return this.baseMapper.addPerformance(userId , performance) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addOwenPerformance(Long userId, BigDecimal performance) {
|
||||||
|
return this.baseMapper.addOwenPerformance(userId , performance) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addPerformanceBatch(List<MarketWelfarePerformanceEntity> teamList) {
|
||||||
|
return this.baseMapper.addPerformanceBatch(teamList) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addOwenPerformanceBatch(List<MarketWelfarePerformanceEntity> ownList) {
|
||||||
|
return this.baseMapper.addOwenPerformanceBatch(ownList) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceLogVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩日志 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketCashPerformanceLogWrapper extends BaseEntityWrapper<MarketCashPerformanceLogEntity, MarketCashPerformanceLogVO> {
|
||||||
|
|
||||||
|
public static MarketCashPerformanceLogWrapper build() {
|
||||||
|
return new MarketCashPerformanceLogWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketCashPerformanceLogVO entityVO(MarketCashPerformanceLogEntity marketCashPerformanceLog) {
|
||||||
|
MarketCashPerformanceLogVO marketCashPerformanceLogVO = Objects.requireNonNull(BeanUtil.copyProperties(marketCashPerformanceLog, MarketCashPerformanceLogVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketCashPerformanceLog.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketCashPerformanceLog.getUpdateUser());
|
||||||
|
//marketCashPerformanceLogVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketCashPerformanceLogVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketCashPerformanceLogVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketCashPerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketCashPerformanceVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金业绩 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketCashPerformanceWrapper extends BaseEntityWrapper<MarketCashPerformanceEntity, MarketCashPerformanceVO> {
|
||||||
|
|
||||||
|
public static MarketCashPerformanceWrapper build() {
|
||||||
|
return new MarketCashPerformanceWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketCashPerformanceVO entityVO(MarketCashPerformanceEntity marketCashPerformance) {
|
||||||
|
MarketCashPerformanceVO marketCashPerformanceVO = Objects.requireNonNull(BeanUtil.copyProperties(marketCashPerformance, MarketCashPerformanceVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketCashPerformance.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketCashPerformance.getUpdateUser());
|
||||||
|
//marketCashPerformanceVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketCashPerformanceVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketCashPerformanceVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeCashLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeCashLogVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户现金升级日志 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketUpgradeCashLogWrapper extends BaseEntityWrapper<MarketUpgradeCashLogEntity, MarketUpgradeCashLogVO> {
|
||||||
|
|
||||||
|
public static MarketUpgradeCashLogWrapper build() {
|
||||||
|
return new MarketUpgradeCashLogWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketUpgradeCashLogVO entityVO(MarketUpgradeCashLogEntity marketUpgradeCashLog) {
|
||||||
|
MarketUpgradeCashLogVO marketUpgradeCashLogVO = Objects.requireNonNull(BeanUtil.copyProperties(marketUpgradeCashLog, MarketUpgradeCashLogVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketUpgradeCashLog.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketUpgradeCashLog.getUpdateUser());
|
||||||
|
//marketUpgradeCashLogVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketUpgradeCashLogVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketUpgradeCashLogVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeConfigEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeConfigVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级升级配置 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketUpgradeConfigWrapper extends BaseEntityWrapper<MarketUpgradeConfigEntity, MarketUpgradeConfigVO> {
|
||||||
|
|
||||||
|
public static MarketUpgradeConfigWrapper build() {
|
||||||
|
return new MarketUpgradeConfigWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketUpgradeConfigVO entityVO(MarketUpgradeConfigEntity marketUpgradeConfig) {
|
||||||
|
MarketUpgradeConfigVO marketUpgradeConfigVO = Objects.requireNonNull(BeanUtil.copyProperties(marketUpgradeConfig, MarketUpgradeConfigVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketUpgradeConfig.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketUpgradeConfig.getUpdateUser());
|
||||||
|
//marketUpgradeConfigVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketUpgradeConfigVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketUpgradeConfigVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketUpgradeWelfareLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketUpgradeWelfareLogVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户福利包升级日志 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketUpgradeWelfareLogWrapper extends BaseEntityWrapper<MarketUpgradeWelfareLogEntity, MarketUpgradeWelfareLogVO> {
|
||||||
|
|
||||||
|
public static MarketUpgradeWelfareLogWrapper build() {
|
||||||
|
return new MarketUpgradeWelfareLogWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketUpgradeWelfareLogVO entityVO(MarketUpgradeWelfareLogEntity marketUpgradeWelfareLog) {
|
||||||
|
MarketUpgradeWelfareLogVO marketUpgradeWelfareLogVO = Objects.requireNonNull(BeanUtil.copyProperties(marketUpgradeWelfareLog, MarketUpgradeWelfareLogVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketUpgradeWelfareLog.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketUpgradeWelfareLog.getUpdateUser());
|
||||||
|
//marketUpgradeWelfareLogVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketUpgradeWelfareLogVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketUpgradeWelfareLogVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceLogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceLogVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩日志 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketWelfarePerformanceLogWrapper extends BaseEntityWrapper<MarketWelfarePerformanceLogEntity, MarketWelfarePerformanceLogVO> {
|
||||||
|
|
||||||
|
public static MarketWelfarePerformanceLogWrapper build() {
|
||||||
|
return new MarketWelfarePerformanceLogWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketWelfarePerformanceLogVO entityVO(MarketWelfarePerformanceLogEntity marketWelfarePerformanceLog) {
|
||||||
|
MarketWelfarePerformanceLogVO marketWelfarePerformanceLogVO = Objects.requireNonNull(BeanUtil.copyProperties(marketWelfarePerformanceLog, MarketWelfarePerformanceLogVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketWelfarePerformanceLog.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketWelfarePerformanceLog.getUpdateUser());
|
||||||
|
//marketWelfarePerformanceLogVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketWelfarePerformanceLogVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketWelfarePerformanceLogVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* BladeX Commercial License Agreement
|
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p>
|
||||||
|
* Use of this software is governed by the Commercial License Agreement
|
||||||
|
* obtained after purchasing a license from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 1. This software is for development use only under a valid license
|
||||||
|
* from BladeX.
|
||||||
|
* <p>
|
||||||
|
* 2. Redistribution of this software's source code to any third party
|
||||||
|
* without a commercial license is strictly prohibited.
|
||||||
|
* <p>
|
||||||
|
* 3. Licensees may copyright their own code but cannot use segments
|
||||||
|
* from this software for such purposes. Copyright of this software
|
||||||
|
* remains with BladeX.
|
||||||
|
* <p>
|
||||||
|
* Using this software signifies agreement to this License, and the software
|
||||||
|
* must not be used for illegal purposes.
|
||||||
|
* <p>
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||||
|
* not liable for any claims arising from secondary or illegal development.
|
||||||
|
* <p>
|
||||||
|
* Author: Chill Zhuang (bladejava@qq.com)
|
||||||
|
*/
|
||||||
|
package org.springblade.modules.market.wrapper;
|
||||||
|
|
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||||
|
import org.springblade.core.tool.utils.BeanUtil;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MarketWelfarePerformanceEntity;
|
||||||
|
import org.springblade.modules.market.pojo.vo.MarketWelfarePerformanceVO;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 福利包业绩 包装类,返回视图层所需的字段
|
||||||
|
*
|
||||||
|
* @author BladeX
|
||||||
|
* @since 2026-03-10
|
||||||
|
*/
|
||||||
|
public class MarketWelfarePerformanceWrapper extends BaseEntityWrapper<MarketWelfarePerformanceEntity, MarketWelfarePerformanceVO> {
|
||||||
|
|
||||||
|
public static MarketWelfarePerformanceWrapper build() {
|
||||||
|
return new MarketWelfarePerformanceWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MarketWelfarePerformanceVO entityVO(MarketWelfarePerformanceEntity marketWelfarePerformance) {
|
||||||
|
MarketWelfarePerformanceVO marketWelfarePerformanceVO = Objects.requireNonNull(BeanUtil.copyProperties(marketWelfarePerformance, MarketWelfarePerformanceVO.class));
|
||||||
|
|
||||||
|
//User createUser = UserCache.getUser(marketWelfarePerformance.getCreateUser());
|
||||||
|
//User updateUser = UserCache.getUser(marketWelfarePerformance.getUpdateUser());
|
||||||
|
//marketWelfarePerformanceVO.setCreateUserName(createUser.getName());
|
||||||
|
//marketWelfarePerformanceVO.setUpdateUserName(updateUser.getName());
|
||||||
|
|
||||||
|
return marketWelfarePerformanceVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user