You've already forked FrameTour-BE
refactor(coupon): 移除优惠券相关模块代码
- 删除优惠券控制器相关类,包括 AppCouponController 和 CouponController - 移除优惠券记录控制器 CouponRecordController - 删除优惠券数据访问层接口及实现类 - 移除优惠券相关的实体类、请求响应对象 - 清理业务逻辑层中与优惠券相关的服务接口及实现 - 从 PriceBiz 中移除优惠券相关导入依赖 - 从任务类 DownloadNotificationTasker 中移除优惠券相关导入 - 删除优惠券相关的 MyBatis 映射文件
This commit is contained in:
@@ -1,85 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.coupon.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("coupon")
|
||||
public class CouponEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
private Long scenicId;
|
||||
|
||||
// 新增优惠券名称字段
|
||||
private String name;
|
||||
|
||||
// 优惠券描述
|
||||
private String description;
|
||||
|
||||
// 倒计时字段(仅用于展示)
|
||||
private String countdown;
|
||||
|
||||
// 广播字段,仅用于展示
|
||||
private String broadcast;
|
||||
|
||||
/**
|
||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 价格配置ID,逗号分隔字符串
|
||||
*/
|
||||
private String configIds;
|
||||
/**
|
||||
* 0降价,1打折
|
||||
*/
|
||||
private Integer discountType;
|
||||
private BigDecimal discountPrice;
|
||||
/**
|
||||
* 状态:0不开启;1开启
|
||||
*/
|
||||
private Integer status;
|
||||
private Date createAt;
|
||||
|
||||
private Integer deleted;
|
||||
private Date deletedAt;
|
||||
|
||||
public BigDecimal calculateDiscountPrice(BigDecimal originalPrice) {
|
||||
if (originalPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (discountType == 0) {
|
||||
return discountPrice;
|
||||
} else {
|
||||
return originalPrice.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN).multiply(discountPrice);
|
||||
}
|
||||
}
|
||||
public BigDecimal calculateDiscountPrice(String originalPrice) {
|
||||
if (originalPrice == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
BigDecimal priceObj = new BigDecimal(originalPrice);
|
||||
if (discountType == 0) {
|
||||
return discountPrice;
|
||||
} else {
|
||||
return priceObj.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN).multiply(discountPrice);
|
||||
}
|
||||
}
|
||||
public String calculateDiscountedPrice(String originalPrice) {
|
||||
if (originalPrice == null) {
|
||||
return "0.00";
|
||||
}
|
||||
BigDecimal priceObj = new BigDecimal(originalPrice);
|
||||
if (discountType == 0) {
|
||||
return priceObj.subtract(discountPrice).setScale(2, RoundingMode.HALF_DOWN).toString();
|
||||
} else {
|
||||
return priceObj.subtract(priceObj.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN).multiply(discountPrice)).setScale(2, RoundingMode.HALF_DOWN).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.coupon.req;
|
||||
|
||||
import lombok.Data;
|
||||
import com.ycwl.basic.model.common.BaseQueryParameterReq;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
// 优惠券查询请求参数
|
||||
public class CouponQueryReq extends BaseQueryParameterReq {
|
||||
// 景区ID
|
||||
private Long scenicId;
|
||||
private String name;
|
||||
|
||||
// 优惠券类型:0普通/1首次推送/2二次/3三次
|
||||
private Integer type;
|
||||
|
||||
// 折扣类型:0降价/1打折
|
||||
private Integer discountType;
|
||||
|
||||
// 状态:0关闭/1开启
|
||||
private Integer status;
|
||||
|
||||
// 创建时间起始
|
||||
private Date createAtStart;
|
||||
|
||||
// 创建时间结束
|
||||
private Date createAtEnd;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.coupon.resp;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CouponRespVO {
|
||||
private Integer id;
|
||||
private Long scenicId;
|
||||
private String scenicName;
|
||||
|
||||
// 新增优惠券名称字段
|
||||
private String name;
|
||||
|
||||
// 优惠券描述
|
||||
private String description;
|
||||
|
||||
// 倒计时字段(仅用于展示)
|
||||
private String countdown;
|
||||
|
||||
// 通知展示字段,仅用于展示
|
||||
private String broadcast;
|
||||
|
||||
/**
|
||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 价格配置ID,逗号分隔字符串
|
||||
*/
|
||||
private String configIds;
|
||||
/**
|
||||
* 0降价,1打折
|
||||
*/
|
||||
private Integer discountType;
|
||||
private BigDecimal discountPrice;
|
||||
/**
|
||||
* 状态:0不开启;1开启
|
||||
*/
|
||||
private Integer status;
|
||||
private Date createAt;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("coupon_record")
|
||||
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;
|
||||
|
||||
private Integer deleted;
|
||||
private Date deletedAt;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CouponRecordPageQueryReq {
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 10;
|
||||
private Long scenicId;
|
||||
private String couponName;
|
||||
private Integer couponType;
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.ycwl.basic.model.pc.couponRecord.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CouponRecordPageResp {
|
||||
private Integer id;
|
||||
private Integer couponId;
|
||||
private String couponName;
|
||||
private Integer couponType;
|
||||
private String couponTypeName;
|
||||
private Long scenicId;
|
||||
private String scenicName;
|
||||
private Long memberId;
|
||||
private Long faceId;
|
||||
private Integer status;
|
||||
private String statusName;
|
||||
private Date createTime;
|
||||
private Date usedTime;
|
||||
private Long usedOrderId;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user