You've already forked FrameTour-BE
优惠券、通知加参数
This commit is contained in:
@@ -13,10 +13,21 @@ public class IsBuyBatchRespVO {
|
||||
private int type;
|
||||
private String goodsIds;
|
||||
private BigDecimal origPrice = BigDecimal.ZERO;
|
||||
private Integer couponId;
|
||||
private Integer couponRecordId;
|
||||
private BigDecimal couponPrice = BigDecimal.ZERO;
|
||||
private BigDecimal slashPrice = BigDecimal.ZERO;
|
||||
private BigDecimal slashPrice;
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return origPrice.subtract(couponPrice);
|
||||
}
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(origPrice);
|
||||
}
|
||||
}
|
||||
|
@@ -12,10 +12,21 @@ public class IsBuyRespVO {
|
||||
private int goodsType;
|
||||
private Long goodsId;
|
||||
private BigDecimal origPrice = BigDecimal.ZERO;
|
||||
private Integer couponId;
|
||||
private Integer couponRecordId;
|
||||
private BigDecimal couponPrice = BigDecimal.ZERO;
|
||||
private BigDecimal slashPrice = BigDecimal.ZERO;
|
||||
private BigDecimal slashPrice;
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return origPrice.subtract(couponPrice);
|
||||
}
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(origPrice);
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@@ -36,4 +37,12 @@ public class CouponEntity {
|
||||
*/
|
||||
private Integer status;
|
||||
private Date createAt;
|
||||
|
||||
public BigDecimal calculateDiscountPrice(BigDecimal originalPrice) {
|
||||
if (discountType == 0) {
|
||||
return discountPrice;
|
||||
} else {
|
||||
return originalPrice.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN).multiply(discountPrice);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CouponRecordEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
private Integer couponId;
|
||||
private Long memberId;
|
||||
private Long faceId;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date usedTime;
|
||||
private Long usedOrderId;
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CouponRecordUserQueryReq {
|
||||
private Long scenicId;
|
||||
private Long memberId;
|
||||
private Long faceId;
|
||||
private Integer couponType;
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.resp;
|
||||
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CouponRecordQueryResp {
|
||||
private boolean exist = false;
|
||||
private Integer id;
|
||||
private Long scenicId;
|
||||
private Integer couponId;
|
||||
private Long memberId;
|
||||
private Long faceId;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date usedTime;
|
||||
private Long usedOrderId;
|
||||
private CouponEntity coupon;
|
||||
|
||||
public boolean isUsable() {
|
||||
return Integer.valueOf(0).equals(status);
|
||||
}
|
||||
}
|
@@ -35,6 +35,9 @@ public class OrderEntity {
|
||||
* 划线价
|
||||
*/
|
||||
private BigDecimal slashPrice;
|
||||
private BigDecimal couponPrice = BigDecimal.ZERO;
|
||||
private Integer couponId;
|
||||
private Integer couponRecordId;
|
||||
/**
|
||||
* 优惠价格
|
||||
*/
|
||||
@@ -88,4 +91,13 @@ public class OrderEntity {
|
||||
*/
|
||||
private Date refundAt;
|
||||
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(price);
|
||||
}
|
||||
}
|
||||
|
@@ -89,4 +89,14 @@ public class OrderAppRespVO {
|
||||
private Integer goodsType;
|
||||
@ApiModelProperty("订单明细")
|
||||
private List<OrderItemVO> orderItemList;
|
||||
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(price);
|
||||
}
|
||||
}
|
||||
|
@@ -108,4 +108,14 @@ public class OrderRespVO {
|
||||
private List<OrderItemVO> orderItemList;
|
||||
private Long scenicId;
|
||||
private String scenicName;
|
||||
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(price);
|
||||
}
|
||||
}
|
||||
|
@@ -63,4 +63,14 @@ public class VideoRespVO {
|
||||
private Integer height;
|
||||
private Integer width;
|
||||
private BigDecimal duration;
|
||||
|
||||
public BigDecimal getDiscountPrice() {
|
||||
if (slashPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return slashPrice.subtract(templatePrice);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user