优惠劵相关逻辑的迁移

This commit is contained in:
YunaiV
2020-08-20 19:47:29 +08:00
parent 2c6331eb75
commit 5b3c464faf
106 changed files with 1277 additions and 2621 deletions

View File

@@ -1,17 +0,0 @@
package cn.iocoder.mall.order.api;
import cn.iocoder.mall.order.api.bo.CalcSkuPriceBO;
public interface CartService {
/**
* 计算指定商品 SKU 的金额,并返回计算结果
*
* TODO 芋艿,此处只会计算,限时折扣带来的价格变化。
*
* @param skuId 商品 SKU 编号
* @return 计算订单金额结果
*/
CalcSkuPriceBO calcSkuPrice(Integer skuId);
}

View File

@@ -1,33 +0,0 @@
package cn.iocoder.mall.order.api.bo;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 计算商品 SKU 价格结果 BO
*/
@Data
@Accessors(chain = true)
public class CalcSkuPriceBO implements Serializable {
/**
* 满减送促销活动
*/
private PromotionActivityBO fullPrivilege;
/**
* 限时折扣促销活动
*/
private PromotionActivityBO timeLimitedDiscount;
/**
* 原价格,单位:分。
*/
private Integer originalPrice;
/**
* 购买价格,单位:分。
*/
private Integer buyPrice;
}

View File

@@ -1,100 +0,0 @@
package cn.iocoder.mall.order.api.bo;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 购物车的商品信息 DO
*/
@Data
@Accessors(chain = true)
public class CartItemBO {
// ========= 基础字段 BEGIN =========
/**
* 编号,唯一自增。
*/
private Integer id;
/**
* 状态
*
* 1-正常
* 2-主动删除
* 3-下单删除
*/
private Integer status;
/**
* 是否选中
*/
private Boolean selected;
// ========= 基础字段 END =========
// ========= 买家信息 BEGIN =========
/**
* 用户编号
*/
private Integer userId;
// /**
// * 会话 key
// */
// private String nobody;
// ========= 买家信息 END =========
// ========= 商品信息 BEGIN =========
/**
* 商品 SPU 编号
*/
private Integer spuId;
/**
* 商品 SKU 编号
*/
private Integer skuId;
/**
* 商品购买数量
*/
private Integer quantity;
// TODO 冗余字段
// ========= 商品信息 END =========
// ========= 交易信息 BEGIN =========
/**
* 订单编号
*/
private Integer orderId;
/**
* 订单创建时间
*/
private Date orderCreateTime;
// ========= 交易信息 BEGIN =========
// ========= 优惠信息 BEGIN =========
// /**
// * 商品营销活动编号
// */
// private Integer activityId;
// /**
// * 商品营销活动类型
// */
// private Integer activityType;
// ========= 优惠信息 END =========
/**
* 创建时间
*/
private Date createTime;
}

View File

@@ -1,57 +0,0 @@
package cn.iocoder.mall.order.api.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 计算订单价格 DTO
*/
@Data
@Accessors(chain = true)
@Deprecated
public class CalcOrderPriceDTO {
@NotNull(message = "用户编号不能为空")
private Integer userId;
/**
* 优惠劵编号
*/
private Integer couponCardId;
@NotNull(message = "商品数组不能为空")
private List<Item> items;
@Data
@Accessors(chain = true)
public static class Item {
/**
* SKU 编号
*/
private Integer skuId;
/**
* 数量
*/
private Integer quantity;
/**
* 是否选中
*
* 注意下,目前只有在购物车的时候,才可能出现该属性为 false 。其它情况下,都会为 true 为主。
*/
private Boolean selected;
public Item() {
}
public Item(Integer skuId, Integer quantity, Boolean selected) {
this.skuId = skuId;
this.quantity = quantity;
this.selected = selected;
}
}
}