feat:生成优惠券领取列表
This commit is contained in:
1 parent
62150787d0
commit
53512b7f9c
9 files changed
+317
-1
No files matched your search
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.act;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActCouponRecordDto extends ActCouponRecordEntity {
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.act;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 优惠券领取记录表
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("act_coupon_record")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "优惠券领取记录表")
|
||||
public class ActCouponRecordEntity extends Model<ActCouponRecordEntity> {
|
||||
|
||||
/**
|
||||
* 领取记录ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "领取记录ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 优惠券ID
|
||||
*/
|
||||
@Schema(description = "优惠券ID")
|
||||
private Long couponId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@Schema(description = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 券码(唯一标识)
|
||||
*/
|
||||
@Schema(description = "券码(唯一标识)")
|
||||
private String couponCode;
|
||||
|
||||
/**
|
||||
* 使用状态 (0:未使用 1:已使用 2:已过期 3:已作废)
|
||||
*/
|
||||
@Schema(description = "使用状态 (0:未使用 1:已使用 2:已过期 3:已作废)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 优惠券名称
|
||||
*/
|
||||
@Schema(description = "优惠券名称")
|
||||
private String couponName;
|
||||
|
||||
/**
|
||||
* 优惠券类型
|
||||
*/
|
||||
@Schema(description = "优惠券类型")
|
||||
private String couponType;
|
||||
|
||||
/**
|
||||
* 面额/折扣
|
||||
*/
|
||||
@Schema(description = "面额/折扣")
|
||||
private Integer faceValue;
|
||||
|
||||
/**
|
||||
* 使用门槛
|
||||
*/
|
||||
@Schema(description = "使用门槛")
|
||||
private Integer minPoint;
|
||||
|
||||
/**
|
||||
* 有效开始时间
|
||||
*/
|
||||
@Schema(description = "有效开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 有效结束时间
|
||||
*/
|
||||
@Schema(description = "有效结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
@Schema(description = "使用时间")
|
||||
private LocalDateTime useTime;
|
||||
|
||||
/**
|
||||
* 关联订单号
|
||||
*/
|
||||
@Schema(description = "关联订单号")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 抵扣金额(分)
|
||||
*/
|
||||
@Schema(description = "抵扣金额(分)")
|
||||
private Integer useAmount;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 领取时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "领取时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.act;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActCouponRecordVo extends ActCouponRecordEntity {
|
||||
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package com.bsd.pjcloud.wallet.controller.act;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponRecordDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import com.bsd.pjcloud.wallet.service.ActCouponRecordService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券领取记录表
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/actCouponRecord" )
|
||||
@Tag(description = "actCouponRecord" , name = "优惠券领取记录表管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ActCouponRecordController {
|
||||
|
||||
private final ActCouponRecordService actCouponRecordService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_view')" )
|
||||
public R getActCouponRecordPage(@ParameterObject Page page, @ParameterObject ActCouponRecordDto dto) {
|
||||
LambdaQueryWrapper<ActCouponRecordEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(actCouponRecordService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询优惠券领取记录表
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(actCouponRecordService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增优惠券领取记录表
|
||||
*/
|
||||
@Operation(summary = "新增优惠券领取记录表" , description = "新增优惠券领取记录表" )
|
||||
@SysLog("新增优惠券领取记录表" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_add')" )
|
||||
public R save(@RequestBody ActCouponRecordEntity actCouponRecord) {
|
||||
return R.ok(actCouponRecordService.save(actCouponRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改优惠券领取记录表
|
||||
*/
|
||||
@Operation(summary = "修改优惠券领取记录表" , description = "修改优惠券领取记录表" )
|
||||
@SysLog("修改优惠券领取记录表" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_edit')" )
|
||||
public R updateById(@RequestBody ActCouponRecordEntity actCouponRecord) {
|
||||
return R.ok(actCouponRecordService.updateById(actCouponRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除优惠券领取记录表
|
||||
*/
|
||||
@Operation(summary = "通过id删除优惠券领取记录表" , description = "通过id删除优惠券领取记录表" )
|
||||
@SysLog("通过id删除优惠券领取记录表" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(actCouponRecordService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_actCouponRecord_export')" )
|
||||
public List<ActCouponRecordEntity> export(ActCouponRecordEntity actCouponRecord,Long[] ids) {
|
||||
return actCouponRecordService.list(Wrappers.lambdaQuery(actCouponRecord).in(ArrayUtil.isNotEmpty(ids), ActCouponRecordEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.act;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ActCouponRecordMapper extends PjcloudBaseMapper<ActCouponRecordEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
|
||||
public interface ActCouponRecordService extends IService<ActCouponRecordEntity> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.act;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.act.ActCouponRecordMapper;
|
||||
import com.bsd.pjcloud.wallet.service.ActCouponRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 优惠券领取记录表
|
||||
*/
|
||||
@Service
|
||||
public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMapper, ActCouponRecordEntity> implements ActCouponRecordService {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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="com.bsd.pjcloud.wallet.service.impl.act.ActCouponServiceImpl">
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.act.ActCouponMapper">
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
<?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="com.bsd.pjcloud.wallet.mapper.act.ActCouponRecordMapper">
|
||||
<sql id="selectA">
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user