TienChin 活动管理-活动导出

2023-10-12 14:53:05 浏览数 (2)

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;

0 人点赞