前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >TienChin 活动管理-活动导出

TienChin 活动管理-活动导出

作者头像
BNTang
发布2023-10-12 14:53:05
1690
发布2023-10-12 14:53:05
举报
文章被收录于专栏:『学习与分享之旅』

ActivityController

代码语言:javascript
复制
/**
 * 导出活动列表
 */
@PreAuthorize("hasPermission('tienchin:activity:export')")
@Log(title = "渠道管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ActivityVO activityVO) {
    List<ActivityVO> activityVOList = iActivityService.selectActivityList(activityVO);
    ExcelUtil<ActivityVO> util = new ExcelUtil<>(ActivityVO.class);
    util.exportExcel(response, activityVOList, "活动数据");
}

ActivityVO.java

代码语言:javascript
复制
/**
 * 活动ID
 */
@NotNull(message = "{activity.id.notnull}", groups = {EditGroup.class})
@Excel(name = "活动ID")
private Integer activityId;

/**
 * 活动名称
 */
@NotBlank(message = "{activity.name.notBlank}", groups = {EditGroup.class, CreateGroup.class})
@Size(max = 20, message = "{activity.name.size}", groups = {EditGroup.class, CreateGroup.class})
@Excel(name = "活动名称")
private String activityName;

/**
 * 渠道ID
 */
@NotNull(message = "{activity.channelId.notnull}", groups = {EditGroup.class, CreateGroup.class})
@Excel(name = "渠道ID")
private Integer channelId;

/**
 * 渠道名称
 */
@Excel(name = "渠道名称")
private String channelName;

/**
 * 活动简介
 */
@NotBlank(message = "{activity.info.notBlank}", groups = {EditGroup.class, CreateGroup.class})
@Size(max = 255, message = "{activity.info.size}", groups = {EditGroup.class, CreateGroup.class})
@Excel(name = "活动简介")
private String activityInfo;

/**
 * 活动类型,1.折扣券、2.代金券
 */
@NotNull(message = "{activity.type.notnull}", groups = {EditGroup.class, CreateGroup.class})
@Excel(name = "活动类型", readConverterExp = "1=折扣券,2=代金券")
private Integer activityType;

/**
 * 活动状态,0.表示过期、1.表示正常
 */
@Max(value = 1, message = "{activity.status.max}", groups = {EditGroup.class, CreateGroup.class})
@Min(value = 0, message = "{activity.status.min}", groups = {EditGroup.class, CreateGroup.class})
@Excel(name = "活动状态", readConverterExp = "0=过期,1=正常")
private Integer activityStatus;

/**
 * 折扣券
 */
@Excel(name = "活动折扣")
@Max(value = 10, message = "{activity.discount.max}", groups = {EditGroup.class, CreateGroup.class})
@Min(value = 0, message = "{activity.discount.min}", groups = {EditGroup.class, CreateGroup.class})
private Double discount;

/**
 * 代金券
 */
@Excel(name = "代金券面值")
@Min(value = 0, message = "{activity.voucher.min}", groups = {EditGroup.class, CreateGroup.class})
private Double voucher;

/**
 * 活动开始时间
 */
@NotNull(message = "{activity.beginTime.notnull}", groups = {EditGroup.class, CreateGroup.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@Excel(name = "活动开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginTime;

/**
 * 活动结束时间
 */
@NotNull(message = "{activity.endTime.notnull}", groups = {EditGroup.class, CreateGroup.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@Excel(name = "活动结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;

/**
 * 备注
 */
@Excel(name = "活动备注")
private String remark;
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-09-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • ActivityController
  • ActivityVO.java
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档