feat:
1. add lottery
This commit is contained in:
@@ -78,7 +78,6 @@ INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark,
|
||||
VALUES (2020766604569534468, 2020766458167353346, 'notice_type', '3', 'Market用户通知', 2, '', 0, 1, 0);
|
||||
|
||||
|
||||
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
@@ -446,14 +445,53 @@ comment on column market_commission_account.is_deleted is '是否已删除';
|
||||
alter table market_commission_account
|
||||
owner to yicha1lu;
|
||||
---------------------------------------insert start
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0','0.0000', 1, '商品成本账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201, '2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1,'分发直推人佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201, '2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3','0.0000', 1, '运营账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4','0.0000', 1, '分发广告补贴账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201, '2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER','5', '0.0000', 1, '分发服务商佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201, '2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6','0.0000', 1, '分发极差代理佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201, '2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7','0.0000', 1, '联创佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201, '2026-01-31 14:34:38.479', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0', '0.0000', 1, '商品成本账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04',
|
||||
1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201,
|
||||
'2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1, '分发直推人佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201,
|
||||
'2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3', '0.0000', 1, '运营账户', 1123598821738675201,
|
||||
1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4', '0.0000', 1, '分发广告补贴账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201,
|
||||
'2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER', '5', '0.0000', 1,
|
||||
'分发服务商佣金账户', 1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201,
|
||||
'2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6', '0.0000', 1, '分发极差代理佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201,
|
||||
'2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type", "amount", "version",
|
||||
"remark", "create_user", "create_dept", "create_time", "update_user",
|
||||
"update_time", "status", "is_deleted")
|
||||
VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7', '0.0000', 1, '联创佣金账户',
|
||||
1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201,
|
||||
'2026-01-31 14:34:38.479', 1, 0);
|
||||
|
||||
---------------------------------------insert end
|
||||
|
||||
@@ -939,3 +977,96 @@ comment on column user_market_package_daily_settlement.is_deleted is '是否已
|
||||
alter table user_market_package_daily_settlement
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS common_lottery_prize;
|
||||
create table common_lottery_prize
|
||||
(
|
||||
id int8 not null primary key,
|
||||
prize_name varchar(100),--奖品名称
|
||||
prize_type int4, -- 类型:1=积分 2=优惠券 3=实物...
|
||||
prize_value VARCHAR(255), -- 奖品内容(如积分数量、券码等)
|
||||
probability DECIMAL(5, 4), -- 中奖概率(如 0.05 = 5%)
|
||||
stock int4, -- 总库存(-1 表示无限)
|
||||
daily_limit int4, -- 每日发放上限
|
||||
sort_order int4, -- 排序(用于前端展示顺序)
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1, -- 状态:0=下架 1=上架,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
COMMENT ON TABLE common_lottery_prize IS '奖品配置表';
|
||||
COMMENT ON COLUMN common_lottery_prize.id IS '主键';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_name IS '奖品名称';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_type IS '奖品类型';
|
||||
COMMENT ON COLUMN common_lottery_prize.prize_value IS '奖品内容';
|
||||
COMMENT ON COLUMN common_lottery_prize.probability IS '中奖概率(如 0.05 = 5%)';
|
||||
COMMENT ON COLUMN common_lottery_prize.stock IS '总库存(-1 表示无限)';
|
||||
COMMENT ON COLUMN common_lottery_prize.daily_limit IS '每日发放上限';
|
||||
COMMENT ON COLUMN common_lottery_prize.sort_order IS '排序(用于前端展示顺序)';
|
||||
COMMENT ON COLUMN common_lottery_prize.remark IS '备注';
|
||||
comment on column common_lottery_prize.create_user is '创建人';
|
||||
comment on column common_lottery_prize.create_dept is '创建部门';
|
||||
comment on column common_lottery_prize.create_time is '创建时间';
|
||||
comment on column common_lottery_prize.update_user is '修改人';
|
||||
comment on column common_lottery_prize.update_time is '修改时间';
|
||||
comment on column common_lottery_prize.status is '状态:0=下架 1=上架';
|
||||
comment on column common_lottery_prize.is_deleted is '是否已删除';
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022583456075808770', '1123598815738675201', 'lotteryPrize', '奖品配置表', 'menu', '/common/lotteryPrize', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022583456075808771', '2022583456075808770', 'lotteryPrize_add', '新增', 'add', '/common/lotteryPrize/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022583456075808772', '2022583456075808770', 'lotteryPrize_edit', '修改', 'edit', '/common/lotteryPrize/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022583456075808773', '2022583456075808770', 'lotteryPrize_delete', '删除', 'delete', '/api/blade-lotteryprize/lotteryPrize/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022583456075808774', '2022583456075808770', 'lotteryPrize_view', '查看', 'view', '/common/lotteryPrize/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS common_lottery_record;
|
||||
create table common_lottery_record
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8, -- 用户id
|
||||
prize_id int8, -- 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
points_used decimal(14, 2) default 0, -- 消耗积分
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 0, --0=未发放 1=已发放 2=发放失败
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
COMMENT ON TABLE common_lottery_record IS '抽奖记录表';
|
||||
COMMENT ON COLUMN common_lottery_record.id IS '主键';
|
||||
COMMENT ON COLUMN common_lottery_record.user_id IS '用户id';
|
||||
COMMENT ON COLUMN common_lottery_record.prize_id IS '中奖奖品ID(null 表示未中奖/谢谢参与)';
|
||||
COMMENT ON COLUMN common_lottery_record.points_used IS '消耗积分';
|
||||
COMMENT ON COLUMN common_lottery_record.remark IS '备注';
|
||||
comment on column common_lottery_record.create_user is '创建人';
|
||||
comment on column common_lottery_record.create_dept is '创建部门';
|
||||
comment on column common_lottery_record.create_time is '创建时间';
|
||||
comment on column common_lottery_record.update_user is '修改人';
|
||||
comment on column common_lottery_record.update_time is '修改时间';
|
||||
comment on column common_lottery_record.status is '0=未发放 1=已发放 2=发放失败';
|
||||
comment on column common_lottery_record.is_deleted is '是否已删除';
|
||||
create index idx_clr_uc on common_lottery_record (user_id, is_deleted, create_time desc);
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022588119768522753', '1123598815738675201', 'lotteryRecord', '抽奖记录表', 'menu', '/common/lotteryRecord', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022588119768522754', '2022588119768522753', 'lotteryRecord_add', '新增', 'add', '/common/lotteryRecord/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022588119768522755', '2022588119768522753', 'lotteryRecord_edit', '修改', 'edit', '/common/lotteryRecord/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022588119768522756', '2022588119768522753', 'lotteryRecord_delete', '删除', 'delete', '/api/blade-lotteryprize/lotteryRecord/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2022588119768522757', '2022588119768522753', 'lotteryRecord_view', '查看', 'view', '/common/lotteryRecord/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import org.springblade.modules.common.wrapper.CommonLotteryPrizeWrapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryPrizeService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 奖品配置表 控制器
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-lotteryprize/lotteryPrize")
|
||||
@Tag(name = "奖品配置表", description = "奖品配置表接口")
|
||||
public class CommonLotteryPrizeController extends BladeController {
|
||||
|
||||
private final ICommonLotteryPrizeService lotteryPrizeService;
|
||||
|
||||
/**
|
||||
* 奖品配置表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入lotteryPrize")
|
||||
public R<CommonLotteryPrizeVO> detail(CommonLotteryPrizeEntity lotteryPrize) {
|
||||
CommonLotteryPrizeEntity detail = lotteryPrizeService.getOne(Condition.getQueryWrapper(lotteryPrize));
|
||||
return R.data(CommonLotteryPrizeWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 奖品配置表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入lotteryPrize")
|
||||
public R<IPage<CommonLotteryPrizeVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryPrize, Query query) {
|
||||
IPage<CommonLotteryPrizeEntity> pages = lotteryPrizeService.page(Condition.getPage(query), Condition.getQueryWrapper(lotteryPrize, CommonLotteryPrizeEntity.class));
|
||||
return R.data(CommonLotteryPrizeWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入lotteryPrize")
|
||||
public R<IPage<CommonLotteryPrizeVO>> page(CommonLotteryPrizeVO lotteryPrize, Query query) {
|
||||
IPage<CommonLotteryPrizeVO> pages = lotteryPrizeService.selectLotteryPrizePage(Condition.getPage(query), lotteryPrize);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入lotteryPrize")
|
||||
public R save(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.save(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入lotteryPrize")
|
||||
public R update(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.updateById(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入lotteryPrize")
|
||||
public R submit(@Valid @RequestBody CommonLotteryPrizeEntity lotteryPrize) {
|
||||
return R.status(lotteryPrizeService.saveOrUpdate(lotteryPrize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品配置表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(lotteryPrizeService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import org.springblade.modules.common.wrapper.CommonLotteryRecordWrapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryRecordService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 控制器
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-lotteryprize/lotteryRecord")
|
||||
@Tag(name = "抽奖记录表", description = "抽奖记录表接口")
|
||||
public class CommonLotteryRecordController extends BladeController {
|
||||
|
||||
private final ICommonLotteryRecordService lotteryRecordService;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入lotteryRecord")
|
||||
public R<CommonLotteryRecordVO> detail(CommonLotteryRecordEntity lotteryRecord) {
|
||||
CommonLotteryRecordEntity detail = lotteryRecordService.getOne(Condition.getQueryWrapper(lotteryRecord));
|
||||
return R.data(CommonLotteryRecordWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 抽奖记录表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入lotteryRecord")
|
||||
public R<IPage<CommonLotteryRecordVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryRecord, Query query) {
|
||||
IPage<CommonLotteryRecordEntity> pages = lotteryRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(lotteryRecord, CommonLotteryRecordEntity.class));
|
||||
return R.data(CommonLotteryRecordWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入lotteryRecord")
|
||||
public R<IPage<CommonLotteryRecordVO>> page(CommonLotteryRecordVO lotteryRecord, Query query) {
|
||||
IPage<CommonLotteryRecordVO> pages = lotteryRecordService.selectLotteryRecordPage(Condition.getPage(query), lotteryRecord);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入lotteryRecord")
|
||||
public R save(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.save(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入lotteryRecord")
|
||||
public R update(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.updateById(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入lotteryRecord")
|
||||
public R submit(@Valid @RequestBody CommonLotteryRecordEntity lotteryRecord) {
|
||||
return R.status(lotteryRecordService.saveOrUpdate(lotteryRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽奖记录表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(lotteryRecordService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-lotteryRecord")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入lotteryRecord")
|
||||
public void exportLotteryRecord(@Parameter(hidden = true) @RequestParam Map<String, Object> lotteryRecord, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<CommonLotteryRecordEntity> queryWrapper = Condition.getQueryWrapper(lotteryRecord, CommonLotteryRecordEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(LotteryRecord::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(LotteryRecordEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<CommonLotteryRecordExcel> list = lotteryRecordService.exportLotteryRecord(queryWrapper);
|
||||
ExcelUtil.export(response, "抽奖记录表数据" + DateUtil.time(), "抽奖记录表数据表", list, CommonLotteryRecordExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 抽奖记录表 Excel实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class CommonLotteryRecordExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("中奖奖品ID(null 表示未中奖/谢谢参与)")
|
||||
private Long prizeId;
|
||||
/**
|
||||
* 消耗积分
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("消耗积分")
|
||||
private BigDecimal pointsUsed;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 奖品配置表 Mapper 接口
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface CommonLotteryPrizeMapper extends BaseMapper<CommonLotteryPrizeEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param lotteryPrize 查询参数
|
||||
* @return List<LotteryPrizeVO>
|
||||
*/
|
||||
List<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage page, CommonLotteryPrizeVO lotteryPrize);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonLotteryPrizeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="lotteryPrizeResultMap" type="org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="prize_name" property="prizeName"/>
|
||||
<result column="prize_type" property="prizeType"/>
|
||||
<result column="prize_value" property="prizeValue"/>
|
||||
<result column="probability" property="probability"/>
|
||||
<result column="stock" property="stock"/>
|
||||
<result column="daily_limit" property="dailyLimit"/>
|
||||
<result column="sort_order" property="sortOrder"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectLotteryPrizePage" resultMap="lotteryPrizeResultMap">
|
||||
select * from common_lottery_prize where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 Mapper 接口
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface CommonLotteryRecordMapper extends BaseMapper<CommonLotteryRecordEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param lotteryRecord 查询参数
|
||||
* @return List<LotteryRecordVO>
|
||||
*/
|
||||
List<CommonLotteryRecordVO> selectLotteryRecordPage(IPage page, CommonLotteryRecordVO lotteryRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<LotteryRecordExcel>
|
||||
*/
|
||||
List<CommonLotteryRecordExcel> exportLotteryRecord(@Param("ew") Wrapper<CommonLotteryRecordEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.common.mapper.CommonLotteryRecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="lotteryRecordResultMap" type="org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="prize_id" property="prizeId"/>
|
||||
<result column="points_used" property="pointsUsed"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectLotteryRecordPage" resultMap="lotteryRecordResultMap">
|
||||
select * from common_lottery_record where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportLotteryRecord" resultType="org.springblade.modules.common.excel.CommonLotteryRecordExcel">
|
||||
SELECT * FROM common_lottery_record ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 数据传输对象实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeDTO extends CommonLotteryPrizeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 数据传输对象实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordDTO extends CommonLotteryRecordEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.tenant.mp.TenantEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("common_lottery_prize")
|
||||
@Schema(description = "LotteryPrize对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeEntity extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 奖品名称
|
||||
*/
|
||||
@Schema(description = "奖品名称")
|
||||
private String prizeName;
|
||||
/**
|
||||
* 奖品类型
|
||||
*/
|
||||
@Schema(description = "奖品类型")
|
||||
private Integer prizeType;
|
||||
/**
|
||||
* 奖品内容
|
||||
*/
|
||||
@Schema(description = "奖品内容")
|
||||
private String prizeValue;
|
||||
/**
|
||||
* 中奖概率(如 0.05 = 5%)
|
||||
*/
|
||||
@Schema(description = "中奖概率(如 0.05 = 5%)")
|
||||
private BigDecimal probability;
|
||||
/**
|
||||
* 总库存(-1 表示无限)
|
||||
*/
|
||||
@Schema(description = "总库存(-1 表示无限)")
|
||||
private Integer stock;
|
||||
/**
|
||||
* 每日发放上限
|
||||
*/
|
||||
@Schema(description = "每日发放上限")
|
||||
private Integer dailyLimit;
|
||||
/**
|
||||
* 排序(用于前端展示顺序)
|
||||
*/
|
||||
@Schema(description = "排序(用于前端展示顺序)")
|
||||
private Integer sortOrder;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.tenant.mp.TenantEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("common_lottery_record")
|
||||
@Schema(description = "LotteryRecord对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordEntity extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 中奖奖品ID(null 表示未中奖/谢谢参与)
|
||||
*/
|
||||
@Schema(description = "中奖奖品ID(null 表示未中奖/谢谢参与)")
|
||||
private Long prizeId;
|
||||
/**
|
||||
* 消耗积分
|
||||
*/
|
||||
@Schema(description = "消耗积分")
|
||||
private BigDecimal pointsUsed;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 奖品配置表 视图实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryPrizeVO extends CommonLotteryPrizeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.pojo.vo;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 视图实体类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonLotteryRecordVO extends CommonLotteryRecordEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
/**
|
||||
* 奖品配置表 服务类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface ICommonLotteryPrizeService extends BaseService<CommonLotteryPrizeEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param lotteryPrize 查询参数
|
||||
* @return IPage<LotteryPrizeVO>
|
||||
*/
|
||||
IPage<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage<CommonLotteryPrizeVO> page, CommonLotteryPrizeVO lotteryPrize);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 服务类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public interface ICommonLotteryRecordService extends BaseService<CommonLotteryRecordEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param lotteryRecord 查询参数
|
||||
* @return IPage<LotteryRecordVO>
|
||||
*/
|
||||
IPage<CommonLotteryRecordVO> selectLotteryRecordPage(IPage<CommonLotteryRecordVO> page, CommonLotteryRecordVO lotteryRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<LotteryRecordExcel>
|
||||
*/
|
||||
List<CommonLotteryRecordExcel> exportLotteryRecord(Wrapper<CommonLotteryRecordEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import org.springblade.modules.common.mapper.CommonLotteryPrizeMapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryPrizeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
/**
|
||||
* 奖品配置表 服务实现类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Service
|
||||
public class CommonLotteryPrizeServiceImpl extends BaseServiceImpl<CommonLotteryPrizeMapper, CommonLotteryPrizeEntity> implements ICommonLotteryPrizeService {
|
||||
|
||||
@Override
|
||||
public IPage<CommonLotteryPrizeVO> selectLotteryPrizePage(IPage<CommonLotteryPrizeVO> page, CommonLotteryPrizeVO lotteryPrize) {
|
||||
return page.setRecords(baseMapper.selectLotteryPrizePage(page, lotteryPrize));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import org.springblade.modules.common.excel.CommonLotteryRecordExcel;
|
||||
import org.springblade.modules.common.mapper.CommonLotteryRecordMapper;
|
||||
import org.springblade.modules.common.service.ICommonLotteryRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 服务实现类
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
@Service
|
||||
public class CommonLotteryRecordServiceImpl extends BaseServiceImpl<CommonLotteryRecordMapper, CommonLotteryRecordEntity> implements ICommonLotteryRecordService {
|
||||
|
||||
@Override
|
||||
public IPage<CommonLotteryRecordVO> selectLotteryRecordPage(IPage<CommonLotteryRecordVO> page, CommonLotteryRecordVO lotteryRecord) {
|
||||
return page.setRecords(baseMapper.selectLotteryRecordPage(page, lotteryRecord));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CommonLotteryRecordExcel> exportLotteryRecord(Wrapper<CommonLotteryRecordEntity> queryWrapper) {
|
||||
List<CommonLotteryRecordExcel> lotteryRecordList = baseMapper.exportLotteryRecord(queryWrapper);
|
||||
//lotteryRecordList.forEach(lotteryRecord -> {
|
||||
// lotteryRecord.setTypeName(DictCache.getValue(DictEnum.YES_NO, LotteryRecord.getType()));
|
||||
//});
|
||||
return lotteryRecordList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryPrizeEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryPrizeVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 奖品配置表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public class CommonLotteryPrizeWrapper extends BaseEntityWrapper<CommonLotteryPrizeEntity, CommonLotteryPrizeVO> {
|
||||
|
||||
public static CommonLotteryPrizeWrapper build() {
|
||||
return new CommonLotteryPrizeWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonLotteryPrizeVO entityVO(CommonLotteryPrizeEntity lotteryPrize) {
|
||||
CommonLotteryPrizeVO lotteryPrizeVO = Objects.requireNonNull(BeanUtil.copyProperties(lotteryPrize, CommonLotteryPrizeVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(lotteryPrize.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(lotteryPrize.getUpdateUser());
|
||||
//lotteryPrizeVO.setCreateUserName(createUser.getName());
|
||||
//lotteryPrizeVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return lotteryPrizeVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.common.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.common.pojo.entity.CommonLotteryRecordEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonLotteryRecordVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 抽奖记录表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author RayLiu
|
||||
* @since 2026-02-14
|
||||
*/
|
||||
public class CommonLotteryRecordWrapper extends BaseEntityWrapper<CommonLotteryRecordEntity, CommonLotteryRecordVO> {
|
||||
|
||||
public static CommonLotteryRecordWrapper build() {
|
||||
return new CommonLotteryRecordWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonLotteryRecordVO entityVO(CommonLotteryRecordEntity lotteryRecord) {
|
||||
CommonLotteryRecordVO lotteryRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(lotteryRecord, CommonLotteryRecordVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(lotteryRecord.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(lotteryRecord.getUpdateUser());
|
||||
//lotteryRecordVO.setCreateUserName(createUser.getName());
|
||||
//lotteryRecordVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return lotteryRecordVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user