release: lottery新增门票价格字段和发布时间字段

release-2024-04-25
huangyw 1 month ago
parent 46e7cf56f8
commit f1da3b4cb0

@ -14,6 +14,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ -82,4 +83,7 @@ public class LotteryAddDto implements Serializable {
@ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
}

@ -12,6 +12,7 @@ import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ -85,4 +86,7 @@ public class LotteryUpdateDto implements Serializable {
@ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
}

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import javax.persistence.Column;
@ -149,6 +150,16 @@ public class Lottery implements Serializable {
@ApiModelProperty(value = "停止原因")
private String stopReason;
@Column(name = "publish_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@Column(name = "price")
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@Transient
@ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList;

@ -26,6 +26,7 @@ import enums.UserVipStatusEnum;
import exception.BizException;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@ -266,6 +267,8 @@ public class LotteryService {
if (lottery.getDrawTime() == null) {
throw new BizException(ErrorConstants.DRAW_TIME_IS_REQUIRED);
}
// 发布时间
lottery.setPublishTime(LocalDateTime.now());
lottery.setUpdateUser(userLoginDto.getUserId());
lottery.setUpdateUserName(userLoginDto.getNickName());
@ -450,7 +453,9 @@ public class LotteryService {
qLottery.createTime,
qLottery.createUser,
qLottery.createUserName,
qLottery.stopReason
qLottery.stopReason,
qLottery.price,
qLottery.publishTime
)).from(qLottery)
.where(booleanBuilder)
.orderBy(qLottery.createTime.desc())
@ -484,7 +489,9 @@ public class LotteryService {
qLottery.description,
qLottery.status,
qLottery.createTime,
qLottery.stopReason
qLottery.stopReason,
qLottery.price,
qLottery.publishTime
)).from(qLottery)
.where(booleanBuilder)
.orderBy(qLottery.createTime.desc())
@ -668,7 +675,9 @@ public class LotteryService {
qLottery.description,
qLottery.status,
qLottery.createTime,
qLottery.stopReason
qLottery.stopReason,
qLottery.price,
qLottery.publishTime
))
.from(qLottery)
.where(qLottery.id.eq(lotteryId))

@ -9,6 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ -83,6 +84,12 @@ public class LotteryAPPVO implements Serializable {
@ApiModelProperty(value = "停止原因")
private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@Transient
@ApiModelProperty(value = "本人是否参与抽奖 1-已参加 2-未参加")
private Integer isParticipate;
@ -117,6 +124,29 @@ public class LotteryAPPVO implements Serializable {
this.stopReason = stopReason;
}
public LotteryAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) {
this.id = id;
this.code = code;
this.title = title;
this.type = type;
this.num = num;
this.participant = participant;
this.point = point;
this.regionCode = regionCode;
this.regionName = regionName;
this.applyStartTime = applyStartTime;
this.applyEndTime = applyEndTime;
this.drawTime = drawTime;
this.way = way;
this.image = image;
this.description = description;
this.status = status;
this.createTime = createTime;
this.stopReason = stopReason;
this.price = price;
this.publishTime = publishTime;
}
public LotteryAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, Integer isParticipate) {
this.id = id;
this.code = code;

@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ -79,6 +80,12 @@ public class LotteryDetailAPPVO implements Serializable {
@ApiModelProperty(value = "停止原因")
private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegionDetailVO> lotteryRegionList;
@ -111,4 +118,25 @@ public class LotteryDetailAPPVO implements Serializable {
this.createTime = createTime;
this.stopReason = stopReason;
}
public LotteryDetailAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) {
this.id = id;
this.code = code;
this.title = title;
this.type = type;
this.num = num;
this.participant = participant;
this.point = point;
this.applyStartTime = applyStartTime;
this.applyEndTime = applyEndTime;
this.drawTime = drawTime;
this.way = way;
this.image = image;
this.description = description;
this.status = status;
this.createTime = createTime;
this.stopReason = stopReason;
this.price = price;
this.publishTime = publishTime;
}
}

@ -5,6 +5,7 @@ import com.luoo.user.pojo.LotteryRegion;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ -80,6 +81,12 @@ public class LotteryDetailPCVO implements Serializable {
@ApiModelProperty(value = "停止原因")
private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegionDetailVO> lotteryRegionList;
@ -104,4 +111,25 @@ public class LotteryDetailPCVO implements Serializable {
this.createTime = createTime;
this.stopReason = stopReason;
}
public LotteryDetailPCVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) {
this.id = id;
this.code = code;
this.title = title;
this.type = type;
this.num = num;
this.participant = participant;
this.point = point;
this.applyStartTime = applyStartTime;
this.applyEndTime = applyEndTime;
this.drawTime = drawTime;
this.way = way;
this.image = image;
this.description = description;
this.status = status;
this.createTime = createTime;
this.stopReason = stopReason;
this.price = price;
this.publishTime = publishTime;
}
}

@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@ -87,6 +88,12 @@ public class LotteryPCVO implements Serializable {
@ApiModelProperty(value = "停止原因")
private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@Transient
@ApiModelProperty(value = "参与人数")
private Long participateNum;
@ -118,4 +125,29 @@ public class LotteryPCVO implements Serializable {
this.createUserName = createUserName;
this.stopReason = stopReason;
}
public LotteryPCVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String createUser, String createUserName, String stopReason, BigDecimal price, LocalDateTime publishTime) {
this.id = id;
this.code = code;
this.title = title;
this.type = type;
this.num = num;
this.participant = participant;
this.point = point;
this.regionCode = regionCode;
this.regionName = regionName;
this.applyStartTime = applyStartTime;
this.applyEndTime = applyEndTime;
this.drawTime = drawTime;
this.way = way;
this.image = image;
this.description = description;
this.status = status;
this.createTime = createTime;
this.createUser = createUser;
this.createUserName = createUserName;
this.stopReason = stopReason;
this.price = price;
this.publishTime = publishTime;
}
}

@ -19,3 +19,9 @@ create index tb_lottery_user_user_id_index
alter table tb_lottery_user
add constraint tb_lottery_user_pk
unique (lottery_id, user_id);
alter table tb_lottery
add publish_time datetime null comment '发布时间';
alter table tb_lottery
add price decimal null comment '抽奖物品价格';
Loading…
Cancel
Save