1. add lottery
This commit is contained in:
2026-02-14 16:31:51 +08:00
parent f5a9d171e0
commit e1105dae89
20 changed files with 1421 additions and 35 deletions

View File

@@ -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)));
}
}

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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>

View File

@@ -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);
}

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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));
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}